/* ============================================================
   OMICA — EDITORIAL ESSAYS / ARTICLES
   Substack & Stripe Press inspired typographic craftsmanship
   Focused single-column reading experience (720px)
   ============================================================ */

.article-page {
  --article-rule: rgba(17, 13, 23, 0.08);
  --article-border: rgba(17, 13, 23, 0.1);
  --article-measure: 720px;
  background-color: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Centered reading column ───────────────────────────────── */
.article-container {
  width: 100%;
  max-width: var(--article-measure);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
  box-sizing: border-box;
}

/* ── Hero / Header ─────────────────────────────────────────── */
.article-hero {
  padding-top: calc(var(--nav-gap, 16px) + var(--nav-h, 52px) + clamp(40px, 5.5vw, 68px));
  padding-bottom: clamp(32px, 4.5vw, 48px);
}

.article-hero-inner {
  width: 100%;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-bottom: clamp(28px, 4vw, 36px);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm, 12px);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.article-back:hover {
  color: var(--blue);
  transform: translateX(-3px);
}

.article-hero .pt-eyebrow,
.article-eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.article-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 48px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

.article-deck {
  margin: clamp(18px, 2.5vw, 24px) 0 0;
  font-family: var(--font-sans);
  font-size: clamp(19px, 1.75vw, 21.5px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-muted);
  text-wrap: pretty;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(24px, 3.5vw, 32px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--article-rule);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.article-meta span + span::before {
  content: "·";
  margin-right: 12px;
  color: var(--line);
}

/* ── Fallback lead if left anywhere ────────────────────────── */
.article-lead {
  display: none !important;
}

/* ── Body Copy ─────────────────────────────────────────────── */
.article-body {
  display: block;
  width: 100%;
}

.article-copy {
  display: block;
  width: 100%;
  padding-top: clamp(16px, 2.5vw, 24px);
}

.article-copy section {
  margin: 0;
  padding: 0;
  border: none;
}

.article-copy section + section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-copy h2 {
  margin: clamp(44px, 5.5vw, 60px) 0 18px;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 28.5px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.article-copy section:first-of-type h2:first-child {
  margin-top: 8px;
}

.article-copy p {
  margin: 0 0 24px;
  font-family: var(--font-sans);
  font-size: clamp(18px, 1.2vw, 19px);
  line-height: 1.7;
  color: var(--ink);
  letter-spacing: -0.003em;
}

.article-copy p + p {
  margin-top: 0;
}

.article-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.article-copy sup {
  font-size: 0.65em;
  line-height: 0;
  vertical-align: super;
  padding-left: 1px;
}

.article-copy sup a {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  padding: 1px 3px;
  border-radius: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}

.article-copy sup a:hover {
  background: rgba(48, 27, 235, 0.1);
  color: var(--blue-dark);
}

/* ── Pullquotes / Blockquotes ──────────────────────────────── */
.article-copy blockquote,
blockquote.article-quote {
  margin: clamp(32px, 4.5vw, 44px) 0;
  padding: 8px 0 8px clamp(20px, 3vw, 28px);
  border-left: 3px solid var(--blue);
  font-family: var(--font-sans);
  font-size: clamp(20px, 2vw, 22.5px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background: transparent;
}

.article-copy blockquote p,
blockquote.article-quote p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

/* ── Figures / Images ──────────────────────────────────────── */
.article-figure {
  margin: clamp(36px, 5vw, 52px) 0;
}

.article-figure img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px -4px rgba(17, 13, 23, 0.06);
  border: 1px solid rgba(17, 13, 23, 0.06);
}

.article-figure figcaption {
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-muted);
  text-align: left;
}

/* ── References Section ────────────────────────────────────── */
.article-refs {
  margin-top: clamp(52px, 7vw, 76px);
  padding-top: clamp(32px, 4.5vw, 44px);
  border-top: 1px solid var(--article-rule);
}

.article-refs h2 {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.article-refs ol {
  margin: 0;
  padding-left: 20px;
}

.article-refs li {
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.article-refs li:last-child {
  margin-bottom: 0;
}

.article-refs em {
  font-style: italic;
  color: var(--ink);
}

.article-refs a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(17, 13, 23, 0.25);
  word-break: break-all;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.article-refs a:hover {
  color: var(--blue);
  text-decoration-color: var(--blue);
}

/* ── End of Article / Next Read Card ───────────────────────── */
.article-end {
  margin-top: clamp(56px, 7vw, 84px);
  margin-bottom: clamp(64px, 8vw, 96px);
}

.article-end-card,
.article-end .wrap {
  display: block;
  padding: clamp(28px, 4.5vw, 40px);
  background: var(--paper-card);
  border: 1px solid var(--article-border);
  border-radius: 16px;
  text-decoration: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.article-end-card:hover,
.article-end .wrap:hover {
  border-color: rgba(48, 27, 235, 0.25);
  box-shadow: 0 8px 24px -6px rgba(17, 13, 23, 0.06);
}

.article-end-eyebrow {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
}

.article-end h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.article-end a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

.article-end a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Legacy aside cleanup in case cached ───────────────────── */
.article-aside {
  display: none !important;
}

/* ── Mobile adjustments ────────────────────────────────────── */
@media (max-width: 640px) {
  .article-container {
    padding-inline: 20px;
  }
  .article-hero h1 {
    font-size: clamp(30px, 8.5vw, 38px);
    line-height: 1.18;
  }
  .article-deck {
    font-size: 18px;
    line-height: 1.5;
  }
  .article-copy p {
    font-size: 17.5px;
    line-height: 1.65;
    margin-bottom: 20px;
  }
  .article-copy h2 {
    font-size: 23px;
    margin-top: 38px;
    margin-bottom: 14px;
  }
}
