/* ============================================================
   nav-sheet.css — the ≤820px counterpart to .nav-links and
   .nav-actions, both of which are display:none at that width.

   It carries the theme toggle as well as the two nav links —
   without it the toggle is unreachable on a phone.

   Sits at z-index 39/38, just under .site-nav (40), so the sheet
   reads as sliding out from beneath the bar. The booth modal
   (100) still covers it.
   ============================================================ */

.nav-sheet,
.nav-sheet__scrim { display: none; }

@media (max-width: 820px) {

  body.nav-sheet-open { overflow: hidden; }

  /* --- Scrim: dims the page and absorbs the outside click --- */
  .nav-sheet__scrim {
    display: block;
    position: fixed;
    inset: var(--nav-h-mob) 0 0 0;
    z-index: 38;
    background: color-mix(in srgb, var(--ink) 32%, transparent);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 0s linear 200ms;
  }
  .nav-sheet__scrim[data-open] {
    opacity: 1;
    visibility: visible;
    transition: opacity 200ms ease, visibility 0s;
  }

  /* --- The sheet itself --- */
  .nav-sheet {
    display: block;
    position: fixed;
    top: var(--nav-h-mob);
    left: 0;
    right: 0;
    z-index: 39;
    padding: var(--space-3) var(--space-5) var(--space-5);
    background: var(--ground);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 200ms ease, transform 200ms ease,
                visibility 0s linear 200ms;
  }
  .nav-sheet[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 200ms ease, transform 200ms ease, visibility 0s;
  }

  /* --- Links: full-width rows, not the desktop pill row --- */
  .nav-sheet__links {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }
  .nav-sheet__item {
    width: 100%;
    text-align: left;
    padding: 14px var(--space-4);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: background 160ms, color 160ms;
  }
  .nav-sheet__item:hover { color: var(--ink); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
  .nav-sheet__item[aria-current="page"] {
    background: var(--sun-soft);
    color: var(--ink);
  }

  /* --- Foot: the rescued theme toggle --- */
  .nav-sheet__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
  }
  .nav-sheet__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
  }
}

/* The sheet is a phone affordance; on a desktop-width resize the
   module closes it, but belt and braces in case JS never ran. */
@media (min-width: 821px) {
  .nav-sheet,
  .nav-sheet__scrim { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-sheet,
  .nav-sheet__scrim { transition-duration: 0s; }
}
