/* topo.css: a barra do topo na moldura preta, como a de um aplicativo de streaming: a marca à esquerda, a busca em
   pílula escura no meio (a lupa dentro, à esquerda) e o menu em linha à direita (três tracinhos no telefone, que abrem
   o menu num modal). No telefone a busca desce pra segunda linha da barra.
   Depende de: base.css. Telefone nas regras soltas, computador no @media do fim. */

.topo {
  position: relative; z-index: 10;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "marca nav" "busca busca";
  align-items: center; gap: 8px 12px; padding: 10px var(--margem);
  background: var(--moldura);
}

/* ------------------------------------------------------------ a marca */

.marca { grid-area: marca; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }

.marca__icone { width: 32px; height: 32px; flex: none; }

.marca__nome { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; }

/* ------------------------------------------------------------ a busca em pílula */

.topo__busca {
  grid-area: busca; display: flex; align-items: center; min-height: 46px; overflow: hidden;
  border: 1px solid transparent; border-radius: 999px; background: var(--superficie);
}
.topo__busca:hover { background: var(--superficie-alta); }
.topo__busca:focus-within { border-color: var(--texto); background: var(--superficie-alta); }

.topo__lupa {
  display: grid; place-items: center; flex: none; width: 48px; height: 46px; border: 0;
  background: none; color: var(--texto-suave);
}
.topo__lupa:hover { color: var(--texto); }
.topo__lupa svg { width: 22px; height: 22px; }

.topo__campo {
  flex: 1 1 auto; min-width: 0; padding: 0 16px 0 0; border: 0; background: none;
  color: var(--texto); font-size: 15px; font-weight: 500;
}
.topo__campo::placeholder { color: var(--texto-suave); }
.topo__campo:focus { outline: 0; }

/* ------------------------------------------------------------ o menu em linha */

.topo__nav { grid-area: nav; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

.topo__links { display: none; }

.topo__links a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--texto-suave); text-decoration: none;
}
.topo__links a:hover { color: var(--texto); }
.topo__links a[aria-current="page"] { background: var(--superficie-alta); color: var(--texto); }

.topo__menu {
  display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--superficie);
}
.topo__menu:hover { background: var(--superficie-alta); }
.topo__menu svg { width: 24px; height: 24px; }

/* o menu do telefone, dentro do modal */
.menu-telefone { display: grid; gap: 2px; }
.menu-telefone a {
  display: block; padding: 12px 14px; border-radius: var(--raio);
  font-size: 18px; font-weight: 700; text-decoration: none;
}
.menu-telefone a:hover { background: var(--superficie-alta); }

@media (min-width: 900px) {
  .topo {
    position: sticky; top: 0;
    grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "marca busca nav";
    gap: 32px; padding-block: 8px;
  }
  .topo__busca { width: min(480px, 100%); justify-self: center; }
  .topo__links { display: flex; gap: 4px; }
  .topo__menu { display: none; }
}
