/* ============================================================================
   Site header — utility bar, primary nav, mobile drawer.

   Two states, driven by header.js adding .is-stuck past the hero:
     • at rest  — transparent over the hero, white type, no shadow
     • stuck    — solid paper, ink type, hairline + shadow

   Pages without a hero opt out by setting .site-header--solid, which pins the
   stuck appearance from the first paint. Without that, the nav on (say) the
   contact page would render white-on-white until the visitor scrolled.
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    transition: background .3s var(--pt-ease), box-shadow .3s var(--pt-ease), border-color .3s var(--pt-ease);
}

/* ---------------------------------------------------------- utility bar -- */

.topbar {
    background: var(--pt-ink-900);
    color: rgba(255, 255, 255, .72);
    font-size: var(--pt-text-xs);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--pt-gap);
    min-height: 38px;
}

.topbar-tagline {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--pt-font-accent);
    font-style: italic;
    font-size: .9375rem;
    color: var(--pt-lime-300);
    letter-spacing: .01em;
}

.topbar-contact { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .3rem .55rem;
    border-radius: var(--pt-radius-sm);
    color: rgba(255, 255, 255, .78);
    font-size: var(--pt-text-xs);
    font-weight: 500;
    transition: color .18s var(--pt-ease), background .18s var(--pt-ease);
}

.topbar-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.topbar-link svg { width: 13px; height: 13px; flex: none; }

.topbar-link-btn {
    border: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

.topbar-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, .18);
    margin-inline: .25rem;
}

/* ------------------------------------------------------------ main nav -- */

.main-nav {
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: inherit;
}

.main-nav-inner {
    display: flex;
    align-items: center;
    gap: var(--pt-gap);
    min-height: var(--pt-header-h);
}

.navbar-brand { display: inline-flex; align-items: center; flex: none; margin-right: auto; }

.brand-logo {
    height: 40px;
    width: auto;
    /* The mark is dark blue on transparent, so over the hero photo it needs a
       lift to stay readable without a white plate behind it. */
    filter: drop-shadow(0 2px 8px rgba(5, 12, 24, .45));
    transition: filter .3s var(--pt-ease), height .3s var(--pt-ease);
}

.site-header.is-stuck .brand-logo,
.site-header--solid .brand-logo { filter: none; height: 36px; }

/* -- links ---------------------------------------------------------------- */

.service-nav {
    display: flex;
    align-items: center;
    gap: .125rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.service-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem .8rem;
    border-radius: var(--pt-radius-pill);
    color: rgba(255, 255, 255, .9);
    font-family: var(--pt-font-display);
    font-size: var(--pt-text-base);
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    transition: color .2s var(--pt-ease), background .2s var(--pt-ease);
}

.service-nav .nav-link svg { width: 16px; height: 16px; opacity: .75; }

.service-nav .nav-link:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* The active marker is a lime dot under the label rather than a filled pill —
   it survives both header states without needing a second colour rule. */
.service-nav .nav-link.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: .18rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pt-lime-500);
    transform: translateX(-50%);
}

.site-header.is-stuck .service-nav .nav-link,
.site-header--solid .service-nav .nav-link { color: var(--pt-slate-700); }

.site-header.is-stuck .service-nav .nav-link:hover,
.site-header--solid .service-nav .nav-link:hover {
    background: var(--pt-blue-100);
    color: var(--pt-blue-700);
}

.site-header.is-stuck .service-nav .nav-link.active,
.site-header--solid .service-nav .nav-link.active { color: var(--pt-blue-700); font-weight: 600; }

/* -- header CTA ----------------------------------------------------------- */

.nav-cta { flex: none; margin-left: .5rem; }

/* -- stuck / solid state -------------------------------------------------- */

.site-header.is-stuck .main-nav,
.site-header--solid .main-nav {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom-color: var(--pt-line);
    box-shadow: 0 4px 24px rgba(10, 22, 40, .07);
}

.site-header.is-stuck .main-nav-inner { min-height: 66px; }

/* --------------------------------------------------------- mobile drawer -- */

.custom-toggler {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: var(--pt-radius-sm);
    background: rgba(255, 255, 255, .1);
    cursor: pointer;
}

.site-header.is-stuck .custom-toggler,
.site-header--solid .custom-toggler {
    border-color: var(--pt-line);
    background: var(--pt-paper);
}

.toggler-bar {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: #fff;
    transition: transform .3s var(--pt-ease), opacity .2s var(--pt-ease);
}

.site-header.is-stuck .toggler-bar,
.site-header--solid .toggler-bar { background: var(--pt-ink-800); }

.custom-toggler[aria-expanded="true"] .toggler-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.custom-toggler[aria-expanded="true"] .toggler-bar:nth-child(2) { opacity: 0; }
.custom-toggler[aria-expanded="true"] .toggler-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 890;
    background: rgba(5, 12, 24, .55);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s var(--pt-ease), visibility .3s;
}

.nav-scrim.is-open { opacity: 1; visibility: visible; }

@media (max-width: 991.98px) {
    .custom-toggler { display: flex; }

    .nav-collapse {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 895;
        width: min(340px, 86vw);
        height: 100dvh;
        padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
        background: var(--pt-paper);
        box-shadow: var(--pt-shadow-xl);
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(102%);
        transition: transform .38s var(--pt-ease-out);
        display: flex;
        flex-direction: column;
        gap: var(--pt-gap-lg);
    }

    .nav-collapse.is-open { transform: none; }

    .service-nav { flex-direction: column; align-items: stretch; gap: 2px; }

    .service-nav .nav-link {
        justify-content: flex-start;
        gap: .75rem;
        padding: .8rem .85rem;
        border-radius: var(--pt-radius);
        color: var(--pt-slate-700);
        font-size: var(--pt-text-md);
        /* 48px minimum: this is the one nav most of the traffic uses. */
        min-height: 48px;
    }

    .service-nav .nav-link svg { width: 19px; height: 19px; opacity: 1; color: var(--pt-blue-600); }
    .service-nav .nav-link:hover { background: var(--pt-blue-100); }

    .service-nav .nav-link.active { background: var(--pt-blue-100); color: var(--pt-blue-700); font-weight: 600; }
    .service-nav .nav-link.active::after { position: static; transform: none; margin-left: auto; }

    .nav-cta { margin: 0; }
    .nav-cta .pt-btn { width: 100%; }
}

@media (min-width: 992px) {
    /* Without this the drawer container is a plain block and its three children
       — the link list, the CTA and the mobile contact block — stack down the
       page instead of sitting in a row beside the logo. */
    .nav-collapse {
        display: flex;
        align-items: center;
        gap: var(--pt-gap);
        margin-left: auto;
    }

    .nav-scrim { display: none; }
    .mobile-contact { display: none; }
    .drawer-top { display: none; }
}

/* Drawer header + contact block, mobile only. */
.drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--pt-gap);
    border-bottom: 1px solid var(--pt-line-soft);
}

.drawer-top .brand-logo { filter: none; height: 40px; }

.drawer-close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--pt-line);
    border-radius: 50%;
    background: var(--pt-paper);
    color: var(--pt-slate-700);
    cursor: pointer;
}

.drawer-close svg { width: 18px; height: 18px; }

.mobile-contact {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-top: var(--pt-gap);
    border-top: 1px solid var(--pt-line-soft);
}

.mobile-contact-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem .85rem;
    border-radius: var(--pt-radius);
    background: var(--pt-sand);
    color: var(--pt-slate-700);
    font-size: var(--pt-text-base);
    font-weight: 600;
    min-height: 48px;
}

.mobile-contact-link svg { width: 18px; height: 18px; color: var(--pt-blue-600); flex: none; }

@media (min-width: 992px) {
    .drawer-top { display: none; }

    /* Repeated here, at the end of the file, on purpose: the base
       .mobile-contact rule below the earlier media query set display:flex at
       the same specificity and therefore won, leaving the phone and email
       pills floating over the hero on desktop. */
    .mobile-contact { display: none; }
}

/* ------------------------------------------------------- "More" dropdown -- */

.nav-more { position: relative; }

.nav-more__trigger {
    border: 0;
    background: none;
    font-family: var(--pt-font-display);
    cursor: pointer;
}

.nav-more__trigger svg { transition: transform .25s var(--pt-ease); }
.nav-more.is-open .nav-more__trigger svg { transform: rotate(180deg); }

.nav-more__panel {
    display: grid;
    gap: 2px;
}

@media (min-width: 992px) {
    .nav-more__panel {
        position: absolute;
        top: calc(100% + .6rem);
        right: 0;
        width: 320px;
        padding: .5rem;
        background: var(--pt-paper);
        border: 1px solid var(--pt-line);
        border-radius: var(--pt-radius-lg);
        box-shadow: var(--pt-shadow-xl);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .22s var(--pt-ease), transform .22s var(--pt-ease-out), visibility .22s;
    }

    .nav-more.is-open .nav-more__panel {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}

.nav-more__item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .7rem;
    border-radius: var(--pt-radius);
    color: var(--pt-slate-700);
    transition: background .18s var(--pt-ease);
}

.nav-more__item:hover { background: var(--pt-blue-050); color: var(--pt-slate-700); }

.nav-more__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 10px;
    background: var(--pt-blue-100);
    color: var(--pt-blue-600);
}

.nav-more__icon svg { width: 17px; height: 17px; }

.nav-more__item strong {
    display: block;
    font-family: var(--pt-font-display);
    font-size: var(--pt-text-base);
    font-weight: 600;
    color: var(--pt-heading);
    line-height: 1.3;
}

.nav-more__item small {
    display: block;
    font-size: var(--pt-text-xs);
    color: var(--pt-text-faint);
    line-height: 1.4;
}

@media (max-width: 991.98px) {
    /* On mobile the drawer is already a list — the panel just sits open under
       its label rather than becoming a second layer to tap through. */
    .nav-more__trigger { display: none; }
    .nav-more__panel { padding-top: .5rem; margin-top: .5rem; border-top: 1px solid var(--pt-line-soft); }
}
