/* ==========================================================================
   DiscoverS News — assets/style.css
   Modern editorial broadsheet · newsprint palette · Fraunces + Source Sans 3
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette (newsprint: warm paper, cool ink, navy brand, urgent red) */
  --paper: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --ink: #111418;
  --muted: #5b6472;
  --navy: #10367a;
  --navy-deep: #0a2450;
  --red: #c1121f;
  --rule: #e4e0d8;
  --rule-strong: #111418;
  --footer-text: #a8b0bd;

  /* Legacy aliases — referenced by admin templates and inline styles */
  --bg: var(--paper);
  --text: var(--ink);
  --accent: var(--navy);
  --accent-2: var(--red);
  --border: var(--rule);
  --radius: 6px;

  /* Typography */
  --font-display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Metrics */
  --max: 1180px;
  --gutter: 24px;
  --measure: 680px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fine paper grain over the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); color: var(--ink); }

a { color: var(--navy); text-decoration: none; }

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

::selection { background: var(--navy); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--red);
  flex: none;
}

/* --------------------------------------------------------------------------
   3. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: #fff;
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   4. Masthead + folio
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

/* Navy rule with a red segment — signature brand bar */
.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--navy) 0 72%, var(--red) 72% 100%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 66px;
}

.logo {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.logo span { color: var(--red); }

.logo:hover { color: var(--navy); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 30px);
}

.nav a {
  position: relative;
  padding: 6px 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.nav a:hover::after,
.nav a:focus-visible::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 40px;
  padding: 0 11px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dateline strip under the masthead */
.folio {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.folio-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 40px;
  flex-wrap: wrap;
}

.folio-date {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.folio-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.folio-nav a {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}

.folio-nav a:hover { color: var(--red); }

/* Reading progress (post page only) */
.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  overflow: hidden;
}

.read-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--red);
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   5. Front page — lead story + most-read rail
   -------------------------------------------------------------------------- */
.front { background: var(--paper); }

.front-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 30px 0 14px;
  border-bottom: 3px solid var(--ink);
}

.front-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.front-label::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--red);
  flex: none;
}

.front-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.front-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.front-grid.has-rail {
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, 1fr);
}

.lead {
  padding: 34px 0 42px;
}

.front-grid.has-rail .lead {
  padding-right: 42px;
  border-right: 1px solid var(--rule);
}

.lead-media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--surface-2);
}

.lead-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.lead-media:hover img { transform: scale(1.03); }

.kicker-live {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.kicker-live .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.65); }
}

.lead-body { padding-top: 22px; }

.kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}

.lead-title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 3.9vw, 3.15rem);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  line-height: 1.04;
  letter-spacing: -0.022em;
}

.lead-title a {
  color: var(--ink);
  transition: color 0.2s ease;
}

.lead-title a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.lead-deck {
  margin: 0 0 20px;
  max-width: 62ch;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--muted);
}

.lead-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--navy);
  letter-spacing: 0.12em;
}

.read-link::after {
  content: "\2192";
  transition: transform 0.2s ease;
}

.read-link:hover { color: var(--red); }
.read-link:hover::after { transform: translateX(4px); }

/* Most-read rail */
.rail {
  padding: 34px 0 42px 36px;
}

.rail-title {
  margin: 0 0 4px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  font-variation-settings: "opsz" 80;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.rail-title small {
  display: block;
  margin-bottom: 7px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.rail-list {
  counter-reset: rank;
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-top: 0;
}

.rail .post-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 15px;
  padding: 15px 16px 17px;
  border: 0;
  background: var(--surface);
}

.rail .post-card::after {
  counter-increment: rank;
  content: counter(rank, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  padding: 5px 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.rail .post-card:hover { background: var(--paper); }

.rail .post-card > a { display: block; }

.rail .post-card img {
  width: 104px;
  height: 78px;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.rail .post-card-body { padding: 0; gap: 6px; }

.rail .post-card .post-meta {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rail .post-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  font-variation-settings: "opsz" 30;
  line-height: 1.28;
}

.rail .post-card h3 a { color: var(--ink); }

.rail .post-card h3 a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

.rail .post-card .desc,
.rail .post-card .tag,
.rail .post-card .read-more { display: none; }

.rail-note {
  margin: 26px 0 0;
  padding: 18px 18px 20px;
  background: var(--surface-2);
  border-left: 3px solid var(--navy);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

.rail-note strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.rail-note a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(16, 54, 122, 0.35);
  text-underline-offset: 3px;
}

.rail-note a:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

/* --------------------------------------------------------------------------
   6. Empty front page (site with zero posts)
   -------------------------------------------------------------------------- */
.front-empty {
  padding: clamp(56px, 9vw, 104px) 0 clamp(56px, 9vw, 96px);
  border-bottom: 1px solid var(--rule);
}

.front-empty .container { max-width: 820px; }

.front-empty h1 {
  margin: 22px 0 18px;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.empty-lede {
  margin: 0 0 34px;
  max-width: 58ch;
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--muted);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   7. Sections & section heads
   -------------------------------------------------------------------------- */
.section { padding: clamp(44px, 6vw, 64px) 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--ink);
}

.section-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 900;
  font-variation-settings: "opsz" 100;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.section-title small {
  display: block;
  margin-bottom: 7px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.section-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
}

.section-link::after { content: "\2192"; transition: transform 0.2s ease; }

.section-link:hover { color: var(--red); }
.section-link:hover::after { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   8. Latest stories strip
   -------------------------------------------------------------------------- */
.gallery-section {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.gallery-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 14px;
}

.gallery-scroll::-webkit-scrollbar { height: 6px; }
.gallery-scroll::-webkit-scrollbar-track { background: var(--surface-2); }
.gallery-scroll::-webkit-scrollbar-thumb { background: var(--navy); }

.gallery-card {
  position: relative;
  flex: 0 0 300px;
  height: 210px;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--ink);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.3s ease;
}

.gallery-card:hover img {
  transform: scale(1.05);
  opacity: 1;
}

.gallery-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 42px 16px 15px;
  background: linear-gradient(transparent, rgba(10, 12, 16, 0.88));
}

.gallery-date {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ff8a8f;
}

.gallery-overlay h3 {
  margin: 0;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
  font-variation-settings: "opsz" 40;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   9. Topic channels
   -------------------------------------------------------------------------- */
.trend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.trend-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 160px;
  overflow: hidden;
  background: var(--ink);
}

.trend-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.3s ease;
}

.trend-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(10, 12, 16, 0.15), rgba(10, 12, 16, 0.82));
}

.trend-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.trend-card:hover img { transform: scale(1.06); opacity: 0.9; }
.trend-card:hover::after { transform: scaleX(1); }

.trend-card span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 16px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.01em;
}

.trend-card span::after {
  content: "\2192";
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: transform 0.25s ease;
  color: #ff8a8f;
}

.trend-card:hover span::after { transform: translateX(5px); }

/* --------------------------------------------------------------------------
   10. Post cards / all stories grid
   -------------------------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  padding: 22px 22px 24px;
  transition: background 0.25s ease;
}

.post-card:hover { background: #fffdf8; }

.post-card > a { display: block; overflow: hidden; }

.post-card img {
  width: 100%;
  height: 195px;
  object-fit: cover;
  border: 1px solid var(--rule);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.post-card:hover img { transform: scale(1.03); }

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding-top: 16px;
}

.post-meta {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-card h3 {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 700;
  font-variation-settings: "opsz" 48;
  line-height: 1.26;
  letter-spacing: -0.01em;
}

.post-card h3 a { color: var(--ink); transition: color 0.2s ease; }

.post-card h3 a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.post-card p.desc {
  margin: 0;
  flex: 1;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--muted);
}

.tag {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 4px 9px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
}

.read-more::after { content: "\2192"; transition: transform 0.2s ease; }

.read-more:hover { color: var(--red); }

.read-more:hover::after { transform: translateX(4px); }

/* Featured first card — breaks the uniform grid */
@media (min-width: 900px) {
  .post-grid .post-card:first-child {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
  }

  .post-grid .post-card:first-child img {
    height: 100%;
    min-height: 300px;
  }

  .post-grid .post-card:first-child .post-card-body { padding-top: 0; }

  .post-grid .post-card:first-child h3 {
    font-size: clamp(1.5rem, 2.2vw, 1.9rem);
    font-weight: 900;
    font-variation-settings: "opsz" 72;
    line-height: 1.14;
  }

  .post-grid .post-card:first-child p.desc { font-size: 1rem; }
}

.empty-state {
  margin: 0;
  padding: 54px 24px;
  background: var(--surface);
  border: 1px dashed var(--rule-strong);
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

.empty-state a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

.empty-state a:hover { color: var(--red); }

/* --------------------------------------------------------------------------
   11. Article page
   -------------------------------------------------------------------------- */
.post-head {
  max-width: 900px;
  padding-top: clamp(36px, 6vw, 60px);
}

.post-head .eyebrow { margin-bottom: 18px; }

.post-title {
  margin: 0 0 20px;
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.post-deck {
  margin: 0 0 26px;
  max-width: 60ch;
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1.8vw, 1.35rem);
  font-weight: 600;
  font-variation-settings: "opsz" 40;
  line-height: 1.5;
  color: #454e5e;
}

.byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 15px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.byline .post-meta { margin: 0; }

.post-tags { display: flex; flex-wrap: wrap; }

.post-figure {
  max-width: 1040px;
  margin-top: clamp(26px, 4vw, 40px);
}

.post-figure img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.post-figure.is-empty { display: none; }

/* --------------------------------------------------------------------------
   12. Prose (article body + static pages)
   -------------------------------------------------------------------------- */
.article-content {
  max-width: var(--measure);
  margin: 0 auto;
  font-size: 1.06rem;
  line-height: 1.75;
  color: #2b3240;
}

.article-content > *:first-child { margin-top: 0; }

.article-content p { margin: 0 0 1.15em; }

.article-content h2 {
  margin: 2.5rem 0 1rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.4rem, 2.4vw, 1.65rem);
  font-weight: 900;
  font-variation-settings: "opsz" 60;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.article-content h3 {
  margin: 2rem 0 0.8rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
}

.article-content h4 {
  margin: 1.6rem 0 0.7rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.article-content a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(16, 54, 122, 0.4);
}

.article-content a:hover {
  color: var(--red);
  text-decoration-color: var(--red);
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.3em;
  padding-left: 1.25em;
}

.article-content li { margin: 0.45em 0; }

.article-content li::marker { color: var(--navy); }

.article-content strong { color: var(--ink); font-weight: 700; }

.article-content blockquote {
  margin: 2rem 0;
  padding: 0.3rem 0 0.3rem 1.4rem;
  border-left: 3px solid var(--red);
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 600;
  font-style: italic;
  font-variation-settings: "opsz" 40;
  line-height: 1.5;
  color: var(--ink);
}

.article-content code {
  padding: 0.12em 0.4em;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 0.87em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.article-content pre {
  margin: 1.7rem 0;
  padding: 18px 20px;
  background: var(--ink);
  color: #e9e6df;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.87rem;
  line-height: 1.6;
}

.article-content pre code {
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
}

.article-content hr {
  border: 0;
  width: 64px;
  height: 3px;
  margin: 2.6rem auto;
  background: var(--ink);
}

.article-content img { margin: 1.3rem 0; }

/* Drop cap on the opening paragraph */
.post-body,
.page-body {
  margin-top: clamp(30px, 5vw, 44px);
}

.post-body > p:first-child::first-letter,
.page-body > p:first-child::first-letter {
  float: left;
  margin: 0.06em 0.1em 0 0;
  font-family: var(--font-display);
  font-size: 3.6em;
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  line-height: 0.8;
  color: var(--navy);
}

/* Related stories */
.related-list {
  counter-reset: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.related-list li {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 22px;
  background: var(--surface);
  transition: background 0.25s ease;
}

.related-list li:hover { background: #fffdf8; }

.related-list a {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  font-variation-settings: "opsz" 40;
  line-height: 1.3;
  color: var(--ink);
}

.related-list a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 4px;
}

.related-list .related-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
}

.related-list .related-arrow::after {
  content: "\2192";
  transition: transform 0.2s ease;
}

.related-list li:hover .related-arrow { color: var(--red); }
.related-list li:hover .related-arrow::after { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   13. Static pages (about / contact / privacy / disclaimer)
   -------------------------------------------------------------------------- */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}

.page-head .container {
  padding-top: clamp(38px, 6vw, 60px);
  padding-bottom: clamp(26px, 4vw, 38px);
}

.page-head .eyebrow { margin-bottom: 18px; }

.page-title {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  line-height: 1.03;
  letter-spacing: -0.028em;
}

.page-body-wrap { padding-top: clamp(34px, 5vw, 52px); }

.page-body-wrap .article-content { max-width: 720px; }

.page-body { margin-top: 0; }

/* --------------------------------------------------------------------------
   14. 404
   -------------------------------------------------------------------------- */
.notfound {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 9vw, 104px);
}

.nf-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 64px) clamp(24px, 5vw, 56px);
  background: var(--paper);
  border: 1px solid var(--rule);
  text-align: center;
}

.nf-inner .eyebrow { justify-content: center; }

.nf-inner .eyebrow::before { display: none; }

.nf-num {
  margin: 22px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(5.5rem, 20vw, 10.5rem);
  font-weight: 900;
  font-variation-settings: "opsz" 144;
  line-height: 0.86;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.nf-num span { color: var(--red); }

.nf-title {
  margin: 18px 0 14px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 900;
  font-variation-settings: "opsz" 80;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.nf-lede {
  margin: 0 auto 32px;
  max-width: 52ch;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--muted);
}

.nf-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: clamp(48px, 7vw, 72px);
  background: var(--ink);
  color: var(--footer-text);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 44px;
  padding: clamp(44px, 6vw, 60px) 0 clamp(36px, 5vw, 48px);
}

.site-footer .logo {
  display: inline-block;
  color: var(--paper);
  font-size: 1.5rem;
}

.site-footer .logo:hover { color: var(--paper); }

.foot-blurb {
  margin: 18px 0 20px;
  max-width: 44ch;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--footer-text);
}

.foot-mail {
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: rgba(250, 249, 247, 0.35);
  text-underline-offset: 4px;
  word-break: break-all;
}

.foot-mail:hover {
  color: #ff8a8f;
  text-decoration-color: #ff8a8f;
}

.foot-head {
  margin: 0 0 4px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
}

.foot-head::after {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  margin-top: 10px;
  background: var(--red);
}

.foot-col {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.foot-col .foot-head { margin-bottom: 6px; }

.foot-col nav {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.foot-col a {
  font-size: 0.95rem;
  color: var(--footer-text);
  transition: color 0.2s ease, transform 0.2s ease;
}

.foot-col a:hover {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 4px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer-bottom {
  border-top: 1px solid rgba(250, 249, 247, 0.14);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding-top: 20px;
  padding-bottom: 24px;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: #97a0ad;
}

.footer-bottom a {
  color: #cdd3dc;
  text-decoration: underline;
  text-decoration-color: rgba(205, 211, 220, 0.4);
  text-underline-offset: 3px;
}

.footer-bottom a:hover {
  color: var(--paper);
  text-decoration-color: var(--red);
}

/* --------------------------------------------------------------------------
   16. Admin (classes used by /admin — restyled to match the new palette)
   -------------------------------------------------------------------------- */
.admin-body { background: var(--bg); }

.admin-wrap { max-width: 460px; margin: 80px auto; padding: 0 20px; }

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
}

.admin-card h1 {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.admin-card .sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.error-msg {
  background: #fdecec;
  color: #a1121c;
  border: 1px solid #f3c9cc;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.success-msg {
  background: #e9f5ee;
  color: #0b6b51;
  border: 1px solid #c6e4d5;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.admin-panel { max-width: 900px; margin: 50px auto; padding: 0 20px; }

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.admin-top h1 {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.form-grid {
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
}

.form-group { margin-bottom: 4px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.form-group textarea {
  min-height: 320px;
  font-family: Consolas, monospace;
  line-height: 1.6;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.check-row input { width: auto; }

.post-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.post-row .danger {
  color: #a1121c;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   17. Motion
   -------------------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.front .front-head { animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.front .lead { animation: rise 0.65s cubic-bezier(0.2, 0.7, 0.3, 1) 0.08s both; }
.front .rail { animation: rise 0.65s cubic-bezier(0.2, 0.7, 0.3, 1) 0.2s both; }
.front-empty .container > * { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.front-empty .container > *:nth-child(2) { animation-delay: 0.08s; }
.front-empty .container > *:nth-child(3) { animation-delay: 0.16s; }
.front-empty .container > *:nth-child(4) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1040px) {
  .front-grid.has-rail { grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); }

  .front-grid.has-rail .lead { padding-right: 30px; }

  .rail { padding-left: 26px; }

  .trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .front-grid.has-rail { grid-template-columns: minmax(0, 1fr); }

  .front-grid.has-rail .lead {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .rail { padding: 30px 0 38px; }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px;
  }

  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .nav-toggle { display: flex; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px var(--gutter) 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--ink);
    box-shadow: 0 14px 24px rgba(17, 20, 24, 0.08);
  }

  body.nav-open .nav { display: flex; }

  .nav a {
    padding: 15px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.88rem;
  }

  .nav a:last-child { border-bottom: 0; }

  .nav a::after { display: none; }

  .header-inner { min-height: 60px; }

  .read-progress { bottom: -1px; }

  .gallery-card { flex: 0 0 78vw; height: 200px; }

  .post-grid { grid-template-columns: minmax(0, 1fr); }

  .byline { align-items: flex-start; }

  .read-link { margin-left: 0; }

  .lead-meta span[aria-hidden="true"] { display: none; }

  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }

  .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  :root { --gutter: 18px; }

  .folio-nav { display: none; }

  .trend-grid { grid-template-columns: minmax(0, 1fr); }

  .trend-card { height: 130px; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }

  .lead-title { font-size: clamp(1.85rem, 8vw, 2.4rem); }

  .post-title { font-size: clamp(1.85rem, 8vw, 2.5rem); }

  .article-content blockquote { font-size: 1.18rem; }

  .empty-actions .btn,
  .nf-actions .btn { width: 100%; }

  .two-col { grid-template-columns: 1fr; }

  .admin-top { flex-direction: column; align-items: flex-start; }

  .post-row { flex-direction: column; align-items: flex-start; }
}
