/* ============================================================
   Wicked Visual Study Guide - Stylesheet
   Emerald + magenta + brass accents evoking the land of Oz.
   ============================================================ */

:root {
  --emerald-900: #0a3a2e;
  --emerald-800: #11503f;
  --emerald-700: #176a52;
  --emerald-600: #1f8767;
  --emerald-500: #28a87e;
  --emerald-300: #6cd6b1;
  --emerald-100: #d6f1e5;
  --magenta-700: #7a1657;
  --magenta-500: #b82a8a;
  --magenta-300: #e57bc4;
  --brass-500: #c89b3c;
  --brass-300: #e7c87a;
  --ink-900: #0e1f1a;
  --ink-700: #2a3a35;
  --ink-500: #4a5b55;
  --ink-300: #7d8a85;
  --paper: #fbf6ed;
  --paper-soft: #f3ebd9;
  --rule: #c8b88c;
  --shadow: 0 18px 40px -22px rgba(8, 38, 28, 0.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  color: var(--ink-900);
  background: var(--paper);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--emerald-700); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--magenta-500); }

h1, h2, h3, h4 {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--emerald-900);
}
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p  { margin: 0 0 1em; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

/* ============== Header / nav ============== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--emerald-900) 0%, var(--emerald-800) 100%);
  color: var(--paper);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1.5rem; gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; color: var(--paper); }
.brand:hover { color: var(--brass-300); }
.brand-mark {
  font-size: 2.2rem; line-height: 1;
  color: var(--brass-300);
  text-shadow: 0 0 18px rgba(231, 200, 122, 0.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-title { font-family: 'Cinzel', serif; font-size: 1.4rem; font-weight: 700; letter-spacing: 0.06em; }
.brand-sub { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass-300); margin-top: 4px; }
.site-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--paper); font-size: 0.95rem;
  letter-spacing: 0.05em; padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--brass-300); border-bottom-color: var(--brass-300); }
.site-nav a.active { color: var(--brass-300); border-bottom-color: var(--brass-300); }
.theme-toggle {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  color: var(--brass-300); font-size: 1.3rem; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; transition: all 0.2s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }

/* ============== Hero ============== */
.hero {
  position: relative;
  padding: clamp(4rem, 12vw, 9rem) 1.5rem clamp(4rem, 10vw, 7rem);
  text-align: center;
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    url('../images/general/wicked_dual_poster.jpg') center/cover no-repeat,
    radial-gradient(ellipse at 30% 20%, rgba(231, 200, 122, 0.15), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(184, 42, 138, 0.25), transparent 55%),
    linear-gradient(135deg, var(--emerald-900) 0%, var(--emerald-700) 50%, var(--emerald-900) 100%);
}
.hero-bg::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 58, 46, 0.55) 0%, rgba(10, 58, 46, 0.35) 50%, rgba(10, 58, 46, 0.7) 100%);
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,0.06) 0, transparent 1.2%),
    radial-gradient(circle at 87% 32%, rgba(255,255,255,0.05) 0, transparent 1%),
    radial-gradient(circle at 45% 78%, rgba(255,255,255,0.05) 0, transparent 1.1%),
    radial-gradient(circle at 70% 12%, rgba(255,255,255,0.06) 0, transparent 0.8%),
    radial-gradient(circle at 25% 60%, rgba(255,255,255,0.04) 0, transparent 0.9%);
}
.hero-content { max-width: 900px; margin: 0 auto; position: relative; }
.kicker {
  font-family: 'Cinzel', serif;
  text-transform: uppercase; letter-spacing: 0.28em; font-size: 0.8rem;
  color: var(--brass-300); margin: 0 0 1.5rem;
}
.hero h1 {
  color: var(--paper);
  text-shadow: 0 0 30px rgba(40, 168, 126, 0.5), 0 4px 14px rgba(0,0,0,0.4);
  font-size: clamp(3rem, 9vw, 6.5rem);
  margin-bottom: 1rem;
}
.hero-sub { font-size: 1.15rem; max-width: 720px; margin: 0 auto 2rem; opacity: 0.92; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 0.85rem 1.8rem; border-radius: 999px;
  font-family: 'Cinzel', serif; letter-spacing: 0.1em; text-transform: uppercase;
  font-size: 0.82rem; font-weight: 700; transition: all 0.2s;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--brass-500); color: var(--emerald-900); }
.btn-primary:hover { background: var(--brass-300); color: var(--emerald-900); transform: translateY(-1px); }
.btn-ghost { border-color: var(--paper); color: var(--paper); }
.btn-ghost:hover { background: var(--paper); color: var(--emerald-900); }

/* ============== Bands ============== */
.band { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band-overview { background: var(--paper-soft); }
.band-source { background: var(--paper); }
.band-quick { background: linear-gradient(180deg, var(--paper) 0%, var(--emerald-100) 100%); }

.kv {
  list-style: none; padding: 0; margin: 1rem 0 0;
  display: grid; gap: 0.4rem;
}
.kv li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.45rem 0; border-bottom: 1px dotted var(--rule);
  font-size: 0.95rem;
}
.kv li span:first-child {
  font-family: 'Cinzel', serif; font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--emerald-700);
}
.kv li span:last-child { text-align: right; color: var(--ink-700); }

.quote {
  font-size: 1.15rem; font-style: italic;
  border-left: 4px solid var(--brass-500);
  padding: 1rem 1.5rem; margin: 1.5rem 0;
  color: var(--ink-700);
}
.quote cite { display: block; margin-top: 0.5rem; font-size: 0.9rem; font-style: normal; color: var(--emerald-700); }

.lede { font-size: 1.1rem; color: var(--ink-700); max-width: 80ch; }

/* ============== Cards ============== */
.card-grid { display: grid; gap: 1.5rem; margin-top: 2rem; }
.two-up   { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.three-up { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.info-card, .feature-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.info-card { border-top: 4px solid var(--emerald-700); }
.feature-card { color: var(--ink-900); display: block; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 22px 50px -22px rgba(8, 38, 28, 0.55); }
.feature-icon { font-size: 2.4rem; margin-bottom: 0.5rem; }
.feature-card h3 { color: var(--emerald-800); }
.feature-card p { color: var(--ink-700); margin: 0; font-size: 0.95rem; }

/* ============== Character / Location cards ============== */
.entity-grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 2rem;
}
.entity-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform 0.2s;
}
.entity-card:hover { transform: translateY(-3px); }
.entity-card .img-wrap {
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, var(--emerald-100), var(--paper-soft));
  overflow: hidden;
  position: relative;
}
.entity-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.entity-card:hover .img-wrap img { transform: scale(1.04); }
.entity-card .body { padding: 1.25rem 1.5rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.entity-card h3 { color: var(--emerald-800); margin: 0 0 0.25rem; }
.entity-card .tagline {
  font-style: italic; color: var(--magenta-700);
  font-size: 0.92rem; margin-bottom: 0.75rem;
}
.entity-card .desc { color: var(--ink-700); font-size: 0.96rem; margin-bottom: 1rem; }
.entity-card .meta {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dotted var(--rule);
  font-size: 0.82rem; color: var(--ink-500);
  display: flex; flex-direction: column; gap: 0.2rem;
}
.entity-card .meta strong { color: var(--emerald-700); font-weight: 600; }
.dual-portrait {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  aspect-ratio: 4/5;
}
.dual-portrait img { width: 100%; height: 100%; object-fit: cover; }
.dual-portrait .caption-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
  color: var(--paper); padding: 0.5rem 0.75rem; font-size: 0.78rem;
  text-align: center; letter-spacing: 0.05em;
}
.img-wrap { position: relative; }

/* ============== Filter chips ============== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin: 1.5rem 0 0.5rem;
  align-items: center;
}
.filter-bar .label {
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--emerald-700); margin-right: 0.5rem;
}
.chip {
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  color: var(--ink-700);
  padding: 0.4rem 0.9rem; border-radius: 999px;
  font-size: 0.85rem; cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.chip:hover { border-color: var(--emerald-700); color: var(--emerald-700); }
.chip.active { background: var(--emerald-700); color: var(--paper); border-color: var(--emerald-700); }

/* ============== Page header ============== */
.page-header {
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700));
  color: var(--paper);
  padding: clamp(3rem, 7vw, 5rem) 1.5rem clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  border-bottom: 3px solid var(--brass-500);
}
.page-header h1 { color: var(--paper); margin: 0 0 0.5rem; }
.page-header p { max-width: 720px; margin: 0 auto; opacity: 0.92; font-size: 1.1rem; }
.page-header .kicker { margin-bottom: 0.75rem; }

/* ============== Story beats ============== */
.story-beats {
  list-style: none;
  counter-reset: beat;
  padding: 0;
  margin: 1.25rem 0 0;
}
.story-beats li {
  counter-increment: beat;
  padding: 0.7rem 0 0.7rem 3.2rem;
  position: relative;
  border-bottom: 1px dotted var(--rule);
  line-height: 1.55;
}
.story-beats li:last-child { border-bottom: none; }
.story-beats li::before {
  content: counter(beat);
  position: absolute;
  left: 0; top: 0.6rem;
  width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center;
  background: var(--emerald-700);
  color: var(--paper);
  border-radius: 50%;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
}
body.theme-twilight .story-beats li::before { background: var(--magenta-500); }

/* ============== Tables ============== */
.song-list { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.95rem; }
.song-list th, .song-list td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--rule); }
.song-list th {
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--emerald-700); background: var(--emerald-100);
}
.song-list td.song-title { font-weight: 600; }
.song-list td.actors { color: var(--ink-500); font-size: 0.9rem; }
.song-list tr.act-header td {
  background: var(--emerald-800); color: var(--paper);
  font-family: 'Cinzel', serif; letter-spacing: 0.1em;
  text-transform: uppercase; font-size: 0.82rem;
}
.song-list tr.famous-song td.song-title::before {
  content: '★'; color: var(--brass-500); margin-right: 0.5rem;
}

/* ============== Sources ============== */
.source-section { margin-top: 2.5rem; }
.source-section h2 {
  border-bottom: 2px solid var(--emerald-700);
  padding-bottom: 0.4rem; margin-bottom: 1.25rem;
}
.source-item {
  display: flex; gap: 1.25rem; align-items: flex-start;
  padding: 1rem 0; border-bottom: 1px dotted var(--rule);
}
.source-item .source-img {
  width: 90px; height: 90px; border-radius: 8px;
  background: var(--emerald-100); object-fit: cover;
  flex-shrink: 0;
}
.source-item .source-text { flex: 1; }
.source-item h4 { margin: 0 0 0.25rem; font-family: 'Cinzel', serif; font-size: 1rem; color: var(--emerald-800); }
.source-item p { margin: 0; font-size: 0.88rem; color: var(--ink-500); }
.source-item a { font-weight: 600; }

/* ============== Footer ============== */
.site-footer {
  background: var(--emerald-900); color: var(--emerald-100);
  padding: 2.5rem 0; text-align: center; font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.site-footer a { color: var(--brass-300); }
.site-footer a:hover { color: var(--brass-500); }
.site-footer p { margin: 0; opacity: 0.85; }

/* ============== Theme: Twilight (dark, magenta-leaning) ============== */
body.theme-twilight {
  --paper: #1a1424;
  --paper-soft: #221830;
  --rule: #3d2e4f;
  --ink-900: #f1e7f7;
  --ink-700: #c8b8d5;
  --ink-500: #978aae;
  --ink-300: #6b5d80;
  --emerald-100: #2c2238;
  background: var(--paper);
  color: var(--ink-900);
}
body.theme-twilight .info-card,
body.theme-twilight .feature-card,
body.theme-twilight .entity-card {
  background: var(--paper-soft);
  border-color: var(--rule);
}
body.theme-twilight .entity-card .img-wrap {
  background: linear-gradient(135deg, #2c2238, #1a1424);
}
body.theme-twilight .kv li { border-color: var(--rule); }
body.theme-twilight .kv li span:first-child { color: var(--magenta-300); }
body.theme-twilight .song-list th { background: #2c2238; color: var(--magenta-300); }
body.theme-twilight .song-list tr.act-header td { background: #2a1a3a; }
body.theme-twilight .chip { background: var(--paper-soft); border-color: var(--rule); color: var(--ink-700); }
body.theme-twilight .chip.active { background: var(--magenta-500); border-color: var(--magenta-500); color: var(--paper); }

/* ============== Theme: Emerald (default) ============== */
/* Default theme tokens are already emerald; nothing extra needed. */

/* ============== Responsive ============== */
@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; }
  .site-nav { width: 100%; justify-content: center; gap: 1rem; font-size: 0.88rem; }
  .brand-sub { display: none; }
  .source-item { flex-direction: column; }
  .source-item .source-img { width: 100%; height: 160px; }
  .entity-card .img-wrap, .dual-portrait { aspect-ratio: 3/4; }
}

/* Hidden helper */
[hidden] { display: none !important; }

/* Print-friendly */
@media print {
  .site-header, .site-footer, .theme-toggle, .filter-bar, .hero-cta { display: none; }
  body { background: white; color: black; }
}
