/* ==========================================================================
   Reconstruindo o Passado — estilos principais
   Dica: as cores ficam nas variáveis logo abaixo. Comece por ali se quiser
   mudar a paleta sem mexer no resto do arquivo.
   ========================================================================== */

:root{
  /* paleta - tema claro (padrão, "mapa antigo" diurno) */
  --bg: #f3e6c9;
  --bg-alt: #ece0c2;
  --surface: #fffaf0;
  --surface-soft: #f7ecd6;
  --text: #2b2115;
  --text-soft: #5c4d38;
  --accent: #b5471b;
  --accent-2: #1f6f5c;
  --border: rgba(43,33,21,0.14);
  --shadow: 0 10px 30px rgba(43,33,21,0.14);

  /* ilustração hero */
  --sky-top: #a9d4d8;
  --sky-bottom: #f3d9a4;
  --sea-top: #3f8f8a;
  --sea-bottom: #1f5c5e;
  --sun-color: #f4b955;
  --line-soft: #ffffff;
  --wave-line: #e7f4f0;
  --sand-dark: #c98f4a;
  --sand-light: #e3b876;
  --wood-dark: #4a3524;
  --sail: #f6ecd8;
  --stone: #cfc3a6;
  --stone-dark: #9c8f72;
  --roof: #8a3b2a;
  --clock-face: #f6ecd8;
  --rocket-body: #d8dee2;
  --rocket-fin: #b5471b;
  --flame: #f4b955;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --ease: cubic-bezier(.22,.9,.32,1);

  /* identidade do universo temático ativo (sobrescrita por js/tema.js em
     tema.html, e por card em js/script.js na home) — os valores abaixo são
     só o "estado neutro" usado fora de uma página de tema. */
  --accent-3: #7c6a4a;
  --tema-font: 'Cinzel', serif;
}

[data-theme="dark"]{
  --bg: #14202b;
  --bg-alt: #0f1922;
  --surface: #1c2b38;
  --surface-soft: #223444;
  --text: #f1e9d8;
  --text-soft: #b9c3cc;
  --accent: #e0793f;
  --accent-2: #4fb8a2;
  --border: rgba(241,233,216,0.12);
  --shadow: 0 10px 34px rgba(0,0,0,0.45);

  --sky-top: #0c1622;
  --sky-bottom: #24384a;
  --sea-top: #0c2b33;
  --sea-bottom: #071820;
  --sun-color: #f4b955;
  --line-soft: #cfe0e8;
  --wave-line: #2f4a58;
  --sand-dark: #6b4a2c;
  --sand-light: #8a6238;
  --wood-dark: #2b1e14;
  --sail: #d8cdb0;
  --stone: #4a5a63;
  --stone-dark: #33414a;
  --roof: #6f2c20;
  --clock-face: #d8cdb0;
  --rocket-body: #aab4bc;
  --rocket-fin: #e0793f;
  --flame: #f4b955;

  --accent-3: #33414a;
}

/* navegação entre páginas reais (index.html <-> tema.html <-> tema.html de
   outro tópico) com esmaecimento suave em vez de "flash" branco — suportado
   nativamente pelo Chrome/Edge via View Transitions API; navegadores sem
   suporte simplesmente ignoram a regra e navegam normalmente. */
@view-transition{ navigation: auto; }

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .4s var(--ease), color .4s var(--ease);
  -webkit-font-smoothing: antialiased;
  animation: pageReveal .45s var(--ease) both;
}
@keyframes pageReveal{ from{ opacity:0; } to{ opacity:1; } }
h1,h2,h3,h4{
  font-family: 'Cinzel', 'Inter', serif;
  line-height: 1.15;
  margin: 0 0 .5em;
}
p{ margin: 0 0 1em; color: var(--text-soft); line-height: 1.6; }
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display:block; }
.container{ width: min(1180px, 92%); margin-inline: auto; }
code{ background: var(--surface-soft); padding: .1em .4em; border-radius: 6px; font-size: .9em; }

/* ---------- buttons ---------- */
.btn[hidden]{ display:none; }
.btn{
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .85em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.btn svg{ width: 18px; height: 18px; flex-shrink: 0; }
.btn:hover{ transform: translateY(-3px); }
.btn-primary{ background: var(--accent); color: #fff8ee; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn-primary:hover{ box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn-ghost{ background: transparent; border-color: color-mix(in srgb, var(--text) 30%, transparent); color: var(--text); }
.btn-ghost:hover{ border-color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }

/* ---------- header ---------- */
.site-header{
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 18px 0;
  transition: background .35s var(--ease), padding .35s var(--ease), box-shadow .35s var(--ease);
}
.site-header.scrolled{
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  padding: 10px 0;
}
/* nas páginas de tema, o cabeçalho ganha um realce sutil na cor do universo
   ativo — pequeno o bastante pra não brigar com a navegação, mas o
   suficiente pra reforçar que você está "dentro" daquele tema. */
body.tema-page .site-header{
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  transition: border-color .3s var(--ease), background .35s var(--ease), padding .35s var(--ease), box-shadow .35s var(--ease);
}
body.tema-page .site-header.scrolled{
  box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 14%, rgba(0,0,0,0.12));
}
.header-inner{ display:flex; align-items:center; justify-content: space-between; gap: 20px; }
.brand{ display:flex; align-items:center; gap:.55em; font-family:'Cinzel',serif; font-weight:700; font-size:1.05rem; color: var(--text); }
.brand-icon{ width: 30px; height: 30px; color: var(--accent); flex-shrink:0; }
.main-nav{ display:flex; gap: 2em; }
.main-nav a{ font-weight: 600; font-size: .95rem; position:relative; color: var(--text); }
.main-nav a::after{
  content:""; position:absolute; left:0; bottom:-6px; width:0; height:2px; background: var(--accent);
  transition: width .25s var(--ease);
}
.main-nav a:hover::after{ width:100%; }
.header-actions{ display:flex; align-items:center; gap: .6em; }

.theme-toggle{
  width: 42px; height:42px; border-radius:50%; border:1px solid var(--border);
  background: var(--surface); color: var(--text); display:grid; place-items:center; cursor:pointer;
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.theme-toggle:hover{ transform: rotate(15deg) scale(1.05); }
.theme-toggle svg{ width:20px; height:20px; fill: currentColor; }
.theme-toggle .icon-moon{ display:none; }
[data-theme="dark"] .theme-toggle .icon-sun{ display:none; }
[data-theme="dark"] .theme-toggle .icon-moon{ display:block; }

.hamburger{
  display:none; width:42px; height:42px; border-radius:50%; border:1px solid var(--border);
  background: var(--surface); cursor:pointer; position:relative;
}
.hamburger span{
  position:absolute; left:11px; right:11px; height:2px; background: var(--text); border-radius:2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.hamburger span:nth-child(1){ top:15px; }
.hamburger span:nth-child(2){ top:20px; }
.hamburger span:nth-child(3){ top:25px; }
.hamburger.open span:nth-child(1){ transform: translateY(5px) rotate(45deg); }
.hamburger.open span:nth-child(2){ opacity:0; }
.hamburger.open span:nth-child(3){ transform: translateY(-5px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero{
  position: relative;
  min-height: 100vh;
  display:flex;
  align-items:flex-end;
  overflow:hidden;
  color: #fff8ee;
}
.hero-illustration{ position:absolute; inset:0; z-index:0; }
.hero-svg{ width:100%; height:100%; display:block; }
.hero-overlay{
  position:absolute; inset:0; z-index:1;
  background: linear-gradient(to top, rgba(20,14,8,0.75) 0%, rgba(20,14,8,0.25) 45%, rgba(20,14,8,0.05) 70%);
}
.hero-content{ position:relative; z-index:2; padding-bottom: 9vh; }
.eyebrow{
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight:700;
  color: var(--sun-color); margin-bottom: .8em;
}
.hero h1{
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  margin-bottom: .3em;
  text-shadow: 0 6px 30px rgba(0,0,0,0.35);
}
.hero-tagline{ color: #f2e9d8; max-width: 620px; font-size: 1.1rem; }
.hero-actions{ display:flex; gap: 1em; flex-wrap: wrap; margin-top: 1.4em; }

.scroll-cue{
  position:absolute; left:50%; bottom: 26px; transform: translateX(-50%);
  z-index:2; width:40px; height:40px; border-radius:50%; border:1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08); backdrop-filter: blur(6px);
  color:#fff; display:grid; place-items:center; cursor:pointer;
  animation: bob 2.2s ease-in-out infinite;
}
.scroll-cue svg{ width:18px; height:18px; }
@keyframes bob{ 0%,100%{ transform: translateX(-50%) translateY(0); } 50%{ transform: translateX(-50%) translateY(8px); } }

.stars{ opacity:0; transition: opacity .4s var(--ease); }
[data-theme="dark"] .stars{ opacity:0.8; }
.rocket-float{ animation: float 4.5s ease-in-out infinite; transform-origin: center; }
.plane-float{ animation: float 3.6s ease-in-out infinite; animation-delay: .4s; }
@keyframes float{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-10px); } }
.rocket-flame{ animation: flicker 0.35s ease-in-out infinite alternate; transform-origin: top center; }
@keyframes flicker{ from{ transform: scaleY(1); opacity:1; } to{ transform: scaleY(0.75); opacity:.8; } }
.clock-hand-m{ transform-origin: 0px 45px; animation: tick 12s linear infinite; }
@keyframes tick{ to{ transform: rotate(360deg); } }

/* ---------- countdown strip ---------- */
.countdown-strip{
  background: var(--accent-2); color:#fff; position:relative; z-index:3;
}
.countdown-inner{
  display:flex; align-items:center; justify-content:space-between; gap: 1.5em; flex-wrap:wrap;
  padding: 1.3em 0;
}
.countdown-text strong{ display:block; font-size: 1rem; }
.countdown-text span{ font-size: .88rem; opacity:.85; }
.countdown-timer{ display:flex; gap: .6em; }
.cd-box{
  background: rgba(255,255,255,0.14); border-radius: var(--radius-sm);
  padding: .5em .8em; text-align:center; min-width: 56px;
}
.cd-value{ display:block; font-family:'Cinzel',serif; font-weight:700; font-size: 1.15rem; }
.cd-label{ font-size: .68rem; text-transform:uppercase; letter-spacing:.06em; opacity:.85; }

/* ---------- topics ---------- */
.topics{ padding: 6.5em 0 5em; }
.section-heading{ text-align:center; max-width: 640px; margin: 0 auto 2.2em; }
.section-heading h2{ font-size: clamp(1.8rem, 3.4vw, 2.5rem); }

.topics-toolbar{ display:flex; justify-content:center; margin-bottom: 2.4em; }
.search-box{
  display:flex; align-items:center; gap:.6em; background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: .7em 1.2em;
  width: min(420px, 100%); box-shadow: var(--shadow);
}
.search-box svg{ width:18px; height:18px; color: var(--text-soft); flex-shrink:0; }
.search-box input{
  border:none; outline:none; background:transparent; color: var(--text); font-size:.95rem; width:100%;
  font-family: inherit;
}

.topics-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 1.4em;
}
.topic-card{
  --card-accent: var(--accent);
  --card-accent2: var(--accent-2);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--card-accent) 20%, var(--border));
  border-top: 3px solid var(--card-accent);
  border-radius: var(--radius-md);
  padding: 1.8em 1.6em;
  text-align:left;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .15s ease-out, box-shadow .3s var(--ease), border-color .3s var(--ease);
  animation: rise .5s var(--ease) both;
}
.topic-card::before{
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--card-accent) 10%, transparent), transparent 55%),
    radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--card-accent) 26%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.topic-card::after{
  /* motivo decorativo: o ícone do próprio tópico, repetido bem sutil —
     visível de leve o tempo todo, e mais forte no hover, pra cada card já
     comunicar seu universo temático antes mesmo de tocar nele. */
  content:""; position:absolute; inset:0; opacity:.035; pointer-events:none;
  background-image: var(--card-motif);
  background-repeat: repeat;
  background-size: 70px 70px;
  transition: opacity .35s var(--ease);
}
[data-theme="dark"] .topic-card::after{ opacity:.05; }
.topic-card:hover, .topic-card:focus-visible{
  transform: translateY(-6px);
  box-shadow: 0 20px 40px color-mix(in srgb, var(--card-accent) 22%, transparent), var(--shadow);
  border-color: color-mix(in srgb, var(--card-accent) 45%, var(--border));
  outline: none;
}
.topic-card:hover::before, .topic-card:focus-visible::before{ opacity:1; }
.topic-card:hover::after, .topic-card:focus-visible::after{ opacity:.09; }
[data-theme="dark"] .topic-card:hover::after, [data-theme="dark"] .topic-card:focus-visible::after{ opacity:.14; }
.topic-icon{
  width:56px; height:56px; border-radius: 50%; display:grid; place-items:center;
  background:
    radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--card-accent) 28%, var(--surface)), color-mix(in srgb, var(--card-accent) 12%, var(--surface-soft)) 70%);
  color: var(--card-accent);
  margin-bottom: 1em; font-size: 1.6rem; position:relative; z-index:1;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-accent) 30%, transparent), 0 8px 18px color-mix(in srgb, var(--card-accent) 24%, transparent);
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.topic-card:hover .topic-icon{ transform: scale(1.08) rotate(-4deg); }
.topic-card h3{ font-size: 1.08rem; margin-bottom:.35em; position:relative; z-index:1; }
.topic-card p{ font-size: .9rem; margin-bottom: 1em; position:relative; z-index:1; }
.topic-cta{
  font-size: .82rem; font-weight:700; color: var(--card-accent); display:inline-flex; align-items:center; gap:.3em;
  position:relative; z-index:1;
}
.topic-cta svg{ width:14px; height:14px; transition: transform .25s var(--ease); }
.topic-card:hover .topic-cta svg{ transform: translateX(4px); }

@keyframes rise{ from{ opacity:0; transform: translateY(16px); } to{ opacity:1; transform: translateY(0); } }

.no-results{ text-align:center; color: var(--text-soft); margin-top: 2em; }
.topics-loading{ grid-column: 1 / -1; text-align:center; color: var(--text-soft); padding: 3em 0; }

/* ---------- about ---------- */
.about{ padding: 5em 0 6em; background: var(--bg-alt); }
.about-inner{ max-width: 720px; margin: 0 auto; text-align:center; }
.about h2{ font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* ---------- modal ---------- */
.modal-backdrop{
  position: fixed; inset:0; z-index: 200;
  background: rgba(15,10,5,0.55);
  backdrop-filter: blur(4px);
  display:flex; align-items:center; justify-content:center;
  padding: 20px;
  opacity:0; visibility:hidden;
  transition: opacity .3s var(--ease), visibility .3s var(--ease);
}
.modal-backdrop.open{ opacity:1; visibility:visible; }
.modal{
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 560px; width:100%;
  max-height: 86vh; overflow-y:auto;
  padding: 2.4em 2.2em;
  position:relative;
  box-shadow: 0 30px 70px rgba(0,0,0,0.35);
  transform: scale(.92) translateY(20px);
  transition: transform .35s var(--ease);
}
.modal-backdrop.open .modal{ transform: scale(1) translateY(0); }
.modal-close{
  position:absolute; top: 18px; right:18px; width:36px; height:36px; border-radius:50%;
  border:1px solid var(--border); background: var(--surface-soft); color: var(--text);
  cursor:pointer; display:grid; place-items:center; transition: transform .25s var(--ease), background .25s;
}
.modal-close:hover{ transform: rotate(90deg); background: color-mix(in srgb, var(--accent) 18%, var(--surface-soft)); }
.modal-close svg{ width:16px; height:16px; }
.modal-icon{
  width:60px; height:60px; border-radius:16px; display:grid; place-items:center; font-size:1.8rem;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-soft)); color: var(--accent); margin-bottom: .9em;
}
.modal-eyebrow{ text-transform:uppercase; letter-spacing:.12em; font-size:.72rem; font-weight:700; color: var(--accent-2); margin-bottom:.2em; }
.modal h3{ font-size: 1.5rem; margin-bottom:.5em; }
.modal-intro{ font-size: .98rem; }
.modal-facts h4{ font-size: .95rem; margin-bottom:.6em; font-family:'Inter',sans-serif; font-weight:700; }
.modal-facts ul{ margin:0 0 1.4em; padding-left: 1.2em; }
.modal-facts li{ color: var(--text-soft); margin-bottom:.5em; line-height:1.5; font-size:.92rem; }
.modal-timeline-btn{ width:100%; justify-content:center; margin-bottom: 1.4em; }
.modal-timeline-btn svg{ width:18px; height:18px; flex-shrink:0; }

/* ==========================================================================
   Página de linha do tempo (tema.html)
   ========================================================================== */
body.tema-page main{ padding-top: 86px; }

.tema-empty[hidden]{ display:none; }
.tema-empty{ min-height: 60vh; display:flex; align-items:center; text-align:center; }
.tema-empty .container{ max-width: 480px; }
.tema-empty .eyebrow{ color: var(--accent); text-transform:uppercase; letter-spacing:.14em; font-weight:700; font-size:.8rem; }

.tema-hero{
  position: relative;
  overflow: hidden;
  min-height: min(60vh, 560px);
  display: flex;
  align-items: flex-end;
  padding: 3em 0 3.5em;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-bottom: 10px solid transparent;
  border-image-slice: 1;
  border-image-source: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 35%, transparent), transparent);
  transition: background .3s var(--ease);
}
.tema-hero-illustration{
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
}
.tema-hero-svg{ width: 100%; height: 100%; display: block; }
.tema-hero-fade{
  /* garante contraste do texto por cima da ilustração, em qualquer tema:
     esconde a arte atrás da coluna de texto (esquerda) e deixa ela livre
     do lado direito, além de um esmaecimento embaixo pra fazer a transição
     com a seção seguinte. */
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(90deg,
      var(--bg) 0%,
      color-mix(in srgb, var(--bg) 92%, transparent) 26%,
      color-mix(in srgb, var(--bg) 55%, transparent) 46%,
      color-mix(in srgb, var(--bg) 10%, transparent) 64%,
      transparent 82%),
    linear-gradient(180deg,
      transparent 0%,
      transparent 62%,
      var(--bg) 100%);
}
@media (max-width: 900px){
  .tema-hero-fade{
    /* em telas estreitas a ilustração some quase toda sob o corte central
       do SVG (preserveAspectRatio slice) — reforça a proteção do texto. */
    background:
      linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 55%, transparent 90%),
      linear-gradient(180deg, transparent 0%, transparent 55%, var(--bg) 100%);
  }
}
.tema-hero::before{
  /* watermark decorativo: o ícone do próprio tópico, repetido bem sutil,
     por trás da ilustração — só um textura extra, quase imperceptível.
     A imagem de fundo (--tema-motif) é definida via JS em js/tema.js. */
  content: "";
  position: absolute;
  inset: -20px;
  z-index: 0;
  background-image: var(--tema-motif);
  background-repeat: repeat;
  background-size: 90px 90px;
  opacity: .06;
  pointer-events: none;
}
[data-theme="dark"] .tema-hero::before{ opacity: .09; }
.tema-hero::after{
  /* camada de atmosfera do universo temático (fumaça, névoa, brilho, água...)
     — cada tópico ativa um comportamento diferente lá embaixo, na seção
     "UNIVERSOS TEMÁTICOS". Por padrão fica inerte. */
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.tema-hero .container{ position: relative; z-index: 4; }
.tema-back{
  display:inline-flex; align-items:center; gap:.4em; font-weight:600; font-size:.9rem;
  color: var(--text-soft); margin-bottom: 1.6em; transition: color .2s var(--ease), transform .2s var(--ease);
}
.tema-back svg{ width:16px; height:16px; }
.tema-back:hover{ color: var(--accent); transform: translateX(-3px); }
.tema-icon{
  --ring: color-mix(in srgb, var(--accent) 55%, transparent);
  position: relative;
  width:84px; height:84px; border-radius: 50%; display:grid; place-items:center; font-size:2.5rem;
  background:
    radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--accent) 30%, var(--surface)), color-mix(in srgb, var(--accent) 12%, var(--surface-soft)) 70%);
  color: var(--accent); margin-bottom: 1.1em;
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--ring),
    0 14px 32px color-mix(in srgb, var(--accent) 32%, transparent);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.tema-icon::before{
  /* anel pontilhado giratório — dá um ar de "medalha" ao ícone do tema */
  content: "";
  position: absolute; inset: -11px; border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--accent-2) 55%, transparent);
  animation: iconRingSpin 30s linear infinite;
}
@keyframes iconRingSpin{ to{ transform: rotate(360deg); } }
.tema-hero .eyebrow{
  text-transform:uppercase; letter-spacing:.14em; font-size:.78rem; font-weight:700; color: var(--accent-2); margin-bottom:.5em;
}
.tema-hero h1{
  font-family: var(--tema-font, 'Cinzel', serif);
  font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom:.4em;
  transition: font-family .1s;
}
.tema-intro{ max-width: 680px; font-size: 1.05rem; margin:0; }
.timeline-detail h2{ font-family: var(--tema-font, 'Cinzel', serif); }

/* ---- timeline track ---- */
.timeline-section{ padding: 4em 0; }
.timeline-track-wrap{ display:flex; align-items:center; gap: 1em; margin-bottom: 2.4em; }

.timeline-nav-btn{
  flex-shrink:0; width:44px; height:44px; border-radius:50%; border:1px solid var(--border);
  background: var(--surface); color: var(--text); display:grid; place-items:center; cursor:pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), opacity .2s var(--ease);
}
.timeline-nav-btn svg{ width:18px; height:18px; }
.timeline-nav-btn:hover:not(:disabled){ transform: scale(1.08); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.timeline-nav-btn:disabled{ opacity: .35; cursor: default; }

.timeline-track{
  display:flex; gap: 0; overflow-x:auto; scroll-behavior:smooth; flex: 1;
  padding: 1.6em .5em; position:relative;
  scrollbar-width: thin;
}
.timeline-track::before{
  content:""; position:absolute; left:0; right:0; top: 50%; height:2px;
  background: var(--border); z-index:0;
}
.timeline-dot{
  flex-shrink:0; width: 128px; display:flex; flex-direction:column; align-items:center; gap:.6em;
  background:none; border:none; cursor:pointer; position:relative; z-index:1; padding: .4em 0;
}
.timeline-dot-marker{
  width:16px; height:16px; border-radius:50%; background: var(--surface); border: 3px solid var(--border);
  transition: all .25s var(--ease);
}
.timeline-dot-year{
  font-size: .82rem; font-weight:700; color: var(--text-soft); white-space:nowrap;
  transition: color .25s var(--ease);
}
.timeline-dot:hover .timeline-dot-marker{ border-color: var(--accent); transform: scale(1.15); }
.timeline-dot.active .timeline-dot-marker{
  background: var(--accent); border-color: var(--accent); transform: scale(1.3);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}
.timeline-dot.active .timeline-dot-year{ color: var(--accent); }

.timeline-detail{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2.4em; box-shadow: var(--shadow); transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.timeline-detail.fade-out{ opacity:0; transform: translateY(6px); }
.timeline-detail-year{
  display:inline-block; font-weight:700; font-size:.8rem; letter-spacing:.08em; text-transform:uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); padding:.3em .8em;
  border-radius: 999px; margin-bottom: .8em;
}
.timeline-detail h2{ font-size: 1.6rem; margin-bottom:.5em; }
.timeline-detail p{ font-size: 1rem; margin:0; }

/* ---- galeria de imagens (tema) ---- */
.gallery-section{ padding: 0 0 4em; }
.gallery-section h3{ font-size: 1.3rem; margin-bottom: .8em; }
.gallery-credit-note{ margin-top: 1.2em; }
.gallery-grid{
  display:grid; grid-template-columns: repeat(4, 1fr); gap: .9em;
}
.gallery-thumb{
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-md);
  overflow: hidden; border: 1px solid var(--border); padding: 0; cursor: pointer;
  background: var(--surface-soft); transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.gallery-thumb:hover, .gallery-thumb:focus-visible{
  transform: translateY(-4px); box-shadow: var(--shadow); outline: none;
}
.gallery-thumb img{ width:100%; height:100%; object-fit: cover; display:block; transition: transform .35s var(--ease); }
.gallery-thumb:hover img{ transform: scale(1.07); }
.gallery-thumb-caption{
  position:absolute; left:0; right:0; bottom:0; padding: 1.8em .7em .55em;
  background: linear-gradient(to top, rgba(10,8,5,.8), transparent);
  color:#fff8ee; font-size:.76rem; text-align:left; line-height:1.3;
  opacity:0; transition: opacity .25s var(--ease);
}
.gallery-thumb:hover .gallery-thumb-caption, .gallery-thumb:focus-visible .gallery-thumb-caption{ opacity:1; }
.gallery-thumb-fallback{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.5em;
  width:100%; height:100%; padding: 1em .8em; text-align:center; position:relative; overflow:hidden;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 20%, var(--surface-soft)),
      color-mix(in srgb, var(--accent-2) 16%, var(--surface-soft)));
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--border));
}
.gallery-thumb-fallback-icon{
  font-size: 1.8rem; line-height:1; opacity:.85;
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--accent) 30%, transparent));
}
.gallery-thumb-fallback-caption{
  font-size:.76rem; line-height:1.3; color: var(--text); font-weight:600; position:relative; z-index:1;
}
.gallery-thumb-fallback-tag{
  font-size:.62rem; letter-spacing:.04em; text-transform:uppercase; color: var(--text-soft);
  background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 999px;
  padding: .25em .7em; position:relative; z-index:1;
}

/* ---- lightbox (visualizador de imagem) ---- */
.lightbox-backdrop{
  position: fixed; inset:0; z-index: 300;
  background: rgba(10,8,5,.9);
  display:flex; align-items:center; justify-content:center; padding: 20px;
  opacity:0; visibility:hidden; transition: opacity .3s var(--ease), visibility .3s var(--ease);
}
.lightbox-backdrop.open{ opacity:1; visibility:visible; }
.lightbox{
  position:relative; max-width:min(1000px, 92vw); max-height:90vh;
  display:flex; flex-direction:column; align-items:center;
}
.lightbox-media{ max-width:100%; max-height:68vh; display:flex; align-items:center; justify-content:center; }
.lightbox-media img{
  max-width:100%; max-height:68vh; border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0,0,0,.5); display:block;
}
.lightbox-caption{ margin-top: 1.2em; text-align:center; max-width: 600px; }
.lightbox-caption p{ margin:0 0 .3em; color:#fff8ee; font-weight:600; font-size:.98rem; }
.lightbox-caption span{ font-size:.76rem; color: rgba(255,255,255,.6); }
.lightbox-close, .lightbox-nav{
  position: fixed; width:46px; height:46px; border-radius:50%;
  border:1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); backdrop-filter: blur(6px);
  color:#fff; display:grid; place-items:center; cursor:pointer; transition: background .2s var(--ease), transform .2s var(--ease);
}
.lightbox-close svg, .lightbox-nav svg{ width:18px; height:18px; }
.lightbox-close:hover, .lightbox-nav:hover{ background: rgba(255,255,255,.18); }
.lightbox-close{ top:20px; right:20px; }
.lightbox-nav{ top:50%; transform: translateY(-50%); }
.lightbox-nav:hover{ transform: translateY(-50%) scale(1.06); }
.lightbox-prev{ left:20px; }
.lightbox-next{ right:20px; }

@media (max-width: 900px){
  .gallery-grid{ grid-template-columns: repeat(3, 1fr); }
  .tema-hero{ min-height: min(48vh, 460px); }
}
@media (max-width: 560px){
  .gallery-grid{ grid-template-columns: repeat(2, 1fr); }
  .lightbox-nav{ width:38px; height:38px; }
  .lightbox-prev{ left:8px; }
  .lightbox-next{ right:8px; }
  .lightbox-close{ top:10px; right:10px; }
  .tema-hero{ min-height: min(42vh, 400px); }
}

/* ---- páginas de texto legal (privacidade, termos) ---- */
.legal-content{ padding: 3.5em 0 6em; }
.legal-container{ max-width: 720px; }
.legal-container h2{ font-size: 1.25rem; margin-top: 1.8em; }
.legal-container h2:first-of-type{ margin-top: 0; }
.legal-container p{ font-size: .96rem; }
.legal-container a{ color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---- fatos rápidos (tema) ---- */
.tema-facts{ padding: 0 0 4em; }
.tema-facts h3{ font-size: 1.3rem; margin-bottom: .8em; }
.tema-facts ul{ padding-left: 1.2em; margin: 0 0 1.2em; }
.tema-facts li{ color: var(--text-soft); margin-bottom:.5em; line-height:1.6; }

/* ---- leia mais / fontes ---- */
.tema-sources{ padding: 0 0 3em; }
.tema-sources h3{ font-size: 1.3rem; margin-bottom: .8em; }
.sources-list{ list-style:none; padding:0; margin:0 0 1.2em; display:flex; flex-direction:column; gap:.6em; }
.sources-list li{ margin:0; }
.sources-list a{
  display:flex; align-items:center; gap:.6em; padding:.75em 1em;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-weight:600; font-size:.92rem; text-decoration:none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.sources-list a::before{
  content:"↗"; font-weight:700; color: var(--accent); flex-shrink:0;
}
.sources-list a:hover{
  transform: translateY(-2px); box-shadow: var(--shadow); color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

/* ---- outros tópicos ---- */
.other-topics{ padding: 3em 0 5em; background: var(--bg-alt); border-top: 1px solid var(--border); }
.other-topics h3{ font-size: 1.2rem; margin-bottom: 1.2em; }
.other-topics-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 1em; }
.other-topic-card{
  display:flex; align-items:center; gap:.7em; background: var(--surface); border:1px solid var(--border);
  border-radius: var(--radius-sm); padding: .9em 1em; font-weight:600; font-size:.9rem;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.other-topic-card:hover{ transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.other-topic-icon{ font-size: 1.3rem; }

@media (max-width: 900px){
  .other-topics-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .timeline-detail{ padding: 1.6em; }
  .timeline-nav-btn{ width:38px; height:38px; }
  .other-topics-grid{ grid-template-columns: 1fr; }
}

/* ==========================================================================
   UNIVERSOS TEMÁTICOS — a atmosfera visual de cada tópico na tema.html
   -----------------------------------------------------------------------
   Cada tópico já define suas próprias cores (--accent/--accent-2/--accent-3,
   setadas via JS em applyTopicTheme) e sua fonte de destaque (--tema-font).
   Aqui a gente soma dois efeitos extra, ambos "baratos" pra rodar bem em
   qualquer aparelho (só opacidade/gradiente/posição de fundo — nada de
   blur animado nem JS pesado):
     1) uma camada de atmosfera animada em .tema-hero::after (fumaça, névoa,
        brilho, água, grão de filme...)
     2) uma "borda" decorativa embaixo do cabeçalho da página, feita com
        border-image (listras, ziguezague, escamas, tracejado) — sem
        precisar de nenhum SVG novo ou elemento extra no HTML.
   Tudo respeita prefers-reduced-motion (regra global no fim do arquivo).
   ========================================================================== */

@keyframes atmoPulse{ 0%,100%{ opacity:.5; transform: scale(1); } 50%{ opacity:.85; transform: scale(1.05); } }
@keyframes atmoDrift{ 0%{ background-position: 0% 50%, 100% 30%; } 50%{ background-position: 12% 55%, 88% 35%; } 100%{ background-position: 0% 50%, 100% 30%; } }
@keyframes atmoShimmer{ 0%{ background-position: 0 0; } 100%{ background-position: 340px 0; } }
@keyframes atmoSweep{ 0%,100%{ background-position: -20% 0; opacity:.35; } 50%{ background-position: 120% 0; opacity:.6; } }
@keyframes atmoTwinkle{ 0%,100%{ opacity:.35; } 50%{ opacity:.75; } }
@keyframes atmoFlicker{ 0%,19%,21%,100%{ opacity:.22; } 20%{ opacity:.12; } 60%{ opacity:.28; } 61%{ opacity:.16; } }

.tema-hero::after{ opacity: 1; }

/* ---- 1. Egito Antigo — brilho dourado pulsante do sol do deserto ---- */
body[data-theme-topic="egito-antigo"] .tema-hero::after{
  background:
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 45%),
    radial-gradient(circle at 8% 100%, color-mix(in srgb, var(--accent-3) 35%, transparent), transparent 55%);
  animation: atmoPulse 7s ease-in-out infinite;
}
body[data-theme-topic="egito-antigo"] .tema-hero{
  border-image-source: repeating-linear-gradient(-45deg, var(--accent) 0 8px, var(--accent-3) 8px 16px);
}

/* ---- 1ª Guerra Mundial — fumaça densa derivando pelo campo de batalha ---- */
body[data-theme-topic="primeira-guerra"] .tema-hero::after{
  background:
    radial-gradient(ellipse 60% 40% at 15% 30%, color-mix(in srgb, var(--text) 22%, transparent), transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 70%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%);
  background-size: 160% 160%, 160% 160%;
  animation: atmoDrift 16s ease-in-out infinite;
}
body[data-theme-topic="primeira-guerra"] .tema-hero{
  border-image-source: repeating-linear-gradient(120deg, var(--accent-3) 0 3px, transparent 3px 15px);
}

/* ---- 2ª Guerra Mundial — holofote varrendo um mapa tático ---- */
body[data-theme-topic="segunda-guerra"] .tema-hero::after{
  background:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--text) 6%, transparent) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 6%, transparent) 0 1px, transparent 1px 34px),
    linear-gradient(100deg, transparent 35%, color-mix(in srgb, var(--accent-2) 30%, transparent) 48%, transparent 60%);
  background-size: auto, auto, 300% 100%;
  animation: atmoSweep 9s ease-in-out infinite;
}
body[data-theme-topic="segunda-guerra"] .tema-hero{
  border-image-source: repeating-linear-gradient(90deg, var(--accent) 0 22px, var(--accent-2) 22px 26px);
}

/* ---- Titanic — reflexo suave de água em movimento ---- */
body[data-theme-topic="titanic"] .tema-hero::after{
  background: repeating-linear-gradient(78deg, color-mix(in srgb, var(--accent-2) 30%, transparent) 0 2px, transparent 2px 40px);
  background-size: 340px 100%;
  opacity: .3;
  animation: atmoShimmer 7s linear infinite;
}
body[data-theme-topic="titanic"] .tema-hero{
  border-image-source: repeating-radial-gradient(circle at 10px 0, transparent 0 6px, var(--accent-2) 6px 8px);
}

/* ---- Criptozoologia — névoa densa indo e vindo ---- */
body[data-theme-topic="criptozoologia"] .tema-hero::after{
  background:
    radial-gradient(ellipse 65% 45% at 20% 20%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 60%),
    radial-gradient(ellipse 55% 40% at 80% 85%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 60%);
  background-size: 170% 170%, 170% 170%;
  animation: atmoDrift 14s ease-in-out infinite reverse;
}
body[data-theme-topic="criptozoologia"] .tema-hero{
  border-image-source: repeating-linear-gradient(100deg, var(--accent-3) 0 2px, transparent 2px 20px);
}

/* ---- Personagens Históricos — pó dourado cintilando, atmosfera de retrato real ---- */
body[data-theme-topic="personagens-historicos"] .tema-hero::after{
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent-2) 4%, transparent) 0 2px, transparent 3px) 0 0/48px 48px,
    radial-gradient(circle at 70% 60%, color-mix(in srgb, var(--accent-2) 45%, transparent), transparent 55%);
  animation: atmoTwinkle 5s ease-in-out infinite;
}
body[data-theme-topic="personagens-historicos"] .tema-hero{
  border-image-source: repeating-linear-gradient(90deg, var(--accent-2) 0 3px, var(--accent) 3px 6px, transparent 6px 22px);
}

/* ---- História do Brasil — luz tropical suave entre folhagem e ouro imperial ---- */
body[data-theme-topic="historia-brasil"] .tema-hero::after{
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--accent-2) 40%, transparent), transparent 45%),
    radial-gradient(circle at 10% 95%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 55%);
  animation: atmoPulse 8s ease-in-out infinite;
}
body[data-theme-topic="historia-brasil"] .tema-hero{
  border-image-source: repeating-radial-gradient(circle at 10px 0, transparent 0 6px, var(--accent) 6px 8px);
}

/* ---- História Americana — grão de filme/documento vintage piscando ---- */
body[data-theme-topic="historia-americana"] .tema-hero::after{
  background:
    radial-gradient(circle at 30% 40%, color-mix(in srgb, var(--accent-3) 55%, transparent) 0 1px, transparent 2px) 0 0/6px 6px,
    radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--accent-3) 55%, transparent) 0 1px, transparent 2px) 3px 3px/7px 7px;
  animation: atmoFlicker 4s steps(1) infinite;
}
body[data-theme-topic="historia-americana"] .tema-hero{
  border-image-source: repeating-linear-gradient(90deg, var(--accent) 0 26px, var(--accent-2) 26px 32px);
}

/* ---- Revolução Francesa — brilho dourado revolucionário, elegante e vivo ---- */
body[data-theme-topic="revolucao-francesa"] .tema-hero::after{
  background:
    radial-gradient(circle at 75% 20%, color-mix(in srgb, var(--accent-3) 55%, transparent), transparent 45%),
    radial-gradient(circle at 15% 90%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 55%);
  animation: atmoTwinkle 6s ease-in-out infinite;
}
body[data-theme-topic="revolucao-francesa"] .tema-hero{
  border-image-source: repeating-linear-gradient(90deg, var(--accent-3) 0 3px, var(--accent) 3px 6px, transparent 6px 22px);
}

/* ---------- espaço de anúncio (Google AdSense) ----------
   Fica invisível (display:none) até o AdSense de verdade ser ativado —
   sem isso, o visitante veria uma caixa tracejada escrito "espaço
   reservado para anúncio", o que não pode aparecer num site publicado.
   Quando for ativar os anúncios de verdade (passo a passo em
   COMO-PUBLICAR.txt), TROQUE "display: none;" abaixo por "display: flex;"
   pra essa caixa voltar a aparecer e servir de moldura pro anúncio real. */
.ad-slot{
  display: none;
  width: 100%; min-height: 100px; margin: 2.6em auto; max-width: 1180px;
  align-items:center; justify-content:center; text-align:center;
  position: relative; overflow: hidden;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-soft));
  padding: 1em;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.ad-slot::before{
  /* eco discreto do motivo do tema — sem chamar mais atenção que o
     conteúdo real, só reforça a identidade visual da página. */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--tema-motif); background-repeat: repeat; background-size: 70px 70px;
  opacity: .035;
}
[data-theme="dark"] .ad-slot::before{ opacity: .06; }
.ad-slot-label{
  position: relative; z-index: 1;
  font-size: .78rem; font-weight:600; letter-spacing:.03em; color: var(--text-soft);
  text-transform: uppercase;
}
.ad-slot--inline{ margin: 3em auto; }

/* ---------- footer ---------- */
.site-footer{ background: var(--bg-alt); border-top: 1px solid var(--border); padding-top: 4em; }
.footer-inner{
  display:grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5em; padding-bottom: 3em;
}
.footer-brand span{ font-family:'Cinzel',serif; font-weight:700; font-size:1.1rem; }
.footer-links, .footer-contact{ display:flex; flex-direction:column; gap:.7em; }
.footer-links h5, .footer-contact h5{ font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color: var(--text-soft); margin:0 0 .3em; }
.footer-links a, .footer-contact a{ font-size:.92rem; }
.footer-links a:hover, .footer-contact a:hover{ color: var(--accent); }
.footer-bottom{ border-top: 1px solid var(--border); padding: 1.4em 0; text-align:center; }
.footer-bottom p{ font-size:.82rem; margin:0; }

/* ---------- responsive ---------- */
@media (max-width: 980px){
  .topics-grid{ grid-template-columns: repeat(2, 1fr); }
  .footer-inner{ grid-template-columns: 1fr 1fr; }
  .footer-brand{ grid-column: 1 / -1; }
}

@media (max-width: 760px){
  .main-nav{
    position: fixed; top: 70px; right: 16px; left: 16px;
    background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-md);
    flex-direction:column; gap: 0; box-shadow: var(--shadow);
    padding: .6em; transform: translateY(-12px); opacity:0; visibility:hidden; pointer-events:none;
    transition: all .3s var(--ease);
  }
  .main-nav.open{ transform: translateY(0); opacity:1; visibility:visible; pointer-events:auto; }
  .main-nav a{ padding: .9em 1em; border-radius: var(--radius-sm); }
  .main-nav a:hover{ background: var(--surface-soft); }
  .hamburger{ display:block; }
  .topics-grid{ grid-template-columns: 1fr; }
  .footer-inner{ grid-template-columns: 1fr; }
  .countdown-inner{ justify-content:center; text-align:center; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
