/* ==========================================================================
   Families hub (Families.php) - the page's own sections

   css/public_site.css MUST be loaded BEFORE this sheet. It holds the --fh-*
   KEEP variables this file reads, the shared primitives (container, eyebrow,
   .fh-btn*, .fh-link*), the home-page teaser, the .fh-section frame, the empty
   state and the site footer. Nothing here redeclares any of them.

     1. Hero and quick facts - .fh-hero*, .fh-facts / .fh-fact*
     2. Section chip bar     - .fh-chipbar, .fh-chips*, .fh-chip*
     3. Calendar hand-off    - the #calendar section's --aca-cal-sticky-top
     4. Schedule             - .fh-schedule-grid, .fh-card*, .fh-tl*, .fh-bell*
     5. Forms                - .fh-forms-*, .fh-form-*
     6. Policies             - .fh-policy*, .fh-note
     7. Responsive (991px layout / 576px type)
     8. Print

   The calendar itself is css/aca-calendar.css, loaded between public_site.css
   and this sheet; every .aca-cal* rule lives there.

   Families.php renders body > #mainBodyDiv > main.fh-page, so the scroll pane
   and its navbar offset come from #mainBodyDiv in css/aca-shell.css; nothing
   here positions the page.
   ========================================================================== */

/* ==========================================================================
   1. Hero and quick facts
   -------------------------------------------------------------------------- */

/* The navy band every ACA page opens with (the home hero's scrim, the portals'
   welcome band): the lattice fades in on the right and the quick-facts card
   sits on it as the one light tile. */
.fh-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 0;
    padding: 3rem 0 2.5rem;
    background: var(--aca-chrome);
    color: var(--aca-on-chrome);
}

.fh-hero::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    width: 60%;
    background: linear-gradient(to right, transparent, var(--aca-orange) 40%);
    opacity: .2;
    -webkit-mask-image: var(--aca-pattern-star);
    mask-image: var(--aca-pattern-star);
    -webkit-mask-size: 56px 56px;
    mask-size: 56px 56px;
    pointer-events: none;
}

.fh-hero .fh-eyebrow {
    color: var(--fh-on-dark-accent);
}

.fh-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fh-hero-text {
    flex: 1 1 60%;
    margin: 0;
    padding: 0 2.5rem 0 0;
}

.fh-hero-title {
    margin: 0 0 0.75rem;
    padding: 0;
    color: var(--aca-on-chrome);
    font-family: inherit;
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.1;
    text-align: left;
}

.fh-hero-lead {
    max-width: 38rem;
    margin: 0 0 1.5rem;
    padding: 0;
    color: var(--aca-on-chrome-muted);
    font-size: 1.1875rem;
    line-height: 1.5;
}

.fh-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 -0.25rem;
    padding: 0;
}

.fh-hero-actions .fh-btn {
    margin: 0.25rem;
}

.fh-facts {
    flex: 0 0 22rem;
    margin: 0;
    padding: 1.25rem 1.375rem;
    list-style: none;
    background: var(--aca-surface);
    border: 1px solid var(--aca-line);
    border-radius: var(--aca-radius);
    box-shadow: var(--aca-shadow);
}

.fh-fact {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--aca-line);
}

.fh-fact:first-child {
    padding-top: 0;
}

.fh-fact:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.fh-fact-icon {
    display: flex;
    flex: 0 0 2.5rem;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 0.875rem 0 0;
    padding: 0;
    border-radius: 50%;
    background: var(--aca-orange-soft);
    color: var(--aca-orange-strong);
    font-size: 1rem;
}

.fh-fact-text {
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.fh-fact-label {
    display: block;
    margin: 0;
    padding: 0;
    color: var(--aca-muted);
    font-size: var(--aca-text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
}

.fh-fact-value {
    display: block;
    margin: 0;
    padding: 0;
    color: var(--aca-ink);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.fh-fact-link {
    text-decoration: none;
}

.fh-fact-link-label {
    color: var(--aca-green);
    font-size: 1rem;
    font-weight: 600;
}

.fh-fact-link:hover .fh-fact-link-label,
.fh-fact-link:focus .fh-fact-link-label {
    color: var(--aca-green-strong);
    text-decoration: underline;
}

/* ==========================================================================
   2. Section chip bar
   -------------------------------------------------------------------------- */

/* Sticky inside #mainBodyDiv, the page's only scroll pane. */
.fh-chipbar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0;
    padding: 0.625rem 0;
    background: var(--aca-surface);
    border-bottom: 1px solid var(--aca-line);
    box-shadow: var(--aca-shadow-sm);
}

.fh-chips {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0.125rem 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.fh-chips::-webkit-scrollbar {
    display: none;
}

.fh-chips-item {
    flex: 0 0 auto;
    margin: 0 0.5rem 0 0;
    padding: 0;
}

.fh-chip {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0.5rem 0.9375rem;
    border: 1px solid var(--aca-line);
    border-radius: var(--aca-radius-pill);
    background: var(--aca-surface);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.fh-chip:hover,
.fh-chip:focus {
    border-color: var(--aca-orange);
    text-decoration: none;
}

.fh-chip-icon {
    margin: 0 0.4375rem 0 0;
    padding: 0;
    color: var(--aca-orange);
    font-size: var(--aca-text-xs);
}

.fh-chip-label {
    margin: 0;
    padding: 0;
    color: var(--aca-ink);
    font-size: var(--aca-text-xs);
    font-weight: 600;
    line-height: 1.2;
}

.fh-chip.is-active {
    background: var(--aca-ink);
    border-color: var(--aca-ink);
}

.fh-chip.is-active .fh-chip-icon {
    color: var(--fh-on-dark-accent);
}

.fh-chip.is-active .fh-chip-label {
    color: var(--aca-on-brand);
}

/* ==========================================================================
   3. Calendar hand-off
   -------------------------------------------------------------------------- */

/* The calendar block is css/aca-calendar.css. Only the hub knows that its
   month grid has to stick below the sticky chip bar, so only the hub sets the
   clearance: 4.25rem, the same figure .fh-section uses for scroll-margin-top
   in public_site.css (the bar measures ~61px - a 36px chip, .fh-chips'
   0.25rem, the bar's 1.25rem and its 1px bottom border). */
#calendar .aca-cal {
    --aca-cal-sticky-top: 4.25rem;
}

/* ==========================================================================
   4. Schedule - class timeline and bell list
   -------------------------------------------------------------------------- */

.fh-schedule-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-gap: 1.25rem;
    align-items: start;
    margin: 0;
    padding: 0;
}

.fh-card {
    margin: 0;
    padding: 1.5rem;
    background: var(--aca-surface);
    border: 1px solid var(--aca-line);
    border-radius: var(--aca-radius);
    box-shadow: var(--aca-shadow);
}

.fh-card-title {
    display: flex;
    align-items: center;
    margin: 0 0 1.25rem;
    padding: 0;
    color: var(--aca-ink);
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    text-align: left;
}

.fh-card-title-icon {
    margin: 0 0.625rem 0 0;
    color: var(--aca-orange);
}

.fh-tl {
    margin: 0;
    padding: 0;
    list-style: none;
}

.fh-tl-item {
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0 0 1rem;
}

.fh-tl-item:last-child {
    padding-bottom: 0;
}

.fh-tl-time {
    flex: 0 0 5.75rem;
    margin: 0;
    padding: 0.5rem 0 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fh-tl-start {
    display: block;
    margin: 0;
    padding: 0;
    color: var(--aca-fg);
    font-size: var(--aca-text-xs);
    font-weight: 800;
    line-height: 1.3;
    white-space: nowrap;
}

.fh-tl-end {
    display: block;
    margin: 0;
    padding: 0;
    color: var(--aca-fg-muted);
    font-size: var(--aca-text-xs);
    line-height: 1.3;
    white-space: nowrap;
}

.fh-tl-rail {
    position: relative;
    display: block;
    flex: 0 0 1.25rem;
    margin: 0 0.875rem;
    padding: 0;
}

.fh-tl-rail::before {
    content: "";
    position: absolute;
    top: 0.75rem;
    bottom: -1rem;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: var(--aca-line);
}

.fh-tl-item:last-child .fh-tl-rail::before {
    display: none;
}

.fh-tl-dot {
    position: absolute;
    top: 0.625rem;
    left: 50%;
    display: block;
    width: 0.875rem;
    height: 0.875rem;
    margin-left: -0.4375rem;
    border: 3px solid var(--aca-orange);
    border-radius: 50%;
    background: var(--aca-surface);
}

.fh-tl-body {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    grid-gap: 0.5rem;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.fh-tl-track {
    margin: 0;
    padding: 0.625rem 0.875rem;
    background: var(--aca-surface-2);
    border: 1px solid var(--aca-line);
    border-left: 4px solid var(--fh-slate);
    border-radius: var(--aca-radius-sm);
}

.fh-tl-track--arabic {
    border-left-color: var(--aca-orange);
}

.fh-tl-track--quran {
    border-left-color: var(--aca-green);
}

.fh-tl-track--lunch {
    border-left-color: var(--fh-track-lunch);
}

.fh-tl-track--kids {
    border-left-color: var(--fh-track-kids);
}

.fh-tl-track--prayer {
    border-left-color: var(--fh-track-prayer);
}

.fh-tl-track--islamic {
    border-left-color: var(--fh-track-islamic);
}

.fh-tl-track--dismissal {
    border-left-color: var(--aca-ink);
}

.fh-tl-label {
    display: block;
    margin: 0;
    padding: 0;
    color: var(--aca-fg);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.fh-tl-detail {
    display: block;
    margin: 0.125rem 0 0;
    padding: 0;
    color: var(--aca-fg-muted);
    font-size: var(--aca-text-xs);
    line-height: 1.4;
}

.fh-bells {
    margin: 0;
    padding: 0;
    list-style: none;
}

.fh-bell {
    display: flex;
    align-items: flex-start;
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--aca-line);
}

.fh-bell:first-child {
    padding-top: 0;
}

.fh-bell:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.fh-bell-time {
    display: block;
    flex: 0 0 5.75rem;
    margin: 0 0.875rem 0 0;
    padding: 0.25rem 0.5rem;
    border-radius: var(--aca-radius-sm);
    background: var(--aca-orange-soft);
    color: var(--aca-orange-strong);
    font-size: var(--aca-text-xs);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
}

.fh-bell-label {
    display: block;
    flex: 1 1 auto;
    margin: 0.1875rem 0 0;
    padding: 0;
    color: var(--aca-fg);
    font-size: var(--aca-text-xs);
    line-height: 1.45;
}

/* ==========================================================================
   5. Forms
   -------------------------------------------------------------------------- */

.fh-forms-intro {
    display: flex;
    align-items: center;
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--aca-green-soft);
    border: 1px solid var(--aca-green-line);
    border-radius: var(--aca-radius);
}

.fh-forms-intro-icon {
    margin: 0 0.875rem 0 0;
    color: var(--aca-green);
    font-size: 1.375rem;
}

.fh-forms-intro-text {
    margin: 0;
    padding: 0;
    color: var(--aca-green-strong);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.fh-forms-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-gap: 1.25rem;
    margin: 0;
    padding: 0;
}

.fh-form-card {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 1.5rem;
    background: var(--aca-surface);
    border: 1px solid var(--aca-line);
    border-radius: var(--aca-radius);
    box-shadow: var(--aca-shadow);
}

.fh-form-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0 0 1rem;
    padding: 0;
    border-radius: var(--aca-radius);
    background: var(--aca-orange-soft);
    color: var(--aca-orange-strong);
    font-size: 1.25rem;
}

.fh-form-title {
    margin: 0 0 0.5rem;
    padding: 0;
    color: var(--aca-ink);
    font-family: inherit;
    font-size: 1.1875rem;
    font-weight: 800;
    line-height: 1.3;
    text-align: left;
}

.fh-form-purpose {
    flex: 1 1 auto;
    margin: 0 0 1.25rem;
    padding: 0;
    color: var(--aca-muted);
    font-size: var(--aca-text-xs);
    line-height: 1.5;
}

.fh-form-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0;
    padding: 0;
}

.fh-form-links {
    display: flex;
    flex-wrap: wrap;
    margin: 0.75rem 0 0;
    padding: 0;
}

.fh-form-links .fh-link {
    margin: 0 1.25rem 0.25rem 0;
}

/* ==========================================================================
   6. Policies
   -------------------------------------------------------------------------- */

.fh-policy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fh-policy {
    display: flex;
    align-items: flex-start;
    margin: 0;
    padding: 1.25rem;
    background: var(--aca-surface-2);
    border: 1px solid var(--aca-line);
    border-radius: var(--aca-radius);
}

.fh-policy-icon {
    display: flex;
    flex: 0 0 2.75rem;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 1rem 0 0;
    padding: 0;
    border-radius: 50%;
    background: var(--aca-green-soft);
    color: var(--aca-green);
    font-size: 1.125rem;
}

.fh-policy-body {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.fh-policy-title {
    margin: 0 0 0.25rem;
    padding: 0;
    color: var(--aca-ink);
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 800;
    line-height: 1.35;
    text-align: left;
}

.fh-policy-text {
    margin: 0;
    padding: 0;
    color: var(--aca-muted);
    font-size: var(--aca-text-xs);
    line-height: 1.55;
}

.fh-policy-link {
    margin: 0.5rem 0 0;
    padding: 0;
}

.fh-note {
    margin: 1.25rem 0 0;
    padding: 0;
    color: var(--aca-fg-muted);
    font-size: var(--aca-text-xs);
    line-height: 1.5;
}

/* ==========================================================================
   7. Responsive - 991px layout switch, 576px phone type scale
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .fh-hero {
        padding: 2rem 0 1.75rem;
    }

    .fh-hero-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .fh-hero-text {
        margin: 0 0 1.5rem;
        padding: 0;
    }

    .fh-facts {
        flex: 1 1 auto;
    }

    .fh-schedule-grid,
    .fh-forms-grid,
    .fh-policy-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .fh-card,
    .fh-form-card {
        padding: 1.25rem;
    }

    .fh-tl-time {
        flex-basis: 4.75rem;
    }

    .fh-tl-rail {
        flex-basis: 1rem;
        margin: 0 0.625rem;
    }
}

@media (max-width: 991px) and (min-width: 577px) {
    .fh-hero-title {
        font-size: 2.375rem;
    }

    .fh-hero-lead {
        font-size: 1.125rem;
    }
}

@media (max-width: 576px) {
    .fh-hero-title {
        font-size: 2rem;
    }

    .fh-hero-lead {
        font-size: 1rem;
    }

    .fh-chip-label {
        font-size: var(--aca-text-xs);
    }

    .fh-tl-start,
    .fh-bell-time {
        font-size: var(--aca-text-xs);
    }

    .fh-tl-label {
        font-size: var(--aca-text-xs);
    }
}

/* ==========================================================================
   8. Print
   families_hub.js stamps body[data-fh-print="<section>"] before
   window.print() and clears it on afterprint, so one section can be printed
   on its own. Nothing here is forced: this block is last in the sheet, so an
   equally specific screen rule above it loses on order.
   -------------------------------------------------------------------------- */

@media print {
    .fh-chipbar,
    .fh-hero,
    .fh-page #forms {
        display: none;
    }

    body[data-fh-print] .fh-page .fh-section {
        break-before: auto;
        page-break-before: auto;
    }

    body[data-fh-print="calendar"] .fh-page .fh-section:not(#calendar),
    body[data-fh-print="schedule"] .fh-page .fh-section:not(#schedule) {
        display: none;
    }

    .fh-card,
    .fh-policy {
        box-shadow: none;
    }

    .fh-tl-item,
    .fh-bell,
    .fh-policy {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .fh-schedule-grid {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }

    .fh-policy-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fh-tl-track,
    .fh-tl-dot,
    .fh-bell-time {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
