/* ==========================================================
   Vividly Built / Answers - Article Template
   Interactive layers shared across all answer detail pages.
   Loaded AFTER _shared.css.
   ========================================================== */

/* --- Reading progress bar (top of viewport) --------------- */
.read-progress {
  position: fixed; left: 0; right: 0; top: 0;
  height: 2px; background: transparent; z-index: 60;
  pointer-events: none;
}
.read-progress::before {
  content: "";
  display: block; height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, #b85c2a 0%, #d97842 100%);
  transition: width .12s linear;
}

/* --- Sticky chrome below nav (last-updated + read-time) --- */
.read-meta-bar {
  position: sticky; top: 64px; z-index: 30;
  background: rgba(244,240,232,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(26,24,22,0.06);
}
.read-meta-bar-inner {
  max-width: 1480px; margin: 0 auto;
  padding: .55rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
@media (min-width: 1024px) {
  .read-meta-bar-inner { padding: .55rem 2.5rem; }
}
.read-meta-bar .meta {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase; color: #4a4541;
}
.read-meta-bar .meta .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(26,24,22,0.25);
}
.read-meta-bar .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: #b85c2a;
  box-shadow: 0 0 0 0 rgba(184,92,42,0.5);
  animation: vb-pulse 2.4s ease-in-out infinite;
}
@keyframes vb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184,92,42,0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(184,92,42,0); }
}

/* --- Hero standfirst (TL;DR) - already styled in _shared.css.tldr  --- */
/* Adds entrance: fade-up on first paint */
.tldr {
  opacity: 0; transform: translateY(8px);
  animation: vb-fadeup .9s cubic-bezier(.2,.7,.2,1) .15s forwards;
}
@keyframes vb-fadeup {
  to { opacity: 1; transform: none; }
}

/* --- Article shell layout --------------------------------- */
.article-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}
@media (min-width: 1024px) {
  .article-shell {
    grid-template-columns: 240px minmax(0, 1fr) 200px;
    gap: 3.5rem;
    padding: 4rem 2.5rem 6rem;
  }
}

/* --- Sticky TOC (left rail) ------------------------------- */
.toc-rail {
  display: none;
}
@media (min-width: 1024px) {
  .toc-rail {
    display: block; position: sticky; top: 130px;
    align-self: start;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
  }
}
.toc-rail .toc-title {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase; color: #4a4541;
  margin-bottom: 1rem;
}
.toc-rail ol {
  list-style: none; padding: 0; margin: 0;
  border-left: 1px solid rgba(26,24,22,0.10);
}
.toc-rail li a {
  display: block; padding: .55rem 0 .55rem 1rem;
  font-size: 13px; color: #4a4541; line-height: 1.4;
  border-left: 2px solid transparent; margin-left: -1px;
  transition: color .25s, border-color .25s, transform .25s;
}
.toc-rail li a:hover { color: #b85c2a; }
.toc-rail li a.is-active {
  color: #b85c2a; border-color: #b85c2a;
  font-weight: 500;
}

/* --- Mobile TOC accordion --------------------------------- */
.toc-mobile {
  border: 1px solid rgba(26,24,22,0.10);
  border-radius: 4px;
  background: #ebe5d8;
  margin-bottom: 2rem;
}
@media (min-width: 1024px) {
  .toc-mobile { display: none; }
}
.toc-mobile summary {
  list-style: none;
  padding: .9rem 1.1rem;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.2em; text-transform: uppercase; color: #1a1816;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after {
  content: "+"; font-family: 'Inter', sans-serif; font-weight: 300;
  font-size: 18px; color: #b85c2a; transition: transform .3s;
}
.toc-mobile[open] summary::after { content: "−"; }
.toc-mobile ol {
  list-style: none;
  padding: 0 1.1rem 1rem;
  margin: 0;
  border-top: 1px solid rgba(26,24,22,0.08);
}
.toc-mobile li a {
  display: block; padding: .5rem 0; font-size: 13px; color: #4a4541;
}

/* --- Right-rail metadata / share -------------------------- */
.meta-rail {
  display: none;
}
@media (min-width: 1024px) {
  .meta-rail {
    display: block; position: sticky; top: 130px;
    align-self: start;
  }
}
.meta-rail-block {
  border-top: 1px solid rgba(26,24,22,0.10);
  padding-top: 1rem; margin-bottom: 1.75rem;
}
.meta-rail-label {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  letter-spacing: 0.22em; text-transform: uppercase; color: #4a4541;
  margin-bottom: .55rem;
}
.meta-rail-value {
  font-family: 'Fraunces', Georgia, serif; font-weight: 400;
  font-size: 22px; line-height: 1.05; color: #1a1816;
  letter-spacing: -0.015em;
}
.meta-rail-value .em { color: #b85c2a; font-style: italic; }

/* --- Animated number callouts ----------------------------- */
.num-callout {
  display: inline-flex; align-items: baseline; gap: .25rem;
  font-variant-numeric: tabular-nums;
  transition: color .35s;
}
.num-callout.is-revealed { color: #b85c2a; }

/* --- Phase strip (interactive accordion) ------------------ */
.phase-strip {
  border-top: 1px solid rgba(26,24,22,0.10);
  margin: 2rem 0 2.5rem;
}
.phase-row {
  border-bottom: 1px solid rgba(26,24,22,0.10);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: start; gap: 1.25rem;
  padding: 1.25rem 0;
  cursor: pointer;
  transition: background .25s;
}
.phase-row:hover { background: rgba(26,24,22,0.025); padding-left: .5rem; padding-right: .5rem; }
.phase-row .pn {
  font-family: 'Fraunces', serif; font-size: 28px; font-weight: 300;
  color: #b85c2a; letter-spacing: -0.02em; line-height: 1;
  padding-top: .15rem;
}
.phase-row .pt-title {
  font-family: 'Fraunces', serif; font-size: 22px; font-weight: 400;
  color: #1a1816; line-height: 1.2; letter-spacing: -0.01em;
  margin-bottom: .25rem;
}
.phase-row .pt-sub {
  font-size: 14px; color: #4a4541; line-height: 1.5; max-width: 56ch;
}
.phase-row .pt-time {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: #4a4541;
  white-space: nowrap; padding-top: .55rem;
}
.phase-row .pt-time strong { color: #1a1816; font-weight: 600; }
.phase-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.2,.7,.2,1);
  grid-column: 1 / -1;
}
.phase-body > div {
  overflow: hidden; min-height: 0;
}
.phase-row[aria-expanded="true"] + .phase-body {
  grid-template-rows: 1fr;
}
.phase-body-inner {
  padding: .25rem 0 1.5rem 4.5rem;
  font-size: 16px; line-height: 1.7; color: #2c2926;
}
.phase-body-inner ul {
  list-style: none; padding: 0; margin: .5rem 0 0;
}
.phase-body-inner ul li {
  position: relative; padding-left: 1rem; margin-bottom: .5rem;
}
.phase-body-inner ul li::before {
  content: ''; position: absolute; left: 0; top: 0.7em; width: 6px; height: 1px;
  background: #b85c2a;
}
.phase-row .chev {
  width: 16px; height: 16px; flex-shrink: 0; align-self: center;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
  color: #b85c2a;
}
.phase-row[aria-expanded="true"] .chev { transform: rotate(90deg); }

/* --- Neighborhood scroller -------------------------------- */
.hood-scroller {
  position: relative;
  margin: 1.5rem -1rem;
}
.hood-track {
  display: flex; gap: .9rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: .5rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: #b85c2a transparent;
}
.hood-track::-webkit-scrollbar { height: 6px; }
.hood-track::-webkit-scrollbar-track { background: transparent; }
.hood-track::-webkit-scrollbar-thumb {
  background: rgba(184,92,42,.35); border-radius: 999px;
}
.hood-card {
  flex: 0 0 280px; scroll-snap-align: start;
  background: #f4f0e8; border: 1px solid rgba(26,24,22,0.08);
  border-radius: 4px; padding: 1.1rem 1.25rem;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .35s;
}
.hood-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -22px rgba(26,24,22,.4);
  border-color: rgba(184,92,42,0.3);
}
.hood-card .hood-name {
  font-family: 'Fraunces', serif; font-size: 18px; font-weight: 500;
  color: #1a1816; margin-bottom: .35rem; letter-spacing: -0.01em;
}
.hood-card .hood-mod {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #b85c2a; margin-bottom: .55rem;
}
.hood-card .hood-note {
  font-size: 13.5px; color: #4a4541; line-height: 1.55;
}

/* --- Cost / range bar (inline mini-chart) ----------------- */
.range-chart {
  margin: 1.5rem 0 2rem;
  display: grid; gap: .75rem;
}
.range-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center; gap: 1rem;
}
@media (max-width: 640px) {
  .range-row {
    grid-template-columns: 1fr;
    gap: .25rem;
  }
}
.range-row .rr-label {
  font-family: 'Fraunces', serif; font-size: 16px; font-weight: 500;
  color: #1a1816;
}
.range-row .rr-bar {
  position: relative; height: 8px; border-radius: 999px;
  background: rgba(26,24,22,0.06);
  overflow: hidden;
}
.range-row .rr-fill {
  position: absolute; top: 0; bottom: 0;
  left: var(--start, 0%); right: calc(100% - var(--end, 100%));
  background: linear-gradient(90deg, #b85c2a 0%, #d97842 100%);
  border-radius: 999px;
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1);
}
.range-row.is-revealed .rr-fill { transform: scaleX(1); }
.range-row .rr-num {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  letter-spacing: 0.06em; color: #1a1816; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Pull-quote (advisory voice) -------------------------- */
.pull-quote {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3;
  letter-spacing: -0.015em; color: #1a1816;
  border-left: 2px solid #b85c2a;
  padding: .25rem 0 .25rem 1.5rem;
  margin: 2.5rem 0;
  text-wrap: balance;
}
.pull-quote em { color: #b85c2a; font-style: italic; }

/* --- FAQ accordion (re-uses vb-faq from main but locally) - */
.q-list {
  border-top: 1px solid rgba(26,24,22,0.12);
  margin-top: 1.5rem;
}
.q-item {
  border-bottom: 1px solid rgba(26,24,22,0.10);
}
.q-item summary {
  list-style: none;
  cursor: pointer; padding: 1.25rem 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.5rem;
  font-family: 'Fraunces', serif; font-size: 19px; font-weight: 500;
  color: #1a1816; line-height: 1.35;
  transition: color .25s;
}
.q-item summary::-webkit-details-marker { display: none; }
.q-item summary:hover { color: #b85c2a; }
.q-item .q-toggle {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid rgba(26,24,22,0.20);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; margin-top: 2px;
  transition: background .25s, color .25s, border-color .25s;
  color: #1a1816;
}
.q-item .q-toggle::before, .q-item .q-toggle::after {
  content: ""; position: absolute; background: currentColor;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.q-item .q-toggle::before { width: 11px; height: 1.2px; }
.q-item .q-toggle::after  { width: 1.2px; height: 11px; }
.q-item[open] .q-toggle {
  background: #1a1816; color: #f4f0e8; border-color: #1a1816;
}
.q-item[open] .q-toggle::after { transform: scaleY(0); }
.q-item .q-body {
  padding: 0 0 1.5rem;
  font-size: 15.5px; line-height: 1.7; color: #2c2926;
  max-width: 78ch;
}
.q-item .q-body p + p { margin-top: .85rem; }

/* --- CTA card --------------------------------------------- */
.cta-card {
  background: #1a1816; color: #f4f0e8; border-radius: 6px;
  padding: 2.5rem 2rem;
  margin: 3rem 0 1rem;
  position: relative; overflow: hidden;
}
.cta-card::before {
  content: "";
  position: absolute; right: -100px; top: -100px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(184,92,42,0.35) 0%, transparent 65%);
  pointer-events: none;
}
.cta-card .cta-eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase; color: #d97842;
  margin-bottom: 1rem;
}
.cta-card h3 {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1;
  letter-spacing: -0.02em; margin-bottom: .85rem;
  text-wrap: balance;
}
.cta-card h3 em { color: #d97842; font-style: italic; font-weight: 400; }
.cta-card p { color: rgba(244,240,232,0.72); font-size: 15.5px; line-height: 1.65; margin-bottom: 1.5rem; max-width: 56ch; }
.cta-card .cta-actions {
  display: flex; flex-wrap: wrap; gap: .6rem;
}
.cta-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  transition: opacity .25s, background .25s;
}
.cta-card .cta-btn-primary,
.prose-vb .cta-card .cta-btn-primary { background: #b85c2a; color: #f4f0e8; text-decoration: none; }
.cta-card .cta-btn-primary:hover,
.prose-vb .cta-card .cta-btn-primary:hover { background: #d97842; color: #f4f0e8; text-decoration: none; }
.cta-card .cta-btn-ghost,
.prose-vb .cta-card .cta-btn-ghost { border: 1px solid rgba(244,240,232,0.25); color: #f4f0e8; text-decoration: none; }
.cta-card .cta-btn-ghost:hover,
.prose-vb .cta-card .cta-btn-ghost:hover { background: rgba(244,240,232,0.08); color: #f4f0e8; text-decoration: none; }

/* Ensure CTA card text and headings stay light against the dark bg
   (overrides the .prose-vb default heading + link colors) */
.prose-vb .cta-card h3 { color: #f4f0e8; }
.prose-vb .cta-card h3 em { color: #d97842; }
.prose-vb .cta-card p { color: rgba(244,240,232,0.78); }
.prose-vb .cta-card a { text-decoration: none; }

/* --- Reveal-on-scroll ------------------------------------- */
.reveal-up {
  opacity: 0; transform: translateY(14px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}
.reveal-up.is-revealed {
  opacity: 1; transform: none;
}

/* --- Reduced motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .read-progress::before { transition: none; }
  .tldr { opacity: 1; transform: none; animation: none; }
  .reveal-up { opacity: 1; transform: none; }
  .range-row .rr-fill { transform: scaleX(1); }
}
