/* =============================================================================
   mobile/css/lang-menu.css — phone language picker (mobile/js/lang-menu.js).
   One 44px globe button; tap opens a small menu of native language names with
   the active one checked. Loaded on / (mobile/loader.js) and /press/.
   @media-only (§13). Tokens only (§10.2).
   ========================================================================== */

@media (max-width: 768px) {
  /* The segmented-pill chrome of .site-nav__lang (css/components/lang-toggle.css)
     → a bare anchor for the trigger + panel. */
  .site-nav__lang.lang-menu {
    position: relative;
    display: inline-flex;
    padding: 0;
    gap: 0;
    border: 0;
    background: none;
  }

  .lang-menu__trigger {
    display: grid;
    place-items: center;
    inline-size: 44px;
    block-size: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent);
    background: color-mix(in srgb, var(--ivory) 92%, transparent);
    color: var(--brass-deep);
    cursor: pointer;
    transition: background-color var(--dur-fast, 160ms) var(--ease-out-cinema, ease),
                border-color var(--dur-fast, 160ms) var(--ease-out-cinema, ease);
  }
  .lang-menu.is-open .lang-menu__trigger {
    border-color: var(--brass);
    background: var(--ivory);
  }
  .lang-menu__trigger:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
  }

  .lang-menu__panel {
    position: absolute;
    inset-block-start: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 5;
    min-inline-size: 9.5rem;
    display: flex;
    flex-direction: column;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent);
    background: var(--ivory);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--ink-deep) 18%, transparent);
    /* closed state: out of the way, no hit area */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 160ms var(--ease-out-cinema, ease),
                transform 160ms var(--ease-out-cinema, ease),
                visibility 0s linear 160ms;
  }
  .lang-menu.is-open .lang-menu__panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }
  /* Hamburger menu overlay (Moshe, 2026-10-11: "at the top of the menu"): the
     globe's list item leaves the link list and sits in the top corner opposite
     the close ×, at the same height (lang-switch.css puts the × at --space-3).
     position:fixed resolves against the overlay (its backdrop-filter makes it
     the containing block — the same trick the × uses), so it stays put while
     the list scrolls. The menu opens downward from the corner. */
  .site-nav__mobile .site-nav__lang-item {
    position: fixed;
    inset-block-start: var(--space-3);
    inset-inline-start: var(--gutter);
    z-index: 2;
  }
  .site-nav__mobile .lang-menu__panel {
    inset-inline-start: 0;
    inset-inline-end: auto;
  }

  /* /press/ puts the picker at the inline-START corner — open toward the page. */
  [data-lang-toggle] .lang-menu__panel {
    inset-inline-end: auto;
    inset-inline-start: 0;
  }

  .lang-menu .lang-menu__opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-block-size: 44px;
    inline-size: 100%;
    padding: 0 0.9rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
    text-align: start;
    color: var(--ink-deep);
    background: transparent;
  }
  .lang-menu .lang-menu__opt::after { content: none; } /* perf.css hit-area extender — rows are 44px already */
  .lang-menu .lang-menu__opt.is-active {
    color: var(--brass-deep);
    font-weight: 600;
    background: color-mix(in srgb, var(--brass) 14%, transparent);
  }
  .lang-menu .lang-menu__opt.is-active::before {
    content: "✓";
    order: 2;
    font-weight: 600;
  }
  .lang-menu .lang-menu__opt:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
  }

  @media (prefers-reduced-motion: reduce) {
    .lang-menu__panel { transition: none; }
  }
}
