/* ============================================================================
   card-grid.css
   ----------------------------------------------------------------------------
   Styles for the "Card Grid" row (cardGrid.vm): a heading and intro line
   with an optional "view all" link at the right, above a three-across grid of
   bordered link cards. Each card is a title and a trailing arrow, and the whole
   card is the link. Reproduces the "Career Pathways at CAMP" section.

   Colors, fonts, and spacing come ONLY from the variables declared in
   style.css (the per-site theme set through Global Setup), so the row
   re-themes with the site:
     --primary-template            green   heading, arrows, view-all link
     --accent-template             focus ring
     --body-text-template          intro + card titles
     --body-bg-template            card surface
     --primary-font-template       heading, intro, card titles
     --secondary-font-template     view-all link (with --secondary-font-style)
     --input-border-template       card border
     --rounded-input, --space-sm, --space-md

   The row background is NOT set here. It comes from the row's rowColor class,
   same as every other row format.

   Structural chrome (.container / .row / .col-md-12 / .section-padding)
   comes from the site's existing stylesheets and is not duplicated.
   ============================================================================ */

.card-grid-row,
.card-grid-row * {
    box-sizing: border-box;
}

.card-grid {
    font-family: var(--primary-font-template), var(--primary-font-style);
    color: var(--body-text-template);
}

/* ── Heading + intro row ── */
.card-grid__heading {
    margin: 0 0 var(--space-sm);
    font-family: var(--primary-font-template), var(--primary-font-style);
    font-size: var(--ds-headline-size);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-template);
}
.card-grid__intro {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm) var(--space-md);
    margin: 0 0 calc(var(--space-md) * 2);
}
.card-grid__lead {
    margin: 0;
    max-width: 640px;
    font-size: 19px;
    line-height: 1.6;
}
.card-grid__viewall {
    margin-left: auto;
    font-family: var(--secondary-font-template), var(--secondary-font-style);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: var(--primary-template);
}
.card-grid__viewall:hover,
.card-grid__viewall:focus {
    color: var(--primary-template);
    text-decoration-thickness: 2px;
}
.card-grid__viewall i {
    margin-left: 4px;
    font-size: 0.9em;
    text-decoration: none;
}

/* ── Card grid (three across, extra cards wrap) ── */
.card-grid__cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
}
.card-grid__item {
    display: flex;
    margin: 0;
    padding: 0;
}
.card-grid__card {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: 88px;
    padding: var(--space-md) calc(var(--space-md) * 1.5);
    border: 1px solid var(--input-border-template);
    border-radius: var(--rounded-input);
    background: var(--body-bg-template);
    color: var(--body-text-template);
    text-decoration: none;
    transition: var(--transition-medium, border-color 0.2s ease, box-shadow 0.2s ease);
}
a.card-grid__card:hover,
a.card-grid__card:focus {
    border-color: var(--primary-template);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    color: var(--body-text-template);
    text-decoration: none;
}
a.card-grid__card:focus-visible,
.card-grid__viewall:focus-visible {
    outline: 3px solid var(--accent-template);
    outline-offset: 2px;
}
.card-grid__card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}
.card-grid__arrow {
    flex: 0 0 auto;
    color: var(--primary-template);
    font-size: 18px;
    transition: transform 0.2s ease;
}
a.card-grid__card:hover .card-grid__arrow,
a.card-grid__card:focus .card-grid__arrow {
    transform: translateX(4px);
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .card-grid__cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 575px) {
    .card-grid__heading {
        font-size: 34px;
    }
    .card-grid__viewall {
        margin-left: 0;
    }
    .card-grid__cards {
        grid-template-columns: 1fr;
    }
    .card-grid__card {
        min-height: 72px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .card-grid__arrow {
        transition: none;
    }
    a.card-grid__card:hover .card-grid__arrow,
    a.card-grid__card:focus .card-grid__arrow {
        transform: none;
    }
}
