/* ===== Articles ("The Cache") =====
   Layered on /lib/landing.css. Self-contained: index (hero, chips, cards) plus
   long-form article prose. Every value references a landing.css token, so the
   whole surface flips with light/dark automatically — no dark-mode block here. */

/* ----- Index hero ----- */
.cache-hero {
  padding: 140px 32px 48px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-light) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cache-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 28%, rgba(253, 108, 29, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 82% 72%, rgba(253, 108, 29, 0.08) 0%, transparent 50%);
  z-index: 0;
}

.cache-hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.cache-hero-title {
  font-size: 84px;
  font-weight: 800;
  margin: 0 0 18px;
  color: var(--accent);
  letter-spacing: -1.5px;
  line-height: 1.0;
  text-transform: uppercase;
}

.cache-hero-subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 0 auto;
  max-width: 640px;
  line-height: 1.7;
}

.cache-hero-subtitle strong { color: var(--text); font-weight: 600; }

/* ----- Listing section ----- */
.articles-listing {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 32px 72px;
}

/* Theme-tag filter chips (rendered by articles-index.js) */
.article-tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 36px;
  min-height: 38px;
}

.article-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--border-color-strong);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.article-chip i { font-size: 12px; }

.article-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.article-chip-active {
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(253, 108, 29, 0.25);
}

/* Card grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.article-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px 26px 22px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  border-left: 4px solid transparent;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px var(--shadow);
  border-left-color: var(--accent);
}

.article-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  background: var(--hover-bg);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.article-card-tag i { font-size: 11px; }

.article-card h2,
.article-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.article-card-blurb {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.article-card-meta {
  margin-top: auto;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-card-meta .dot { opacity: 0.5; }

.article-card-readmore {
  margin-top: 14px;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: gap 0.2s ease;
}

.article-card:hover .article-card-readmore { gap: 12px; }

/* Featured card — first/lead article spans the full row with a richer layout */
.article-card-featured {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: stretch;
  gap: 28px;
  padding: 32px;
  border-left-width: 4px;
  border-left-color: var(--accent);
  background: linear-gradient(135deg, rgba(253, 108, 29, 0.05) 0%, var(--card-bg) 60%);
}

.article-card-featured .article-card-visual {
  flex: 0 0 132px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(253, 108, 29, 0.25);
}

.article-card-featured .article-card-visual i {
  font-size: 48px;
  color: white;
}

.article-card-featured .article-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.article-card-featured h2 { font-size: 27px; }
.article-card-featured .article-card-blurb { font-size: 15.5px; max-width: 62ch; }

.article-card-featured-flag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 10px;
}

@media (max-width: 680px) {
  .article-card-featured {
    flex-direction: column;
    gap: 20px;
  }
  .article-card-featured .article-card-visual {
    flex-basis: auto;
    width: 100%;
    height: 96px;
  }
}

/* Empty state when a theme has no articles yet */
.articles-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  border: 1px dashed var(--border-color-strong);
  border-radius: 16px;
}

.articles-empty i { font-size: 28px; color: var(--accent); margin-bottom: 12px; }
.articles-empty p { margin: 0; font-size: 15px; }

/* ===== Article title system — tag pill, big title, dek, byline.
   Theme-aware via tokens; a faint accent glow bleeds behind it. ===== */
.fsm-hero {
  position: relative;
  margin: 0 0 36px;
  padding: 12px 0 28px;
  border-bottom: 1px solid var(--border-color);
}

.fsm-hero-bg {
  position: absolute;
  inset: -48px -64px auto -64px;
  height: 320px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 56% 90% at 4% 6%, rgba(253, 108, 29, 0.08) 0%, transparent 60%);
}

.fsm-hero-lede { position: relative; z-index: 1; }

.fsm-hero .article-tag-pill { margin-bottom: 20px; }

.fsm-hero-title {
  margin: 0 0 18px !important;
  font-size: 52px !important;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--text);
}

.fsm-hero-title .accent { color: var(--accent); }

.fsm-hero-dek {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 600px;
}

.fsm-hero-dek strong { color: var(--text); font-weight: 600; }

.fsm-hero-byline {
  margin-top: 28px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fsm-hero-byline .dot { opacity: 0.5; }

@media (max-width: 768px) {
  .fsm-hero-title { font-size: 36px !important; }
  .fsm-hero-dek { font-size: 16px; }
}

/* ===== Long-form article (detail page) ===== */
.article-page {
  padding: 120px 32px 60px;
  background: var(--bg);
  min-height: calc(100vh - 200px);
}

.article {
  max-width: 720px;
  margin: 0 auto;
}

.article-breadcrumb {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 22px;
}

.article-breadcrumb a { color: var(--accent); text-decoration: none; }
.article-breadcrumb a:hover { text-decoration: underline; }
.article-breadcrumb .sep { margin: 0 8px; opacity: 0.5; }

.article-tag-pill {
  display: inline-block;
  margin-bottom: 18px;
}

.article-tag-pill a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--hover-bg);
  color: var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.article-tag-pill a:hover { background: rgba(253, 108, 29, 0.16); }

.article h1 {
  font-size: 44px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 12px;
}

.article-byline .dot { opacity: 0.5; }

.article-dek {
  font-size: 19px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.article-body { font-size: 17px; line-height: 1.8; color: var(--text); }

.article-body h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 48px 0 16px;
  color: var(--text);
  letter-spacing: -0.01em;
  scroll-margin-top: 100px;
}

.article-body h3 {
  font-size: 21px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text);
}

.article-body p { margin: 0 0 20px; }

.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 24px; }
.article-body li { margin-bottom: 10px; }

.article-body strong { font-weight: 700; color: var(--text); }
.article-body em { font-style: italic; }

.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 4px 22px;
  margin: 28px 0;
  background: rgba(253, 108, 29, 0.04);
  color: var(--text);
  font-style: italic;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 40px 0;
}

/* Numbered principle list ("Southern Cross") — accent counters */
.article-body ol.article-principles {
  list-style: none;
  counter-reset: principle;
  padding-left: 0;
}

.article-body ol.article-principles > li {
  counter-increment: principle;
  position: relative;
  padding-left: 56px;
  margin-bottom: 24px;
}

.article-body ol.article-principles > li::before {
  content: counter(principle);
  position: absolute;
  left: 0;
  top: 2px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(253, 108, 29, 0.25);
}

/* Pull-quote for the four North Star promises */
.article-pullquote {
  margin: 32px 0;
  padding: 24px 28px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  box-shadow: 0 2px 8px var(--shadow-soft);
}

/* End-of-article CTA */
.article-cta {
  margin-top: 56px;
  padding: 32px;
  background: var(--bg-light);
  border-radius: 16px;
  text-align: center;
}

.article-cta h3 { margin: 0 0 8px; font-size: 22px; color: var(--text); }
.article-cta p { margin: 0 0 20px; color: var(--muted); font-size: 15px; }

/* "Back to The Cache" strip */
.article-backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.article-backlink:hover { gap: 12px; transition: gap 0.2s ease; }

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .cache-hero { padding: 110px 20px 36px; }
  .cache-hero-title { font-size: 54px; letter-spacing: -1.5px; }
  .cache-hero-subtitle { font-size: 16px; }
  .articles-listing { padding: 8px 20px 56px; }
  .article-page { padding: 100px 20px 40px; }
  .article h1 { font-size: 32px; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 24px; }
  .article-dek { font-size: 17px; }
}
