/* Article pages — extends galeja.css design language */

.article-page {
  padding-top: 144px;
  padding-bottom: 128px;
  /* Stacking context at 0: keeps all article descendants (incl. .article-nav borders) below fixed nav (z-index 1000) */
  position: relative;
  z-index: 0;
  /* Do not participate in body’s overflow clipping of the last in-flow block */
  overflow: visible;
}

/* Reading column: max line length + inner inset so text + nav never hug the container edges.
   (.container already pads the viewport; this pads the column content uniformly.) */
.article-column {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding-inline: clamp(0.75rem, 3vw, 1.25rem);
  box-sizing: border-box;
  overflow: visible;
}

.article-header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.article-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* Article detail page — single h1 in header (not listing cards) */
.article-header .article-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 12px;
  color: var(--text);
}

.article-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.5;
  margin-bottom: 16px;
}

.article-header .article-meta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.article-header .article-meta a {
  color: var(--accent);
  text-decoration: none;
}
.article-header .article-meta a:hover {
  text-decoration: underline;
}

.article-body {
  font-size: 16px;
  line-height: 1.75;
  font-weight: 300;
  color: var(--text-muted);
}

.article-body h2 {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 36px 0 14px;
}

.article-body h3 {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 10px;
}

.article-body p {
  margin-bottom: 1em;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1em 1.25em;
  padding: 0;
}

.article-body li {
  margin-bottom: 0.4em;
}

/* Article body only — never target bare blockquote globally (avoids leaking into section chrome) */
.article-body blockquote {
  margin: 1.25em 0;
  padding-left: 18px;
  border-left: 2px solid var(--accent-dim);
  color: var(--text-muted);
}

.article-body code {
  font-family: 'DM Mono', monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 2px 6px;
  border: 1px solid var(--border);
}

.article-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 1.25em 0;
  font-size: 13px;
}

.article-body pre code {
  border: none;
  padding: 0;
  background: transparent;
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
}
.article-body a:hover {
  border-bottom-color: var(--accent);
}

/* Not the site header (#nav) — stay in flow at end of article; never fixed full-bleed */
.article-nav {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  z-index: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 1rem 1.5rem;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.article-nav__prev {
  min-width: 0;
  text-align: left;
}

.article-nav__next {
  min-width: 0;
  text-align: right;
}

.article-nav > .article-nav__prev:only-child,
.article-nav > .article-nav__next:only-child {
  grid-column: 1 / -1;
}

.article-nav > .article-nav__next:only-child {
  text-align: right;
}

@media (max-width: 520px) {
  .article-nav {
    grid-template-columns: 1fr;
  }
  .article-nav > .article-nav__prev:only-child,
  .article-nav > .article-nav__next:only-child {
    grid-column: auto;
  }
  .article-nav__next {
    text-align: left;
  }
  .article-nav > .article-nav__next:only-child {
    text-align: left;
  }
}

.article-nav a {
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.article-nav a:hover {
  color: var(--accent);
}

.article-section {
  border-top: 1px solid var(--border);
  padding: 88px 0 72px;
  background: var(--bg);
}

.article-section--listing {
  background: var(--bg);
}

.article-section--muted {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* /articles/ index: extra bottom padding so the assessment CTA clears the footer edge */
.article-section.article-hub {
  padding-bottom: 120px;
  overflow: visible;
}

/* —— /articles/ hub: header uses global .section-header + .section-label (green) —— */

/* —— Insight cards (homepage Latest articles, /articles/, related) —— */
.insight-list {
  max-width: 980px;
  display: grid;
  gap: 20px;
  margin-top: 0;
}

.insight-card {
  margin: 0;
}

.insight-card__body {
  margin: 0;
}

.insight-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px 20px;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.insight-card__link:hover,
.insight-card__link:focus-visible {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.insight-card__title,
.insight-card__title a {
  margin: 0;
  color: #f3f1ea;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-decoration: none !important;
}

.insight-card__summary {
  margin: 14px 0 0 0;
  color: rgba(243, 241, 234, 0.72);
  font-size: 15px;
  line-height: 1.5;
  max-width: 46ch;
}

.insight-card__meta {
  margin-top: 16px;
  color: rgba(243, 241, 234, 0.46);
  font-size: 12px;
  letter-spacing: 0.02em;
  opacity: 0.6;
}

.related-block {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.article-all-link {
  margin-top: 40px;
}

/* Shared: /articles/ hub + bottom of each article page */
.article-cta-bar {
  margin-top: 48px;
  padding-top: 40px;
  padding-bottom: 56px;
  margin-bottom: max(0px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.article-all-link a {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.article-all-link a:hover {
  color: var(--text-muted);
}

.related-block__title {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* Latest articles: “View all” as button below cards (max 2 on homepage) */
.latest-articles__footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 0;
}

.latest-articles__view-all {
  align-self: flex-start;
}

.latest-articles__header .section-intro {
  max-width: 44rem;
  margin-bottom: 56px;
}

@media (max-width: 600px) {
  .article-page {
    padding-top: 104px;
  }
}
