/* Aqueles Tempos Incríveis — hub do canal
   Direção: editorial nostálgico contido (papel, impressão offset, moldura de TV).
   Tokens derivados de config/youtube-channel-brandbook.md. */

:root {
  --petrol: #173b4a;
  --cream: #f3e6c8;
  --paper: #fbf6ea;
  --ocher: #e6a100;
  --coffee: #3e2723;
  --rust: #a74732;
  --ink: #2a201a;
  --muted: #6b5b47;
  --line: #d8c9a8;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 68rem;
  --radius: 14px;
  --shadow: 0 14px 34px rgba(62, 39, 35, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }

h1, h2, h3 { text-wrap: balance; }
:where(section[id], h2[id], h3[id]) { scroll-margin-top: 1.5rem; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  color: var(--ink);
  color-scheme: light;
  touch-action: manipulation;
  background: var(--cream);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(230, 161, 0, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(23, 59, 74, 0.08), transparent 55%),
    linear-gradient(rgba(243,230,200,.88),rgba(243,230,200,.88)), url('/brand/capa.jpg');
  background-size: auto, auto, auto, cover;
  background-attachment: scroll, scroll, scroll, fixed;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--petrol); text-underline-offset: 3px; }
a:hover { color: var(--rust); }

:focus-visible {
  outline: 3px solid var(--ocher);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--coffee); color: var(--cream);
  padding: 0.6rem 1rem; z-index: 50; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */

.site-header {
  background: var(--petrol);
  color: var(--cream);
  border-bottom: 4px solid var(--ocher);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.brand img { width: 40px; height: 40px; border-radius: 50%; background: var(--cream); padding: 2px; }
.brand .wordmark { font-family: var(--serif); line-height: 1; }
.brand .wordmark span { display: block; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.brand .wordmark strong { display: block; font-size: 1.15rem; letter-spacing: 0.06em; }

.nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a {
  color: var(--cream); text-decoration: none; font-size: 0.95rem;
  letter-spacing: 0.02em; padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--ocher); color: #fff; }

/* ---------- Hero ---------- */

.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 2rem; }
.hero .wrap { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(12rem,.85fr); gap:clamp(2rem,7vw,6rem); align-items:center; }
.hero-copy { max-width: 52rem; }
.hero-identity { justify-self:end; display:grid; place-items:center; gap:.75rem; width:min(100%,20rem); padding:1.4rem; color:var(--cream); background:var(--petrol); border:1px solid rgba(230,161,0,.6); box-shadow:var(--shadow); transform:rotate(2deg); }
.hero-identity img { width:min(100%,13rem); aspect-ratio:1; object-fit:contain; filter:drop-shadow(0 10px 16px rgba(0,0,0,.22)); }
.hero-identity span { font-family:var(--serif); font-style:italic; font-size:1rem; color:#f7d984; }
.hero .eyebrow { margin: 0 0 0.9rem; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  color: var(--coffee);
  max-width: 20ch;
}
.hero p.lede { max-width: 52ch; font-size: 1.1rem; color: var(--muted); margin: 0 0 1.6rem; }
.hero .actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--rust); font-weight: 700;
}
.eyebrow::before { content: "◆"; color: var(--ocher); margin-right: 0.5rem; font-size: 0.7em; }

/* ---------- Buttons ---------- */

.button { 
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 2px solid var(--coffee);
  background: var(--coffee);
  color: var(--cream);
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.button:focus-visible, .nav a:focus-visible, .episode-card:focus-visible { outline:3px solid var(--ocher); outline-offset:4px; }
.button:hover { transform: translateY(-1px); background: var(--ocher); color: var(--coffee); border-color: var(--ocher); }
.button--ghost { background: transparent; color: var(--coffee); }
.button--ghost:hover { background: var(--coffee); color: var(--cream); }

/* ---------- Sections ---------- */

.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); color: var(--coffee); margin: 0; }
.section-head p { margin: 0; color: var(--muted); }

/* ---------- Episode cards ---------- */

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
}
.episode-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.episode-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(62, 39, 35, 0.22); }
.episode-card .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--petrol); }
.episode-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-card .body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; }
.episode-card h3 { font-family: var(--serif); font-size: 1.2rem; line-height: 1.25; margin: 0; color: var(--coffee); }
.episode-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.episode-card .more { margin-top: auto; color: var(--rust); font-weight: 700; font-size: 0.9rem; }

/* ---------- TV frame (memory window) ---------- */

.tv-frame {
  position: relative;
  border-radius: 22px;
  padding: clamp(10px, 2vw, 18px);
  background: linear-gradient(160deg, #2a211c, #17110e);
  box-shadow: inset 0 0 0 2px rgba(230, 161, 0, 0.4), var(--shadow);
}
.tv-frame::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 22px;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, rgba(230, 161, 0, 0.16), transparent 60%);
}
.tv-frame .screen { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0b0b0b; }
.tv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Episode page ---------- */

.episode-hero { padding: clamp(1.5rem, 4vw, 3rem) 0 0.5rem; }
.episode-hero h1 { font-family: var(--serif); font-size: clamp(1.7rem, 1.3rem + 2vw, 2.6rem); line-height: 1.12; color: var(--coffee); margin: 0.4rem 0 0.8rem; max-width: 26ch; }
.episode-body { display: grid; gap: 1.5rem; }
.episode-body .summary { font-size: 1.08rem; }
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; box-shadow: var(--shadow);
}
.disclosure { font-size: 0.86rem; color: var(--muted); }

/* ---------- Archive label ---------- */

.archive-label {
  display: inline-block;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--coffee);
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0.28rem 0.6rem;
  border-radius: 4px;
}

/* ---------- Series / links lists ---------- */

.series-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.series-list li {
  display: flex; gap: 0.8rem; align-items: baseline;
  padding: 0.85rem 1rem; background: var(--paper);
  border: 1px solid var(--line); border-left: 5px solid var(--ocher); border-radius: 8px;
}
.series-list strong { font-family: var(--serif); color: var(--coffee); }
.series-list span { color: var(--muted); font-size: 0.92rem; }

/* ---------- Stub pages ---------- */

.stub { max-width: 44rem; }
.stub h1 { font-family: var(--serif); font-size: clamp(1.7rem, 1.3rem + 2vw, 2.6rem); color: var(--coffee); }
.notice { background: var(--paper); border: 1px dashed var(--ocher); border-radius: var(--radius); padding: 1.2rem 1.4rem; color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer { margin-top: 2rem; background: var(--petrol); color: var(--cream); border-top: 4px solid var(--ocher); }
.site-footer .wrap { padding: 2rem 0; display: grid; gap: 1rem; }
.site-footer a { color: var(--cream); }
.site-footer .meta { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.9rem; opacity: 0.9; }
.site-footer small { color: #cfe0e6; }

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

@media (max-width: 700px) {
  .wrap { width:min(100% - 1.5rem, var(--wrap)); }
  .hero .wrap { grid-template-columns:1fr; gap:2rem; }
  .hero-identity { justify-self:start; width:min(100%,15rem); transform:rotate(1deg); }
  .hero-identity img { width:9rem; }
  .site-header .wrap { padding-block: .8rem; }
}
