/* Historia Argentina — Archive/Newspaper Design System */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,400&family=Playfair+Display:wght@400;700;900&family=Special+Elite&display=swap');

:root {
  /* Base */
  --bg: #f5f0e8;
  --bg-alt: #ede7d9;
  --panel: #faf6ee;
  --panel2: #f0ebe0;
  --line: #d4c9b5;
  --text: #2c2416;
  --dim: #7a6f5e;
  --dim2: #a69c8a;

  /* Track colors */
  --argentina: #75aadb;
  --argentina-dark: #4a7fb5;
  --argentina-bg: rgba(117, 170, 219, 0.12);
  --latam: #c4a35a;
  --latam-dark: #9a7d3a;
  --latam-bg: rgba(196, 163, 90, 0.12);
  --mundo: #8b7d6b;
  --mundo-dark: #6b5d4b;
  --mundo-bg: rgba(139, 125, 107, 0.12);

  /* Accent */
  --accent: #b8432f;
  --accent2: #2e5c4f;
  --highlight: #d4a940;

  /* Era bands */
  --era1: rgba(184, 67, 47, 0.07);
  --era2: rgba(212, 169, 64, 0.07);
  --era3: rgba(139, 125, 107, 0.07);
  --era4: rgba(46, 92, 79, 0.07);
  --era5: rgba(117, 170, 219, 0.07);

  /* Sizing */
  --max-w: 1200px;
  --side: 24px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: 2.2rem; margin: 0.6em 0 0.4em; }
h2 { font-size: 1.6rem; margin: 1.2em 0 0.5em; border-bottom: 2px solid var(--line); padding-bottom: 0.3em; }
h3 { font-size: 1.2rem; margin: 1em 0 0.4em; }
h4 { font-size: 1rem; margin: 0.8em 0 0.3em; }

p { margin: 0.6em 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

small { color: var(--dim); font-size: 0.85em; }
strong { font-weight: 700; }

.date, .tag, .meta, .nav-label {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 0.9em;
}

.chapter-number {
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.12;
  position: absolute;
  top: -10px;
  left: -5px;
  z-index: 0;
  line-height: 1;
}

/* --- Layout --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side);
}

.two-col {
  columns: 2;
  column-gap: 2rem;
  column-rule: 1px solid var(--line);
}
@media (max-width: 768px) {
  .two-col { columns: 1; }
}

/* --- Cards / Panels --- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.2rem;
  margin: 1rem 0;
  position: relative;
}

.card-sepia {
  background: var(--panel2);
  border-left: 4px solid var(--highlight);
}

/* --- Source Document (En profundidad) --- */
.source-doc {
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
  position: relative;
  font-style: italic;
  line-height: 1.8;
}
.source-doc::before {
  content: '\201C';
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  color: var(--dim2);
  position: absolute;
  top: -10px;
  left: 8px;
  line-height: 1;
}
.source-doc .attribution {
  font-style: normal;
  text-align: right;
  margin-top: 0.8em;
  color: var(--dim);
  font-size: 0.9em;
}

/* --- Figure Cards --- */
.figure-card {
  display: flex;
  gap: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1rem;
  margin: 0.8rem 0;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.figure-card:hover {
  box-shadow: 0 2px 12px rgba(44, 36, 22, 0.12);
}
.figure-card .portrait {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  filter: sepia(0.4) contrast(1.1);
  border: 2px solid var(--line);
  flex-shrink: 0;
}
.figure-card .portrait-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--dim2);
  flex-shrink: 0;
}
.figure-card .bio { flex: 1; }
.figure-card .bio h4 { margin: 0 0 0.2em; }
.figure-card .bio .years { font-family: 'Special Elite', monospace; color: var(--dim); font-size: 0.85em; }
.figure-card .bio .role { color: var(--dim); font-size: 0.9em; }

/* --- Timeline (mini in-chapter) --- */
.mini-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 1rem 0;
  overflow-x: auto;
  position: relative;
}
.mini-timeline .tl-line {
  flex: 1;
  height: 3px;
  background: var(--line);
  min-width: 30px;
}
.mini-timeline .tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 2px var(--accent);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}
.mini-timeline .tl-dot.active {
  background: var(--highlight);
  box-shadow: 0 0 0 2px var(--highlight);
}
.mini-timeline .tl-label {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Special Elite', monospace;
  font-size: 0.75rem;
  color: var(--dim);
  white-space: nowrap;
}

/* --- Quiz / Actividades --- */
.quiz-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent2);
  padding: 1.2rem;
  margin: 1rem 0;
}
.quiz-block h4 { color: var(--accent2); }
.quiz-block .options label {
  display: block;
  padding: 0.4rem 0.6rem;
  margin: 0.3rem 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s;
}
.quiz-block .options label:hover {
  background: var(--bg-alt);
}
.quiz-block .options input[type="radio"] { margin-right: 0.5em; }
.quiz-block .feedback {
  margin-top: 0.8em;
  padding: 0.6rem;
  border-radius: 2px;
  display: none;
}
.quiz-block .feedback.correct {
  background: rgba(46, 92, 79, 0.1);
  color: var(--accent2);
  display: block;
}
.quiz-block .feedback.wrong {
  background: rgba(184, 67, 47, 0.1);
  color: var(--accent);
  display: block;
}

/* --- Track badges --- */
.track-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 2px;
  font-family: 'Special Elite', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.track-badge.argentina { background: var(--argentina-bg); color: var(--argentina-dark); }
.track-badge.latam { background: var(--latam-bg); color: var(--latam-dark); }
.track-badge.mundo { background: var(--mundo-bg); color: var(--mundo-dark); }

/* --- Section header --- */
.section-header {
  background: var(--bg-alt);
  border-bottom: 3px solid var(--accent);
  padding: 2rem var(--side);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.section-header h1 {
  position: relative;
  z-index: 1;
}

/* --- Navigation --- */
nav.top-nav {
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem var(--side);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: 'Special Elite', monospace;
  font-size: 0.9rem;
}
nav.top-nav a {
  color: var(--bg);
  opacity: 0.8;
}
nav.top-nav a:hover { opacity: 1; }
nav.top-nav .brand {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

/* --- Chapter navigation --- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}
.chapter-nav a {
  font-family: 'Special Elite', monospace;
  font-size: 0.9rem;
}

/* --- Map container --- */
.map-container {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}
.map-container svg {
  max-width: 100%;
  height: auto;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root { --side: 16px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .chapter-number { font-size: 3.5rem; }
  .figure-card { flex-direction: column; align-items: center; text-align: center; }
}

/* --- Print --- */
@media print {
  nav.top-nav, .chapter-nav { display: none; }
  body { background: white; font-size: 11pt; }
  .card, .source-doc, .quiz-block { break-inside: avoid; }
}
