:root {
  --tinta: #14304f;
  --tinta-suave: #47607a;
  --azul: #1769b0;
  --azul-escuro: #0d3566;
  --ceu: #e8f4fd;
  --ceu-medio: #cfe6f8;
  --branco: #ffffff;
  --sol: #ffc857;
  --whats: #0f7a40;
  --whats-escuro: #0b6134;
  --borda: #c3d6e8;
  --erro: #a32a1c;
  --raio: 20px;
  --topo-altura: 64px;
  --nuvem-altura: 52px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--branco);
  color: var(--tinta);
  font: 400 1.0625rem/1.6 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: clip;
}

h1, h2, h3 { font-family: "Baloo 2", Nunito, system-ui, sans-serif; line-height: 1.12; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 1.5rem + 3.6vw, 3.9rem); color: var(--azul-escuro); }
h2 { font-size: clamp(1.9rem, 1.5rem + 2vw, 2.9rem); color: var(--azul-escuro); }
h3 { font-size: 1.3rem; color: var(--azul-escuro); }
p { margin: 0 0 1em; }
a { color: var(--azul); }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--azul-escuro); outline-offset: 3px; border-radius: 4px; }
.topo :focus-visible, .hero :focus-visible, .pagina-topo :focus-visible, .fundo-azul :focus-visible, .rodape :focus-visible { outline-color: var(--branco); }

.largura { width: min(1120px, 100% - 32px); margin-inline: auto; }

.pular { position: absolute; left: -9999px; z-index: 30; }
.pular:focus { left: 16px; top: 16px; background: var(--branco); padding: 8px 16px; }

/* Cabeçalho flutuante */
.topo {
  position: sticky; top: 8px; z-index: 20;
  width: min(1160px, 100% - 16px); height: var(--topo-altura);
  margin: 8px auto calc(-1 * var(--topo-altura) - 8px);
  padding: 0 8px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgb(13 53 102 / .9); border-radius: 22px; color: var(--branco);
  box-shadow: 0 6px 18px rgb(13 53 102 / .25);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.marca { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--branco); text-decoration: none; font: 700 1.15rem/1.05 "Baloo 2", system-ui, sans-serif; }
.marca img { flex: none; width: 50px; height: 50px; }
.marca em { font-style: normal; color: var(--sol); }
.menu-botao {
  flex: none; width: 48px; height: 48px; display: grid; place-content: center; gap: 5px;
  background: transparent; border: 0; border-radius: 14px; cursor: pointer;
}
.menu-botao span { display: block; width: 24px; height: 3px; background: var(--branco); border-radius: 2px; }
.menu-botao:hover { background: rgb(255 255 255 / .14); }
.menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  padding: 8px; background: var(--azul-escuro); border-radius: 20px;
  box-shadow: 0 10px 24px rgb(13 53 102 / .35);
}
.menu.aberto { display: grid; }
.menu a { display: block; padding: 12px 14px; border-radius: 12px; color: var(--branco); font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.menu a:hover { background: rgb(255 255 255 / .14); }
.menu a[aria-current="page"] { color: var(--sol); }

/* Céu */
.hero, .pagina-topo {
  position: relative; color: var(--branco);
  background: url(estrelas.svg), linear-gradient(180deg, #0a2c58 0%, #0f4a86 55%, #1769b0 100%);
}
.hero::after, .pagina-topo::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--nuvem-altura) * .55); height: calc(var(--nuvem-altura) * 1.5);
  background: var(--branco); opacity: .13; pointer-events: none;
  -webkit-mask: url(nuvens.svg) left bottom / 900px 100% repeat-x; mask: url(nuvens.svg) left bottom / 900px 100% repeat-x;
}
.hero { padding: calc(var(--topo-altura) + 32px) 0 calc(var(--nuvem-altura) + 44px); text-align: center; overflow: clip; }
.hero-grade { display: grid; gap: 20px; justify-items: center; position: relative; z-index: 1; }
.hero-arte { width: min(68vw, 270px); height: auto; filter: drop-shadow(0 12px 24px rgb(5 25 55 / .35)); }
.hero h1 { color: var(--branco); }
.sobre-titulo { font-weight: 800; color: var(--sol); margin-bottom: .5em; }
.hero-texto { font-size: 1.15rem; max-width: 34em; margin-inline: auto; margin-bottom: 1.4em; }
.hero-botoes { display: grid; gap: 12px; justify-content: stretch; }

.pagina-topo { padding: calc(var(--topo-altura) + 44px) 0 calc(var(--nuvem-altura) + 44px); }
.pagina-topo h1 { color: var(--branco); margin: 0; }
.pagina-topo h1:focus { outline: none; }
.pagina-topo p { margin: .5em 0 0; font-size: 1.15rem; }
.pagina-topo .largura { position: relative; z-index: 1; }
.voltar { display: inline-block; padding: 8px 0; margin-bottom: 4px; font-weight: 700; color: var(--branco); }

/* Botões */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 12px 26px; border-radius: 999px; border: 2px solid transparent;
  font: 800 1.0625rem Nunito, system-ui, sans-serif; text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color .15s;
}
.botao svg { flex: none; }
.botao-whats { background: var(--whats); color: var(--branco); }
.botao-whats:hover { background: var(--whats-escuro); }
.botao-contorno { background: transparent; border-color: var(--azul); color: var(--azul); }
.botao-contorno:hover { background: var(--ceu); }
.botao-claro { background: var(--branco); color: var(--azul-escuro); }
.botao-claro:hover { background: var(--ceu); }
.botao-vazado { background: transparent; border-color: var(--branco); color: var(--branco); }
.botao-vazado:hover { background: rgb(255 255 255 / .14); }
.botao-primario { background: var(--azul); color: var(--branco); }
.botao-primario:hover { background: var(--azul-escuro); }
.botao:disabled { opacity: .6; cursor: wait; }
.botoes { display: grid; gap: 12px; }

/* Seções com borda de nuvens */
.secao { position: relative; padding-block: 44px calc(var(--nuvem-altura) + 44px); background: var(--fundo, var(--branco)); --fundo: var(--branco); }
.secao::before, .rodape::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: var(--nuvem-altura);
  background: var(--fundo); pointer-events: none;
  -webkit-mask: url(nuvens.svg) center bottom / calc(var(--nuvem-altura) * 8) 100% repeat-x;
  mask: url(nuvens.svg) center bottom / calc(var(--nuvem-altura) * 8) 100% repeat-x;
}
.secao:last-of-type { padding-bottom: calc(var(--nuvem-altura) + 44px); }
.fundo-ceu { --fundo: var(--ceu); }
.fundo-azul { --fundo: var(--azul); color: var(--branco); }
.fundo-azul h2 { color: var(--branco); }
.secao-texto { color: var(--tinta-suave); margin-bottom: 1.5em; }
.fundo-azul .secao-texto { color: var(--branco); }
.secao-titulo { text-align: center; margin-bottom: 28px; }
.secao-titulo h2 { margin-bottom: .25em; }
.secao-titulo p { margin: 0; }

/* Promoções */
.promocoes { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 20px; }
.promocao {
  flex: 1 1 280px; max-width: 380px; min-width: 0; display: flex; flex-direction: column;
  background: var(--branco); border-radius: var(--raio); overflow: hidden;
  box-shadow: 0 6px 18px rgb(13 53 102 / .14);
}
.promocao img { width: 100%; }
.promocao-corpo { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 20px; }
.promocao h3 { margin: 0; overflow-wrap: anywhere; }
.promocao-validade { margin: 0; font-size: .95rem; color: var(--tinta-suave); }
.promocao .botao { margin-top: auto; width: 100%; }

/* Inclusão e história */
.com-astronauta { display: grid; gap: 20px; justify-items: center; text-align: center; }
.astronauta { width: 150px; height: auto; }
.com-astronauta .botao { width: 100%; }
.texto-corrido { max-width: 42em; }
.texto-corrido [data-historia] { margin-bottom: 1.5em; text-align: left; }
.texto-corrido [data-historia] p { white-space: pre-line; overflow-wrap: anywhere; }

/* Listas de temas */
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; }
.chips li { background: var(--branco); color: var(--tinta); border-radius: 999px; padding: 10px 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.chips li:has(a) { padding: 0; }
.chips li a { display: block; padding: 10px 16px; color: var(--tinta); text-decoration: none; border-radius: 999px; }
.chips li a:hover { color: var(--azul); text-decoration: underline; }
.temas-acao { display: flex; justify-content: center; margin-top: 24px; }
.temas-acao .botao { width: 100%; max-width: 360px; }

.busca { max-width: 460px; margin: 0 auto 28px; }
.busca input { background: var(--ceu); border-color: var(--azul); }
[data-grupos] { display: grid; gap: 16px; }
.temas-grupo { padding: 20px; background: var(--ceu); border-radius: var(--raio); }
.temas-grupo h2 { font-size: 1.45rem; margin-bottom: .5em; }
.temas-grupo ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.temas-grupo a { display: block; padding: 10px 16px; background: var(--branco); border-radius: 999px; color: var(--tinta); font-weight: 700; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
.temas-grupo a:hover { background: var(--ceu-medio); text-decoration: underline; }
.tema-contato { width: 100%; margin-top: 28px; }

/* Galeria */
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 30vw, 260px), 1fr)); gap: 10px; }
.galeria button { padding: 0; border: 0; background: var(--ceu-medio); border-radius: 16px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; }
.galeria img { width: 100%; height: 100%; object-fit: cover; }
#fotos .secao-texto { margin: 0; text-align: center; }

/* Como chegar */
.onde { display: grid; gap: 24px; }
.onde h2 { margin-bottom: .3em; }
.mapa { width: 100%; height: 320px; border: 0; border-radius: var(--raio); background: var(--ceu); }

/* Rodapé */
.rodape { --fundo: var(--azul-escuro); position: relative; background: var(--fundo); color: var(--branco); padding: 28px 0 100px; }
.rodape-grade { display: grid; gap: 28px; justify-items: center; text-align: center; }
.rodape-marca img { width: 128px; height: 128px; margin: 0 auto 10px; }
.rodape p { margin: 0; }
.rodape a { color: var(--branco); }
.rodape h2 { color: var(--sol); font-size: 1.25rem; margin-bottom: .4em; }
.rodape ul { list-style: none; margin: 0; padding: 0; }
.rodape li a { display: inline-block; padding: 7px 0; font-weight: 600; }

.whats-flutuante {
  position: fixed; right: 16px; bottom: 16px; z-index: 15;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; min-width: 58px;
  padding: 12px; border-radius: 999px; background: var(--whats); color: var(--branco);
  font-weight: 800; text-decoration: none; box-shadow: 0 6px 18px rgb(13 53 102 / .35);
}
.whats-flutuante:hover { background: var(--whats-escuro); }
.whats-flutuante-texto { display: none; }

/* Foto ampliada */
.ampliada { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 8px; border: 0; background: rgb(10 28 48 / .94); }
.ampliada[open] { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ampliada img { max-height: calc(100dvh - 16px); min-width: 0; width: auto; object-fit: contain; border-radius: 8px; flex: 0 1 auto; }
.ampliada button { background: rgb(255 255 255 / .16); color: var(--branco); border: 0; border-radius: 999px; width: 52px; height: 52px; font-size: 1.8rem; line-height: 1; cursor: pointer; flex: none; }
.ampliada button:hover { background: rgb(255 255 255 / .3); }
.ampliada :focus-visible { outline-color: var(--branco); }
.ampliada-fechar { position: absolute; top: 12px; right: 12px; z-index: 1; }
.ampliada-seta { position: absolute; bottom: 16px; }
.ampliada-seta[data-anterior] { left: 16px; }
.ampliada-seta[data-proxima] { right: 16px; }

@media (min-width: 560px) {
  .hero-botoes { grid-auto-flow: column; justify-content: center; }
  .botoes { grid-auto-flow: column; justify-content: start; }
  .com-astronauta .botao { width: auto; }
  .tema-contato { width: auto; }
  .whats-flutuante { padding: 12px 20px; }
  .whats-flutuante-texto { display: inline; }
}

@media (min-width: 720px) {
  :root { --nuvem-altura: 84px; }
  .secao { padding-block: 64px calc(var(--nuvem-altura) + 64px); }
  [data-grupos] { grid-template-columns: repeat(2, 1fr); align-items: start; }
  .rodape { padding-top: 44px; }
  .rodape-grade { grid-template-columns: 1.1fr 1fr 1fr; justify-items: start; text-align: left; }
  .rodape-marca img { margin: 0 0 10px; }
  .com-astronauta { grid-template-columns: 220px 1fr; align-items: center; justify-items: start; text-align: left; gap: 48px; }
  .astronauta { width: 220px; }
  .galeria { gap: 14px; }
}

@media (min-width: 960px) {
  .menu-botao { display: none; }
  .topo { padding-inline: 16px 20px; top: 12px; margin-top: 12px; margin-bottom: calc(-1 * var(--topo-altura) - 12px); }
  .menu { display: flex; position: static; gap: 4px; padding: 0; background: none; box-shadow: none; }
  .menu a { font-size: 1.0625rem; padding: 8px 14px; }
  .hero { padding-top: calc(var(--topo-altura) + 64px); text-align: left; }
  .hero-grade { grid-template-columns: 1.15fr 1fr; align-items: center; gap: 40px; }
  .hero-grade > :first-child { order: -1; }
  .hero-arte { width: min(100%, 440px); order: 2; }
  .hero-botoes { justify-content: start; }
  .hero-texto { margin-inline: 0; }
  .onde { grid-template-columns: 1fr 1.4fr; align-items: center; }
  .mapa { height: 400px; }
  [data-grupos] { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Painel do administrador */
.painel { padding-block: 32px 64px; }
.painel-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.painel-topo h1 { font-size: 2rem; margin: 0; }
.cartao { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: clamp(16px, 4vw, 28px); margin-bottom: 24px; }
.login { max-width: 420px; margin: 48px auto; }
.campo { display: grid; gap: 4px; margin-bottom: 16px; font-weight: 700; }
.campo small { font-weight: 400; color: var(--tinta-suave); }
.campo.busca { margin-bottom: 28px; }
.campo input, .campo textarea { width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid var(--tinta-suave); border-radius: 12px; font: inherit; font-weight: 400; background: var(--branco); color: var(--tinta); }
.campo.busca input { background: var(--ceu); }
.campo textarea { resize: vertical; }
.aviso { min-height: 1.6em; margin: 12px 0 0; font-weight: 600; }
.aviso-erro { color: var(--erro); }
.itens { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.item { display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--borda); border-radius: 12px; }
.item img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; }
.item-texto { min-width: 0; overflow-wrap: anywhere; }
.item-texto strong { display: block; }
.item-texto small { color: var(--tinta-suave); }
.item-texto .vencida { color: var(--erro); font-weight: 700; }
.item-acoes { display: flex; gap: 6px; }
.item-acoes button { min-width: 44px; min-height: 44px; border: 1px solid var(--borda); border-radius: 10px; background: var(--branco); color: var(--tinta); font: 700 1rem Nunito, system-ui, sans-serif; cursor: pointer; padding: 0 10px; }
.item-acoes button:hover { background: var(--ceu); }
.item-acoes .excluir { color: var(--erro); }
.temas-admin { display: grid; gap: 12px; margin-top: 24px; }
.tema-admin { border: 1px solid var(--borda); border-radius: 12px; }
.tema-admin summary { padding: 14px 16px; min-height: 48px; font-weight: 700; cursor: pointer; overflow-wrap: anywhere; }
.tema-admin-corpo { padding: 4px 16px 16px; }
.tema-admin-corpo form { margin-bottom: 24px; }
.tema-admin-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.tema-admin-foto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.tema-admin-foto .item-acoes { margin-top: 6px; }
.tema-admin-foto .item-acoes button { flex: 1; padding: 0 4px; }
.tema-admin-excluir { color: var(--erro); border-color: var(--erro); }

@media (max-width: 560px) {
  .item { grid-template-columns: 64px 1fr; }
  .item img { width: 64px; height: 64px; }
  .item-acoes { grid-column: 1 / -1; justify-content: flex-end; }
}
