/* ==========================================================================
   CODEZEN BLOG — EXTRA LAYOUT COMPONENTS
   Additive stylesheet for articles 10–16. Load AFTER assets/css/style.css.
   Reuses the site's existing design tokens (:root vars from style.css) —
   does not redefine or override any existing class.
   ========================================================================== */

/* ---------- Floated image inside the lede / early paragraphs ---------- */
.article-float-figure {
  float: right;
  width: 300px;
  margin: 4px 0 var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.article-float-figure img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; }

/* ---------- Alternating text / image rows (checkerboard) ---------- */
.article-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  margin: var(--space-10) 0;
}
.article-row__img { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.article-row__img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.article-row__text h2 { margin-top: 0; }
.article-row--reverse .article-row__img { order: 2; }
.article-row--reverse .article-row__text { order: 1; }

/* ---------- Feature grid (2x2 cards with image, inside article body) ---------- */
.article-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-8) 0;
}
.article-feature-grid__item {
  background: var(--color-bg-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.article-feature-grid__item img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.article-feature-grid__body { padding: var(--space-5); }
.article-feature-grid__num {
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-xs);
  color: var(--color-accent); letter-spacing: 0.06em;
}
.article-feature-grid__body h3 { font-family: var(--font-display); font-size: var(--text-base); font-weight: 700; margin: var(--space-2) 0 var(--space-2); }
.article-feature-grid__body p { font-size: var(--text-sm); color: var(--color-muted); margin: 0; }

/* ---------- Full-bleed stat banner (breaks out of the 740px column) ---------- */
.article-stat-banner {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: var(--color-text);
  margin-block: var(--space-10);
  padding: var(--space-8) 0;
}
.article-stat-banner__inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  padding: 0 var(--space-6);
}
.article-stat-banner__item { text-align: center; }
.article-stat-banner__number { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 800; color: var(--color-accent); display: block; }
.article-stat-banner__label { font-size: var(--text-xs); color: rgba(255,255,255,0.65); margin-top: var(--space-2); }

/* ---------- Full-bleed breakout image ---------- */
.article-breakout {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-block: var(--space-10);
}
.article-breakout img { width: 100%; height: 46vh; min-height: 280px; object-fit: cover; display: block; }

/* ---------- Magazine drop cap ---------- */
.article-dropcap::first-letter {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.6rem;
  line-height: 0.8;
  float: left;
  padding: 6px 10px 0 0;
  color: var(--color-accent);
}

/* ---------- Floated highlight / quote card ---------- */
.article-quote-float {
  float: right;
  width: 260px;
  margin: 6px 0 var(--space-6) var(--space-8);
  background: var(--color-accent-lt);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: 1.4;
}

/* ---------- 3-image gallery strip ---------- */
.article-gallery-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin: var(--space-8) 0;
}
.article-gallery-3 img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius); display: block; }

/* ---------- Typographic hero (no photo — used once, for the general-angle article) ---------- */
.article-hero--typo {
  position: relative;
  height: auto;
  min-height: 0;
  max-height: none;
  background: var(--color-text);
  padding: calc(var(--nav-height) + var(--space-16)) 0 var(--space-16);
  overflow: hidden;
}
.article-hero--typo::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 22px 22px;
}
.article-hero--typo .article-hero__content { position: relative; padding: 0; }
.article-hero--typo .article-hero__title { max-width: 720px; }
.article-hero--typo .article-hero__back {
  position: static;
  display: inline-flex;
  margin-bottom: var(--space-8);
}

/* ---------- Small inline figure that floats within body text ---------- */
.article-inline-figure {
  float: left;
  width: 220px;
  margin: 4px var(--space-6) var(--space-4) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.article-inline-figure.article-inline-figure--right { float: right; margin: 4px 0 var(--space-4) var(--space-6); }
.article-inline-figure img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }

.stat-inline {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-accent-dk);
}

/* ---------- Clearfix safety net ----------
   Floated elements above (.article-float-figure, .article-quote-float,
   .article-inline-figure) must never bleed into the next block. */
.article-body h2,
.article-body h3,
.article-figure,
.article-figure-grid,
.article-stat-row,
.article-checklist,
.article-cta,
.article-row,
.article-feature-grid,
.article-stat-banner,
.article-breakout,
.article-gallery-3,
.pull-quote {
  clear: both;
}


