/* The Dailies — broadsheet-styled public front page.
 *
 * Deliberately print-adjacent: serif headlines (Playfair Display),
 * old-style body (EB Garamond), rule lines across the masthead,
 * multi-column section bodies, small caps flourishes. No framework,
 * no build step — just CSS variables so a future theme override is
 * one :root block.
 */

/* ─── Typography (Google Fonts) ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=Playfair+Display:ital,wght@0,700;0,900;1,700&display=swap');

/* ─── Palette ───────────────────────────────────────────────── */
:root {
  --paper:       #faf7ef;   /* aged newsprint */
  --ink:         #1a1613;   /* deep warm black */
  --rule:        #3b2f25;   /* darker than ink for masthead rules */
  --byline:      #6b5f53;   /* faded to muted */
  --angle:       #2a2218;
  --accent:      #7f1d1d;   /* oxblood for tone chip + section numerals */
  --section-bg:  #f4eedf;   /* faint tint under section headers */
  --link-hover:  #5c1515;

  --column-gap: 2rem;
  --max-width:  1400px;

  /* Lens accents — mapped from the hollywood_gen tailwind tokens so
   * the-dailies inherits section-colour consistency without coupling
   * to the React build. */
  --lens-comedy:       #b45309;  /* amber-700 */
  --lens-world-impact: #b91c1c;  /* red-700 */
  --lens-sports:       #047857;  /* emerald-700 */
  --lens-economy-tech: #1d4ed8;  /* blue-700 */
  --lens-default:      #3b2f25;
}

/* ─── Reset ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ─── Masthead ──────────────────────────────────────────────── */
.masthead {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.25rem 2rem 1.25rem;
  text-align: center;
}
.masthead .title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 1;
  margin: 0.5rem 0 0.4rem;
  letter-spacing: -0.02em;
}
.masthead .tagline {
  font-style: italic;
  color: var(--byline);
  margin: 0.25rem 0 1rem;
  font-size: 1.05rem;
}
.masthead-rule {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--byline);
}
.masthead-rule.bottom {
  border-top: 1px solid var(--rule);
  border-bottom: 3px double var(--rule);
  margin-top: 0.5rem;
}
.masthead-rule .flourish {
  color: var(--accent);
  letter-spacing: 0;
}

/* ─── Main layout ───────────────────────────────────────────── */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

.loading, .error, .offline {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--byline);
  font-style: italic;
  font-size: 1.15rem;
}
.error { color: var(--accent); }
.offline .retry {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  font-style: normal;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
}
.offline .retry:hover { background: var(--section-bg); }

.empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--byline);
  font-style: italic;
}

/* ─── Section header ────────────────────────────────────────── */
.edition-section {
  margin-bottom: 3rem;
  break-inside: avoid;
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
}
.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 1.9rem;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
  margin-bottom: 0.4rem;
}

/* Per-lens accent line under the section title */
.edition-section[data-lens="comedy"]        .section-header { border-bottom-color: var(--lens-comedy); }
.edition-section[data-lens="world-impact"]  .section-header { border-bottom-color: var(--lens-world-impact); }
.edition-section[data-lens="sports"]        .section-header { border-bottom-color: var(--lens-sports); }
.edition-section[data-lens="economy-tech"]  .section-header { border-bottom-color: var(--lens-economy-tech); }

/* ─── Section body — multi-column layout ────────────────────── */
.section-body {
  column-count: 3;
  column-gap: var(--column-gap);
  column-rule: 1px solid var(--rule);
}
@media (max-width: 900px) { .section-body { column-count: 2; } }
@media (max-width: 600px) { .section-body { column-count: 1; } }

.story {
  break-inside: avoid;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dotted var(--rule);
}
.story:last-child { border-bottom: none; }

/* Lead story (first in each section) — bigger headline + drop cap */
.section-body .story:first-child .headline {
  font-size: 1.6rem;
  line-height: 1.12;
}
.section-body .story:first-child .angle::first-letter {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 3.2rem;
  float: left;
  line-height: 0.85;
  padding: 0.35rem 0.5rem 0 0;
  color: var(--accent);
}

.story-link {
  text-decoration: none;
  color: var(--ink);
}
.story-link:hover .headline {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  margin: 0 0 0.4rem;
  letter-spacing: -0.005em;
}

.angle {
  margin: 0.4rem 0 0.6rem;
  font-style: italic;
  color: var(--angle);
  font-size: 1rem;
  line-height: 1.45;
}

.byline {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--byline);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.byline .sep { color: var(--rule); }
.byline .score {
  color: var(--accent);
  font-weight: 600;
}
.byline .tone {
  font-style: italic;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

/* ─── Footer ────────────────────────────────────────────────── */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 2rem 2.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--byline);
  border-top: 1px solid var(--rule);
  font-style: italic;
}
