/* article.css — dual-theme styles for all article pages */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ══ THEME VARIABLES ══ */
[data-theme="new"] {
  --ink: #1a1410;
  --ink-light: #3d3028;
  --paper: #faf7f2;
  --cream: #f0ebe0;
  --rule: #c8b99a;
  --accent: #8b3a2a;
  --accent-light: #c4614d;
  --gold: #b8952a;
  --gold-pale: #e8d9a0;
}

[data-theme="classic"] {
  --ink: #333;
  --ink-light: #555;
  --paper: #fff;
  --cream: #f5f5f5;
  --rule: #ddd;
  --accent: #0073aa;
  --accent-light: #0096cc;
  --gold: #555;
  --gold-pale: #eee;
}

body {
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ══ THEME TOGGLE ══ */
.theme-toggle-wrap {
  position: fixed;
  top: 14px; right: 16px;
  z-index: 9999;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.92);
  border: 1px solid #ccc; border-radius: 30px;
  padding: 5px 10px 5px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  backdrop-filter: blur(8px);
  cursor: pointer; user-select: none;
  transition: box-shadow 0.2s;
}

.theme-toggle-wrap:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.22); }

.toggle-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: #555;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1;
}

.toggle-switch { position: relative; width: 38px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-track {
  position: absolute; inset: 0;
  background: #ccc; border-radius: 20px; transition: background 0.25s;
}

.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff; border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.toggle-switch input:checked ~ .toggle-track { background: #8b3a2a; }
.toggle-switch input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* ══ SITE HEADER ══ */
[data-theme="new"] .site-header {
  background: var(--ink); padding: 14px 24px; text-align: center;
}

[data-theme="new"] .site-header a {
  color: var(--paper); text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 700; letter-spacing: 0.04em;
  transition: color 0.2s;
}

[data-theme="new"] .site-header a:hover { color: var(--gold); }

[data-theme="classic"] .site-header {
  background: var(--paper); padding: 24px;
  text-align: center; border-bottom: 4px solid var(--ink);
}

[data-theme="classic"] .site-header a {
  color: var(--ink); text-decoration: none;
  font-family: Georgia, serif;
  font-size: 1.4rem; font-weight: normal;
}

[data-theme="classic"] .site-header a:hover { color: var(--accent); }

/* ── BACK BAR ── */
[data-theme="new"] .back-bar {
  background: var(--accent); padding: 10px 24px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
}

[data-theme="new"] .back-bar a { color: rgba(250,247,242,0.85); text-decoration: none; transition: color 0.2s; }
[data-theme="new"] .back-bar a:hover { color: #fff; }
[data-theme="new"] .back-bar a::before { content: '← '; }

[data-theme="classic"] .back-bar {
  background: var(--cream); padding: 8px 24px;
  border-bottom: 1px solid var(--rule);
  font-family: Georgia, serif; font-size: 0.85rem;
}

[data-theme="classic"] .back-bar a { color: var(--accent); text-decoration: none; }
[data-theme="classic"] .back-bar a:hover { text-decoration: underline; }
[data-theme="classic"] .back-bar a::before { content: '← '; }

/* ══ ARTICLE HERO ══ */
[data-theme="new"] .article-hero {
  background: var(--cream); border-bottom: 1px solid var(--rule);
  padding: 56px 24px 40px; text-align: center;
}

[data-theme="new"] .article-kicker {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.72rem; letter-spacing: 0.35em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 16px;
}

[data-theme="new"] .article-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 900;
  line-height: 1.1; max-width: 700px; margin: 0 auto 16px;
  letter-spacing: -0.02em; color: var(--ink);
}

[data-theme="new"] .article-byline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-style: italic; color: var(--ink-light);
}

[data-theme="classic"] .article-hero {
  background: var(--paper); padding: 30px 24px 20px;
  border-bottom: 1px solid var(--rule);
}

[data-theme="classic"] .article-kicker {
  font-family: Georgia, serif; font-size: 0.82rem;
  color: var(--ink-light); margin-bottom: 8px;
  font-style: italic;
}

[data-theme="classic"] .article-hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: bold;
  line-height: 1.2; max-width: 800px; color: var(--ink);
  margin-bottom: 10px;
}

[data-theme="classic"] .article-byline {
  font-family: Georgia, serif; font-size: 0.9rem; color: var(--ink-light);
}

/* ══ ARTICLE BODY ══ */
.article-wrap { max-width: 680px; margin: 0 auto; padding: 52px 24px 80px; }

[data-theme="new"] .article-body p {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.05rem; margin-bottom: 1.4em; line-height: 1.8; color: var(--ink);
}

[data-theme="classic"] .article-body p {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem; margin-bottom: 1.3em; line-height: 1.75; color: var(--ink);
}

/* Drop cap */
[data-theme="new"] .article-body .drop-cap::first-letter {
  float: left; font-family: 'Playfair Display', serif;
  font-size: 4.2rem; line-height: 0.82; font-weight: 900;
  margin: 4px 10px 0 0; color: var(--accent);
}

[data-theme="classic"] .article-body .drop-cap::first-letter {
  float: left; font-family: Georgia, serif;
  font-size: 3.8rem; line-height: 0.85; font-weight: bold;
  margin: 4px 8px 0 0; color: var(--ink);
}

/* Blockquote */
[data-theme="new"] .article-body blockquote {
  border-left: 3px solid var(--accent); padding: 12px 20px;
  margin: 28px 0;
  font-family: 'Playfair Display', serif; font-size: 1.1rem;
  font-style: italic; color: var(--ink-light); background: var(--cream);
}

[data-theme="classic"] .article-body blockquote {
  border-left: 3px solid var(--rule); padding: 10px 18px;
  margin: 24px 0;
  font-family: Georgia, serif; font-size: 0.95rem;
  font-style: italic; color: var(--ink-light); background: var(--cream);
}

/* Figures */
.article-body figure { margin: 32px 0; }
.article-body figure img { width: 100%; max-width: 100%; display: block; }

[data-theme="new"] .article-body figcaption {
  margin-top: 8px; font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem; font-style: italic;
  color: var(--ink-light); text-align: center;
}

[data-theme="classic"] .article-body figcaption {
  margin-top: 6px; font-family: Georgia, serif;
  font-size: 0.82rem; font-style: italic;
  color: var(--ink-light); text-align: center;
}

/* H2 inside body */
[data-theme="new"] .article-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700; margin: 36px 0 14px; color: var(--ink);
}

[data-theme="classic"] .article-body h2 {
  font-family: Georgia, serif;
  font-size: 1.15rem; font-weight: bold; margin: 28px 0 12px; color: var(--ink);
}

/* Pull quote */
[data-theme="new"] .pull-quote {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem; font-style: italic; line-height: 1.45;
  color: var(--ink-light);
  border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule);
  padding: 20px 0; margin: 36px 0; text-align: center;
}

[data-theme="classic"] .pull-quote {
  font-family: Georgia, serif;
  font-size: 1.1rem; font-style: italic; line-height: 1.5;
  color: var(--ink-light);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 16px 0; margin: 28px 0; text-align: center;
}

/* Rule divider */
.rule-divider { width: 60px; height: 1px; background: var(--rule); margin: 36px auto; }

/* Resource link */
[data-theme="new"] .resource-link {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem; transition: color 0.15s, border-color 0.15s;
}

[data-theme="classic"] .resource-link {
  color: var(--accent); text-decoration: underline; font-size: 0.9rem;
}

/* Video embed */
.video-embed {
  position: relative; padding-bottom: 56.25%; height: 0;
  overflow: hidden; background: #000; margin: 28px 0;
}

.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Article footer nav */
.article-footer {
  border-top: 1px solid var(--rule); padding-top: 28px; margin-top: 48px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}

[data-theme="new"] .article-footer {
  font-family: 'Cormorant Garamond', serif; font-size: 0.9rem; color: var(--ink-light);
}

[data-theme="classic"] .article-footer {
  font-family: Georgia, serif; font-size: 0.85rem; color: var(--ink-light);
}

.article-footer a { color: var(--accent); text-decoration: none; }
.article-footer a:hover { text-decoration: underline; }

/* ══ SITE FOOTER ══ */
[data-theme="new"] footer.site-footer {
  background: var(--ink); color: var(--rule); text-align: center;
  padding: 32px 24px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem; letter-spacing: 0.08em;
}

[data-theme="new"] footer.site-footer a { color: var(--gold); text-decoration: none; }

[data-theme="classic"] footer.site-footer {
  background: var(--ink); color: #aaa; text-align: center;
  padding: 20px 24px;
  font-family: Georgia, serif; font-size: 0.82rem;
  border-top: 4px solid #555;
}

[data-theme="classic"] footer.site-footer a { color: #ccc; text-decoration: none; }

.footer-rule { width: 60px; height: 1px; background: var(--rule); margin: 12px auto; }
[data-theme="classic"] .footer-rule { display: none; }

/* Smooth transitions */
*, *::before, *::after {
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}
