/* Site-specific styles that Bootstrap doesn't cover. Load after theme.css. */

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 1030; background: var(--chrome); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.12; text-wrap: balance; letter-spacing: -.01em; margin-bottom: 0; }
h2 { font-size: var(--s3); }
h3 { font-size: var(--s2); }
.h-body { font-family: var(--f-body); font-weight: 700; font-size: var(--s1); }
p { margin-bottom: 0; }

.container { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-family: var(--f-mono); font-size: var(--s-1); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lede { font-size: var(--s1); color: var(--muted); max-width: 40rem; }
.small-muted { color: var(--muted); font-size: .95rem; }
.text-plum { color: var(--plum); }
.mono-label { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

/* Header */
.site-head { top: env(safe-area-inset-top, 0px); background: var(--chrome); }
.site-head .navbar-brand svg { width: 28px; height: 28px; flex: none; }
.site-head .nav-link { font-size: .9rem; font-weight: 500; border-radius: 999px; }
@media (min-width: 1200px) { .site-head .nav-link { padding-inline: .65rem !important; } .site-head .nav-link:hover { background: color-mix(in srgb, var(--chrome-ink) 12%, transparent); } }
.navbar-toggler { color: var(--chrome-ink); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 35%, transparent); }

/* Sections */
section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.band { background: var(--band); }
.sec-head { display: grid; gap: .75rem; margin-bottom: 2.25rem; }
.sub-h { font-size: var(--s2); margin-block: 3rem 1.25rem; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 6vw, 4.5rem); }
/* Headline stays on one line: it scales down with the column width (8.3% of the column fits the full phrase) */
.hero-copy { container-type: inline-size; }
.hero h1 { font-size: min(var(--s4), 8.3cqi); white-space: nowrap; margin-block: .75rem 1.25rem; }
.hero h1 em { font-style: normal; color: var(--accent); }

.facts { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.fact { border-top: 1px solid var(--line); padding: 1.25rem 1.25rem 1.25rem 0; display: grid; gap: .35rem; align-content: start; font-variant-numeric: tabular-nums; }
.fact b { font-family: var(--f-display); font-weight: 400; font-size: var(--s3); color: var(--plum); line-height: 1; }
.fact span { color: var(--muted); font-size: .95rem; }
.facts-src { font-family: var(--f-mono); font-size: .75rem; color: var(--muted); margin-top: .6rem; }

/* Cards with icons */
.sign-icon { width: 40px; height: 40px; color: var(--accent); }
.card-body { display: grid; gap: .5rem; align-content: start; }

/* Tags */
.tag { font-family: var(--f-mono); font-size: .72rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; justify-self: start; }
.tag-fixed { background: var(--band); color: var(--muted); }
.tag-change { background: var(--accent-soft); color: var(--accent); }
.list-group-item b { font-weight: 600; display: block; }

/* Self-exam clock diagram */
.exam-clock { width: min(100%, 230px); margin: .25rem auto 0; }
.exam-clock figcaption { font-family: var(--f-mono); font-size: var(--s-1); color: var(--muted); margin-top: .6rem; }

/* Self-exam steps */
.steps { counter-reset: step; display: grid; gap: 1rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.steps li::before { content: counter(step); font-family: var(--f-display); font-size: 1.6rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.steps p { color: var(--muted); }
.nav-pills { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .25rem; display: inline-flex; }
.nav-pills .nav-link { border-radius: 999px; font-weight: 600; }
@media (min-width: 992px) { .exam-aside { position: sticky; top: 6rem; } }

/* Tables */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table { margin-bottom: 0; font-variant-numeric: tabular-nums; min-width: 34rem; }
.table th { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: .9rem 1.1rem; }
.table td { padding: .9rem 1.1rem; }
.table td:first-child { font-weight: 700; white-space: nowrap; color: var(--plum); }
.table tbody tr:last-child td { border-bottom: 0; }
.stages td:first-child { font-family: var(--f-display); font-weight: 400; font-size: 1.35rem; }
.note { font-size: .9rem; color: var(--muted); margin-top: .9rem; max-width: 46rem; }

/* Ruled items: screening tools, prevention, rights, types */
.ruled { border-top: 1px solid var(--line); padding-top: 1rem; display: grid; gap: .4rem; align-content: start; }
.ruled-accent { border-top: 2px solid var(--accent); }

/* Diagnosis path */
.path { counter-reset: p; }
.path li { counter-increment: p; display: grid; gap: .5rem; align-content: start; }
.path li::before { content: "Step " counter(p); font-family: var(--f-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); padding-bottom: .75rem; border-bottom: 2px solid var(--accent); margin-bottom: .5rem; }

/* Glossary */
.gloss-search { max-width: 26rem; }
.gloss-count { font-family: var(--f-mono); font-size: var(--s-1); color: var(--muted); }
.gloss dt { font-weight: 700; color: var(--plum); }
.gloss dd { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.gloss .col { border-top: 1px solid var(--line); padding-block: 1rem; }

/* Resources */
.res-card { color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.res-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink); }
.res-card b { font-size: var(--s1); }

/* Ads: fixed side rails on wide screens (Bootstrap xxl, 1400px+), inline banners below that */
:root { --rail-w: clamp(240px, 16vw, 300px); }
.ad-rail { display: none; }
@media (min-width: 1400px) {
  body:has(.ad-rail) :is(main, .site-foot) .container { max-width: min(1320px, calc(100vw - 2 * (var(--rail-w) + 3rem))); }
  /* Both rails: same width, 75% of the visible screen tall, centered in the space below the header */
  .ad-rail { display: block; position: fixed; z-index: 1010; width: var(--rail-w); height: 75vh; height: 75dvh; top: calc(env(safe-area-inset-top, 0px) + 2.125rem + 12.5vh); top: calc(env(safe-area-inset-top, 0px) + 2.125rem + 12.5dvh); }
  .ad-left { left: max(1.25rem, env(safe-area-inset-left, 0px)); }
  .ad-right { right: max(1.25rem, env(safe-area-inset-right, 0px)); }
}
.ad-card, .ad-banner {
  font: inherit; text-align: left; border: 0; cursor: pointer; width: 100%;
  background: var(--plum); color: var(--bg); border-radius: var(--radius);
  transition: transform .15s, box-shadow .15s;
}
.ad-card:hover, .ad-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--plum) 70%, transparent); }
.ad-card { display: flex; flex-direction: column; gap: 1.1rem; height: 100%; padding: 1.75rem 1.25rem; overflow: hidden; }
.ad-card .ad-cta { margin-top: auto; }
/* Never squeeze a section: long text pushes the checklist down instead of running into it */
.ad-card > * { flex-shrink: 0; }
.ad-card .ad-kicker, .ad-card .ad-title, .ad-card .ad-body { text-align: center; }
/* Same slot heights in every side ad so headlines, text, checklists, and buttons line up across both */
.ad-card .ad-title { min-height: 6em; display: flex; flex-direction: column; justify-content: center; }
.ad-card .ad-body { min-height: 6.4em; text-align: justify; text-align-last: center; hyphens: auto; -webkit-hyphens: auto; }
.ad-banner .ad-title { text-align: center; }
.ad-title { display: block; }
.ad-line { display: block; white-space: nowrap; line-height: 1.2; }
.ad-card > *, .ad-banner > * { transition: opacity .3s ease; }
.ad-swapping > * { opacity: 0; }
.ad-kicker { font-family: var(--f-mono); font-size: .88rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.ad-title { font-family: var(--f-display); font-size: clamp(1.6rem, 1.9vw, 2.2rem); line-height: 1.1; text-wrap: balance; }
.ad-body { font-size: 1rem; opacity: .85; }
.ad-list { display: grid; gap: .5rem; font-size: 1rem; }
.ad-list span::before { content: "\2713"; color: var(--ad-accent); margin-right: .5rem; font-weight: 700; }
.ad-cta { justify-self: stretch; text-align: center; background: var(--ad-accent); color: var(--ad-accent-ink); border-radius: 999px; padding: .8rem .75rem; font-weight: 700; font-size: 1rem; white-space: nowrap; }

.ad-inline { padding-block: 1.5rem; }

/* Quote form */
#leadModal .form-check-label { font-size: .82rem; line-height: 1.45; }
#leadModal .form-label { margin-bottom: .3rem; font-weight: 500; }
.choice .btn-check:checked + .btn { --bs-btn-active-bg: var(--accent); --bs-btn-active-border-color: var(--accent); --bs-btn-active-color: var(--accent-ink); }
.was-validated .choice .btn-check:invalid + .btn { border-color: var(--bs-form-invalid-border-color); }
.ad-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kicker cta" "title cta"; align-items: center; gap: .3rem 1.5rem; padding: 1.25rem 1.5rem; }
.ad-banner .ad-kicker { grid-area: kicker; }
.ad-banner .ad-title { grid-area: title; font-size: 1.35rem; }
.ad-banner .ad-cta { grid-area: cta; justify-self: start; }
@media (max-width: 575.98px) {
  .ad-banner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kicker" "title" "cta"; gap: .6rem; }
}

/* Footer: one row (copyright left, links right); wraps under the copyright on small screens */
.site-foot { background: var(--chrome); color: var(--chrome-ink); padding-block: 1.25rem; font-size: .875rem; }
.site-foot a { color: inherit; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1.5rem; }
.foot-copy { white-space: nowrap; opacity: .85; }
.foot-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.foot-nav a { text-decoration: none; opacity: .85; white-space: nowrap; }
.foot-nav a:hover { opacity: 1; text-decoration: underline; }

/* Legal page */
.legal { max-width: 48rem; }
.legal-title { font-size: var(--s4); }
.legal-toc { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.5rem; }
.legal-toc a { padding: .4rem 1rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; }
.legal-toc a:hover { border-color: var(--accent); }
.legal h2 { margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--accent); }
.legal h2:first-of-type { margin-top: 0; }
.legal h3 { font-family: var(--f-body); font-weight: 700; font-size: var(--s1); margin-top: 1.75rem; margin-bottom: .5rem; }
.legal p, .legal li { color: var(--muted); }
.legal p + p, .legal ul + p, .legal p + ul { margin-top: .75rem; }
.legal ul { display: grid; gap: .4rem; padding-left: 1.25rem; margin-bottom: 0; }
