/* Barra amarela do site (R-FE-20). Tamanhos vêm da configuração do menu: --menu-fonte e --menu-logo. */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--e-4);
  min-height: var(--e-8); padding: var(--e-1) var(--calha);
  background: var(--ouro);
}
.topo__marca { display: block; line-height: 0; }
.topo__marca img { height: min(var(--menu-logo, 40px), 150px); width: auto; display: block; transition: opacity .3s; }
.topo:not(.topo--pronto) .topo__marca img { opacity: 0; }
.topo nav { flex: 1 1 auto; margin-right: auto; } /* ocupa o espaço livre: 8 itens cabem numa linha em 1280 px */
.topo__menu { display: flex; flex-wrap: wrap; gap: var(--e-1) var(--e-3); margin: 0; padding: 0; list-style: none; }
.topo__menu a { font: 600 var(--menu-fonte, 14px)/1.15 Roboto, sans-serif; color: var(--vinho); text-decoration: none; }
.topo__menu a:hover { text-decoration: underline; text-underline-offset: 4px; }
.topo__acoes { display: flex; align-items: center; gap: var(--e-2); }
.topo .redes__link { width: var(--e-4); height: var(--e-4); background: rgba(122, 16, 32, .1); }
.topo .redes__link svg { width: 16px; height: 16px; }

/* AMISCIM Ensina (R-FE-22): botão na barra; no menu hambúrguer vira item da lista. */
.topo__ensina {
  display: inline-flex; align-items: center; height: var(--e-5); padding: 0 var(--e-2); border-radius: 999px; flex: none;
  background: var(--vinho); color: #fff; text-decoration: none; white-space: nowrap;
  font: 700 var(--menu-fonte, 14px)/1 Roboto, sans-serif; transition: transform .2s, background .2s;
}
.topo__ensina:hover { background: #95172b; transform: scale(1.03); }
.topo__ensina:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.topo__menu-ensina { display: none; }

/* Login = ícone de usuário */
.topo__usuario {
  display: inline-grid; place-items: center; width: var(--e-5); height: var(--e-5); flex: none;
  color: #fff; background: var(--vinho); border-radius: 50%; text-decoration: none;
  transition: transform .2s, background .2s;
}
.topo__usuario { cursor: pointer; list-style: none; }
.topo__usuario::-webkit-details-marker { display: none; }
.topo__usuario:hover { transform: scale(1.06); background: #95172b; }
/* Entrar / Quero me cadastrar: o ícone abre um menu pequeno (o cadastro é feito no domínio do sistema) */
.topo__conta { position: relative; flex: none; }
.topo__conta-menu {
  position: absolute; right: 0; top: calc(100% + var(--e-1)); z-index: 60; min-width: 200px;
  display: grid; gap: 2px; padding: var(--e-1); background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.topo__conta-menu a { display: block; padding: var(--e-1) var(--e-2); border-radius: 8px; color: var(--vinho); font-weight: 600; text-decoration: none; white-space: nowrap; }
.topo__conta-menu a:hover, .topo__conta-menu a:focus-visible { background: #f6e9ec; outline: none; }
.topo__usuario svg { width: 22px; height: 22px; }
.topo__usuario:focus-visible, .topo__hamburguer:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Botão hambúrguer (só em telas menores) */
.topo__hamburguer {
  display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: var(--e-5); height: var(--e-5); padding: 0; border: 0; border-radius: var(--e-1);
  background: rgba(122, 16, 32, .1); cursor: pointer;
}
.topo__hamburguer span { display: block; width: 22px; height: 2.5px; border-radius: 2px; background: var(--vinho); transition: transform .25s, opacity .2s; }
.topo--aberto .topo__hamburguer span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.topo--aberto .topo__hamburguer span:nth-child(2) { opacity: 0; }
.topo--aberto .topo__hamburguer span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Telas menores: logomarca centralizada no alto, hambúrguer no centro abaixo dela, usuário à direita. */
/* Telas médias (1201–1279 px): menos espaço entre os itens para os 8 caberem numa linha. */
/* Telas de 1201 a 1439 px: as redes sociais saem da barra (continuam no rodapé) para o botão AMISCIM Ensina caber. */
@media (min-width: 1201px) and (max-width: 1439px) { #redes-topo { display: none; } }
@media (min-width: 1201px) and (max-width: 1279px) {
  .topo { gap: var(--e-2); }
  .topo__menu { gap: var(--e-1) var(--e-2); }
  .topo__acoes { gap: var(--e-1); }
}
@media (max-width: 1200px) {
  .topo {
    display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "redes marca acoes" ". ham .";
    justify-items: center; align-items: center; row-gap: var(--e-1); padding-block: var(--e-1);
  }
  .topo__marca { grid-area: marca; }
  .topo__marca img { height: min(var(--menu-logo, 40px), 96px); }
  .topo__hamburguer { grid-area: ham; display: flex; }
  .topo__acoes { grid-area: acoes; justify-self: end; }
  .topo nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    background: var(--ouro); box-shadow: 0 12px 24px rgba(42, 26, 28, .18);
    display: none;
  }
  .topo--aberto nav { display: block; }
  .topo__menu { flex-direction: column; align-items: center; gap: 0; padding: var(--e-1) 0 var(--e-2); }
  .topo__menu li { width: 100%; text-align: center; }
  .topo__menu a { display: block; padding: var(--e-2) var(--calha); font-size: max(var(--menu-fonte, 14px), 16px); }
  #redes-topo { grid-area: redes; justify-self: start; }
  .topo__ensina { display: none; }
  .topo__menu-ensina { display: block; }
}
@media (max-width: 600px) { #redes-topo { display: none; } }
