/* ============================================================
   THE CHRONICLES — Shared Stylesheet
   ============================================================ */

/* 1. Variables & Reset */
:root {
  --bg:          #0d0d12;
  --bg-card:     #14141e;
  --bg-raised:   #1c1c28;
  --text:        #ddd4bb;
  --text-muted:  #8a8070;
  --border:      #2a2a38;
  --font-heading: Georgia, 'Palatino Linotype', Palatino, serif;
  --font-body:   'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius:      6px;
  --max-width:   1100px;
  --section-pad: 5rem 1.5rem;
}

/* Campaign themes applied to <body> */
body.chains {
  --accent:       #9b2626;
  --accent-light: #c43c3c;
  --accent-dim:   rgba(155, 38, 38, 0.15);
  --accent-glow:  rgba(155, 38, 38, 0.4);
  --secondary:    #3a5a8a;
  --highlight:    #8ab0d8;
  --hero-gradient: linear-gradient(160deg, rgba(10,15,30,0.88) 0%, rgba(13,13,18,0.72) 55%, rgba(26,10,10,0.88) 100%);
}

body.dawn {
  --accent:       #c9a227;
  --accent-light: #e8bc30;
  --accent-dim:   rgba(201, 162, 39, 0.12);
  --accent-glow:  rgba(201, 162, 39, 0.4);
  --secondary:    #7a3090;
  --highlight:    #d4aaee;
  --hero-gradient: linear-gradient(160deg, rgba(13,10,24,0.88) 0%, rgba(13,13,18,0.72) 55%, rgba(26,20,0,0.88) 100%);
}

body.hub {
  --accent:       #6a7090;
  --accent-light: #8a90b8;
  --accent-dim:   rgba(106, 112, 144, 0.12);
  --accent-glow:  rgba(106, 112, 144, 0.35);
  --hero-gradient: linear-gradient(160deg, rgba(10,10,16,0.97) 0%, rgba(13,13,18,0.93) 50%, rgba(10,10,16,0.97) 100%);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 100vh;
}


/* 2. Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.8rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.05rem; letter-spacing: 0.05em; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-light); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.8; text-decoration: underline; }

em { font-style: italic; color: var(--text); }
strong { font-weight: 600; color: var(--text); }

.label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-body);
}


/* 3. Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

section {
  padding: var(--section-pad);
}

section:nth-child(even) {
  background: var(--bg-card);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-header .label {
  margin-bottom: 0.75rem;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-muted);
}

.divider {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin: 1rem auto;
}


/* 4. Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 18, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  padding: 0.85rem 1.5rem;
}

.site-nav .nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.nav-back {
  color: var(--text-muted);
  font-size: 0.88rem;
  white-space: nowrap;
  transition: color 0.15s;
}

.nav-back:hover { color: var(--text); text-decoration: none; }

.nav-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--accent-light);
  flex: 1;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--text); text-decoration: none; }


/* 5. Hero Sections */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--hero-gradient);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, var(--accent-dim) 0%, transparent 70%);
  pointer-events: none;
}

.campaign-hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  background: var(--hero-gradient);
  position: relative;
  overflow: hidden;
}

.campaign-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, var(--accent-dim) 0%, transparent 65%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1.5rem;
}

.hero h1 {
  color: var(--text);
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 30px rgba(0,0,0,0.5);
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  font-style: italic;
  max-width: 600px;
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.7;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}


/* 6. Campaign Cards (Index page) */
.campaigns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 3rem;
  width: 100%;
  max-width: 900px;
}

.campaign-card {
  display: block;
  position: relative;
  padding: 3rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
  overflow: hidden;
}

.campaign-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.campaign-card.chains-card {
  border-top: 3px solid #9b2626;
}
.campaign-card.chains-card::before {
  background: radial-gradient(ellipse at 30% 30%, rgba(155,38,38,0.12) 0%, transparent 70%);
}

.campaign-card.dawn-card {
  border-top: 3px solid #c9a227;
}
.campaign-card.dawn-card::before {
  background: radial-gradient(ellipse at 70% 30%, rgba(201,162,39,0.1) 0%, transparent 70%);
}

.campaign-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.campaign-card:hover::before { opacity: 1; }

.card-label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}

.chains-card .card-label { color: #9b2626; }
.dawn-card .card-label { color: #c9a227; }

.campaign-card h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--text);
  margin-bottom: 0.75rem;
}

.campaign-card .tagline {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.campaign-card .card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.card-enter {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chains-card .card-enter { color: #c43c3c; }
.dawn-card .card-enter { color: #e8bc30; }


/* 7. Info Cards */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.info-card h3 {
  color: var(--accent-light);
  margin-bottom: 0.35rem;
}

.info-card .subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.info-card p {
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 0;
}


/* 8. Character Cards */
.character-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.character-card:hover {
  border-color: var(--accent);
}

.char-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.char-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-dim);
  opacity: 0;
  transition: opacity 0.2s;
}

.character-card:hover .char-header::before { opacity: 1; }

.char-header h3 {
  color: var(--text);
  margin-bottom: 0.2rem;
  position: relative;
}

.char-role {
  font-size: 0.78rem;
  color: var(--accent-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
}

.char-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.91rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.char-body p { color: var(--text-muted); }

/* Expand/collapse for backstory */
.char-card details {
  border-top: 1px solid var(--border);
}

.char-card details summary {
  padding: 0.75rem 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.15s;
}

.char-card details summary::-webkit-details-marker { display: none; }
.char-card details summary:hover { color: var(--accent-light); }
.char-card details summary::after { content: ' ↓'; }
.char-card details[open] summary::after { content: ' ↑'; }

.char-card details .backstory-text {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
  border-top: 1px solid var(--border);
}


/* 9. Faction Cards */
.faction-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.faction-card .faction-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.faction-card .faction-side {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 0.85rem;
}

.faction-card p {
  font-size: 0.91rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.faction-card .faction-members {
  font-size: 0.83rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.faction-card .faction-members strong {
  color: var(--text);
}


/* 10. Timeline (DoD History) */
.timeline {
  position: relative;
  padding-left: 2rem;
  max-width: 750px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline-entry {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -2.45rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-era {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 0.3rem;
}

.timeline-entry h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.timeline-entry p {
  font-size: 0.91rem;
  color: var(--text-muted);
}


/* 11. Epilogue Cards */
.epilogue-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.epilogue-card .epi-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--accent-dim);
}

.epilogue-card .epi-header h3 {
  color: var(--accent-light);
  margin-bottom: 0.1rem;
}

.epilogue-card .epi-header .epi-title {
  font-size: 0.83rem;
  font-style: italic;
  color: var(--text-muted);
}

.epilogue-card details summary {
  padding: 1rem 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.15s;
}

.epilogue-card details summary::-webkit-details-marker { display: none; }
.epilogue-card details summary:hover { color: var(--accent-light); }
.epilogue-card details summary::after { content: '  Read epilogue ↓'; }
.epilogue-card details[open] summary::after { content: '  Collapse ↑'; }

.epilogue-card .epi-text {
  padding: 0 1.5rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
  border-top: 1px solid var(--border);
}

.epilogue-card .epi-text p { margin-bottom: 0.85em; }


/* 12. NPC / Key Figure Cards */
.npc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.npc-card h4 {
  color: var(--text);
  margin-bottom: 0.15rem;
}

.npc-card .npc-title {
  font-size: 0.78rem;
  color: var(--accent-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.npc-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.npc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}


/* 13. Pull Quotes */
.pull-quote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-muted);
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.pull-quote cite {
  display: block;
  font-size: 0.78rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.5rem;
}


/* 14. Myth vs. Truth Boxes */
.myth-truth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.myth-box, .truth-box {
  padding: 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.myth-box {
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.25);
}

.truth-box {
  background: rgba(122, 48, 144, 0.08);
  border: 1px solid rgba(122, 48, 144, 0.3);
}

.myth-box .box-label { color: #c9a227; }
.truth-box .box-label { color: #9a4ab0; }

.box-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}

.myth-box p, .truth-box p {
  color: var(--text-muted);
}


/* 15. Footer */
footer {
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }


/* 16. Utility */
.text-accent { color: var(--accent-light); }
.text-muted { color: var(--text-muted); }
.italic { font-style: italic; }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }


/* 17. Responsive */
@media (max-width: 768px) {
  :root { --section-pad: 3.5rem 1.25rem; }

  .campaigns-grid { grid-template-columns: 1fr; gap: 1px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .myth-truth { grid-template-columns: 1fr; }

  .site-nav .nav-inner { gap: 1rem; }
  .nav-links { gap: 1rem; }

  .hero { min-height: auto; padding: 5rem 1.25rem 4rem; }
  .campaign-hero { min-height: auto; padding: 5rem 1.25rem 3rem; }

  .campaign-card { padding: 2rem 1.5rem; }
}

@media (max-width: 768px) {
  .art-panel img { height: 160px; }
  .card-image { height: 80px; }
}

@media (max-width: 480px) {
  :root { --section-pad: 2.5rem 1rem; }
  .nav-links { display: none; }
  .npc-grid { grid-template-columns: 1fr; }
  .art-panel img { height: 120px; }
}


/* Image components */
.art-panel {
  width: 100%;
  margin: 2.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.art-panel img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center 35%;
  display: block;
  filter: brightness(0.65) saturate(0.7);
}

.art-panel figcaption {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  font-size: 0.62rem;
  color: rgba(221,212,187,0.45);
  font-style: italic;
  pointer-events: none;
}

.card-image {
  margin: -2.5rem -2.5rem 1.5rem;
  height: 110px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  filter: brightness(0.45) saturate(0.65);
  transition: filter 0.35s;
}

.campaign-card:hover .card-image img {
  filter: brightness(0.55) saturate(0.8);
}

/* Subtle cross-reference links within body text */
a.xref {
  color: inherit;
  border-bottom: 1px dotted var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
}
a.xref:hover {
  color: var(--accent-light);
  border-color: var(--accent-light);
  text-decoration: none;
  opacity: 1;
}
