/* ============================================================
   css/mobile.css — celular e tablet.
 *
 * MENU NO CELULAR
 *   Até 999px o menu de áreas sai da barra e vira painel que abre
 *   SOBRE a página. O toque numa área abre o que tem dentro.
 *   Comportamento em js/menu.js.
 *
 * TOQUE NA GALERIA
 *   Alvos de 44px no mínimo. O visualizador aceita arrastar.
 * ============================================================ */

@media (max-width:999px){

  .faixa{display:block}
  .faixa .busca{flex:none;width:auto}
  .faixa .busca .wrap{padding-left:clamp(1rem,3vw,2.5rem)}

  html{font-size:17px}

  /* topo compacto */
  .topo .wrap{min-height:56px;gap:.45rem}
  .hamb{display:inline-flex}
  .marca img{height:34px}
  .acoes{gap:.22rem}
  .botao{width:42px;height:42px;flex:0 0 42px}
  .botao .ic{width:18px;height:18px;flex:0 0 18px}

  /* busca compacta */
  .busca .wrap{padding-top:.5rem;padding-bottom:.5rem}
  .busca form{max-width:none}
  .busca input{font-size:.95rem;min-height:40px}
  .busca button{padding:0 .85rem;font-size:.88rem}

  /* painel do menu */
  .menu-veu{
    display:block;
    position:fixed;inset:0;z-index:70;
    background:rgba(9,13,18,.55);
    backdrop-filter:blur(2px);
  }
  .menu-veu[hidden]{display:none}

  .menu{
    position:fixed;
    top:0;left:0;bottom:0;
    z-index:80;
    width:min(86vw,340px);
    max-width:100%;
    background:#fff;
    border:0;border-right:1px solid var(--l);
    box-shadow:0 12px 40px rgba(9,13,18,.35);
    transform:translateX(-102%);
    transition:transform .22s ease;
    overflow-y:auto;
    overscroll-behavior:contain;
    display:flex;flex-direction:column;
  }
  .menu.aberto{transform:translateX(0)}

  .menu-cab{
    display:flex;align-items:center;justify-content:space-between;gap:.5rem;
    padding:.8rem .8rem .6rem;
    border-bottom:1px solid var(--l);
    background:var(--pa);color:#fff;
  }
  .menu-cab span{
    font-size:.78rem;font-weight:800;
    letter-spacing:1px;text-transform:uppercase;
  }
  .menu-x{
    display:inline-flex;align-items:center;justify-content:center;
    width:44px;height:44px;flex:0 0 44px;
    padding:0;border:1px solid rgba(255,255,255,.3);border-radius:10px;
    background:rgba(255,255,255,.14);color:#fff;cursor:pointer;
  }
  .menu-x:focus-visible{outline:3px solid #fff;outline-offset:2px}

  .menu .wrap{
    display:flex;flex-direction:column;align-items:stretch;
    gap:.4rem;padding:.8rem;
  }
  .mega-bar{flex-direction:column;align-items:stretch;gap:.35rem}
  .mega-abre{min-height:52px;padding:0 .9rem;font-size:1rem;justify-content:flex-start}
  .mega-abre .ic{width:20px;height:20px;flex:0 0 20px}
  .mega-painel{
    position:static;top:auto;left:auto;right:auto;
    width:auto;max-width:none;
    display:none;max-height:none;
    margin:.15rem 0 .35rem;padding:.35rem;
    border-radius:14px;box-shadow:none;
    background:var(--tom-f);border:0;border-left:4px solid var(--tom);
  }
  .mega-col.mega-larga .mega-links{width:auto}
  .mega-item.aberto > .mega-painel{display:block}
  .mega-grade{grid-template-columns:1fr}
  .mega-col.mega-larga .mega-links{grid-template-columns:1fr}

  /* árvore: alvo maior, mas caixa ainda colada no texto */
  .arvore details > ul{margin-left:.35rem;padding-left:.22rem}
  .tr-linha{min-height:38px}
  .tr-seta{flex:0 0 18px;width:18px;height:32px}
  .tr-seta.vazio{flex-basis:0;width:0;height:0}
  .tr-seta .ic{width:14px;height:14px}
  .arvore li{font-size:.76rem;line-height:1.4}
  li[data-n="1"]{font-size:.82rem}
  li[data-n="2"]{font-size:.76rem}
  li[data-n="3"]{font-size:.72rem}
  li[data-n="4"],li[data-n="5"]{font-size:.72rem}

  /* cabeçalho da página */
  .pag-tit{font-size:1.5rem}
  .pag-cat{font-size:.72rem;padding:.22rem .6rem}
  .pag-info{font-size:.82rem;padding:.55rem .65rem;gap:.35rem .9rem}

  /* texto de instrução */
  .texto-galeria{padding:.9rem 1rem;font-size:.98rem;max-width:none}

  /* grade de galeria: 2 colunas confortáveis */
  .grade{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:.6rem}
  .figura{border-radius:10px}

  /* atividade */
  .grade.passos{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.7rem}
  .passo-num{font-size:.72rem;padding:.35rem .45rem}
  .atv-acao .bt{width:100%;min-height:52px}

  /* visualizador: setas grandes, moldura ocupa a tela */
  .lb-topo{padding:.5rem .5rem .35rem;gap:.35rem}
  .lb-conta{min-height:38px;padding:0 .75rem;font-size:.88rem}
  .lb-b{width:42px;height:42px;flex:0 0 42px}
  .lb-b svg{width:20px;height:20px}
  .lb-grupo{gap:.22rem;padding:.22rem}

  .lb-palco{
    padding:.2rem .35rem 0;
    gap:.3rem;
    flex-wrap:nowrap;
    align-items:center;
  }
  .lb-moldura{
    padding:.35rem;border-radius:12px;
    background-size:18px 18px;
    background-position:0 0,0 9px,9px -9px,-9px 0;
    flex:1 1 auto;min-width:0;
  }
  .lb-moldura img{max-height:calc(100vh - 250px)}
  .lb-seta{width:46px;height:46px;flex:0 0 46px;opacity:.9}
  .lb-seta svg{width:24px;height:24px}
  .lb-legenda{font-size:.82rem;padding:.4rem .8rem .8rem}

  /* home */
  .areas{grid-template-columns:1fr;gap:.9rem}
  .vitrine{grid-template-columns:repeat(auto-fill,minmax(96px,1fr))}
  .lista-links{columns:1}

  /* botão topo acima do VLibras */
  #topo{right:.9rem;bottom:5.6rem;width:46px;height:46px}

  /* VLibras menor no celular */
  div[vw],div[vw].enabled{right:8px!important;bottom:8px!important;max-width:86vw!important}
}

@media (max-width:420px){
  html{font-size:16px}
  .marca{font-size:.98rem}
  .botao{width:40px;height:40px;flex:0 0 40px}
  .grade{grid-template-columns:repeat(auto-fill,minmax(128px,1fr))}
  .lb-b{width:40px;height:40px;flex:0 0 40px}
  .lb-seta{width:42px;height:42px;flex:0 0 42px}
}