/* ═══════════════════════════════════════════════════════════════════ */
/*  THE BRONZE AGE — Campaign Compendium Stylesheet                   */
/*  Themes: Terracotta & Gold (landing), Papyrus & Ink (content)      */
/* ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Cinzel+Decorative:wght@400;700;900&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ─── Theme: Terracotta & Gold (Landing Page) ─── */
[data-theme="terracotta"] {
  --bg-deep: #0e0806;
  --bg-primary: #1a0f0a;
  --bg-secondary: #2a1810;
  --bg-card: #352015;
  --bg-stat: #3d2818;
  --text-primary: #e8d5b7;
  --text-secondary: #c4a882;
  --text-muted: #8a7560;
  --accent-gold: #c9a54e;
  --accent-primary: #c4703f;
  --accent-secondary: #8b4513;
  --border-stat: #c4703f;
  --border-accent: #c9a54e;
  --nav-bg: rgba(26, 15, 10, 0.95);
  --stat-gradient: linear-gradient(to right, #c4703f, #c9a54e, #c4703f);
  --link-color: #d4a84b;
}

/* ─── Theme: Papyrus & Ink (Content Pages) ─── */
[data-theme="papyrus"] {
  --bg-deep: #e8d8b8;
  --bg-primary: #f4e8d0;
  --bg-secondary: #ede0c8;
  --bg-card: #e6d5b8;
  --bg-stat: #dcc8a8;
  --text-primary: #2a1810;
  --text-secondary: #5a4030;
  --text-muted: #8a7560;
  --accent-gold: #8b6914;
  --accent-primary: #6b3a2a;
  --accent-secondary: #8b5a3a;
  --border-stat: #6b3a2a;
  --border-accent: #8b6914;
  --nav-bg: rgba(237, 224, 200, 0.97);
  --stat-gradient: linear-gradient(to right, #6b3a2a, #8b6914, #6b3a2a);
  --link-color: #6b3a2a;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Libre Baskerville', 'Georgia', serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 16px;
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navigation ─── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--accent-gold);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  height: 52px;
}

.nav-brand {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 1rem;
  color: var(--accent-gold);
  letter-spacing: 0.12em;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; opacity: 0.85; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  transition: color 0.2s;
  white-space: nowrap;
}

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

.nav-links .divider {
  width: 1px;
  height: 14px;
  background: var(--text-muted);
  opacity: 0.3;
}

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown > a::after {
  content: ' ▾';
  font-size: 0.6rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 105, 20, 0.3);
  min-width: 180px;
  padding: 0.5rem 0;
  z-index: 1001;
}

.nav-dropdown:hover .dropdown-menu { display: block; }

.dropdown-menu a {
  display: block;
  padding: 0.4rem 1rem;
  font-size: 0.7rem;
}

/* ─── Page Layout ─── */
.page-body { padding-top: 52px; }

.content-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.content-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.two-column {
  column-count: 2;
  column-gap: 2.5rem;
  column-rule: 1px solid rgba(139, 105, 20, 0.15);
}

section { padding: 1.5rem 0; }

/* ─── Typography ─── */
h1.page-title {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-gold);
}

h1.page-title + .page-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--accent-gold);
}

h2:first-child { margin-top: 0; }

h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--accent-primary);
  margin: 1.5rem 0 0.5rem;
  letter-spacing: 0.04em;
}

p { margin-bottom: 1rem; }

.drop-cap::first-letter {
  font-family: 'Cinzel Decorative', serif;
  font-size: 3.5rem;
  float: left;
  line-height: 0.8;
  margin-right: 0.1em;
  margin-top: 0.05em;
  color: var(--accent-gold);
}

.section-divider {
  text-align: center;
  margin: 2rem 0;
  color: var(--accent-gold);
  font-size: 1rem;
  letter-spacing: 0.5em;
  opacity: 0.4;
}

.section-alt { background: var(--bg-secondary); }

/* ─── Stat Block (Species) ─── */
.stat-block {
  background: var(--bg-stat);
  border: 1px solid rgba(139, 105, 20, 0.2);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  position: relative;
  break-inside: avoid;
}

.stat-block::before,
.stat-block::after {
  content: '';
  display: block;
  height: 3px;
  background: var(--stat-gradient);
  position: absolute;
  left: 0; right: 0;
}
.stat-block::before { top: 0; }
.stat-block::after { bottom: 0; }

.stat-block h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--accent-gold);
  margin: 0 0 0.15rem;
}

.stat-type {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.stat-source {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(139, 105, 20, 0.15);
}

.stat-line {
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

.stat-label {
  font-variant: small-caps;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.04em;
}

.stat-divider {
  height: 2px;
  background: var(--stat-gradient);
  margin: 0.6rem 0;
  opacity: 0.4;
}

.flavor-text {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.stat-block ul, .bg-block ul {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0;
}

.stat-block ul li, .bg-block ul li {
  font-size: 0.88rem;
  padding: 0.15rem 0 0.15rem 1.2rem;
  position: relative;
  line-height: 1.5;
}

.stat-block ul li::before, .bg-block ul li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--accent-gold);
  font-size: 0.45rem;
  top: 0.5rem;
}

/* ─── Background Block ─── */
.bg-block {
  background: var(--bg-stat);
  border: 1px solid rgba(139, 105, 20, 0.2);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  position: relative;
  break-inside: avoid;
}

.bg-block::before,
.bg-block::after {
  content: '';
  display: block;
  height: 3px;
  background: var(--stat-gradient);
  position: absolute;
  left: 0; right: 0;
}
.bg-block::before { top: 0; }
.bg-block::after { bottom: 0; }

.bg-block h3 {
  font-family: 'Cinzel', serif;
  color: var(--accent-gold);
  margin: 0 0 0.1rem;
}

.bg-culture {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--accent-primary);
  font-size: 0.88rem;
  margin-bottom: 0.6rem;
}

.bg-stats {
  font-size: 0.82rem;
  line-height: 1.8;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(139, 105, 20, 0.15);
}

.feat-name {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--accent-primary);
  margin: 0.6rem 0 0.2rem;
}

.feat-desc {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.bg-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(139, 105, 20, 0.1);
  font-style: italic;
}

/* ─── Culture Tab Navigation ─── */
.culture-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--accent-gold);
  margin-bottom: 2rem;
}

.culture-tab {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.culture-tab:hover { color: var(--text-primary); }
.culture-tab.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.culture-section { display: none; }
.culture-section.active { display: block; }

/* ─── Journal Entry ─── */
.journal-entry {
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  border-left: 3px solid var(--accent-gold);
}

.journal-date {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.journal-entry h4 {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0.25rem 0 0.5rem;
}

.journal-entry p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.journal-placeholder {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
  font-style: italic;
  border: 1px dashed var(--text-muted);
  margin: 1.5rem 0;
  opacity: 0.5;
}

/* ─── Map ─── */
.map-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.map-toggle {
  background: var(--bg-card);
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  padding: 0.35rem 0.9rem;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.map-toggle:hover, .map-toggle.active {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

#map {
  width: 100%;
  height: 550px;
  border: 1px solid rgba(139, 105, 20, 0.3);
}

/* ─── Footer ─── */
.site-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid rgba(139, 105, 20, 0.2);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: italic;
}

/* ─── Landing Page Specifics ─── */
.landing-gate {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0e0806;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.6s;
}

.landing-gate.hidden {
  opacity: 0;
  pointer-events: none;
}

.landing-gate h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.8rem;
  color: #c9a54e;
  letter-spacing: 0.18em;
  margin-bottom: 0.4rem;
}

.landing-gate .gate-sub {
  color: #8a7560;
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.landing-gate input {
  background: #2a1810;
  border: 1px solid #c9a54e;
  color: #e8d5b7;
  padding: 0.7rem 1.5rem;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.95rem;
  text-align: center;
  width: 260px;
  outline: none;
}

.landing-gate input:focus {
  box-shadow: 0 0 12px rgba(201, 165, 78, 0.15);
}

.landing-gate .gate-error {
  color: #c44;
  font-size: 0.82rem;
  margin-top: 0.75rem;
  height: 1.2rem;
}

.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background-image:
    linear-gradient(135deg, rgba(26,15,10,0.92), rgba(42,24,16,0.85)),
    url('./map-dark-archaic.png');
  background-size: cover;
  background-position: center 30%;
}

.hero-section h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 4rem;
  color: #c9a54e;
  letter-spacing: 0.22em;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-section .hero-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-style: italic;
  color: #c4a882;
  letter-spacing: 0.08em;
  margin-bottom: 2.5rem;
}

.hero-section .hero-body {
  font-size: 0.95rem;
  color: #8a7560;
  max-width: 560px;
  line-height: 1.9;
  margin-bottom: 3rem;
}

.hero-enter {
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: #c9a54e;
  border: 1px solid #c9a54e;
  background: transparent;
  padding: 0.75rem 2.5rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.hero-enter:hover {
  background: rgba(201, 165, 78, 0.1);
  text-decoration: none;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .two-column { column-count: 1; }
  .hero-section h1 { font-size: 2.2rem; }
  .site-nav { padding: 0 1rem; }
  .nav-links a { padding: 0.5rem 0.4rem; font-size: 0.65rem; }
  .content-wrapper, .content-narrow { padding: 2rem 1rem; }
  .culture-tabs { flex-wrap: wrap; }
}
