/* =====================================================================
   Blog post — long-form editorial styles. Layered on top of main.css.

   Layout model:
     .post-page   max-width 1100px (hero, wide figures live here)
     .post-header max-width 720px  (centered title block)
     .post-body   max-width 720px  (the article column)
   The page reads at ~720px so line-length stays comfortable; only hero
   imagery and explicit "wide" figures break out to the full 1100px.

   Image guidelines:
     HERO        16:9, 1600×900 minimum, ≤300KB JPG
     WIDE FIGURE 16:9 or 4:3, full content-column width
     SIDE FIGURE 4:5 or 1:1, ~340–400px wide, floats left/right
   ===================================================================== */

.post-page {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: var(--container-pad);
  padding-block: clamp(2rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem);
}

/* ---------- Header ---------- */

.post-header {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.post-header .eyebrow { justify-content: center; }

.post-title {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: var(--tracking-display);
  margin-block: 1rem 1.25rem;
  text-wrap: balance;
  font-variation-settings: "opsz" 96, "wdth" 95, "wght" 700;
}
.post-title em {
  font-style: normal;
  color: var(--color-primary);
  font-variation-settings: "opsz" 96, "wdth" 92, "wght" 800;
}

.post-dek {
  font-size: clamp(1.1rem, .95rem + .55vw, 1.3rem);
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 38em;
  margin-inline: auto;
  margin-bottom: 1.75rem;
  text-wrap: balance;
}

.post-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .65rem 1rem;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}
.post-meta__author { color: var(--color-text); font-weight: 600; }
.post-meta__sep { width: 3px; height: 3px; border-radius: 50%; background: var(--color-text-soft); display: inline-block; }

/* ---------- Hero figure ---------- */

.post-hero {
  margin: 0 0 clamp(2.5rem, 5vw, 4rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}
.post-hero img,
.post-hero .placeholder-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}
.post-hero figcaption {
  padding: .85rem 1.25rem;
  background: var(--color-surface);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

/* ---------- Body column ---------- */

.post-body {
  max-width: 720px;
  margin-inline: auto;
  font-size: 1.0625rem;
  line-height: 1.75;
}
.post-body > * + * { margin-top: 1.25rem; }

.post-body p { color: var(--color-text); }
.post-body p strong { font-weight: 700; }

/* Lead paragraph — first one after intro is heavier visually */
.post-lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--color-text);
  font-weight: 500;
  margin-bottom: 1.5rem !important;
}
.post-lead::first-letter {
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: .85;
  font-weight: 700;
  color: var(--color-primary);
  float: left;
  margin: .15rem .5rem 0 0;
  font-variation-settings: "opsz" 96, "wdth" 95, "wght" 800;
}

/* Headings */
.post-body h2 {
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2rem);
  line-height: 1.15;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  letter-spacing: var(--tracking-display);
  font-variation-settings: "opsz" 60, "wdth" 95, "wght" 700;
  scroll-margin-top: 88px;
}
.post-body h2 .post-h2-num {
  display: inline-block;
  font-family: var(--font-display);
  color: var(--color-primary);
  font-variation-settings: "opsz" 60, "wdth" 88, "wght" 800;
  margin-right: .5em;
  font-feature-settings: "tnum" 1;
}

.post-body h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: .75rem;
  font-variation-settings: "opsz" 32, "wdth" 100, "wght" 700;
}

.post-body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(196, 53, 31, .35);
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}
.post-body a:hover { text-decoration-color: var(--color-primary); }

/* Lists */
.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}
.post-body ul > li,
.post-body ol > li { margin-bottom: .55rem; }
.post-body ul > li::marker { color: var(--color-primary); }
.post-body ol > li::marker { color: var(--color-primary); font-weight: 700; }

/* ---------- Inline figures ---------- */

/* Default: inline figure spans the body column */
.post-figure {
  margin-block: clamp(2rem, 4vw, 2.75rem);
}
.post-figure img,
.post-figure .placeholder-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}
.post-figure figcaption {
  margin-top: .75rem;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* WIDE — breaks out of the body column up to the page max */
.post-figure--wide {
  margin-inline: calc(50% - 50vw);   /* full bleed on small screens */
  margin-inline: calc((720px - min(1100px, 100vw - var(--container-pad) * 2)) / 2);
}
@media (max-width: 760px) {
  .post-figure--wide { margin-inline: calc(50% - 50vw); padding-inline: var(--container-pad); }
  .post-figure--wide img,
  .post-figure--wide .placeholder-img { border-radius: 0; border-inline: 0; }
}

/* SIDE — floats next to body text */
.post-figure--right,
.post-figure--left {
  max-width: 50%;
  margin-block: .25rem 1.25rem;
}
.post-figure--right { float: right; margin-left: 1.5rem; }
.post-figure--left  { float: left;  margin-right: 1.5rem; }
@media (max-width: 600px) {
  .post-figure--right,
  .post-figure--left { float: none; max-width: 100%; margin-inline: 0; }
}
.post-figure--right .placeholder-img,
.post-figure--left  .placeholder-img { aspect-ratio: 4 / 5; }

/* Default placeholder block (used until real images drop in) */
.placeholder-img {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, transparent 49.4%, var(--color-border) 49.4%, var(--color-border) 50.6%, transparent 50.6%),
    linear-gradient(45deg,  transparent 49.4%, var(--color-border) 49.4%, var(--color-border) 50.6%, transparent 50.6%),
    var(--color-bg-alt);
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  text-align: center;
  padding: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* ---------- Pull quotes ---------- */

.post-pullquote {
  margin-block: clamp(2rem, 4vw, 3rem);
  padding-left: 1.5rem;
  border-left: 3px solid var(--color-primary);
}
.post-pullquote p {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.05rem + .8vw, 1.65rem);
  line-height: 1.35;
  color: var(--color-text);
  font-variation-settings: "opsz" 60, "wdth" 95, "wght" 600;
  margin: 0;
  text-wrap: balance;
}
.post-pullquote cite {
  display: block;
  margin-top: .85rem;
  font-style: normal;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* ---------- Callouts ---------- */

.post-callout {
  margin-block: clamp(1.5rem, 3vw, 2.25rem);
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius);
}
.post-callout__label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: .5rem;
  font-variation-settings: "opsz" 32, "wdth" 100, "wght" 700;
}
.post-callout__label::before {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  display: inline-block;
}
.post-callout p { margin: 0; font-size: var(--fs-sm); line-height: 1.65; color: var(--color-text); }
.post-callout p + p { margin-top: .5rem; }

.post-callout--note { border-left-color: var(--color-text); }
.post-callout--note .post-callout__label { color: var(--color-text); }
.post-callout--note .post-callout__label::before { background: var(--color-text); }

.post-callout--warning { border-left-color: #B8860B; background: #FCF7E8; }
.post-callout--warning .post-callout__label { color: #8A6308; }
.post-callout--warning .post-callout__label::before { background: #B8860B; }

/* ---------- Code-style example block ---------- */

.post-example {
  margin-block: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--color-text);
}
.post-example__bad,
.post-example__good { display: block; }
.post-example__bad  { color: #8A6308; }
.post-example__good { color: var(--color-secondary); }

/* ---------- Divider ---------- */

.post-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .65rem;
  margin-block: clamp(2.5rem, 5vw, 3.5rem);
  color: var(--color-text-soft);
}
.post-divider::before,
.post-divider::after {
  content: '';
  width: 60px;
  height: 1px;
  background: var(--color-border-strong);
}

/* ---------- End-of-post CTA ---------- */

.post-cta {
  max-width: 720px;
  margin: clamp(3rem, 5vw, 4rem) auto 0;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius-lg);
  text-align: center;
}
.post-cta h3 {
  color: var(--color-bg);
  font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem);
  margin-bottom: .75rem;
  text-wrap: balance;
  font-variation-settings: "opsz" 60, "wdth" 95, "wght" 700;
}
.post-cta h3 em {
  font-style: normal;
  color: var(--color-primary-vivid);
  font-variation-settings: "opsz" 60, "wdth" 92, "wght" 800;
}
.post-cta p {
  color: rgba(247, 243, 235, .8);
  font-size: var(--fs-lg);
  margin-bottom: 1.5rem;
  max-width: 50ch;
  margin-inline: auto;
}

/* ---------- Author block ---------- */

.post-author {
  max-width: 720px;
  margin: clamp(2.5rem, 4vw, 3.5rem) auto 0;
  padding: 1.5rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
}
.post-author__avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px dashed var(--color-border-strong);
  display: grid; place-items: center;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-align: center;
  font-weight: 600;
}
.post-author__name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; font-variation-settings: "opsz" 32, "wdth" 100, "wght" 700; }
.post-author__role { font-size: var(--fs-sm); color: var(--color-text-muted); margin-top: .15rem; }
.post-author__bio  { font-size: var(--fs-sm); color: var(--color-text-muted); margin-top: .5rem; line-height: 1.55; }

/* ---------- Section header for post nav (optional in-post nav) ---------- */
.nav--post { background: var(--color-bg); border-bottom: 1px solid var(--color-border); }

/* Float clearfix for floated figures */
.post-body > h2,
.post-body > .post-divider,
.post-body > .post-cta { clear: both; }

/* =====================================================================
   Blog INDEX page — listing of posts
   ===================================================================== */

.blog-index { padding-block: clamp(2rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem); }

.blog-index__header {
  max-width: 720px;
  margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
}
.blog-index__header .eyebrow { justify-content: center; }
.blog-index__header h1 {
  font-size: clamp(2.5rem, 1.8rem + 3vw, 3.75rem);
  margin-block: 1rem 1.25rem;
  line-height: 1.05;
  text-wrap: balance;
  font-variation-settings: "opsz" 96, "wdth" 95, "wght" 700;
}
.blog-index__header h1 em {
  font-style: normal;
  color: var(--color-primary);
  font-variation-settings: "opsz" 96, "wdth" 92, "wght" 800;
}
.blog-index__lede {
  font-size: clamp(1.05rem, .95rem + .4vw, 1.2rem);
  color: var(--color-text-muted);
  line-height: 1.55;
  max-width: 38em;
  margin-inline: auto;
  text-wrap: balance;
}

/* ---------- Featured post (large, 2-column on desktop) ---------- */
.post-featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: clamp(3rem, 5vw, 4.5rem);
  text-decoration: none;
  color: inherit;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out), border-color var(--dur-mid) var(--ease-out);
}
.post-featured:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--color-border-strong);
}
@media (max-width: 760px) {
  .post-featured { grid-template-columns: 1fr; gap: 0; }
}

.post-featured__thumb { margin: 0; background: var(--color-bg-alt); }
.post-featured__thumb .placeholder-img {
  border-radius: 0;
  border: 0;
  height: 100%;
  min-height: 280px;
}
@media (max-width: 760px) {
  .post-featured__thumb .placeholder-img { aspect-ratio: 16 / 9; min-height: 0; }
}

.post-featured__body {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.post-featured__tag {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: .85rem;
}
.post-featured__title {
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem);
  line-height: 1.15;
  margin-bottom: .85rem;
  text-wrap: balance;
  font-variation-settings: "opsz" 60, "wdth" 95, "wght" 700;
  transition: color var(--dur-mid) var(--ease-out);
}
.post-featured:hover .post-featured__title { color: var(--color-primary); }
.post-featured__title em {
  font-style: normal;
  color: var(--color-primary);
  font-variation-settings: "opsz" 60, "wdth" 92, "wght" 800;
}
.post-featured__dek {
  color: var(--color-text-muted);
  font-size: var(--fs-lg);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.post-featured__meta {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.post-featured__cta {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 700;
  color: var(--color-primary);
  font-size: var(--fs-sm);
}
.post-featured:hover .post-featured__cta span[aria-hidden="true"] {
  transform: translateX(3px);
  transition: transform var(--dur-mid) var(--ease-out);
}

/* ---------- Upcoming section ---------- */
.blog-index__upcoming { margin-bottom: clamp(3rem, 5vw, 4.5rem); }
.blog-index__upcoming-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.blog-index__upcoming-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: var(--tracking-display);
  font-variation-settings: "opsz" 48, "wdth" 95, "wght" 700;
}
.blog-index__upcoming-sub {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  max-width: 36ch;
}

/* ---------- Newsletter ---------- */
.blog-index__newsletter {
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
}
.blog-index__newsletter::before {
  content: '';
  position: absolute;
  top: 0; left: 2rem; right: 2rem;
  height: 2px;
  background: var(--color-primary-vivid);
}
.blog-index__newsletter-inner {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}
.blog-index__newsletter h2 {
  color: var(--color-bg);
  font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem);
  margin-block: 1rem .85rem;
  line-height: 1.15;
  text-wrap: balance;
  font-variation-settings: "opsz" 60, "wdth" 95, "wght" 700;
}
.blog-index__newsletter h2 em {
  font-style: normal;
  color: var(--color-primary-vivid);
  font-variation-settings: "opsz" 60, "wdth" 92, "wght" 800;
}
.blog-index__newsletter > .blog-index__newsletter-inner > p {
  color: rgba(247, 243, 235, .8);
  font-size: var(--fs-lg);
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.blog-index__newsletter-form {
  display: flex;
  gap: .65rem;
  max-width: 460px;
  margin-inline: auto;
}
@media (max-width: 480px) {
  .blog-index__newsletter-form { flex-direction: column; }
}
.blog-index__newsletter-form input[type="email"] {
  flex: 1;
  padding: .9rem 1.1rem;
  border: 1px solid rgba(247, 243, 235, .25);
  background: rgba(247, 243, 235, .08);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--color-bg);
  min-height: 46px;
}
.blog-index__newsletter-form input[type="email"]::placeholder { color: rgba(247, 243, 235, .45); }
.blog-index__newsletter-form input[type="email"]:focus {
  outline: 2px solid var(--color-primary-vivid);
  outline-offset: 1px;
  background: rgba(247, 243, 235, .14);
  border-color: rgba(247, 243, 235, .4);
}
.blog-index__newsletter-form .btn--primary { background: var(--color-primary-vivid); color: var(--color-bg); }
.blog-index__newsletter-form .btn--primary:hover { background: var(--color-bg); color: var(--color-text); }

.blog-index__newsletter-note {
  font-size: var(--fs-xs);
  color: rgba(247, 243, 235, .55);
  margin-top: 1rem;
}
.blog-index__newsletter-note a { color: rgba(247, 243, 235, .85); text-decoration: underline; text-underline-offset: 2px; }

/* Inverse eyebrow — for use on dark backgrounds */
.eyebrow--inverse { color: rgba(247, 243, 235, .65); }
.eyebrow--inverse .eyebrow__dot { background: var(--color-primary-vivid); }

/* Visually hidden (accessibility — hide from sight, keep for screen readers) */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
