/* ============================================================
   THE WEEKLY DISPATCH — Sunday Comics Stylesheet
   Newsprint broadsheet. Black press tradition.
   No Afrofuturist grain/scanlines. No Living Relic.
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  --paper-bg: #f7f3e8;
  --paper-stain: #f0ebdc;
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;
  --ink-faint: #888;
  --masthead-ink: #111;
  --accent-teal: #1F8A8E;
  --accent-rust: #8B4513;
  --accent-gold: #B8956A;
  --rule-color: #333;
  --card-bg: #faf7ef;
  --card-border: #ddd5c4;
  --btn-bg: #eee8d9;
  --btn-hover: #e0d8c4;
  --btn-active: #1a1a1a;
  --btn-active-text: #f7f3e8;
  --paper-max: 900px;
  --strip-max: 650px;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  background: #d9d1bc;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(139,69,19,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(31,138,142,0.04) 0%, transparent 50%);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 1rem;
}

/* ── The Paper ── */
.paper {
  background: var(--paper-bg);
  max-width: var(--paper-max);
  width: 100%;
  min-height: 100vh;
  padding: 2.5rem 2rem 2rem;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.12),
    0 4px 16px rgba(0,0,0,0.08),
    0 0 0 1px rgba(0,0,0,0.04);
  position: relative;
}

/* Coffee ring / age stain (subtle) */
.paper::before {
  content: '';
  position: absolute;
  top: 40px;
  right: 60px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,69,19,0.06) 0%, rgba(139,69,19,0.02) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Masthead ── */
.masthead {
  text-align: center;
  padding-bottom: 1.2rem;
  border-bottom: 3px double var(--rule-color);
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
}

.masthead-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}

.masthead-date { }
.masthead-volume { }

.masthead-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--masthead-ink);
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.masthead-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.5rem auto;
  max-width: 400px;
}

.divider-star {
  color: var(--ink-faint);
  font-size: 0.6rem;
  flex-shrink: 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--rule-color);
  opacity: 0.4;
}

.masthead-motto {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.3rem;
}

/* ── Section Header ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule-color);
}

.section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink);
}

.section-page {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--ink-faint);
}

/* ── Strip Anchor ── */
.strip-anchor {
  text-align: center;
  margin-bottom: 1.5rem;
}

.strip-banner { margin-bottom: 1.2rem; }

.strip-creator {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.strip-rule {
  width: 60px;
  height: 2px;
  background: var(--rule-color);
  margin: 0 auto 0.6rem;
}

.strip-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--masthead-ink);
  margin-bottom: 0.3rem;
}

.strip-episode-label {
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem;
}

.ep-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-teal);
  letter-spacing: 0.1em;
}

.ep-title {
  font-family: Georgia, serif;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ── Strip Frame ── */
.strip-frame {
  max-width: var(--strip-max);
  margin: 0 auto;
  border: 1px solid var(--card-border);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  line-height: 0;
}

.strip-art {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Pull Quote ── */
.strip-pullquote {
  max-width: var(--strip-max);
  margin: 0.8rem auto 0;
  padding: 0.5rem 1rem;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Strip Navigation ── */
.strip-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.nav-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--rule-color);
  background: var(--btn-bg);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: var(--btn-hover);
}

.nav-btn:active {
  background: var(--btn-active);
  color: var(--btn-active-text);
}

.nav-arrow { font-size: 0.9rem; }

.nav-episodes {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.ep-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--card-border);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  padding: 0;
}

.ep-dot:hover { background: var(--ink-faint); }
.ep-dot.current {
  background: var(--accent-teal);
  transform: scale(1.4);
  box-shadow: 0 0 0 2px rgba(31,138,142,0.2);
}
.ep-dot.published { background: var(--ink-soft); }

/* ── Spread Toggle ── */
.spread-toggle-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 1rem 0 1.5rem;
}

.spread-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.45rem 1.2rem;
  border: 1px solid var(--rule-color);
  background: var(--btn-bg);
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.15s ease;
}

.spread-btn:first-child { border-right: none; }
.spread-btn.active {
  background: var(--btn-active);
  color: var(--btn-active-text);
  border-color: var(--btn-active);
}

/* ── Sunday Spread View ── */
.spread-view {
  margin-top: 1.5rem;
}

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

.spread-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.spread-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.spread-card-img {
  width: 100%;
  height: auto;
  display: block;
  line-height: 0;
}

.spread-card-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0.7rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--card-border);
}

.spread-card-label .card-ep { color: var(--accent-teal); }
.spread-card-label .card-title { font-style: italic; font-family: Georgia, serif; text-transform: none; font-size: 0.7rem; }

/* ── Footer ── */
.paper-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
}

.footer-rule {
  height: 2px;
  background: var(--rule-color);
  margin-bottom: 0.8rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}

.footer-location {
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.feed-mark {
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  opacity: 0.7;
}

/* ── Keyboard Hint ── */
.kbd-hint {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: rgba(247,243,232,0.9);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--card-border);
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* ── Loading State ── */
.strip-art.loading {
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  body { padding: 0.3rem; }
  .paper { padding: 1.2rem 1rem 1.5rem; }
  .masthead-title { font-size: 2rem; }
  .strip-title { font-size: 1.5rem; }
  .strip-nav { gap: 0.5rem; }
  .nav-btn { padding: 0.4rem 0.8rem; font-size: 0.65rem; }
  .nav-episodes { gap: 0.2rem; }
  .ep-dot { width: 6px; height: 6px; }
  .spread-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; }
  .kbd-hint { display: none; }
}

/* ── Section Rules ── */
.section-rule {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 2.5rem 0 1.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule-color);
  border-bottom: 1px solid var(--rule-color);
}

.section-rule .divider-star {
  color: var(--ink-faint);
  font-size: 0.6rem;
  flex-shrink: 0;
}

.section-rule .divider-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  flex: 1;
}

/* ── Concept Strips ── */
.concept-strips {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.concept-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.2rem;
  position: relative;
}

.concept-card--single {
  grid-template-columns: 1fr 1.5fr;
}

.concept-badge {
  position: absolute;
  top: -0.5rem;
  right: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--accent-teal);
  color: #fff;
  padding: 0.2rem 0.6rem;
}

.concept-frame {
  border: 1px solid var(--card-border);
  background: #fff;
  line-height: 0;
  overflow: hidden;
}

.concept-art {
  width: 100%;
  height: auto;
  display: block;
}

.concept-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  justify-content: center;
}

.concept-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--masthead-ink);
  line-height: 1.2;
}

.concept-title small {
  font-weight: 400;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.concept-creator {
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-teal);
}

.concept-desc {
  font-family: Georgia, serif;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-soft);
  font-style: italic;
}

.concept-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.concept-tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--card-border);
  color: var(--ink-faint);
  background: var(--paper-bg);
}

/* ── Strip Subtitle ── */
.strip-subtitle {
  font-family: Georgia, serif;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

/* ── Coming Soon ── */
.coming-soon {
  text-align: center;
  padding: 1.5rem 2rem;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  body { padding: 0.3rem; }
  .paper { padding: 1.2rem 1rem 1.5rem; }
  .masthead-title { font-size: 2rem; }
  .strip-title { font-size: 1.5rem; }
  .strip-nav { gap: 0.5rem; }
  .nav-btn { padding: 0.4rem 0.8rem; font-size: 0.65rem; }
  .nav-episodes { gap: 0.2rem; }
  .ep-dot { width: 6px; height: 6px; }
  .spread-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; }
  .concept-card { grid-template-columns: 1fr; }
  .concept-card--single { grid-template-columns: 1fr; }
  .kbd-hint { display: none; }
}

@media (max-width: 480px) {
  .paper { padding: 0.8rem; }
  .masthead-title { font-size: 1.5rem; }
  .masthead-top { flex-direction: column; gap: 0.2rem; }
  .spread-grid { grid-template-columns: 1fr; }
  .concept-title { font-size: 1.1rem; }
}
