/* Dr. Phyx — "Questions & evidence" pages. Builds on styles.css tokens; no animation library needed. */

.page-nav { position: sticky; top: 0; color: var(--ink); background: rgba(255, 255, 255, 0.74); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 1px 0 rgba(45, 45, 86, 0.08); }
.page-nav .nav__word--dark { display: block; }
.page-nav .nav__word--light { display: none; }

.crumbs { font-family: var(--f-label); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs a { text-decoration: none; color: var(--navy); }
.crumbs a:hover { color: var(--blue-ink); }
.crumbs span[aria-hidden] { color: var(--rule-strong); }

/* ---------- article head ---------- */

.doc-head { background: var(--mist); padding: clamp(40px, 8vh, 88px) var(--gutter) clamp(36px, 6vh, 64px); }
.doc-head__inner { max-width: 880px; margin: 0 auto; }
.doc-head h1 {
  margin: 18px 0 16px;
  font-family: var(--f-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.doc-head h1 span { color: var(--blue-ink); }
.doc-head__lead { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.55; color: var(--navy); max-width: 46ch; }
.reviewed {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--muted);
}
.reviewed strong { color: var(--ink); font-weight: 600; }
.reviewed img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: center 18%; }
.reviewed__who { display: flex; align-items: center; gap: 12px; }

/* ---------- article body ---------- */

.doc { padding: clamp(40px, 7vh, 80px) var(--gutter) clamp(64px, 10vh, 120px); }
.doc__inner { max-width: 880px; margin: 0 auto; }
.doc section + section { margin-top: clamp(48px, 8vh, 88px); }
.doc h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 8px;
}
.doc .section-lead { color: var(--muted); max-width: 60ch; margin-bottom: 20px; }
.doc p, .doc li { max-width: 68ch; }
.doc p + p { margin-top: 14px; }

/* questions first: ruled Q&A list, the same field language as the care plan */
.qa { border-top: 1px solid var(--ink); }
.qa__item { padding: 22px 0 24px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: 14px; }
.qa__n { font-family: var(--f-label); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); padding-top: 8px; }
.qa__item h3 { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; font-size: 1.375rem; line-height: 1.2; margin-bottom: 8px; }
.qa__item p { grid-column: 2; color: var(--ink); }
.qa__item p + p { margin-top: 10px; }

/* evidence: each finding carries its strength in words, never colour alone */
.evidence { display: grid; gap: 14px; }
.finding { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; }
.finding__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 8px; }
.finding h3 { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; font-size: 1.25rem; line-height: 1.2; }
.strength { font-family: var(--f-label); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--navy); white-space: nowrap; }
.strength { white-space: normal; max-width: 100%; } /* long study labels wrap instead of widening the page */
.strength--strong { background: var(--ink); border-color: var(--ink); color: #fff; }
.strength--moderate { background: var(--mist); }
.finding p { color: var(--ink); }
.cite { font-family: var(--f-label); font-size: 0.75rem; font-weight: 700; color: var(--blue-ink); text-decoration: none; vertical-align: super; line-height: 0; margin-left: 2px; }
.cite:hover { text-decoration: underline; }

.takeaway { margin-top: 22px; padding: 20px 22px; border-radius: var(--radius); background: var(--mist); }
.takeaway p { font-family: var(--f-hand); font-style: italic; font-size: 1.25rem; line-height: 1.45; color: var(--navy); }
.takeaway p strong { font-style: normal; font-family: var(--f-label); font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; display: block; margin-bottom: 6px; color: var(--ink); }

.plain-list { display: grid; gap: 10px; margin-top: 14px; }
.plain-list li { position: relative; padding-left: 22px; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }

.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius); padding: clamp(28px, 4vw, 44px); display: grid; gap: 18px; }
.cta-band h2 { color: #fff; font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
.cta-band h2 span { color: var(--sky); }
.cta-band p { color: var(--on-dark); }
.cta-band .btn { justify-self: start; }

.refs { counter-reset: none; display: grid; gap: 12px; font-size: 0.9375rem; color: var(--muted); padding-left: 1.4em; list-style: decimal; }
.refs li { padding-left: 4px; max-width: 80ch; }
.refs li::marker { color: var(--ink); font-weight: 600; }
.refs a { color: var(--navy); word-break: break-word; }
.refs li:target { background: var(--mist); outline: 6px solid var(--mist); border-radius: 2px; }

.doc-note { margin-top: 28px; font-size: 0.875rem; color: var(--muted); max-width: 72ch; }

/* ---------- index ---------- */

.articles { border-top: 1px solid var(--ink); }
.article-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 24px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  position: relative;
}
.article-link h2 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); margin: 0; }
.article-link p { grid-column: 1; color: var(--muted); max-width: 60ch; }
.article-link .go { grid-row: 1 / span 2; grid-column: 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--rule-strong); transition: background-color 200ms ease, border-color 200ms ease, transform 240ms var(--ease-out); }
.article-link .go svg { width: 20px; height: 20px; }
.article-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .article-link:hover .go { background: var(--blue); border-color: var(--blue); transform: translateX(4px); }
  .article-link:hover::after { transform: scaleX(1); }
}
.coming { margin-top: 28px; color: var(--muted); font-family: var(--f-hand); font-style: italic; font-size: 1.125rem; }

@media (max-width: 600px) {
  .qa__item { grid-template-columns: 1fr; }
  .qa__n { padding-top: 0; margin-bottom: 4px; }
  .qa__item p { grid-column: 1; }
  .article-link { grid-template-columns: 1fr; }
  .article-link .go { display: none; }
}

/* "One technique is not enough": the clinic's combination principle, shown on every evidence page */
.combo { margin-top: 22px; padding: 22px 24px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.combo__title { font-family: var(--f-display); font-weight: 600; text-transform: uppercase; font-size: 1.375rem; line-height: 1.15; margin-bottom: 8px; color: var(--sky); }
.combo p + p { margin-top: 0; }
.combo p:not(.combo__title) { color: var(--on-dark); max-width: 64ch; }

/* jump targets clear the sticky bar (WCAG 2.4.11) */
[id] { scroll-margin-top: calc(var(--nav-h) + 20px); }

/* ---------- article header: editorial split with the clinician's photo ---------- */
.ah { background: var(--mist); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); min-height: min(620px, calc(100svh - var(--nav-h))); }
.ah__text { padding: clamp(48px, 9vh, 96px) clamp(24px, 5vw, 80px) clamp(40px, 6vh, 64px) max(var(--gutter), calc((100vw - var(--max)) / 2)); display: flex; flex-direction: column; justify-content: flex-end; }
.ah h1 { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; font-size: clamp(3rem, 6.4vw, 6rem); line-height: 0.9; margin: 18px 0 20px; letter-spacing: -0.01em; text-wrap: balance; }
.ah h1 span { display: block; color: var(--blue-ink); font-size: 0.52em; line-height: 1; margin-top: 10px; }
.ah__lead { font-size: 1.1875rem; line-height: 1.55; color: var(--navy); max-width: 44ch; }
.ah__meta { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule-strong); display: flex; flex-wrap: wrap; gap: 8px 24px; font-family: var(--f-label); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ah__meta b { color: var(--ink); font-weight: 700; }
.ah__photo { position: relative; margin: 0; overflow: hidden; min-height: 360px; }
.ah__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.ah__photo--low img { object-position: 50% 42%; } /* photos where the face sits lower in the frame */
.ah__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--mist) 0%, rgba(232, 237, 247, 0) 18%); }

/* reading progress: pure CSS, shown only where scroll-linked animation is supported */
.readbar { position: sticky; top: var(--nav-h); z-index: 40; height: 3px; background: rgba(45, 45, 86, 0.08); display: none; }
.readbar span { display: block; height: 100%; width: 100%; background: var(--blue); transform-origin: left; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  .readbar { display: block; }
  .readbar span { animation: readprogress linear both; animation-timeline: scroll(root); }
}
@keyframes readprogress { to { transform: scaleX(1); } }

/* question index */
.toc { margin-bottom: clamp(48px, 8vh, 88px); }
.toc h2 { font-family: var(--f-label); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: q; border-top: 1px solid var(--ink); }
.toc li { counter-increment: q; max-width: none; }
.toc a { display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--rule); text-decoration: none; font-family: var(--f-display); font-weight: 500; text-transform: uppercase; font-size: 1.1875rem; line-height: 1.2; padding: 8px 0; transition: padding 300ms var(--ease-out), color 200ms ease; }
.toc a::before { content: counter(q, decimal-leading-zero); font-family: var(--f-label); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; color: var(--blue-ink); }
.toc a::after { content: "↓"; font-family: var(--f-body); color: var(--muted); }
.toc .toc__ev a::before { content: "→"; }
@media (hover: hover) and (pointer: fine) { .toc a:hover { padding-left: 8px; color: var(--blue-ink); } }

@media (max-width: 899px) {
  .ah { grid-template-columns: 1fr; min-height: 0; }
  .ah__photo { order: -1; min-height: 0; height: 300px; }
  .ah__photo::after { background: linear-gradient(0deg, var(--mist) 0%, rgba(232, 237, 247, 0) 35%); }
  .ah__text { padding-top: 8px; }
}

/* Brand typography (Montserrat) on evidence pages: normal-case labels, tracking tightens with size */
.crumbs, .ah__meta, .toc h2, .strength, .qa__n, .reviewed { text-transform: none; letter-spacing: 0; font-size: 0.8125rem; }
.ah h1, .doc-head h1 { text-transform: none; font-weight: 800; letter-spacing: -0.035em; line-height: 1; font-size: clamp(2.5rem, 5.2vw, 4.5rem); }
.ah h1 span, .doc-head h1 span { font-weight: 700; letter-spacing: -0.02em; }
.qa__item h3, .finding h3, .toc a, .article-link h2, .combo__title, .cta-band h2 { text-transform: none; letter-spacing: -0.015em; font-weight: 700; }
.qa__item h3 { font-size: 1.1875rem; }
.finding h3 { font-size: 1.125rem; }
.toc a { font-size: 1.0625rem; }
.combo__title { font-size: 1.25rem; }
.doc h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
.article-link h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }

/* brand safety signature under "How we use it" */
.safety { font-weight: 600; color: var(--blue-ink); }
