/* ============================================
   FitForgeFlow — Blog Post Styles
   Editorial light-theme article body, scoped to
   .post-light so the shared dark header/final-cta
   are untouched. Token overrides here cascade to
   every existing component (.category-tag, .toc,
   .related-card, etc.) without duplicating rules.
   ============================================ */

.post-light {
  --color-bg: #ffffff;
  --color-surface: #f6f8fb;
  --color-surface-raised: #ffffff;
  --color-border: #e5e9f0;
  --color-text: #14181f;
  --color-text-dim: #4b5364;
  --color-text-faint: #7c8494;
  background: var(--color-bg);
  color: var(--color-text);
}

.post-header { padding-top: 0; padding-bottom: 0; }
.post-body-section { padding-top: var(--space-md); padding-bottom: var(--space-xl); }

.back-link {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-dim);
  margin-bottom: var(--space-sm);
}

.back-link:hover { color: var(--color-accent); }

/* ============ Breadcrumb ============ */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text-faint);
  padding: var(--space-md) 0 0.6rem;
}

.breadcrumb a { color: var(--color-text-faint); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb span[aria-hidden] { opacity: 0.6; }
.breadcrumb .current { color: var(--color-text-dim); font-weight: 600; }

/* On narrow phones, a long article title on the breadcrumb's last segment
   truncates with an ellipsis instead of wrapping to a second line --
   "Blog / Decision Fatigue at the…" reads cleaner than a wrapped title.
   Desktop/tablet are unaffected; this only engages below 480px. */
@media (max-width: 480px) {
  .breadcrumb .current {
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
  }
}

/* ============ Hero band (real photo left, gradient + overlay right) ============ */

.post-hero {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: center;
  background: #0a0e18;
}

.post-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  z-index: 0;
}

.post-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, transparent 0%, transparent 44%, #0b1220 62%, #0a0e18 100%);
}

.post-hero-content {
  position: relative;
  z-index: 2;
  margin-left: auto;
  padding: var(--space-lg) var(--space-xl) var(--space-lg) var(--space-md);
  max-width: 520px;
  text-align: left;
}

.post-hero-tagline {
  font-family: var(--font-body);
  font-weight: var(--display-weight);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: #ffffff;
  text-wrap: balance;
}

.post-hero-subtagline {
  font-size: 1rem;
  font-weight: 600;
  color: #eef3fb;
}

.post-hero-accent-bar {
  width: 46px;
  height: 3px;
  background: var(--gradient-brand);
  border-radius: 2px;
  margin-top: 0.7rem;
}

@media (max-width: 860px) {
  .post-hero { min-height: 300px; align-items: flex-end; }
  .post-hero-img { object-position: center 20%; }
  .post-hero-overlay {
    background: linear-gradient(180deg, transparent 0%, transparent 38%, rgba(8,12,20,0.78) 66%, #0a0e18 100%);
  }
  .post-hero-content { margin-left: 0; max-width: 100%; padding: var(--space-md); }
}

/* A supporting editorial photo inside the article body (not the full-bleed
   hero band) -- same rounded-corner/bordered treatment as the legacy
   .post-hero-photo pattern, so a body image always looks like it belongs to
   this design system no matter which article uses it. */
.post-inline-image {
  margin: 1.4rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.post-inline-image img {
  display: block;
  width: 100%;
  height: auto;
}
.post-inline-image figcaption {
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--color-text-faint);
  background: var(--color-surface);
}

/* Opt-in modifier for a hero image that is itself a finished, self-contained
   graphic (its own headline/branding/CTA already baked into the pixels --
   e.g. the-first-rep.html) rather than a plain photo meant to be cropped
   full-bleed with the site's own overlay text on top. `object-fit: cover`
   would aggressively crop a portrait graphic like that inside this wide,
   short band and cut off exactly the text it exists to show; `contain`
   keeps the whole graphic legible at any viewport width. Every other
   article's hero (a plain `.post-hero`, no modifier) is completely
   unaffected by this rule. */
/* object-position, not justify-content: .post-hero-img is absolutely
   positioned (inset: 0), so it never participates in .post-hero's flex
   layout -- object-position is what actually centers a `contain`-fit image
   within its box. Specificity here (0,2,0) intentionally beats the plain
   `.post-hero-img` rule above and its own max-width:860px override, so this
   stays centered at every viewport without needing a duplicate mobile rule. */
.post-hero--contain .post-hero-img { object-fit: contain; object-position: center center; }

/* Legacy real-photo hero (still used by earlier posts, e.g. pyramid-sets-
   for-beginners.html) -- kept alongside .post-hero so older articles that
   already have their own inline photo markup don't need to change. */

.post-hero-photo { margin-top: var(--space-md); margin-bottom: var(--space-sm); }

.post-hero-photo img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  display: block;
}

.photo-credit { font-size: 0.78rem; color: var(--color-text-faint); margin-top: 0.5rem; }
.photo-credit a { color: var(--color-text-faint); text-decoration: underline; }
.photo-credit a:hover { color: var(--color-text-dim); }

@media (max-width: 760px) {
  .post-hero-photo img { height: 240px; }
}

/* ============ Header meta ============ */

.post-header .category-tag { display: inline-block; margin: 0.8rem 0 0.5rem; }

.post-header h1 {
  margin: 0.3rem 0 0.5rem;
  color: var(--color-text);
  font-size: clamp(2rem, 4.4vw, 2.6rem);
}

.post-header .lede {
  max-width: 640px;
  color: var(--color-text-dim);
  font-size: 1.1rem;
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  color: var(--color-text-faint);
  font-size: 0.88rem;
  font-weight: 600;
  margin: var(--space-md) 0 var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.post-meta-row .meta-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.post-meta-row .post-byline a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }
.post-meta-row .post-byline a:hover { color: var(--color-accent); }
.post-meta-row .meta-item svg { color: var(--color-primary); flex-shrink: 0; }
.post-meta-row .meta-share { margin-left: auto; }
.post-meta-row .meta-share button {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: none; font: inherit; color: inherit; cursor: pointer; padding: 0;
}
.post-meta-row .meta-share button:hover { color: var(--color-accent); }

/* ============ Early CTA strip ============ */

.early-cta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: rgba(0, 168, 255, 0.07);
  border: 1px solid rgba(0, 168, 255, 0.18);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.early-cta-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 168, 255, 0.14);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.early-cta-text { flex: 1; min-width: 0; }
.early-cta-text p:first-child { font-weight: 700; color: var(--color-text); margin: 0 0 0.2rem; }
.early-cta-text p:last-child { font-size: 0.88rem; color: var(--color-text-dim); margin: 0; }
.early-cta .btn { flex-shrink: 0; }

@media (max-width: 640px) {
  .early-cta { flex-wrap: wrap; }
  .early-cta .btn { width: 100%; justify-content: center; }
}

/* ============ Two-column layout: content + sidebar ============ */

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 960px) {
  .post-layout { grid-template-columns: 1fr; }
}

.post-body h2 {
  font-size: 1.5rem;
  color: var(--color-text);
  margin-top: var(--space-xl);
  scroll-margin-top: 90px;
}

/* The first H2 follows the lead-in paragraphs rather than another section,
   so it gets its own, smaller gap instead of inheriting the full
   between-section spacing used everywhere else. */
.post-body h2:first-of-type { margin-top: var(--space-md); }
.post-body p { color: var(--color-text-dim); line-height: 1.75; margin: 0 0 1.15rem; }
.post-body a { color: var(--color-accent); font-weight: 600; }
.post-body .lede-line { color: var(--color-text); font-weight: 600; font-size: 1.05rem; }

/* Lead-in: the one or two paragraphs before the article's first heading
   read as a distinct opening idea -- larger, full-contrast text -- so the
   article feels like title -> lead idea -> first major section, instead of
   body copy that happens to stop before a heading. */
.post-body > p:first-of-type,
.post-body > p:first-of-type + p {
  color: var(--color-text);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* The paragraph right before the article's first heading gets a bit more
   room and a thin rule, so the lead-in resolves into "first major section"
   intentionally instead of jumping straight into a bold heading. Later
   section breaks already have generous space above each H2, so this stays
   scoped to the one transition that was flagged as feeling abrupt. */
.post-body > p:has(+ h2:first-of-type) {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

/* Pull quote */
.pull-quote {
  background: rgba(0, 168, 255, 0.06);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.3rem;
  margin: 1.4rem 0;
}
.pull-quote p {
  font-style: italic;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  font-size: 1.05rem;
}

/* Green check callout */
.check-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: rgba(16, 163, 74, 0.08);
  border: 1px solid rgba(16, 163, 74, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
}
.check-callout .check-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10a34a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.check-callout p { margin: 0; color: var(--color-text); font-weight: 600; }

/* ============ Person A / Person B comparison ============ */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: 1.6rem 0;
}

@media (max-width: 640px) {
  .compare-grid { grid-template-columns: 1fr; }
}

.compare-card {
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border-left: 4px solid;
}

.compare-card-a {
  background: rgba(239, 68, 68, 0.06);
  border-left-color: #ef4444;
}

.compare-card-b {
  background: var(--color-surface);
  border-left-color: #9aa3b2;
}

.compare-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.compare-card-head h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}

.compare-card-a h4 { color: #b91c1c; }
.compare-card-a .compare-card-head svg { color: #ef4444; }
.compare-card-b .compare-card-head svg { color: #9aa3b2; }

.compare-card ul { list-style: none; margin: 0; padding: 0; }
.compare-card li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--color-text-dim);
  margin-bottom: 0.5rem;
}
.compare-card li svg { flex-shrink: 0; margin-top: 0.15rem; }
.compare-card-a li svg { color: #ef4444; }
.compare-card-b li svg { color: #9aa3b2; }

/* ============ Sidebar ============ */

.sidebar-card {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.3rem;
  margin-bottom: var(--space-md);
}

.sidebar-card h3 {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin: 0 0 0.9rem;
}

.toc {
  position: sticky;
  top: calc(var(--space-md) + 16px);
}

.toc summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.toc summary::-webkit-details-marker { display: none; }

.toc summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.toc[open] summary::after { transform: rotate(-135deg); }

.toc ol {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
}

.toc li { margin-bottom: 0.55rem; }

.toc a {
  display: flex;
  gap: 0.55rem;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--color-text-dim);
  padding-left: 0.6rem;
  border-left: 2px solid var(--color-border);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.toc a:hover { color: var(--color-accent); border-left-color: var(--color-accent); }

/* Sidebar CTA card (dark, intentionally contrasts the light sidebar).
   Re-declares the color tokens locally -- it sits inside .post-light, so
   without this its text would inherit the LIGHT theme's dark-charcoal
   values and become nearly invisible on this card's dark background. */
.sidebar-cta {
  --color-text: #ffffff;
  --color-text-dim: #b7c0d1;
  --color-text-faint: #8b95a8;
  background: linear-gradient(160deg, #0f1728 0%, #0a0e1a 100%);
  border: 1px solid #1f2940;
  border-radius: var(--radius-md);
  padding: 1.3rem;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.sidebar-cta .nav-logo { margin-bottom: 0.8rem; font-size: 1rem; color: var(--color-text); }
.sidebar-cta .nav-logo img { height: 22px; }

.sidebar-cta h3 {
  color: #fff;
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 800;
}

.sidebar-cta p {
  color: var(--color-text-dim);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.sidebar-cta .btn { width: 100%; }

/* Related articles -- compact list, real published links only */
.related-list { list-style: none; margin: 0; padding: 0; }

.related-list li { margin-bottom: 0.9rem; }
.related-list li:last-child { margin-bottom: 0; }

.related-item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  text-decoration: none;
}

.related-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--color-surface);
}

.related-item-text h4 {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.related-item-text span {
  font-size: 0.75rem;
  color: var(--color-text-faint);
}

.related-item:hover .related-item-text h4 { color: var(--color-accent); }

.view-all-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
}

@media (max-width: 960px) {
  .toc { position: static; }
}

/* ============ Inline CTA box (kept for any article that wants a mid-body
   CTA -- not used by the launch article, which uses .early-cta instead) ==== */

.cta-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  text-align: center;
}

.cta-block h2 { margin-top: 0 !important; color: var(--color-text) !important; }
.cta-block p { max-width: 460px; margin: 0.5rem auto var(--space-md); }
