/* ============ Voilà site header ============
   The one header for voila.fun marketing pages and tutors.voila.fun: blue
   bar, white wordmark, pink underline on the current link, language and
   currency pill, Login + primary CTA, phone sheet, and the LanguageMenu
   popover the pill opens.

   Framework-free on purpose: plain classes, no `.vds` scope, nothing from
   Tailwind or MUI, so the tutor-search Lambda can serve this file verbatim.
   Contract:
   - The VDS tokens (tokens.css) must be in scope on an ancestor: `.vds` on
     the website, `:root` in the Lambda.
   - `.v-btn`, `.v-btn--sm/--md`, `.v-btn--primary/--secondary`,
     `.v-btn--full` and `.v-container` come from the design system
     (voila.css / layout.css); this file only overrides them inside the bar.
   - Source of truth is voila-website. `scripts/sync-header-css.mjs` copies it
     to the Lambda and prints the SHA-256 its drift test pins. */

/* ---------- bar ---------- */
.v-header { position: sticky; top: 0; z-index: 40; background: var(--surface-brand); color: var(--white); }
.v-header.scrolled { box-shadow: 0 1px 0 rgba(13,30,61,0.35); }
.v-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.v-header__logo { display: flex; align-items: center; min-height: 44px; flex: 0 0 auto; }
.v-header__logo img { display: block; height: 32px; width: auto; }
.v-header__nav { display: none; align-items: center; gap: 22px; font-weight: 600; font-size: 15px; }
.v-header__link { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: transparent; font: inherit; color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.v-header .v-header__link, .v-header .v-header__link:hover { color: inherit; }
.v-header__link:is([aria-current="page"], [aria-current="true"])::after { content: ''; position: absolute; inset-inline: 0; bottom: 6px; height: 2px; border-radius: 2px; background: var(--pink-300); }
.v-header__link svg { transition: transform 200ms cubic-bezier(.2,.7,.3,1); }
.v-header__link[aria-expanded="true"] svg { transform: rotate(180deg); }

.v-header .v-header__login { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill); color: var(--white); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); font-weight: 700; text-decoration: none; white-space: nowrap; }
.v-header .v-header__login:hover { color: var(--white); background: rgba(255,255,255,.1); }
/* `.v-header__start-learner` is the name tutor-search's markup uses. */
.v-header :is(.v-header__start, .v-header__start-learner) { background: var(--white); color: var(--blue-600); box-shadow: var(--shadow-pop-sm); }
.v-header :is(.v-header__start, .v-header__start-learner):hover { background: var(--white); color: var(--blue-700); }

.v-header__menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: var(--radius-pill); background: transparent; color: inherit; cursor: pointer; }

.v-header .v-header__logo:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-focus-dark); border-radius: var(--radius-md); }
.v-header :is(.v-header__link, .v-header__login, .v-header__locale, .v-header__menu-btn):focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-focus-dark); border-radius: var(--radius-pill); }
.v-header :is(.v-header__start, .v-header__start-learner):focus-visible { outline: 2px solid transparent; box-shadow: var(--shadow-pop-sm), var(--ring-focus-dark); }

.v-announce { display: block; padding: 10px var(--gutter-mobile); background: var(--navy-900); color: var(--white); text-align: center; font-size: 14px; font-weight: 600; text-decoration: none; }
.v-announce:hover { color: var(--white); }
.v-announce strong { color: var(--pink-300); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 900px) {
  .v-header__nav { display: flex; }
  .v-header__menu-btn { display: none; }
}

/* ---------- language / currency pill ---------- */
.v-header__locale { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: transparent; color: inherit; font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.v-header__nav .v-header__locale:hover { background: rgba(255,255,255,0.1); }
.v-header__locale-sep { opacity: 0.55; }

/* ---------- For tutors dropdown ---------- */
.v-dd { position: relative; }
.v-dd__panel { position: absolute; top: calc(100% + 10px); inset-inline-start: -16px; width: 320px; padding: 8px; background: var(--surface-card); border: 2px solid var(--border-pop); border-radius: 18px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 2px; z-index: 50; }
.v-dd__panel[hidden] { display: none; }
.v-dd__item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; text-decoration: none; }
.v-dd__item:hover, .v-dd__item[aria-current="page"] { background: var(--pink-50); }
.v-dd__item-title { font-weight: 800; color: var(--text-strong); }
.v-dd__item-desc { font-weight: 400; font-size: 13.5px; color: var(--text-muted); }

/* ---------- phone sheet ---------- */
.v-sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--surface-page); color: var(--text-strong); overflow-y: auto; }
.v-sheet[hidden] { display: none; }
.v-sheet__head { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding-inline: var(--gutter-mobile); border-bottom: 1px solid var(--border-subtle); }
.v-sheet__close { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--text-strong); cursor: pointer; }
.v-sheet__close:hover { background: var(--grey-100); }
.v-sheet__body { display: flex; flex-direction: column; gap: 4px; padding: 16px var(--gutter-mobile) 32px; }
.v-sheet__link { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 0 12px; border: 0; border-radius: var(--radius-lg); background: transparent; font: inherit; font-size: 17px; font-weight: 700; color: var(--text-strong); text-align: start; text-decoration: none; cursor: pointer; }
.v-sheet__link:hover, .v-sheet__link:is([aria-current="page"], [aria-current="true"]) { background: var(--pink-50); color: var(--text-strong); }
.v-sheet__link svg { transition: transform 200ms cubic-bezier(.2,.7,.3,1); }
.v-sheet__link[aria-expanded="true"] svg { transform: rotate(180deg); }
.v-sheet__sub { display: flex; flex-direction: column; gap: 2px; padding-inline-start: 12px; }
.v-sheet__locale { display: flex; margin-top: 8px; }
.v-sheet__locale .v-langmenu { display: flex; width: 100%; }
.v-sheet__locale .v-header__locale { width: 100%; min-height: 52px; justify-content: flex-start; padding-inline: 12px; border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--border-default); color: var(--text-strong); font-size: 16px; }
.v-sheet__locale .v-header__locale > svg:last-child { margin-inline-start: auto; }
.v-sheet__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* ---------- LanguageMenu (popup listbox; the pill's popover) ---------- */
.v-langmenu { position: relative; display: inline-flex; }
.v-langmenu__panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 50; width: max-content; min-width: 220px; max-width: min(300px, calc(100vw - 32px)); max-height: var(--v-langmenu-max, 440px); margin: 0; padding: 6px; list-style: none; overflow-y: auto; overscroll-behavior: contain; background: var(--surface-card); color: var(--text-body); border: 2px solid var(--border-pop); border-radius: 18px; box-shadow: var(--shadow-pop); text-align: start; }
.v-langmenu__panel--up { top: auto; bottom: calc(100% + 8px); }
.v-langmenu__panel:focus-visible, .v-langmenu__list:focus-visible { outline: 2px solid transparent; }
.v-langmenu__option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 12px; color: var(--text-body); font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer; user-select: none; }
.v-langmenu__option[data-active] { background: var(--surface-sunken); color: var(--text-strong); }
.v-langmenu__panel:focus-visible .v-langmenu__option[data-active], .v-langmenu__list:focus-visible .v-langmenu__option[data-active] { box-shadow: inset 0 0 0 2px var(--border-strong); }
.v-langmenu__option[aria-selected="true"] { background: var(--pink-50); color: var(--text-strong); font-weight: 800; }
.v-langmenu__label { flex: 1 1 auto; min-width: 0; }
.v-langmenu__hint { flex: none; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-muted); }
.v-langmenu__check { display: inline-flex; flex: none; width: 16px; color: var(--pink-700); }

/* Rich panel: tabs + search + list (the header pill). */
.v-langmenu__panel--rich { display: flex; flex-direction: column; width: 280px; padding: 0; overflow: hidden; color: var(--text-strong); }
.v-langmenu__sheet-head { display: none; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 8px 16px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.v-langmenu__sheet-title { margin: 0; font-size: 18px; font-weight: 800; color: var(--text-strong); min-width: 0; }
.v-langmenu__sheet-close { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-sunken); color: var(--text-strong); cursor: pointer; }
.v-langmenu__sheet-close:hover { background: var(--grey-100); }
.v-langmenu__tabs { display: flex; gap: 4px; padding: 6px; margin: 10px 10px 0; background: var(--surface-sunken); border-radius: var(--radius-pill); flex-shrink: 0; }
.v-langmenu__tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 8px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text-muted); background: none; border: 0; border-radius: var(--radius-pill); cursor: pointer; }
.v-langmenu__tab:hover { color: var(--text-strong); }
.v-langmenu__tab[aria-pressed="true"] { background: var(--surface-card); color: var(--text-strong); box-shadow: inset 0 0 0 2px var(--border-pop); }
.v-langmenu__search { padding: 10px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.v-langmenu__search input { width: 100%; min-height: 44px; padding: 0 14px; font: inherit; font-size: 15px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-strong); }
.v-langmenu__search input:focus { outline: none; border-color: var(--focus); box-shadow: var(--ring-focus); }
.v-langmenu__list { flex: 1 1 auto; min-height: 0; max-height: 300px; margin: 0; padding: 6px; list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.v-langmenu__panel--rich .v-langmenu__option { min-height: 44px; }
.v-langmenu__empty { margin: 0; padding: 14px 16px; text-align: center; font-size: 14px; color: var(--text-muted); }

/* Phones and touch tablets: the rich panel becomes a full-screen sheet. */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .v-langmenu__panel.v-langmenu__panel--rich { position: fixed; inset: 0; z-index: 10000; width: 100%; min-width: 0; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); border: 0; border-radius: 0; box-shadow: none; }
  .v-langmenu__panel--rich .v-langmenu__sheet-head { display: flex; }
  .v-langmenu__panel--rich .v-langmenu__list { max-height: none; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  .v-langmenu__panel--rich .v-langmenu__search input { font-size: 16px; }
  .v-langmenu__panel--rich .v-langmenu__option { min-height: 52px; padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .v-header__link svg, .v-sheet__link svg { transition: none; }
}
