/* =========================================================================
   Justin Karlin, MD — site.css
   Content-page components layered on top of styles.css.
   Used by /about, /procedures, /results, /research, /contact, /blog.
   Every component here is in service of the GEO content pattern:
   H1 → direct-answer → H2/H3 → fact density → FAQ → author attribution.
   ========================================================================= */

/* ---------- Breadcrumb ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--faint);
  padding-top: clamp(26px, 4vw, 48px);
}
.crumbs a { color: var(--muted); transition: color .2s ease; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--faint); }
.crumbs [aria-current] { color: var(--ink); }

/* ---------- Page hero (content pages) ---------- */
.page-hero { padding-top: clamp(18px, 3vw, 34px); padding-bottom: clamp(8px, 2vw, 18px); }

/* entrance choreography — transform-only rise, mirrors the homepage hero */
@media (prefers-reduced-motion: no-preference) {
  .crumbs            { animation: heroRise .8s cubic-bezier(.22,.61,.36,1) both; }
  .page-hero .eyebrow{ animation: heroRise .9s cubic-bezier(.22,.61,.36,1) .04s both; }
  .page-hero h1      { animation: heroRise 1.0s cubic-bezier(.22,.61,.36,1) .10s both; }
  .page-hero .sub    { animation: heroRise 1.0s cubic-bezier(.22,.61,.36,1) .18s both; }
}
.page-hero .eyebrow { margin-bottom: 22px; }
.page-hero h1 {
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-bottom: 0.45em;
}
.page-hero h1 em { font-style: italic; color: var(--accent); }
.page-hero .sub {
  margin-top: 0;
  max-width: 640px;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.6;
  color: var(--muted);
  font-weight: 300;
}

/* ---------- Direct-answer block (the AI-liftable paragraph) ---------- */
.answer {
  margin-top: clamp(30px, 4vw, 46px);
  max-width: 760px;
  padding: clamp(24px, 3vw, 34px) clamp(24px, 3.2vw, 38px);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  background: oklch(0.955 0.006 250 / 0.025);
}
.answer p {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(19px, 1.9vw, 26px);
  line-height: 1.46;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: pretty;
}
.answer .answer-tag {
  display: block;
  margin-bottom: 14px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Author byline (E-E-A-T, machine-readable) ---------- */
.byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 14px 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.byline .who { display: grid; gap: 3px; }
.byline .who b { font-family: var(--sans); font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.byline .who span { font-size: 12px; }
.byline .avatar {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--panel);
}
.byline .avatar image-slot { width: 100%; height: 100%; display: block; }
.byline a { color: var(--ink); border-bottom: 1px solid var(--accent-line); transition: color .2s, border-color .2s; }
.byline a:hover { color: var(--accent); border-color: var(--accent); }
.byline time { color: var(--faint); }

/* ---------- Two-column article scaffold ---------- */
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(36px, 5vw, 88px);
  align-items: start;
  margin-top: clamp(48px, 6vw, 84px);
}
.article-grid.no-aside { grid-template-columns: minmax(0, 760px); }

/* sticky table of contents / facts rail */
.rail { position: sticky; top: 100px; display: grid; gap: 30px; }
.rail .rail-block { border-top: 1px solid var(--line); padding-top: 20px; }
.rail .rail-label { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.toc { display: grid; gap: 11px; }
.toc a { font-size: 13.5px; color: var(--muted); line-height: 1.4; transition: color .2s, padding-left .2s; border-left: 1px solid transparent; padding-left: 0; }
.toc a:hover, .toc a.active { color: var(--ink); border-left-color: var(--accent); padding-left: 10px; }

/* fact chips in the rail */
.fact { display: grid; gap: 3px; padding-bottom: 14px; }
.fact + .fact { border-top: 1px solid var(--line-2); padding-top: 14px; }
.fact dt { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.fact dd { margin: 0; font-family: var(--serif); font-weight: 300; font-size: 19px; letter-spacing: -0.01em; }
.fact dd small { font-family: var(--sans); font-size: 12px; color: var(--faint); letter-spacing: 0; display: block; margin-top: 2px; }

/* ---------- Prose (article body) ---------- */
.prose { max-width: 760px; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-top: clamp(48px, 5vw, 72px);
  scroll-margin-top: 100px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2vw, 25px);
  letter-spacing: -0.015em;
  margin-top: 2em;
  scroll-margin-top: 100px;
}
.prose p, .prose li {
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.72;
  color: oklch(0.955 0.006 250 / 0.82);
  font-weight: 300;
  text-wrap: pretty;
}
.prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }
.prose a { color: var(--ink); border-bottom: 1px solid var(--accent-line); transition: color .2s, border-color .2s; }
.prose a:hover { color: var(--accent); border-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.2em; margin-block: 1.2em; display: grid; gap: 0.6em; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 28px; }
.prose ul > li::before {
  content: ""; position: absolute; left: 4px; top: 0.72em;
  width: 12px; height: 1px; background: var(--accent);
}
.prose ol { padding-left: 1.4em; }
.prose ol > li { padding-left: 6px; }
.prose ol > li::marker { color: var(--accent); font-family: var(--serif); }
.prose blockquote {
  margin: 2em 0;
  padding-left: 26px;
  border-left: 2px solid var(--accent-line);
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(20px, 2.2vw, 27px);
  line-height: 1.5;
  color: var(--ink);
}
.prose .source {
  font-size: 13px;
  color: var(--faint);
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.prose .source a { border-bottom-color: var(--line); }

/* a numbered steps / timeline list (recovery, candidacy) */
.steps { display: grid; gap: 0; margin-top: 1.4em; border-top: 1px solid var(--line); }
.steps .step {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: clamp(16px, 3vw, 36px);
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.steps .step .when {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(18px, 1.8vw, 22px);
  letter-spacing: -0.01em;
  color: var(--accent);
}
.steps .step .what { font-size: 15.5px; line-height: 1.6; color: oklch(0.955 0.006 250 / 0.82); font-weight: 300; }
.steps .step .what b { color: var(--ink); font-weight: 600; }

/* ---------- FAQ (FAQPage schema target) ---------- */
.faq { border-top: 1px solid var(--line); margin-top: clamp(40px, 4vw, 56px); }
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 4px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(18px, 1.9vw, 24px);
  letter-spacing: -0.015em;
  line-height: 1.3;
  transition: color .2s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary .ico {
  flex: none;
  width: 22px; height: 22px;
  position: relative;
  margin-top: 4px;
}
.faq summary .ico::before, .faq summary .ico::after {
  content: ""; position: absolute; background: var(--accent);
  transition: transform .3s cubic-bezier(.2,.7,.3,1), opacity .3s ease;
}
.faq summary .ico::before { top: 10px; left: 0; width: 22px; height: 1.5px; }
.faq summary .ico::after { top: 0; left: 10px; width: 1.5px; height: 22px; }
.faq details[open] summary .ico::after { transform: scaleY(0); opacity: 0; }
/* smooth open/close where the browser supports it (::details-content +
   interpolate-size); everywhere else the toggle stays instant. */
:root { interpolate-size: allow-keywords; }
@media (prefers-reduced-motion: no-preference) {
  .faq details::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size .5s cubic-bezier(.22,.61,.36,1), content-visibility .5s allow-discrete;
  }
  .faq details[open]::details-content { block-size: auto; }
}
.faq summary .ico::before { transform-origin: center; }
.faq details[open] summary { color: var(--accent); }

.faq .answer-body {
  padding: 0 46px 26px 4px;
  max-width: 720px;
}
.faq .answer-body p {
  margin: 0 0 0.9em;
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.7;
  color: oklch(0.955 0.006 250 / 0.78);
  font-weight: 300;
}
.faq .answer-body p:last-child { margin-bottom: 0; }
.faq .answer-body a { color: var(--ink); border-bottom: 1px solid var(--accent-line); }

/* ---------- Procedures hub cards ---------- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: clamp(40px, 5vw, 60px);
}
.hub-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: clamp(26px, 3vw, 36px);
  transition: border-color .25s ease, transform .25s cubic-bezier(.2,.7,.3,1), background .25s ease;
  position: relative;
  overflow: hidden;
}
.hub-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent); transform: scaleY(0); transform-origin: top;
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.hub-card:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.hub-card:hover::after { transform: scaleY(1); }
.hub-card .hub-num { font-size: 12px; letter-spacing: 0.12em; color: var(--faint); }
.hub-card h3 {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -0.02em; line-height: 1.05;
}
.hub-card p { font-size: 14.5px; line-height: 1.6; color: var(--muted); font-weight: 300; }
.hub-card .go { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.hub-card .go .arr { transition: transform .22s ease; }
.hub-card:hover .go .arr { transform: translateX(4px); }

/* ---------- Research / publications list ---------- */
.cred-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: clamp(40px, 5vw, 60px);
}
.cred-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: clamp(24px, 3vw, 32px);
  display: grid;
  gap: 12px;
  align-content: start;
}
.cred-card .label { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.cred-card h3 { font-family: var(--serif); font-weight: 300; font-size: clamp(21px, 2.2vw, 27px); letter-spacing: -0.015em; line-height: 1.12; }
.cred-card p { font-size: 14px; line-height: 1.6; color: var(--muted); font-weight: 300; }
.cred-card .verify {
  margin-top: 4px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink);
  border-bottom: 1px solid var(--accent-line);
  width: fit-content;
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.cred-card .verify:hover { color: var(--accent); border-color: var(--accent); }
.cred-card .verify::after { content: "↗"; font-size: 12px; }

.pub-list { margin-top: clamp(36px, 4vw, 52px); border-top: 1px solid var(--line); }
.pub {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: clamp(16px, 3vw, 32px);
  padding: 24px 4px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  transition: padding-left .3s cubic-bezier(.2,.7,.3,1), background .3s ease;
}
a.pub:hover { padding-left: 14px; background: oklch(0.955 0.006 250 / 0.025); }
.pub .yr { font-family: var(--sans); font-size: 13px; color: var(--faint); letter-spacing: 0.04em; }
.pub .pub-body { display: grid; gap: 6px; }
.pub .pub-title { font-family: var(--serif); font-weight: 300; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.3; letter-spacing: -0.01em; }
.pub .pub-meta { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.pub .pub-meta em { font-style: italic; }
.pub .pub-go { font-size: 12px; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
a.pub:hover .pub-go { color: var(--ink); }

/* ---------- Blog list ---------- */
.post-list { display: grid; gap: 0; margin-top: clamp(40px, 5vw, 60px); border-top: 1px solid var(--line); }
.post-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(20px, 4vw, 56px);
  align-items: baseline;
  padding: clamp(26px, 3vw, 38px) 4px;
  border-bottom: 1px solid var(--line);
  transition: padding-left .3s cubic-bezier(.2,.7,.3,1), background .3s ease;
}
.post-row:hover { padding-left: 16px; background: oklch(0.955 0.006 250 / 0.025); }
.post-row .post-cat { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; display: block; }
.post-row h3 { font-family: var(--serif); font-weight: 300; font-size: clamp(22px, 2.8vw, 36px); letter-spacing: -0.02em; line-height: 1.08; max-width: 22ch; }
.post-row .excerpt { margin-top: 12px; font-size: 14.5px; line-height: 1.6; color: var(--muted); font-weight: 300; max-width: 56ch; }
.post-row .post-date { font-size: 12.5px; color: var(--faint); white-space: nowrap; letter-spacing: 0.03em; }

/* ---------- Reusable bottom CTA band ---------- */
.cta-band {
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(720px 340px at 18% 100%, oklch(0.76 0.035 238 / 0.055), transparent 68%);
  pointer-events: none;
}
.cta-band .cta-inner { position: relative; }
.cta-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding-block: clamp(56px, 7vw, 104px);
}
.cta-inner h2 { font-size: clamp(30px, 4.4vw, 58px); line-height: 1.0; letter-spacing: -0.03em; }
.cta-inner h2 em { font-style: italic; color: var(--accent); }
.cta-inner .lead { margin-top: 18px; max-width: 460px; font-size: clamp(15px, 1.2vw, 18px); line-height: 1.6; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.cta-actions .btn { --bh: 56px; justify-content: space-between; }
.cta-actions .small { font-size: 12px; color: var(--faint); line-height: 1.5; margin-top: 4px; }

/* ---------- Generic content section spacing ---------- */
.content { padding-bottom: clamp(40px, 6vw, 80px); }
.lede-row { max-width: 820px; }
.lede-row + .lede-row { margin-top: clamp(40px, 5vw, 64px); }

/* ---------- Contact form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  margin-top: clamp(40px, 5vw, 60px);
}
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field.row2 { grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px 15px;
  width: 100%;
  transition: border-color .2s ease, background .2s ease;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--panel-2);
  box-shadow: 0 0 0 3px oklch(0.76 0.035 238 / 0.12);
}
.field select {
  appearance: none;
  cursor: pointer;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 L6 6.5 L11 1.5' stroke='%239db5c5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.form .btn { --bh: 54px; margin-top: 6px; }
.form .consent { font-size: 12px; color: var(--faint); line-height: 1.5; }
.form-ok {
  border: 1px solid var(--accent-line);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  padding: 24px 26px;
  background: oklch(0.955 0.006 250 / 0.025);
}
.form-ok h3 { font-family: var(--serif); font-weight: 300; font-size: 26px; letter-spacing: -0.02em; }
.form-ok p { margin-top: 10px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* contact info card reuses .contact-card from styles.css */
.contact-side { display: grid; gap: 16px; }
.map-slot {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, oklch(0.26 0.012 250) 0 11px, oklch(0.23 0.012 250) 11px 22px);
  display: grid;
  place-items: center;
}
.map-slot .map-tag { font-family: var(--sans); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

/* small responsive */
@media (max-width: 1000px) {
  .article-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .rail { position: static; order: 2; }
  .hub-grid, .cred-grid { grid-template-columns: 1fr; }
  .cta-inner { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .pub { grid-template-columns: 1fr; gap: 8px; }
  .pub .pub-go { display: none; }
  .post-row { grid-template-columns: 1fr; gap: 10px; }
  .post-row .post-date { order: -1; }
  .steps .step { grid-template-columns: 1fr; gap: 4px; }
  .faq .answer-body { padding-right: 4px; }
  .field.row2 { grid-template-columns: 1fr; }
}
