:root {
  --primary: #f2a900;
  --primary-dark: #d18f00;
  --dark: #14213d;
  --text: #333;
  --muted: #6b7280;
  --bg-alt: #f5f6f8;
  --radius: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* O conteúdo ocupa o espaço disponível, empurrando o rodapé para o fim da tela */
/* Fundo azul marinho ocupa toda a área entre o cabeçalho e o rodapé */
main {
  flex: 1;
  background: var(--dark);
}

a { color: inherit; text-decoration: none; }

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

/* Cabeçalho */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  padding: 0.6rem 1.5rem;
  box-shadow: 0 2px 12px rgba(20, 33, 61, 0.08);
  position: relative;
  z-index: 10;
}

/* Menu de navegação do cabeçalho */
.header__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1.5rem;
  margin-right: auto;
}
.header__link {
  position: relative;
  color: var(--dark);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.header__link::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.2rem;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.25s;
}
.header__link:hover { background: #f3f4f6; }
.header__link:hover::after,
.header__link[aria-current="page"]::after { transform: scaleX(1); }

/* Botão de idioma no cabeçalho */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 5px 10px 5px 14px;
  cursor: pointer;
  line-height: 1;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.lang-btn:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.2); }
.lang-texto { font-size: 0.8rem; font-weight: 600; color: var(--dark); white-space: nowrap; }
.lang-btn img { width: 28px; height: auto; border-radius: 2px; }

/* Tela de seleção de idioma */
.lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  padding: 16px;
  overflow-y: auto;
  background: rgba(13, 22, 40, 0.85);
}
.lang-overlay[hidden] { display: none; }

/* margin: auto centraliza a caixa sem cortar o topo quando ela é maior que a tela */
.lang-box {
  margin: auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  text-align: center;
}

@media (max-width: 600px) {
  /* Logo centralizada no topo; botão de idioma à direita; menu centralizado embaixo */
  .header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    row-gap: 0.25rem;
    padding: 0.6rem 1rem;
  }
  .logo { grid-column: 2; grid-row: 1; }
  .lang-btn { grid-column: 3; grid-row: 1; justify-self: end; }
  .header__nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; margin: 0; }
  .lang-texto { font-size: 0.7rem; }
  .header__link { font-size: 0.85rem; padding: 0.4rem 0.6rem; }

  .lang-box { padding: 1.25rem; }
  .lang-box h2 { font-size: 1.25rem; }
  .lang-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .lang-opcao { padding: 0.75rem 0.25rem; font-size: 0.9rem; }
  .lang-opcao img { width: 44px; }
}
.lang-box h2 { color: var(--dark); font-size: 1.5rem; margin-bottom: 0.5rem; }
.lang-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.5rem; }

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.lang-opcao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: var(--bg-alt);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--dark);
  transition: border-color 0.2s, background 0.2s;
}
.lang-opcao:hover, .lang-opcao:focus-visible {
  border-color: var(--primary);
  background: #fff;
  outline: none;
}
.lang-opcao img { width: 56px; height: auto; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.logo { display: inline-block; }
.logo img { display: block; height: 56px; width: auto; }

/* Hero */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  background: var(--dark);
  color: #fff;
}
.eyebrow {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.75rem;
}
.hero .eyebrow { color: #fff; }
.destaque { color: var(--primary); }
.sublinhado { text-decoration: underline; }

/* Bloco de apoio ao projeto (links de canal e membros) */
.apoio {
  color: var(--primary);
  font-weight: 400;
  margin-top: -1rem;
  margin-bottom: 2rem;
}
.apoio p { font-weight: 700; }
.apoio ul { list-style: none; margin-top: 0.5rem; }
.apoio li { margin-bottom: 0.4rem; }
.apoio a { color: var(--primary); display: inline-flex; align-items: center; gap: 0.4rem; }
.apoio a:hover { text-decoration: underline; }
.subtitulo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hero__text {
  max-width: 600px;
  margin: 0 auto 2rem;
  opacity: 0.85;
  font-size: 1.1rem;
}
.hero__meta {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Contador de downloads: texto claro para contrastar com o fundo azul */
.contador-downloads {
  margin-top: 0.75rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}
.contador-downloads strong { color: var(--primary); font-size: 1.2rem; }

/* Botões de download */
.downloads {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.download-btn {
  display: inline-block;
  background: var(--primary);
  color: var(--dark);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1rem 2.2rem;
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.2s;
}
.download-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}
.download-btn small {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
}

/* Espaço de anúncio */
.ad-slot {
  padding: 40px 0;
}
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  margin: 0 auto;
  max-width: 336px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
}

/* Rodapé */
.footer {
  background: #0d1628;
  color: #aab;
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.9rem;
  text-transform: uppercase;
}
.bandeira-rodape {
  width: 20px;
  height: auto;
  vertical-align: middle;
  margin-left: 4px;
}
.contador { display: block; margin: 0.75rem auto 0; }

@media (max-width: 600px) {
  .hero { padding: 56px 0 48px; }
}

/* Link do menu no cabeçalho */

/* Páginas de vídeo (geradas por generate_videos.py) */
.section-video { padding: 48px 0 64px; color: #fff; }
.section-video h1 { color: #fff; margin-bottom: 0.5rem; }
.voltar a { color: var(--primary); font-weight: 600; }
.video-meta { opacity: 0.8; margin-bottom: 1.25rem; }
.video-wrap {
  position: relative;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-descricao { line-height: 1.7; opacity: 0.9; }
.video-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.video-card {
  display: block;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
}
.video-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.video-card div { padding: 1rem; }
.video-card h2 { font-size: 1rem; color: var(--dark); margin-bottom: 0.4rem; }
.video-card p { font-size: 0.85rem; color: var(--muted); }

/* Texto de introdução da home */
.intro { padding: 48px 0 32px; text-align: center; color: #fff; }
.intro p { max-width: 700px; margin: 0 auto; font-size: 1.05rem; line-height: 1.7; opacity: 0.92; }

/* Links do rodapé */
.footer__links { margin-bottom: 0.5rem; }
.footer__links a { color: inherit; text-decoration: underline; padding: 0 0.4rem; }

/* Páginas institucionais (sobre, contato, termos e privacidade) */
.texto-legal { color: #fff; line-height: 1.7; }
.texto-legal h2 { color: var(--primary); font-size: 1.25rem; margin: 1.75rem 0 0.5rem; }
.texto-legal p, .texto-legal li { margin-bottom: 0.75rem; opacity: 0.95; }
.texto-legal ul { padding-left: 1.25rem; }
.texto-legal a { color: var(--primary); text-decoration: underline; }
.texto-legal .data { opacity: 0.7; font-size: 0.9rem; }
