/* Redesign global navigation (gnav) — extracted from webroot/redesign/final.html.
   Mobile burger menu (.gnav__toggle + .gnav--open) is a new addition: the prototypes simply
   hid the links below 860px; the toggle reveals them in a panel below the nav bar. */
.gnav { font-family: var(--g-body); font-size: 1.2rem; line-height: 1.55; }
/* Note: prototype used "top: 26px" to sit below the sticky .proto bar; without that bar it is 0. */
.gnav { background: #ffffff; border-bottom: 1px solid var(--g-border); position: sticky; top: 0; z-index: 80; }
.gnav-inner { display: flex; align-items: center; gap: 30px; height: 72px; }
/* logo lives inside a schema.org <div itemscope> wrapper in navigation.tpl.php,
   so the prototype's ".gnav-inner > a img" child selector would not match */
.gnav-inner a img { height: 42px; width: auto; display: block; }
.gnav-links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.gnav-links > a {
    font-family: var(--g-display-bold); text-transform: uppercase; letter-spacing: .04em;
    color: var(--g-navy); text-decoration: none; font-size: .95rem;
    padding: 4px 0; border-bottom: 2px solid transparent;
    transition: border-color .18s, color .18s;
}
.gnav-links > a:hover,
.gnav-links > a.active { color: var(--g-blue); border-color: var(--g-yellow); }
.gbtn {
    display: inline-block;
    font-family: var(--g-display-bold); text-transform: uppercase; letter-spacing: .05em;
    text-decoration: none; font-size: 1rem;
    padding: 13px 30px; border-radius: 999px;
    transition: transform .18s var(--ease), box-shadow .18s, background .18s;
    cursor: pointer;
}
.gbtn-yellow { background: var(--g-yellow); color: var(--g-navy); box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.gbtn-yellow:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0,0,0,.12); background: #f6c94e; }
.gbtn-blue { background: var(--g-blue); color: #fff; }
.gbtn-blue:hover { transform: translateY(-2px); background: var(--g-blue-deep); }
.gnav-links .gbtn { padding: 10px 22px; font-size: .9rem; white-space: nowrap; }
/* desktop: mobile icon CTAs hidden */
.gnav-cta-mobile, .gnav-cta-mobile-group { display: none; }
@media (max-width: 860.98px) {
    /* collapsed bar: [icon CTA left] [logo centered] [burger right] */
    .gnav-inner { position: relative; justify-content: space-between; gap: 0; }
    .gnav-links > a:not(.gbtn) { display: none; }
    /* the text CTA lives in the dropdown panel only */
    .gnav-links .gbtn { display: none; }
    .gnav--open .gnav-links .gbtn { display: inline-block; }
    .gnav-cta-mobile-group { display: flex; gap: 8px; }
    .gnav-cta-mobile {
        display: inline-flex; align-items: center; justify-content: center;
        width: 44px; height: 44px;
        background: var(--g-yellow); color: var(--g-navy);
        border-radius: 12px; text-decoration: none; font-size: 1.15rem;
        box-shadow: 0 3px 0 rgba(0, 0, 0, .12);
    }
    .gnav-cta-mobile--ghost {
        background: #fff; color: var(--g-blue);
        box-shadow: inset 0 0 0 2px var(--g-blue);
    }
    /* two icon CTAs on the left leave no room for an absolutely centered wordmark */
    .gnav-brand { flex: 1; min-width: 0; text-align: center; padding: 0 14px; }
    /* the image is display:block, so text-align cannot centre it; height stays auto so
       max-width scales it proportionally instead of squashing it on narrow phones */
    .gnav-brand a img { height: auto; max-height: 40px; max-width: 100%; margin: 0 auto; }
    .gnav__toggle { margin-left: auto; }
}

/* ---------- Mobile burger menu (addition, same tokens as gnav) ---------- */
.gnav__toggle {
    display: none;
    align-items: center; justify-content: center;
    width: 44px; height: 44px;
    margin-left: 8px;
    background: transparent;
    border: 1px solid var(--g-border); border-radius: 12px;
    color: var(--g-navy);
    font-size: 1.15rem;
    cursor: pointer;
    transition: color .18s, border-color .18s;
}
.gnav__toggle:hover { color: var(--g-blue); border-color: var(--g-yellow); }
@media (max-width: 860.98px) {
    .gnav__toggle { display: inline-flex; }
    /* Open state: links become a panel below the nav bar */
    .gnav--open .gnav-links {
        position: absolute; left: 0; right: 0; top: 100%;
        display: flex; flex-direction: column; align-items: stretch; gap: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--g-border);
        box-shadow: 0 18px 50px rgba(40, 62, 110, .12);
        padding: 8px 28px 18px;
        z-index: 79;
    }
    .gnav { position: sticky; }
    .gnav--open .gnav-links > a:not(.gbtn) {
        display: block;
        padding: 13px 0;
        border-bottom: 1px solid var(--g-border);
    }
    .gnav--open .gnav-links > a:not(.gbtn):hover,
    .gnav--open .gnav-links > a:not(.gbtn).active { border-color: var(--g-yellow); }
    .gnav--open .gnav-links .gbtn { margin-top: 14px; text-align: center; }
}

/* Secondary phone link in the gnav (carried over from the old navigation) */
.gnav-links > a.gnav-phone {
    font-family: var(--g-body);
    text-transform: none;
    letter-spacing: 0;
    color: var(--g-blue);
    font-size: .95rem;
}
.gnav-links > a.gnav-phone:hover { color: var(--g-navy); border-color: transparent; }

/* menu bar animation */
.gnav .gnav__toggle {
    position: relative;
}

.gnav .gnav__toggle i {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    width: 22px;
    height: 2px;
    margin: -1px auto 0;
    background-color: currentColor;
    font-size: 0;
    transition: background-color 0.2s ease;
}

.gnav .gnav__toggle i::before,
.gnav .gnav__toggle i::after {
    content: ""; /* overrides the FontAwesome glyph in ::before */
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: transform 0.3s ease, top 0.3s ease;
}

.gnav .gnav__toggle i::before {
    top: -7px;
}

.gnav .gnav__toggle i::after {
    top: 7px;
}

.gnav.gnav--open  .gnav__toggle {
    background-color: var(--g-yellow);
}

.gnav.gnav--open .gnav__toggle i {
    background-color: transparent;
}

.gnav.gnav--open .gnav__toggle i::before {
    top: 0;
    transform: rotate(45deg);
    background-color: var(--g-navy);
}

.gnav.gnav--open .gnav__toggle i::after {
    top: 0;
    transform: rotate(-45deg);
    background-color: var(--g-navy);
}

/* ---------- Scroll CTA (restores the pre-redesign sub navigation) ----------
   The secondary CTA appears once the page is scrolled. To keep the row on one line the
   hotline collapses to its icon, the gaps tighten and — below 1200px — the wordmark is
   swapped for the brand mark. */
.gbtn-ghost { background: transparent; color: var(--g-blue); box-shadow: inset 0 0 0 2px var(--g-blue); }
.gnav-links .gbtn-ghost { padding: 10px 18px; }
.gnav-links > a.gbtn-ghost:hover { background: var(--g-blue); color: #fff; border-color: transparent; transform: translateY(-2px); }
.gbtn-ghost i { display: none; }
.gnav-inner a img.gnav-brand-icon { display: none; }

@keyframes gnav-cta-in {
    from { opacity: 0; transform: translateY(-6px); }
}

@media (min-width: 861px) {
    .gnav-links { transition: gap .18s var(--ease); }
    .gnav-cta-scroll { display: none; }
    .gnav--scrolled .gnav-cta-scroll { display: inline-block; animation: gnav-cta-in .22s var(--ease); }
    .gnav--scrolled .gnav-links { gap: 12px; }
    /* hidden visually only — the number stays the link's accessible name */
    .gnav--scrolled .gnav-phone-num {
        position: absolute; width: 1px; height: 1px;
        clip-path: inset(50%); overflow: hidden; white-space: nowrap;
    }
    /* icon-only hotline keeps a 24px pointer target (WCAG 2.5.8) */
    .gnav--scrolled .gnav-links > a.gnav-phone { padding: 6px 6px; }
}

/* narrow desktops: the wordmark and the hotline number would push the row into a second
   line, so both give way — the number stays readable for screen readers */
@media (min-width: 861px) and (max-width: 1199px) {
    .gnav--scrolled .gnav-inner a img.gnav-brand-full { display: none; }
    .gnav--scrolled .gnav-inner a img.gnav-brand-icon { display: block; }
}

@media (min-width: 861px) and (max-width: 1119px) {
    .gnav-phone-num {
        position: absolute; width: 1px; height: 1px;
        clip-path: inset(50%); overflow: hidden; white-space: nowrap;
    }
    .gnav-links > a.gnav-phone { padding: 6px 6px; }
}

/* below 1200px the row is tight, so the secondary CTA gets a slimmer box */
@media (min-width: 861px) and (max-width: 1199px) {
    .gnav-links .gbtn-ghost { padding: 10px 14px; }
}

/* below 1000px the secondary CTA collapses to its icon (aria-label carries the name) */
@media (min-width: 861px) and (max-width: 999px) {
    .gnav-links .gbtn-ghost { padding: 10px 13px; }
    .gnav-links .gbtn-ghost i { display: inline-block; font-size: 1.05rem; }
    .gnav-links .gbtn-ghost .gbtn-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gnav-links { transition: none; }
    .gnav--scrolled .gnav-cta-scroll { animation: none; }
}

/* very narrow phones: the wordmark would shrink below readable size next to the two
   icon CTAs, so the brand mark takes over */
@media (max-width: 379.98px) {
    .gnav-inner a img.gnav-brand-full { display: none; }
    .gnav-inner a img.gnav-brand-icon { display: block; }
}
