/* ============================================================
   plena-as-prophecy.css — Article page
   Design system: warm-earth, serif-led, magazine direction.
   Scoped to body.blog-article-page and .article.
   ============================================================ */

/* ── Design tokens (override base.css on this page) ── */
:root {
  --paper:           oklch(0.986 0.008 83);
  --paper-sand:      oklch(0.963 0.019 82);
  --ink:             oklch(0.255 0.012 55);
  --ink-soft:        oklch(0.430 0.020 50);
  --ink-faint:       oklch(0.560 0.020 55);
  --rule:            oklch(0.865 0.020 72);
  --rule-strong:     oklch(0.760 0.025 65);
  --terracotta:      oklch(0.555 0.130 40);
  --terracotta-deep: oklch(0.460 0.120 38);
  --ochre:           oklch(0.680 0.100 72);
  --sand:            oklch(0.905 0.030 80);

  --font-text:    "Newsreader", Georgia, "Times New Roman", serif;
  --font-display: "Newsreader", Georgia, serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace;
  --font-ui:      ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 39rem;
  --page:    39rem;
  --gutter:  1.5rem;
}

/* ── Page base ── */
body.blog-article-page {
  background: transparent;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.18rem;
  line-height: 1.72;
  font-weight: 400;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  position: relative;
}

/* ── Full-page background container ── */
#article-bg-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Four quarter-height slots: top, bottom, top, bottom */
#article-bg-1,
#article-bg-2,
#article-bg-3,
#article-bg-4 {
  position: absolute;
  left: 0;
  width: 100%;
  height: 25%;
  overflow: hidden;
  filter: blur(6px);
}

#article-bg-1 { top: 0;   }
#article-bg-2 { top: 25%; }
#article-bg-3 { top: 50%; }
#article-bg-4 { top: 75%; }

/* ── Nav: same positioning as blog/about pages ── */
.blog-article-page .hero__logo-group {
  position: absolute;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.blog-article-page .hero__social-link img {
  mix-blend-mode: normal;
}

/* ── Selection ── */
::selection { background: color-mix(in oklch, var(--ochre) 35%, transparent); }

/* ── Back link ── */
.article-back {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-decoration: none;
  margin-bottom: 2.8rem;
  transition: color .15s ease;
}
.article-back:hover { color: var(--terracotta); }

/* ── Article links ── */
.article a {
  color: var(--terracotta);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in oklch, var(--terracotta) 45%, transparent);
  transition: color .15s ease, text-decoration-color .15s ease;
}
.article a:hover {
  color: var(--terracotta-deep);
  text-decoration-color: currentColor;
}
.article a:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   ARTICLE STRUCTURE
   ============================================================ */
.article {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(7rem, 10vw, 9rem) var(--gutter) 6rem;
  transition: max-width .3s ease;
  position: relative;
  z-index: 1;
}

.masthead > *,
.body > * {
  max-width: var(--measure);
  margin-inline: auto;
}

/* ── Masthead ── */
.masthead { margin-bottom: clamp(2rem, 4vw, 3.25rem); }

.kicker {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 1.1rem;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.1rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 1.2rem;
  text-wrap: balance;
  color: var(--ink);
}

.byline {
  font-size: 1.02rem;
  color: var(--ink-soft);
  margin: 0 0 0.3rem;
}
.byline .author { font-style: italic; color: var(--ink); }
.byline .handle { white-space: nowrap; }

.dateline {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin: 0;
}
.dateline .dot { margin: 0 0.5em; color: var(--rule-strong); }

/* ── Body copy ── */
.body p {
  margin: 0 0 1.45rem;
  text-wrap: pretty;
}
.body p.lead { margin-top: 0.5rem; }

.body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 1.95rem);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: clamp(2.6rem, 4vw, 3.6rem) auto 1.1rem;
  text-wrap: balance;
  color: var(--ink);
}

.body em, .body i { font-style: italic; }
.body strong { font-weight: 600; }

/* ── Figures ── */
figure { margin: clamp(2.2rem, 4vw, 3.4rem) auto; }

figure img {
  width: 100%;
  border-radius: 2px;
  background: var(--sand);
}

figcaption {
  font-family: var(--font-ui);
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--ink-faint);
  margin-top: 0.7rem;
  max-width: 34rem;
}

figure.lead-figure img {
  max-height: 78vh;
  width: auto;
  margin-inline: auto;
}
figure.lead-figure { text-align: center; }
figure.lead-figure figcaption { text-align: left; display: inline-block; }

figure.breakout { max-width: var(--page); }
figure.breakout--sm { max-width: calc(var(--page) * 0.8); }

figure.pair { max-width: var(--page); }
figure.pair .pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  align-items: end;
}
figure.pair .pair-grid img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 640px) {
  figure.pair .pair-grid { grid-template-columns: 1fr; }
  figure.pair .pair-grid img { height: auto; object-fit: contain; }
}

/* ============================================================
   MAGAZINE DIRECTION (active via data-direction="magazine")
   ============================================================ */
html[data-direction="magazine"] {
  --measure: 41rem;
  --page:    62rem;
  --font-display: "Spectral", Georgia, serif;
}

html[data-direction="magazine"] .title {
  font-weight: 600;
  letter-spacing: -0.015em;
}

html[data-direction="magazine"] .body h2 {
  font-weight: 500;
}

html[data-direction="magazine"] .body h2::before {
  content: "";
  display: block;
  width: 2.4rem;
  height: 2px;
  background: var(--terracotta);
  margin-bottom: 1.1rem;
}

html[data-direction="magazine"] .body p.lead::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 4.4em;
  line-height: 0.78;
  font-weight: 600;
  padding: 0.06em 0.1em 0 0;
  color: var(--terracotta);
}

/* ============================================================
   FOOTER (shared styles, mirrors blog-footer pattern)
   ============================================================ */
.article-footer {
  padding: var(--space-xl, 64px) 0;
  display: flex;
  justify-content: center;
  position: relative;
}

.article-footer .blog-footer__logo-group {
  position: relative;
  display: inline-block;
}

.article-footer .blog-footer__logo-group::before {
  content: '';
  position: absolute;
  left: -38vw;
  right: -38vw;
  top: -4vh;
  bottom: -4vh;
}

.article-footer .blog-footer__logo {
  width: clamp(64px, 8vw, 104px);
  height: auto;
  display: block;
  transform: rotate(180deg);
  transition: transform 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-footer .blog-footer__logo img {
  width: 100%;
  height: auto;
  display: block;
}

.article-footer .blog-footer__logo-group:hover .blog-footer__logo {
  transform: rotate(360deg);
}

.article-footer .blog-footer__left,
.article-footer .blog-footer__right {
  position: absolute;
  top: 50%;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-footer .blog-footer__left {
  right: calc(100% + max(68px, 8vw));
  transform: translateY(-50%) translateX(10px);
}

.article-footer .blog-footer__right {
  left: calc(100% + max(68px, 8vw));
  transform: translateY(-50%) translateX(-10px);
}

.article-footer .blog-footer__logo-group:hover .blog-footer__left,
.article-footer .blog-footer__logo-group:hover .blog-footer__right {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .blog-article-page .hero__logo-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .blog-article-page .hero__logo-socials {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    flex-direction: row;
    gap: 20px;
  }

  .blog-article-page .hero__logo-nav {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    flex-direction: row;
    gap: clamp(16px, 5vw, 28px);
  }
}
