/* ─────────────────────────────────────
   Episode 02 — overrides for the shared template
   Cargado por episodio_02/index.html DESPUÉS de styles.css.
   Mantenemos esto pequeño: solo ajustes específicos de este episodio.
   ───────────────────────────────────── */

/* El template tiene un grid de hero con collage de imágenes. Aquí lo
   sustituimos por un layout simple — política ep02+: máx. 2 raster por
   episodio cuando sean suficientemente ilustrativas. */
.hero { padding-bottom: clamp(3rem, 6vw, 5rem); }
.hero-title .hl { background: linear-gradient(180deg, transparent 60%, var(--signal-soft) 60%); padding: 0 0.05em; }

/* Override reading-column width for ep02: many sections contain wide visuals */
.prose { max-width: var(--maxw); }

/* Section title — used at the top of each chapter */
.section-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0.5rem 0 1.75rem;
  line-height: 1.1;
  max-width: 22ch;
}

/* Reading column for prose blocks (keeps text readable inside wider sections) */
.prose-block { max-width: var(--readw); }
.prose-block p + p { margin-top: 1rem; }
.prose-block ol, .prose-block ul { padding-left: 1.25rem; margin: 1rem 0; }
.prose-block li + li { margin-top: 0.5rem; }
.prose-block strong { color: var(--ink); }
.prose-block a { font-weight: 500; }

/* Footer classes used by the template (ep01 used different names) */
.foot-block { display: flex; flex-direction: column; gap: 0.5rem; }
.foot-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: color-mix(in oklab, var(--paper) 55%, transparent);
  margin-bottom: 0.25rem;
}
.foot-mini {
  color: color-mix(in oklab, var(--paper) 70%, transparent);
  max-width: 42ch; line-height: 1.5;
}

/* ─── vocabulary tooltips ─── */
.term {
  border-bottom: 1.5px dashed var(--cobalt);
  cursor: help;
  position: relative;
  display: inline;
}

/* tooltip bubble */
.term::after {
  content: attr(data-def);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 0.45rem 0.7rem;
  border-radius: 5px;
  width: max-content;
  max-width: min(28ch, 90vw);
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 150ms, transform 150ms var(--ease-spring);
  z-index: 200;
}

/* arrow */
.term::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0.7rem;
  border: 5px solid transparent;
  border-top-color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 150ms, transform 150ms var(--ease-spring);
  z-index: 201;
}

.term:hover::after,
.term:focus-visible::after,
.term--active::after {
  opacity: 1;
  transform: translateY(0);
}

.term:hover::before,
.term:focus-visible::before,
.term--active::before {
  opacity: 1;
  transform: translateY(0);
}

.term:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .term::after, .term::before { transition: none; }
}

/* ─── raster figure ─── */
.raster-figure {
  margin: 2.5rem auto;
  max-width: 640px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 4px 24px color-mix(in oklab, var(--ink) 30%, transparent);
}
.raster-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  object-position: center;
}
.raster-figure figcaption {
  padding: 0.65rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--mist);
  border-top: 1px solid color-mix(in oklab, var(--mist) 18%, transparent);
}
