
/* ==========================================================================
   HAMBURGER BUTTON  (drawn here, but only shown on phones once JS enhances it)
   ========================================================================== */
.nav-toggle {
    display: none;                 /* hidden on desktop */
    align-items: center;
    justify-content: center;
    width: 44px;                   /* comfortable tap target */
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

/* three bars = one middle span + its ::before / ::after */
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    content: "";
    display: block;
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .3s var(--ease), opacity .2s var(--ease), background .2s var(--ease);
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { position: absolute; left: 0; top: -7px; }
.nav-toggle-bars::after  { position: absolute; left: 0; top:  7px; }

/* morph into an X when the menu is open */
.nav-open .nav-toggle-bars            { background: transparent; }
.nav-open .nav-toggle-bars::before    { top: 0; transform: rotate(45deg); }
.nav-open .nav-toggle-bars::after     { top: 0; transform: rotate(-45deg); }


.brand svg {
    height: 100%;
    width: auto;
    max-width: var(--nav-height);   /* never wider than the bar is tall (~60px) */
    aspect-ratio: 1;
    flex: 0 0 auto;
}


/* ==========================================================================
   TABLETS & SMALL LAPTOPS  (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {

    /* Pull the page margins in a little. */
    body {
        margin-left: 32px;
        margin-right: 32px;
    }

    /* Tighten the big vertical rhythm (keeps the auto left margin intact). */
    section {
        margin-top: 64px;
        margin-bottom: 64px;
    }

    /* Footer: 4 columns -> 2. */
    .grid-container {
        grid-template-columns: 1fr 1fr;
        grid-row-gap: 36px;
    }

    /* Accreditation logos: let them wrap and centre instead of squashing. */
    .accreditations-wrapper {
        width: auto;
        max-width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }
}


/* ==========================================================================
   PHONES  (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* Margins: keep enough top space to clear the fixed nav (~80px tall). */
    body {
        margin: 90px 16px 0 16px;
    }

    section {
        margin-top: 48px;
        margin-bottom: 48px;
    }

    /* Collapse EVERY two-column split (hero, intro, approach, CTA) to one column. */
    .split {
        grid-template-columns: 1fr;
        row-gap: 32px;
    }

    /* Once stacked, any right-hand column shouldn't stick. */
    .sticky {
        position: static;
    }

    /* SAFETY NET (also in index-responsive.css): on mobile .hero-photo must drop
       its desktop calc(100vh ...) height, otherwise .photo's aspect-ratio:4/5
       turns that ~610px height into a ~488px WIDTH that overflows the screen —
       the real cause of horizontal scroll under the nav. Kept here too so the
       overflow can't come back if the per-page file isn't linked. */
    .hero-photo {
        height: auto !important;
    }

    .grid-cols-3 {
        grid-template-columns: 1fr;
        grid-row-gap: 20px;
        width: 100%;
    }

    /* Accreditation logos: two per row, full-width wrapper. */
    .accreditations-wrapper {
        width: 100%;
    }
    .accreditation-logo {
        width: 45%;
    }

    /* Footer: single column. */
    .grid-container {
        grid-template-columns: 1fr;
        grid-row-gap: 32px;
    }

    /* Paired ghost-button + link: stack them instead of a 50px-gap row. */
    .inline-btns {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    /* Show the hamburger; hide the desktop "Book" button. */
    .nav-toggle     { display: inline-flex; }
    .inner-nav .btn { display: none; }

    /* Keep the bar's own contents from being pushed past the edge:
       every inner-nav child may shrink, the toggle holds its size, and the
       wide letter-spaced tagline is dropped on phones. */
    .nav, .inner-nav, .brand, .nav-toggle { box-sizing: border-box; }
    .inner-nav     { min-width: 0; flex-wrap: nowrap; gap: 12px; }
    .inner-nav > * { min-width: 0; }
    .brand         { min-width: 0; font-size: 1.1rem; }
    .brand small   { display: none; }   /* remove this line to keep the tagline */
    .nav-toggle    { flex: 0 0 auto; }

    /* The links become a fixed drop-down panel below the bar, collapsed by
       default. Applies immediately (no .nav-js), so the inline desktop links
       are never shown on mobile — not even for one frame. */
    #primary-nav {
        position: fixed;
        top: calc(var(--nav-height) + 2 * var(--nav-padding));
        left: 0;
        right: 0;
        z-index: 90;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        overflow: hidden;
        max-height: 0;                       /* collapsed */
        transition: max-height .32s var(--ease);
    }
    .nav.nav-open #primary-nav {
        max-height: 70vh;                    /* opened — nav.js toggles .nav-open */
        overflow-y: auto;
    }

    /* Stack the links vertically inside the panel. */
    #primary-nav .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 6px 20px 14px;
    }
    #primary-nav .nav-links a {
        display: block;
        padding: 14px 2px;
        font-size: 1.05rem;
    }
    /* drop the sliding underline in the dropdown — looks odd full-width */
    #primary-nav .nav-links a::after {
        display: none;
    }
}