/* section-cards.css — kid-friendly visual grid of section cards.
 *
 * Used on the homepage to navigate to the five top-level sections, and
 * reusable on any L2 page that needs a "pick a sub-section" grid. Each
 * card has a coloured accent (via --card-accent CSS variable), a large
 * emoji icon, a section name, a one-line description, and a CTA arrow.
 *
 * Layout: CSS grid with auto-fit so cards reflow to fit the viewport —
 * 1 column on phones, 2 on small tablets, 3+ on desktop.
 */

.fm-section-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 1.75rem 0 2.5rem;
    padding: 0;
    list-style: none;
}

/* Each card is the <a> itself so the whole thing is one big tap target. */
.fm-section-card {
    --card-accent: #4A7286;

    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 1.25rem 1.25rem;
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(15, 30, 42, 0.07);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.18s ease,
                box-shadow 0.18s ease,
                border-color 0.18s ease;
}

/* Coloured accent strip down the left edge for visual identity. */
.fm-section-card::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 6px;
    background: var(--card-accent);
    transition: width 0.18s ease;
}

.fm-section-card:hover,
.fm-section-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 30, 42, 0.14);
    border-color: var(--card-accent);
    outline: none;
}
.fm-section-card:hover::before,
.fm-section-card:focus-visible::before {
    width: 10px;
}

.fm-section-card__icon {
    display: inline-block;
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 0.6rem;
    /* Lift the emoji slightly off the baseline for breathing room */
    margin-left: 0.25rem;
}

.fm-section-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2933;
    line-height: 1.2;
}

.fm-section-card__count {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--card-accent) 14%, transparent);
    color: var(--card-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-radius: 999px;
}

.fm-section-card__desc {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #4a5660;
    flex-grow: 1;        /* pushes CTA to the bottom for consistent card heights */
}

.fm-section-card__cta {
    align-self: flex-start;
    color: var(--card-accent);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.fm-section-card__cta::after {
    content: ' \2192';   /* → arrow */
    transition: transform 0.18s ease;
    display: inline-block;
}
.fm-section-card:hover .fm-section-card__cta::after,
.fm-section-card:focus-visible .fm-section-card__cta::after {
    transform: translateX(4px);
}

/* Section-name H2 above the grid, on homepage and L2 pages. */
.fm-section-cards-heading {
    margin: 2rem 0 0.5rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2933;
}

/* Dark theme variant — colours read well on a dark background too. */
[data-theme="dark"] .fm-section-card {
    background: #1e293b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .fm-section-card__title  { color: #f1f5f9; }
[data-theme="dark"] .fm-section-card__desc   { color: #cbd5e1; }
[data-theme="dark"] .fm-section-cards-heading { color: #f1f5f9; }
