/* Ported Panel Logic from Vivid-Bio-Labs */
/* Purpose: Ensure insights cards wrap and center correctly like the Labs panels */

.insights-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 2rem !important;
    /* Default MPO (Max Panels per Row) */
    --max-panels-per-row: 3;
}

.insight-card {
    /* Calculate width: (100% - (gaps)) / count */
    flex: 1 1 calc((100% - (var(--max-panels-per-row) - 1) * 2rem) / var(--max-panels-per-row)) !important;

    /* Force wrap on smaller screens */
    min-width: 350px !important;
    /* Slightly wider than Labs due to content */
    max-width: 100% !important;

    /* Ensure Equal Heights */
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
}

/* Ensure content inside card grows to fill space if needed */
.insight-card__content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Push tags/meta to appropriate places if needed */
.insight-card__category {
    margin-top: auto;
}

/* Mobile Responsive Override */
@media (max-width: 768px) {
    .insights-grid {
        --max-panels-per-row: 1;
    }
}

/* Allow container to expand for 3 columns on large screens */
.page-container.wide-grid {
    max-width: 1200px !important;
    padding: 0 2rem;
}