/* ==========================================================================
 * Typography  one scale for the whole site (v1).
 * Roles, not tags: each component maps to a role token below. Loaded after
 * the section stylesheets and before surfaces.css. Remove the enqueue in
 * functions.php (drhoa_enqueue_typography) to roll back.
 * Families are unchanged: Source Serif 4 (display, headings, statements),
 * Be Vietnam Pro (body, labels, controls).
 * ======================================================================= */

:root {
--fs-h1: clamp(1.875rem, 1.6rem + .8vw, 2.25rem);
--fs-h2: clamp(1.5rem, 1.3rem + .55vw, 1.75rem);
--fs-h3: clamp(1.25rem, 1.15rem + .3vw, 1.375rem);
--fs-h4: clamp(1.0625rem, 1rem + .2vw, 1.1875rem);
--fs-h5: 1.0625rem;
--fs-card: .875rem;
--fs-statement: clamp(1.25rem, 1.12rem + .4vw, 1.4375rem);
--fs-subtitle: 1.0625rem;
--fs-body: .9375rem;
--fs-small: .8125rem;
--fs-label: .6875rem;
--ls-eyebrow: .18em;
--ls-control: .12em;
}
/* Selectors are scoped to #page: section templates print their own <style>
 * blocks inside <body>, after this file; the id gives the role tokens the
 * precedence they need without !important. */


/* H1  the page's one display title (homepage: the physician). */
#page .hero-copy h1 {
font-size: var(--fs-h1);
line-height: 1.05;
letter-spacing: .01em;
}

/* H2  every section title, one size, title case. */
#page .section-title,
#page .ipmx-title {
font-size: var(--fs-h2);
line-height: 1.15;
letter-spacing: 0;
text-transform: none;
}

/* H3  headings inside a section (domain detail). */
#page .sixd-heading {
font-size: var(--fs-h3);
line-height: 1.2;
}

/* H4  component headings. */
#page .faq-btn-label,
#page .facx-clinic-title {
font-size: var(--fs-h4);
line-height: 1.3;
}

/* Card titles (uppercase serif). */
#page .condx-title,
#page .facx-title {
font-size: var(--fs-card);
line-height: 1.3;
letter-spacing: .04em;
}

/* H5  sentence-case titles of stories and method families. */
#page .hwt-family,
#page .pst-title {
font-size: var(--fs-h5);
line-height: 1.3;
}

/* Statements  the large serif sentences that open or close a section. */
#page .hero-copy .lead,
#page .ipmx-lead,
#page .hwt-statement {
font-size: var(--fs-statement);
line-height: 1.3;
}

/* Subtitles  the italic line under a section title. */
#page .ipmx-copy .subtitle,
#page .facx-head .subtitle,
#page .hwt-subtitle,
#page .pst-subtitle,
#page .edu-subtitle {
font-size: var(--fs-subtitle);
line-height: 1.4;
}

/* Body  section introductions. */
#page .hwt-intro,
#page .pst-intro,
#page .lede-text,
#page .hwt-closing {
font-size: var(--fs-body);
line-height: 1.7;
}

/* Small  text inside cards. */
#page .hwt-desc,
#page .apprx-card p,
#page .pst-card p:not([class]) {
font-size: var(--fs-small);
line-height: 1.6;
}

/* Eyebrows. */
#page .hero-bio__eyebrow,
#page .dhpc-accordion__eyebrow,
#page .sixd-eyebrow,
#page .apprx-eyebrow,
#page .facx-clinic-eyebrow,
#page .edu-hl-label {
font-size: var(--fs-label);
letter-spacing: var(--ls-eyebrow);
}

/* Text controls (uppercase link-buttons). */
#page .dhpc-accordion__link,
#page .apprx-more,
#page .dplate-btn,
#page .hwt-more,
#page .pst-link,
#page .pst-all,
#page .edu-door {
font-size: var(--fs-label);
letter-spacing: var(--ls-control);
}

/* Balanced wrapping for display text; no orphans in body copy. */
#page .hero-copy h1,
#page .section-title,
#page .ipmx-title,
#page .sixd-heading,
#page .faq-btn-label,
#page .hwt-family,
#page .pst-title,
#page .hero-copy .lead,
#page .ipmx-lead,
#page .hwt-statement,
#page .ed-head h1,
#page .ed-group-title {
text-wrap: balance;
}

#page .hwt-intro,
#page .pst-intro,
#page .lede-text,
#page .hwt-closing {
text-wrap: pretty;
}

/* Narrowest phones: the uppercase card title must fit its text column
 * ("Neuropathic" in a 102px column at 320). */
@media (max-width: 374px) {
#page .condx-title {
font-size: .8125rem;
letter-spacing: .01em;
}
}

/* Editorial pages share the homepage roles. Reading text (.ed-p and prose
 * paragraphs, 17px) stays one step above homepage body copy (15px) on
 * purpose: these pages are read at length. */
#page .ed h1 {
font-size: var(--fs-h1);
line-height: 1.08;
}

#page .ed h2 {
font-size: var(--fs-h2);
line-height: 1.15;
}

#page .ed .ed-lede {
font-size: var(--fs-statement);
line-height: 1.35;
}

/* Readable measure for section introductions. */
#page .hwt-intro,
#page .pst-intro,
#page .lede-text {
max-width: 68ch;
}

/* --------------------------------------------------------------------------
 * Six domains panel.
 * The views share one grid cell; they now change in sequence (old out,
 * then new in) instead of cross-fading, so two texts never overlap. Each
 * view centres itself in the panel. Type follows the role tokens.
 * ----------------------------------------------------------------------- */
#page .sixd-view {
align-self: center;
transform: translateY(4px);
transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

#page .sixd-view.is-current {
transform: none;
transition: opacity .34s var(--ease-out-soft, ease) .18s, transform .34s var(--ease-out-soft, ease) .18s, visibility 0s linear 0s;
}

#page .sixd-view[data-panel="overview"] .sixd-body {
max-width: 34em;
font-size: var(--fs-statement);
line-height: 1.34;
text-wrap: balance;
}

#page .sixd-list li,
#page .sixd-view[data-panel="overview"] .sixd-list li {
font-size: var(--fs-small);
}

#page .sixd-kicker-number {
font-size: 1.5rem;
}

#page .sixd-view[data-num]::before {
font-size: clamp(4.5rem, 3.5rem + 3vw, 7rem);
top: -18px;
opacity: .18;
}

#page .sixd-index-name {
font-size: .625rem;
letter-spacing: .12em;
}

@media (prefers-reduced-motion: reduce) {
#page .sixd-view,
#page .sixd-view.is-current {
transform: none;
transition: none;
}
}

/* Narrowest phones: the domain index runs in two columns so names fit. */
@media (max-width: 374px) {
#page .sixd-index {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}

/* Six domains panel: the frame is as tall as its content (the tallest
 * view plus the domain index) and sits centred against the title and the
 * diagram, instead of stretching to their height and leaving the frame
 * half empty. */
#page .sixd-panel {
align-self: center;
min-height: 0;
}

#page .sixd-panel-inner {
flex: 0 0 auto;
align-content: start;
max-height: none;
overflow: visible;
}

/* Remaining body copy brought onto the body role. */
#page .apprx-intro p:not(.apprx-lead),
#page .sixd-view:not([data-panel="overview"]) .sixd-body {
font-size: var(--fs-body);
line-height: 1.7;
}

/* Domain index columns by width: six across only where names fit;
 * three on laptops and tablets; two on the narrowest phones. */
@media (max-width: 1100px) {
#page .sixd-index {
grid-template-columns: repeat(3, minmax(0, 1fr));
row-gap: 12px;
}
}

@media (max-width: 374px) {
#page .sixd-index {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
