/* Scoped header/footer/breadcrumb chrome for redesign 1c/1d. Uses site tokens. */
:root {
    --chrome-navy: var(--navy, #102431);
    --chrome-blue: var(--blue, #1f5fbf);
    --chrome-teal: var(--green, #0f766e);
    --chrome-booking-bar-height: 4.75rem;
    --chrome-header-height: 64px;
}

/* overflow-x:hidden on html/body breaks position:sticky; clip preserves stickiness */
html,
body {
    overflow-x: clip;
}

.site-header.site-chrome {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header.site-chrome .navbar {
    position: relative;
    top: auto;
    z-index: auto;
}

.site-header.site-chrome .nav-content {
    min-height: var(--chrome-header-height);
}

/* AA: logo subtitle contrast (was #8793a3 at ~10.4px / 2.96:1) */
.site-header .logo span {
    color: var(--subtle, #5f6b7a);
    font-size: 12px;
}

/* AC-7: logo-link tap target >=44px without enlarging the wordmark */
.site-header a.logo-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min, 44px);
}

.site-header .nav-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Desktop header buttons: 48px tap targets.
   Header / in-menu / booking-bar Book CTAs use the shared .btn-secondary token
   (no chrome override). */
.site-header .nav-links a,
.site-header .nav-actions .btn {
    min-height: var(--btn-min-height, 48px);
}

/* Dark footer focus ring (AA on navy) */
.site-footer a:focus-visible,
.footer a:focus-visible,
.site-footer .social-links a:focus-visible,
.footer .social-links a:focus-visible {
    outline: 2px solid var(--focus-on-dark, #74d3c4);
    outline-offset: 4px;
}

/* Preserve locked aria-hidden slash remnant on About without showing it.
   Span sits between </main> and the footer; breadcrumb separators are inside main. */
main + span[aria-hidden="true"] {
    display: none;
}

.breadcrumbs {
    margin: 0;
    padding: 0.85rem 2rem 0;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: center;
    max-width: var(--content, 1240px);
    margin: 0 auto;
    padding: 0;
    color: var(--muted, #5f6b7a);
    font-size: 0.82rem;
    font-weight: 700;
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    color: var(--subtle, #5f6b7a);
    font-weight: 600;
}

.breadcrumbs a {
    color: var(--chrome-blue);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
    color: var(--ink, #111827);
}

.mobile-booking-bar {
    display: none;
}

/* Fail-closed: [hidden] must win over any display:grid on the bar */
.mobile-booking-bar[hidden] {
    display: none !important;
}

@media (max-width: 860px) {
    /* Keep focused/hash targets (inquiry submit, etc.) clear of the fixed booking bar */
    html {
        scroll-padding-bottom: var(--chrome-booking-bar-height);
    }

    #inquiry,
    #project-inquiry,
    .inquiry-form,
    .inquiry-form button[type="submit"],
    #project-inquiry button[type="submit"] {
        scroll-margin-bottom: calc(var(--chrome-booking-bar-height) + 0.75rem);
    }

    .site-header .nav-content {
        position: static;
        min-height: var(--chrome-header-height);
        padding: 0 1rem;
    }

    /* Pin open menu to the sticky header / viewport edges (not the padded nav-content box) */
    .site-header .nav-panel,
    .site-header .nav-panel.open {
        position: absolute;
        left: 0;
        right: 0;
        width: 100%;
        top: var(--chrome-header-height);
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 0;
        box-sizing: border-box;
        align-items: stretch;
        justify-content: stretch;
        justify-items: stretch;
    }

    .site-header .nav-links {
        gap: 0;
        width: 100%;
        max-width: none;
        justify-self: stretch;
        align-items: stretch;
        justify-content: stretch;
        justify-items: stretch;
    }

    .site-header .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--line, #d9e1ea);
    }

    .site-header .nav-links a {
        justify-content: flex-start;
        min-height: 48px;
        width: 100%;
        border: none;
        border-radius: 0;
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }

    .site-header .nav-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.65rem;
        padding: 0.85rem 1rem 1rem;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        justify-items: stretch;
    }

    /* Full-width in-menu CTAs (was ~224px content-sized column) */
    .site-header .nav-actions .btn {
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: 48px;
        justify-self: stretch;
        box-sizing: border-box;
    }

    .mobile-booking-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 950;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
        padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0));
        border-top: 1px solid var(--line, #d9e1ea);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
        box-sizing: border-box;
    }

    .mobile-booking-bar[hidden] {
        display: none !important;
    }

    .mobile-booking-bar .btn {
        min-height: 48px;
        width: 100%;
        font-size: 0.82rem;
        padding: 0.65rem 0.5rem;
    }

    /* Keep scroll-to-top above the booking bar so it never covers bar CTAs */
    #scrollToTop,
    .scroll-to-top {
        bottom: calc(var(--chrome-booking-bar-height) + 1.2rem);
        right: 1.2rem;
    }

    body {
        padding-bottom: var(--chrome-booking-bar-height);
    }

    /*
     * C2: keep #scrollToTop clear of inquiry fields at ~390px.
     * Right padding clears the fixed control; bottom padding clears submit
     * when scrolled to the end of the form. While the form is in view, JS
     * adds .scroll-to-top--clear-inquiry so the control does not cover copy.
     */
    #inquiry.consulting-section {
        padding-bottom: calc(var(--chrome-booking-bar-height) + var(--tap-min, 44px) + 2.5rem);
    }

    .inquiry-form {
        padding-right: calc(var(--tap-min, 44px) + 1.2rem + 1.5rem);
    }

    .inquiry-form button[type="submit"] {
        max-width: 100%;
    }

    #scrollToTop.scroll-to-top--clear-inquiry.visible:not(:focus):not(:focus-visible),
    .scroll-to-top.scroll-to-top--clear-inquiry.visible:not(:focus):not(:focus-visible) {
        opacity: 0;
        pointer-events: none;
    }

    #scrollToTop.scroll-to-top--clear-inquiry:focus,
    #scrollToTop.scroll-to-top--clear-inquiry:focus-visible,
    .scroll-to-top.scroll-to-top--clear-inquiry:focus,
    .scroll-to-top.scroll-to-top--clear-inquiry:focus-visible {
        opacity: 1;
        pointer-events: auto;
    }
}
