/* Celular e tablet: menu em painel inferior, cabeçalho que se recolhe e ajustes de toque.
   Carrega depois de gabinete.css. */

/* Retorno no toque também nos cartões e opções (o dedo sente a resposta antes de soltar) */
.choice, .post-card, .chip { transition: transform var(--t-move) var(--spring), border-color var(--t-fast) ease, background-color var(--t-fast) ease, color var(--t-fast) ease; }
.choice.is-pressed, .post-card.is-pressed, .chip.is-pressed { transform: scale(.98); transition-duration: 90ms; transition-timing-function: ease-out; }

@media (max-width: 1180px) {
  /* Cabeçalho se recolhe ao rolar para baixo */
  .nav { transition: transform 420ms var(--spring); will-change: transform; }
  .nav.nav--off { transform: translateY(-100%); }

  /* Painel do menu: sobe da borda de baixo, com alça para arrastar */
  .sheet { inset: 0; z-index: 60; }
  .sheet__scrim { background: rgba(6, 12, 26, .55); }
  .menu-open .sheet__scrim { opacity: calc(1 - var(--drag, 0)); }
  .sheet__panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    max-height: calc(100% - 56px - env(safe-area-inset-top)); overflow: hidden;
    display: flex; flex-direction: column; padding: 0;
    background: rgba(23, 33, 56, .97);
    border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .35);
    opacity: 1; transform: translateY(100%);
    transition: transform 400ms cubic-bezier(.32, .72, 0, 1);
    touch-action: none;
  }
  .menu-open .sheet__panel { transform: none; }
  .sheet__grab { display: grid; place-items: center; height: 28px; flex: none; cursor: grab; }
  .sheet__grab i { width: 40px; height: 4px; border-radius: 2px; background: rgba(237, 230, 218, .32); }
  .sheet__list { overflow-y: auto; overscroll-behavior: contain; padding: 0 24px; touch-action: pan-y; }
  .sheet__list > a {
    display: flex; align-items: center; min-height: 56px; text-decoration: none;
    font: 400 26px/1.1 var(--serif); color: var(--cream); border-bottom: 1px solid rgba(182, 136, 80, .22);
    opacity: 0; transform: translateY(14px);
    transition: opacity 260ms ease, transform 400ms var(--spring), color var(--t-fast) ease;
  }
  .sheet__list > a:last-child { border-bottom: 0; }
  .sheet__list > a[aria-current="page"] { color: var(--gold-l); }
  .sheet__list > a.sheet__sub { min-height: 46px; padding: 0 0 0 18px; font: italic 400 20px/1.2 var(--serif); color: var(--muted); }
  .menu-open .sheet__list > a { opacity: 1; transform: none; }
  /* Itens entram em cascata curta, de cima para baixo */
  .menu-open .sheet__list > a:nth-child(2) { transition-delay: 20ms; }
  .menu-open .sheet__list > a:nth-child(3) { transition-delay: 40ms; }
  .menu-open .sheet__list > a:nth-child(4) { transition-delay: 60ms; }
  .menu-open .sheet__list > a:nth-child(5) { transition-delay: 80ms; }
  .menu-open .sheet__list > a:nth-child(6) { transition-delay: 100ms; }
  .menu-open .sheet__list > a:nth-child(7) { transition-delay: 120ms; }
  .menu-open .sheet__list > a:nth-child(8) { transition-delay: 140ms; }
  .menu-open .sheet__list > a:nth-child(n+9) { transition-delay: 160ms; }
  .sheet__foot { flex: none; padding: 16px 24px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .sheet__foot .btn { width: 100%; min-height: 54px; gap: 10px; margin: 0; }
  .sheet__foot .btn svg { width: 18px; height: 18px; }
  .menu-open .nav { transform: none; }
}

/* Telas de celular */
@media (max-width: 640px) {
  :root { --sec: 64px; --gap-l: 40px; --gap-m: 26px; }
  .nav__in { padding: 0 16px; }
  .btn { min-height: 52px; }
  .fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .sheet__list > a { opacity: 1; transform: none; }
  .nav.nav--off { transform: none; }
}
@media (prefers-reduced-transparency: reduce) { .sheet__panel { background: #172138; } }
