/*
 * Bridge: let the approved Nuxt shell sit on a Blade page.
 *
 * approved-shell.css is loaded UNCHANGED from the Nuxt build — nothing here
 * overrides it. This file only resolves collisions between that stylesheet and
 * the legacy Blade page styles that were written when the signed-in area had
 * its own chrome.
 *
 * Keep it small. Anything that grows here is a signal the page beneath should
 * change, not the shell.
 */

/* The approved header is position:fixed at --approved-shell-height. Blade pages
   were laid out under a static header, so without this the first section sits
   behind it. */
body.has-approved-shell main#main-content {
    /* --rd-header-h is the variable the approved shell actually publishes
       (66px at the time of writing); the literal is only a floor for the
       moment before CSS applies. Measured, not guessed. */
    padding-top: var(--rd-header-h, 66px);
}

/* The legacy floating chrome belongs to the old shell and duplicates controls
   the approved header already provides. */
body.has-approved-shell .mobile-menu-toggle,
body.has-approved-shell .dashboard-hamburger {
    display: none !important;
}

/* Bootstrap sets a global box-sizing and heading scale that the Nuxt shell
   assumes for itself; scope the reset so the shell measures as designed. */
body.has-approved-shell .site-header *,
body.has-approved-shell .site-footer * {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    body.has-approved-shell .site-header { transition: none !important; }
}

/*
 * Open state for a CLICK-driven mega menu.
 *
 * approved-shell.css reveals a desktop menu on
 * `.mega-nav-item:focus-within > .mega-menu` — correct for the Vue original,
 * where hovering and keyboard focus drive it. On a Blade page the menu is
 * opened by a click handler, and :focus-within is unreliable for that: it
 * requires the document itself to hold focus, so a click that moves focus
 * elsewhere (or a programmatic open) leaves the panel at opacity 0 with its
 * full height — visually "the menu does nothing".
 *
 * approved-shell.js adds .is-open alongside aria-expanded, and this makes that
 * the authority. It does not override the closed state or the transition — it
 * supplies the open state the click path needs.
 */
body.has-approved-shell .site-header .mega-nav-item.is-open > .mega-menu,
body.has-approved-shell .site-header .mega-nav-item.is-open > .nav-dropdown,
body.has-approved-shell .site-header .nav-item.is-open > .nav-dropdown {
    /* !important on purpose. The closed state is set by several overlapping
       rules in approved-shell.css (.mega-menu AND .nav-dropdown), and the open
       state there is gated on :focus-within, which a click path cannot rely on.
       This is a deliberate, scoped override of a focus rule for a click
       context — not a specificity race being won by force. */
    clip-path: inset(0) !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* ---- Nav hover, and the logo -----------------------------------------------
   THE ACTUAL CAUSE, found 18 Aug 2026 after two wrong guesses.

   public/assets/css/styles.css carries a bare, unscoped rule:

       header a:hover { color: #fff; }

   Every anchor inside any <header>. The Nuxt homepage never loads styles.css,
   so it has never seen it; the account pages load the legacy bundle AND the
   approved shell, so the shell's nav inherits a white hover on a white bar —
   measured at 1:1 contrast.

   Two of my own changes are what exposed it. The mega menus were flattened from
   <button> to <a> (they could not be driven without Vue), and that turned every
   nav trigger into exactly the element this legacy rule targets. Before the
   flattening they were buttons and the rule never matched.

   Wrong guesses, recorded so nobody repeats them: it is NOT the `no-hero` class
   (switching to `has-hero` changed nothing), and NOT the missing
   `has-open-menu` (adding it changed nothing either — verified by hovering with
   the class applied on production).

   The colour below is not a choice. rgb(8,51,68) is what the live homepage
   computes when you hover its nav, so this restores the homepage's own value
   after a legacy rule overrode it. */
body.has-approved-shell .site-header a:hover,
body.has-approved-shell .site-header a:focus-visible {
    color: var(--approved-shell-navy, #083344) !important;
}

/* The logo must NOT react to hover — it does not on the homepage, and a
   wordmark that changes colour under the cursor reads as a broken link. */
body.has-approved-shell .site-header .logo-lockup:hover,
body.has-approved-shell .site-header .logo-lockup:hover * {
    color: inherit !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

/* ---- Account dropdown ------------------------------------------------------
   Airbnb pattern, founder-confirmed 19 Aug 2026. Two states; the growth block
   and settings group persist across both, only the personal rows change.

   Before this, the header's account icon was a plain <a href="/login"> — the
   Nuxt build is static and cannot know who is signed in, so a signed-in guest
   clicking their own account icon landed on a sign-in form. */
body.has-approved-shell .site-header .icon-row,
body.has-approved-shell .site-header .header-right { position: relative; }

.ac-menu {
    /* FIXED, not absolute. The panel is rendered OUTSIDE the header — the shell
       markup is cached per release and shared by everyone, while this menu
       depends on who is signed in — so it has no positioned ancestor in the
       header to anchor to. With `absolute` it resolved against the page and
       opened 560px tall somewhere below the fold: present in the DOM, reporting
       itself open, and invisible on screen. Anchored to the viewport under the
       header instead, at the shell's own gutter. */
    position: fixed;
    top: calc(var(--rd-header-h, 80px) + 8px);
    right: clamp(16px, 3.5vw, 80px);
    z-index: 1200;
    width: min(340px, calc(100vw - 32px));
    padding: 8px 0;
    background: #fff;
    border: 1px solid rgba(8, 51, 68, .12);
    border-radius: 16px;
    box-shadow: 0 22px 55px rgba(8, 51, 68, .16);
    font-family: 'Montserrat', sans-serif;
    color: #17323b;
}
.ac-menu[hidden] { display: none; }

/* ~72px rows. The account area shipped 87 controls under 44px; this is where
   that gets fixed for the header. */
.ac-menu-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    /* ~72px, per the founder's observation of the live Airbnb menu. Well
       above the 44px touch minimum, and the generosity is what makes a
       dropdown feel like a destination rather than a context menu. */
    min-height: 72px;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #17323b;
    text-decoration: none;
    background: none;
    border: 0;
    text-align: left;
    transition: background .16s cubic-bezier(.16,1,.3,1);
}
.ac-menu-row:hover { background: rgba(8, 51, 68, .05); color: #083344; }
.ac-menu-row:focus-visible,
.ac-menu-balance:focus-visible,
.ac-menu-promo:focus-visible {
    outline: 2px solid #06717e;
    outline-offset: -2px;
    border-radius: 10px;
}
/* The growth group carries no icons. The quietness is deliberate. */
.ac-menu-icon { flex-shrink: 0; color: #4d5c60; }
.ac-menu-row--quiet { font-weight: 500; color: #4d5c60; }
.ac-menu-form { margin: 0; }

.ac-menu-rule { height: 1px; margin: 8px 20px; background: rgba(8, 51, 68, .12); }

/* The one number in the menu. */
.ac-menu-balance {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 4px 12px 8px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(8,51,68,.04), rgba(6,113,126,.12));
    border: 1px solid rgba(6, 113, 126, .28);
    text-decoration: none;
    color: #4d5c60;
    font-size: 13.5px;
}
.ac-menu-balance-amount {
    font-family: 'Montserrat Alternates', 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #083344;
    font-variant-numeric: tabular-nums;
}

/* Promo block: title, two lines of grey copy, illustration. Not a plain row. */
.ac-menu-promo {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px 16px;
    text-decoration: none;
    color: #4d5c60;
}
.ac-menu-promo:hover { background: rgba(8, 51, 68, .05); }
.ac-menu-promo-text { display: flex; flex-direction: column; gap: 2px; }
.ac-menu-promo-text strong {
    font-family: 'Montserrat Alternates', 'Montserrat', sans-serif;
    font-size: 15px;
    color: #083344;
    margin-bottom: 2px;
}
.ac-menu-promo-text span { font-size: 12.5px; line-height: 1.45; }
.ac-menu-promo-art { flex-shrink: 0; color: #06717e; }

/* On a phone the account control still opens the same menu, but it behaves as
   a contained sheet below the approved header. It never overflows the viewport
   and remains independently scrollable when the signed-in state has more rows. */
@media (max-width: 640px) {
    .ac-menu {
        top: calc(var(--rd-header-h, 68px) + 6px);
        right: 10px;
        left: 10px;
        width: auto;
        max-height: calc(100dvh - var(--rd-header-h, 68px) - 18px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 14px;
        box-shadow: 0 18px 44px rgba(8, 51, 68, .2);
    }
    .ac-menu-row {
        min-height: 58px;
        padding: 12px 18px;
    }
    .ac-menu-promo { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .ac-menu-row { transition: none; }
}

/* ---- Nav typography parity, measured not assumed ---------------------------
   Production, 1440px, same element (.mega-nav-item > a), homepage scrolled to
   its solid state so both are like-for-like:

                      homepage    account (before)
     font-size        17px        16px
     font-weight      600         400
     letter-spacing   -0.17px     normal
     line-height      27.2px      25.6px

   Fifteen other header properties already matched exactly — height, background,
   border, shadow, padding, nav gap, colour, logo and icon sizes. It was only
   ever the type, and it is enough to make the account nav read as a different
   site. The cause is this page loading styles.css / main.css / Bootstrap, none
   of which the homepage loads; their generic link rules land on the shell's nav.

   These are the homepage's own computed values, restored. -0.01em is -0.17px at
   17px, and 1.6 is 27.2px — both derived from the measurement above, not chosen.
   !important because the legacy sheets use it. */
body.has-approved-shell .site-header .desktop-nav a,
body.has-approved-shell .site-header .desktop-nav button,
body.has-approved-shell .site-header .mega-nav-item > a,
body.has-approved-shell .site-header .mega-nav-item > button,
body.has-approved-shell .site-header .nav-item > a,
body.has-approved-shell .site-header .nav-item > button {
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    line-height: 1.6 !important;
}

/* ---- Nav hover underline and hit target, same cause as the type above -------
   The type block fixed what the legacy sheets overrode. This fixes what the
   shell's own stylesheet never applied here in the first place.

   approved-shell.css draws the nav underline with:

     .bnbstay-approved-shell > .site-header .nav-item > button:after
         { content:""; left:0; right:100%; bottom:7px; height:1px;
           background:currentColor; transition:right .28s }
     .nav-item > button:hover:after,
     .nav-item > button[aria-expanded="true"]:after   { right:0 }

   and sizes the trigger with:

     .desktop-nav > a, .nav-item > button { position:relative; min-height:44px }

   Every one of those is gated on `button`. The Vue header renders its four
   top-level triggers as <button>; the Blade header renders them as
   <a href="/greece"> so they still work without JS. So on an account page the
   underline pseudo-element is never created and the trigger keeps its natural
   text height.

   Measured on production, 19 Aug 2026, 1728px, real pointer on the trigger:

                        homepage            account (before)
     ::after content    ""                  none
     ::after height     1px                 —
     rest width         0 (right:100%)      —
     hover width        full (right:0)      —
     trigger height     44px                21px

   The fix is to extend those three rules to the anchor form. No new design:
   the values below are copied from approved-shell.css, not invented, so the
   two headers resolve to the same numbers. Scoped to .has-approved-shell, so
   only the Blade shell is affected and the Vue header is untouched. */
body.has-approved-shell .site-header .desktop-nav > a,
body.has-approved-shell .site-header .nav-item > a {
    position: relative;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

body.has-approved-shell .site-header .nav-item > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 7px;
    height: 1px;
    background: currentColor;
    transition: right .28s var(--approved-shell-ease, cubic-bezier(.16, 1, .3, 1));
}

body.has-approved-shell .site-header .nav-item > a:hover::after,
body.has-approved-shell .site-header .nav-item > a[aria-expanded="true"]::after,
body.has-approved-shell .site-header .nav-item.is-open > a::after {
    right: 0;
}

/* The pointer path adds .is-open to the item, not aria-expanded to the anchor,
   so the underline follows the panel it belongs to. */

@media (prefers-reduced-motion: reduce) {
    body.has-approved-shell .site-header .nav-item > a::after { transition: none; }
}
