/* ============================================================
   ELSE — Article / blog post styles (new design system)
   Off-white theme on top of landing.css tokens.
   Re-styles the legacy article class names (.article-hero,
   .article-body, .bluf-answer, .faq-block, .sidebar-toc,
   .related, .article-cta, etc.) to match the new homepage.
   Pairs with /css/landing.css (shared header / footer / tokens).
   ============================================================ */

/* ---------- base ---------- */
html, body { margin: 0; padding: 0; background: #FBFAF8; }
* { box-sizing: border-box; }
body {
  background: #FBFAF8;
  color: #15120F;
  font-family: 'Inter Tight', sans-serif;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 90, 31, 0.22); }
html { scroll-behavior: smooth; }

/* anchor offset for sticky capsule header */
[id] { scroll-margin-top: 96px; }

a { color: #FF5A1F; }

/* legacy CSS-var fallbacks for inline styles that survived from the
   old site.css (e.g. the author byline) — remapped to the new theme */
:root {
  --accent: #FF5A1F;
  --txt-3: rgba(21, 18, 15, 0.45);
}

/* faint precision grid backdrop (matches homepage) */
.article-grid-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.6;
  background-image:
    linear-gradient(rgba(21, 18, 15, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 18, 15, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 40% at 50% 0%, #000 26%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 40% at 50% 0%, #000 26%, transparent 72%);
}
.article-shell { position: relative; z-index: 1; }

/* ---------- shared width wrappers ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: clamp(20px, 5vw, 56px); box-sizing: border-box; }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding-inline: clamp(20px, 5vw, 56px); box-sizing: border-box; }

/* ---------- reveal (intersection-observer fade up) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.06s; }
.reveal.d2 { transition-delay: 0.12s; }
.reveal.d3 { transition-delay: 0.18s; }

/* ============================================================
   ARTICLE HERO
   ============================================================ */
.article-hero {
  position: relative;
  padding: clamp(20px, 4vh, 44px) 0 clamp(24px, 4vh, 48px);
}

.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  color: rgba(21, 18, 15, 0.5);
  margin-bottom: 22px;
}
.breadcrumb a { color: rgba(21, 18, 15, 0.5); text-decoration: none; transition: color 0.2s ease; }
.breadcrumb a:hover { color: #FF5A1F; }
.breadcrumb span { color: rgba(21, 18, 15, 0.3); }

.article-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #FF4407; background: #FFE3D4;
  border: 1px solid rgba(255, 90, 31, 0.28);
  border-radius: 999px; padding: 8px 15px;
  margin-bottom: 22px;
}
.article-label svg { width: 12px; height: 12px; }

.article-h1 {
  font-size: clamp(30px, 4.6vw, 56px);
  font-weight: 800; line-height: 1.04; letter-spacing: -0.03em;
  margin: 0 0 22px; max-width: 20ch;
}

.article-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 26px; }
.meta-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: rgba(21, 18, 15, 0.55);
}
.meta-item svg { flex-shrink: 0; color: #FF5A1F; opacity: 0.85; }

.article-intro {
  font-size: clamp(16px, 1.4vw, 19px); line-height: 1.65;
  color: rgba(21, 18, 15, 0.66); max-width: 64ch; margin: 0 0 30px;
}

.hero-banner {
  position: relative; width: 100%; height: clamp(150px, 24vw, 220px);
  border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(21, 18, 15, 0.08);
  box-shadow: 0 20px 50px rgba(21, 18, 15, 0.1);
}
.hero-banner-inner { width: 100%; height: 100%; }
.hero-banner-inner svg { width: 100%; height: 100%; display: block; }

/* ============================================================
   ARTICLE BODY LAYOUT
   ============================================================ */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(36px, 5vw, 72px);
  align-items: start;
  padding: clamp(8px, 2vh, 24px) 0 clamp(48px, 7vh, 88px);
}

.article-content { min-width: 0; max-width: 760px; }

.article-content h2 {
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.12;
  margin: 48px 0 16px;
}
.article-content h2:first-child { margin-top: 0; }
.article-content h3 {
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 700; letter-spacing: -0.01em; line-height: 1.25;
  margin: 32px 0 10px;
}
.article-content p {
  font-size: clamp(15.5px, 1.2vw, 17px); line-height: 1.7;
  color: rgba(21, 18, 15, 0.78); margin: 0 0 18px;
}
.article-content ul, .article-content ol { padding-left: 24px; margin: 0 0 18px; }
.article-content li {
  font-size: clamp(15.5px, 1.2vw, 17px); line-height: 1.7;
  color: rgba(21, 18, 15, 0.78); margin-bottom: 8px;
}
.article-content strong { color: #15120F; font-weight: 700; }
.article-content em { color: #FF4407; font-style: normal; font-weight: 600; }
.article-content a:not(.btn) {
  color: #FF4407; text-decoration: none;
  border-bottom: 1px solid rgba(255, 90, 31, 0.35);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.article-content a:not(.btn):hover { color: #FF5A1F; border-bottom-color: #FF5A1F; }

/* ---------- BLUF answer callout ---------- */
.bluf-answer {
  background: #FFFFFF;
  border: 1px solid rgba(21, 18, 15, 0.08);
  border-left: 4px solid #FF5A1F;
  border-radius: 0 14px 14px 0;
  padding: 16px 20px;
  margin: 6px 0 24px;
  font-size: clamp(14.5px, 1.1vw, 15.5px);
  line-height: 1.65;
  color: rgba(21, 18, 15, 0.72);
  box-shadow: 0 2px 6px rgba(21, 18, 15, 0.04);
}
.bluf-answer strong { color: #FF4407; }

/* ---------- generic callout ---------- */
.callout {
  background: linear-gradient(135deg, rgba(255, 122, 56, 0.09), rgba(255, 68, 7, 0.05));
  border: 1px solid rgba(255, 90, 31, 0.22);
  border-radius: 16px;
  padding: 22px 24px;
  margin: 24px 0;
}
.callout-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #FF4407; margin-bottom: 10px;
}
.callout p {
  margin: 0; font-size: clamp(14.5px, 1.1vw, 16px); line-height: 1.65;
  color: rgba(21, 18, 15, 0.74);
}
.callout p em { color: #FF4407; font-style: normal; font-weight: 600; }

/* ---------- code block ---------- */
.code-block {
  background: #15120F;
  color: #F4F1EE;
  border: 1px solid rgba(21, 18, 15, 0.1);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 22px 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  box-shadow: 0 14px 34px rgba(21, 18, 15, 0.18);
}

/* ---------- divider ---------- */
.divider { height: 1px; background: rgba(21, 18, 15, 0.1); margin: 40px 0; border: none; }

/* ============================================================
   FAQ BLOCK
   ============================================================ */
.faq-block { margin: 18px 0 28px; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: #FFFFFF;
  border: 1px solid rgba(21, 18, 15, 0.1);
  border-radius: 16px;
  padding: clamp(18px, 2.2vw, 24px) clamp(18px, 2.4vw, 26px);
  box-shadow: 0 1px 2px rgba(21, 18, 15, 0.04);
}
.faq-q-text {
  font-size: clamp(15.5px, 1.4vw, 17.5px);
  font-weight: 700; letter-spacing: -0.01em; line-height: 1.3;
  color: #15120F; margin-bottom: 9px;
}
.faq-q-text::before { content: "Q: "; color: #FF5A1F; }
.faq-a-text {
  font-size: clamp(14px, 1.1vw, 15px); line-height: 1.65;
  color: rgba(21, 18, 15, 0.66); padding-left: 18px;
}

/* ============================================================
   SIDEBAR TOC
   ============================================================ */
.article-sidebar { position: sticky; top: 96px; }
.sidebar-toc {
  background: #FFFFFF;
  border: 1px solid rgba(21, 18, 15, 0.1);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 2px 6px rgba(21, 18, 15, 0.04);
}
.sidebar-toc-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(21, 18, 15, 0.4); margin-bottom: 16px;
}
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.toc-list li { margin: 0; }
.toc-list a {
  display: block;
  font-size: 14px; line-height: 1.4; font-weight: 500;
  color: rgba(21, 18, 15, 0.62);
  text-decoration: none;
  padding: 8px 10px; border-radius: 9px;
  border-left: 2px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.toc-list a:hover {
  color: #15120F; background: rgba(255, 90, 31, 0.06);
  border-left-color: #FF5A1F;
}

/* ============================================================
   ARTICLE CTA BOX (dark block)
   ============================================================ */
.article-cta {
  position: relative; overflow: hidden;
  background: #15120F; color: #F4F1EE;
  border-radius: 22px;
  padding: clamp(28px, 3.4vw, 40px);
  margin: 36px 0;
  box-shadow: 0 24px 56px rgba(21, 18, 15, 0.24);
}
.article-cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 120, 60, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 120, 60, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(120% 80% at 20% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(120% 80% at 20% 0%, #000 30%, transparent 80%);
}
.article-cta::after {
  content: ""; position: absolute; top: -30%; right: -6%;
  width: 48%; height: 80%; pointer-events: none;
  background: radial-gradient(circle at 70% 30%, rgba(255, 90, 31, 0.2), transparent 62%);
}
.article-cta > * { position: relative; z-index: 1; }
.cta-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #FF8A52; margin-bottom: 12px;
}
.article-cta h3 {
  font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.1; margin: 0 0 12px; color: #F4F1EE;
}
.article-cta p {
  font-size: clamp(14.5px, 1.2vw, 16.5px); line-height: 1.6;
  color: rgba(244, 241, 238, 0.7); margin: 0 0 24px; max-width: 56ch;
}
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer;
  border-radius: 999px; padding: 15px 26px;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(135deg, #FF7A38, #FF4407);
  box-shadow: 0 14px 32px rgba(255, 77, 15, 0.32);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ============================================================
   RELATED ARTICLES
   ============================================================ */
.related {
  position: relative; z-index: 1;
  padding: clamp(40px, 6vh, 72px) 0;
  border-top: 1px solid rgba(21, 18, 15, 0.08);
}
.related-title {
  font-size: clamp(22px, 2.6vw, 32px); font-weight: 800; letter-spacing: -0.025em;
  margin: 0 0 clamp(24px, 4vh, 36px);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}
.related-card {
  display: flex; flex-direction: column;
  background: #FFFFFF;
  border: 1px solid rgba(21, 18, 15, 0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(21, 18, 15, 0.04);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.related-card:hover {
  border-color: rgba(255, 90, 31, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(21, 18, 15, 0.1);
}
.related-thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(150deg, #FFF1E9, #FFFFFF);
}
.related-thumb svg { width: 100%; height: 100%; display: block; }
.related-card .related-tag {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #FF5A1F; padding: 22px 24px 0;
}
.related-card h3 {
  font-size: clamp(17px, 1.5vw, 20px); font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.25; margin: 10px 0 0; padding: 0 24px;
}
.related-card h3 a { color: inherit; text-decoration: none; }
.related-card > p {
  font-size: 14px; line-height: 1.6; color: rgba(21, 18, 15, 0.6);
  margin: 10px 0 auto; padding: 0 24px;
}
.read-more {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: #FF5A1F; text-decoration: none;
  padding: 16px 24px 24px;
  transition: gap 0.2s ease;
}
.read-more:hover { gap: 11px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .article-layout { grid-template-columns: 1fr; gap: 40px; }
  .article-sidebar { position: static; order: -1; }
  .sidebar-toc { background: rgba(255, 255, 255, 0.7); }
  .article-content { max-width: none; }
}

@media (max-width: 560px) {
  .article-h1 { font-size: clamp(27px, 8vw, 36px); }
  .hero-banner { height: 130px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
