/* Chrome-only overrides for clean Astro pages.
   This is the route-scoped subset of overrides.css that the clean component
   chrome actually uses: the desktop Nav (.site-nav), the MobileMenu overlay
   (.mobile-menu / .submenu / burger), and the YouTube facade (.yt-facade),
   plus general viewport/overflow guards. The full overrides.css (Squarespace
   fluid-engine / sqs-block / page-section / blog-item / acuity / per-page
   tuning) stays loaded ONLY on the two dump pages, /contact and /feelbetter.
   Keeping it off the 97 clean pages removes ~37 KB of dead, render-blocking
   CSS and the expensive [class*="sqs-"] / body>* / page-section selector
   matching that inflated Style & Layout. */

/* =============================================
   VIEWPORT WIDTH CONSTRAINTS (general guards)
   ============================================= */
html {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
}

body {
    overflow-x: hidden !important;
    overflow-x: clip !important;  /* Stronger than hidden */
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Constrain all direct children to viewport width */
body > * {
    max-width: 100vw !important;
    box-sizing: border-box !important;
}

/* Keep media responsive (height:auto WITHOUT !important so explicit
   width/height on component <img> still wins). */
img, video, iframe, embed, object {
    max-width: 100% !important;
    height: auto;
}

pre, code {
    overflow-x: auto !important;
    max-width: 100% !important;
}

/* =============================================
   DESKTOP NAV (.site-nav — components/Nav.astro)
   ============================================= */
.site-nav {
    display: flex;
    align-items: center;
}

.site-nav .nav-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    /* Fluid gap: full 1.5em of breathing room on a wide screen, tightening to
       0.75em on a laptop so the eight items stay on one line well below the
       old 1360px burger threshold. Paired with the fluid .nav-link font-size
       below; both are part of how the header breakpoint was measured. */
    gap: clamp(0.75em, 1.35vw, 1.5em);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav .nav-item {
    position: relative;
    display: inline-block;
}

.site-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.5em 0;
    text-decoration: none;
    color: #1b1b1b;
    /* 15.2px on a wide screen, easing to 13.8px on a laptop rather than
       collapsing the whole nav into the burger. */
    font-size: clamp(0.86rem, 0.5vw + 0.58rem, 0.95rem);
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.site-nav .nav-link:hover {
    color: #06b5d4;
}

.site-nav .icon-arrow {
    width: 10px;
    height: 10px;
    transition: transform 0.2s;
}

.site-nav .nav-item:hover .icon-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.site-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 4px;
    list-style: none;
    margin: 0;
    padding: 0.5em 0;
    z-index: 1000;
}

.site-nav .nav-item:hover .dropdown-menu,
.site-nav .nav-item:focus-within .dropdown-menu,
.site-nav .dropdown-toggle[aria-expanded="true"] + .dropdown-menu {
    display: block;
}

.site-nav .dropdown-item {
    display: block;
}

.site-nav .dropdown-link {
    display: block;
    padding: 0.6em 1.2em;
    text-decoration: none;
    color: #1b1b1b;
    font-size: 0.9em;
    transition: background 0.2s;
}

.site-nav .dropdown-link:hover {
    background: #f5f5f5;
    color: #06b5d4;
}

/* Hide stray .icon-arrow icons by default (re-enabled inside the mobile
   accordion further down, and on the desktop dropdown toggle just below — the
   arrow is a needed affordance that keyboard/non-JS users rely on). */
.icon-arrow,
svg.icon-arrow {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
}

/* Desktop dropdown caret — a visible "this opens a submenu" affordance. More
   specific than the hide rule above, so it wins. Rotates when the dropdown is
   open (hover, keyboard focus-within, or the JS aria-expanded state). */
.site-nav .dropdown-toggle .icon-arrow {
    display: inline-block !important;
    visibility: visible !important;
    width: 10px !important;
    height: 10px !important;
    opacity: 1 !important;
    flex: 0 0 auto;
    transition: transform 0.2s ease;
}
.site-nav .nav-item:hover .dropdown-toggle .icon-arrow,
.site-nav .nav-item:focus-within .dropdown-toggle .icon-arrow,
.site-nav .dropdown-toggle[aria-expanded="true"] .icon-arrow {
    transform: rotate(180deg);
}
.site-nav .dropdown-toggle .icon-arrow path {
    stroke: currentColor;
}

/* Visible keyboard focus rings on nav + dropdown links/toggles, matching the
   deep-teal focus treatment the forms use. */
.site-nav .nav-link:focus-visible,
.site-nav .dropdown-toggle:focus-visible,
.site-nav .dropdown-link:focus-visible {
    outline: 3px solid var(--color-accent-text);
    outline-offset: 2px;
    border-radius: 2px;
}

/* =============================================
   MOBILE MENU — hidden by default (all sizes);
   shows only when nav.js adds .is-active.
   ============================================= */
.mobile-menu,
.mobile-menu-inner,
.mobile-nav,
.mobile-nav-list,
.mobile-menu-overlay,
.mobile-cta,
.mobile-social {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
}

.mobile-menu.is-active,
.mobile-menu.is-active .mobile-menu-inner,
.mobile-menu.is-active .mobile-nav,
.mobile-menu.is-active .mobile-nav-list,
.mobile-menu.is-active .mobile-cta,
.mobile-menu.is-active .mobile-social {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    width: auto !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    left: 0 !important;
    pointer-events: auto !important;
}

.mobile-menu-overlay.is-active {
    display: block !important;
    visibility: visible !important;
    height: 100vh !important;
    width: 100vw !important;
    max-height: none !important;
    overflow: hidden !important;
    opacity: 0.5 !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    pointer-events: auto !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 998 !important;
}

/* =============================================
   MOBILE OVERLAY MENU (driven by static/js/nav.js)
   Full-screen overlay; these rules come last so they win over the bare
   show/hide rules above.
   ============================================= */

/* Lock background scroll while the menu is open */
body.menu-open {
    overflow: hidden !important;
}

/* The overlay container: full-screen white panel */
.mobile-menu.is-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Reset the bare position:fixed/left:0 applied to inner pieces above */
.mobile-menu.is-active .mobile-menu-inner,
.mobile-menu.is-active .mobile-nav,
.mobile-menu.is-active .mobile-nav-list,
.mobile-menu.is-active .mobile-cta,
.mobile-menu.is-active .mobile-social {
    position: static !important;
    left: auto !important;
    top: auto !important;
}

.mobile-menu.is-active .mobile-menu-inner {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    padding: 90px 28px 48px !important;
    box-sizing: border-box !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Close (X) button */
.mobile-menu.is-active .mobile-menu-close {
    position: absolute !important;
    top: 22px;
    right: 22px;
    width: 42px;
    height: 42px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    color: #1b1b1b;
    cursor: pointer;
    z-index: 2;
}
.mobile-menu.is-active .mobile-menu-close svg {
    width: 26px;
    height: 26px;
}
/* Explicit stroke — the inherited currentColor resolves to transparent here */
.mobile-menu.is-active .mobile-menu-close svg path {
    stroke: #1b1b1b !important;
}

/* Nav list */
.mobile-menu.is-active .mobile-nav,
.mobile-menu.is-active .mobile-nav-list {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
}
.mobile-menu.is-active .mobile-nav-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
}
.mobile-menu .mobile-nav-list li {
    list-style: none !important;
    margin: 0 !important;
}
.mobile-menu .mobile-nav-list > li > a,
.mobile-menu .submenu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5em;
    margin: 0;
    padding: 15px 4px !important;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
    color: #1b1b1b !important;
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #ededed;
    cursor: pointer;
}
.mobile-menu .mobile-nav-list > li > a:hover,
.mobile-menu .submenu-toggle:hover {
    color: #06b5d4 !important;
}

/* Folder dropdown arrow — re-enable for the mobile accordion (global rule hides
   .icon-arrow; this more-specific selector restores it inside the mobile menu) */
.mobile-menu .submenu-toggle .icon-arrow {
    display: inline-block !important;
    visibility: visible !important;
    width: 14px !important;
    height: 14px !important;
    opacity: 1 !important;
    flex: 0 0 auto;
    transition: transform 0.2s ease;
}
.mobile-menu .submenu-toggle[aria-expanded="true"] .icon-arrow {
    transform: rotate(180deg);
}
.mobile-menu .submenu-toggle .icon-arrow path {
    stroke: #1b1b1b !important;
}

/* Submenu accordion */
.mobile-menu .submenu {
    display: none !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 2px 0 10px 14px !important;
}
.mobile-menu .submenu.is-open {
    display: block !important;
}
.mobile-menu .submenu a {
    display: block !important;
    padding: 10px 4px !important;
    font-size: 1rem;
    font-weight: 500;
    color: #555 !important;
    text-decoration: none;
}
.mobile-menu .submenu a:hover {
    color: #06b5d4 !important;
}

/* Book now CTA */
.mobile-menu.is-active .mobile-cta {
    display: inline-block !important;
    width: auto !important;
    align-self: flex-start;
    margin: 26px 4px 0 !important;
    padding: 13px 30px !important;
    background: #06b5d4 !important;
    color: #fff !important;
    border-radius: 50px !important;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}
.mobile-menu.is-active .mobile-cta:hover {
    background: #0891b2 !important;
}

/* Social icons */
.mobile-menu.is-active .mobile-social {
    display: flex !important;
    gap: 18px;
    margin: 30px 4px 0 !important;
}
.mobile-menu .mobile-social a {
    display: inline-flex !important;
    color: #1b1b1b;
}
.mobile-menu .mobile-social svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

/* Burger -> X animation while the menu is open (components/Header.astro) */
.header-burger-btn .top-bun,
.header-burger-btn .patty,
.header-burger-btn .bottom-bun {
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.header-burger-btn.burger--active .top-bun {
    transform: translateY(5px) rotate(45deg);
}
.header-burger-btn.burger--active .patty {
    opacity: 0;
}
.header-burger-btn.burger--active .bottom-bun {
    transform: translateY(-5px) rotate(-45deg);
}

/* =============================================
   LIGHTWEIGHT YOUTUBE FACADE (driven by static/js/nav.js)
   Self-hosted poster + play button; the real iframe loads only on click.
   The facade is an <a> to the YouTube watch page (works with NO JS); with JS
   nav.js intercepts and swaps in the youtube-nocookie embed inline.
   ============================================= */
/* Responsive 16:9 wrapper (emitted by YouTube.astro + postbuild markdown wrap).
   aspect-ratio is the modern path; padding-top is the old-browser fallback. */
.yt-embed {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}
.yt-embed::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}
.yt-embed > .yt-facade,
.yt-embed > .yt-facade-frame {
    position: absolute;
    inset: 0;
}
.yt-facade {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
    padding: 0;
    border: 0;
    display: block;
    cursor: pointer;
    background: #000;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
.yt-facade:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}
.yt-facade .yt-facade-poster {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    opacity: 1 !important;
    max-width: none !important;
}
.yt-facade .yt-facade-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.62);
    transition: background 0.2s ease;
}
.yt-facade:hover .yt-facade-play,
.yt-facade:focus-visible .yt-facade-play {
    background: #ff0000;
}
.yt-facade .yt-facade-play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 11px 0 11px 19px;
    border-color: transparent transparent transparent #ffffff;
}
/* The iframe injected on click (override the global iframe height:auto) */
.yt-facade-frame {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/* =============================================
   DESKTOP DROPDOWN TEXT COLOR
   The header establishes a transparent text color that the dropdown links
   inherit; force readable dark text.
   ============================================= */
.site-nav .dropdown-menu {
    text-align: left !important;
}
.site-nav .dropdown-menu .dropdown-link,
.site-nav .dropdown-menu .dropdown-item a {
    color: #1b1b1b !important;
    -webkit-text-fill-color: #1b1b1b !important;
    text-align: left !important;
}
.site-nav .dropdown-menu .dropdown-link:hover,
.site-nav .dropdown-menu .dropdown-item a:hover {
    color: #06b5d4 !important;
    -webkit-text-fill-color: #06b5d4 !important;
}
