/* Dental Smile Office — single stylesheet.
   :root below is the ONE token owner. Identity from the clinic's real treatment room:
   marble-white ground, olive cabinet green, deep blue chair. Measured with
   dental-fleet-palette's checker (pairs and revision evidence in DESIGN.md). */

:root {
  --smo-ground: #F5F4EE;      /* marble white */
  --smo-surface: #FFFFFF;
  --smo-tint: #E8ECDD;        /* soft cabinet green, section ground */
  --smo-ink: #1B2622;
  --smo-muted: #4D5A54;
  --smo-action: #1D4F7C;      /* chair blue: buttons, links, focus */
  --smo-action-hover: #163D60;
  --smo-on-action: #FFFFFF;
  --smo-leaf: #4A6420;        /* olive: accents, numerals (6.1:1 on ground) */
  --smo-leaf-block: #7F9A3E;  /* decorative slab only, never text */
  --smo-line: #D8D5C9;        /* decorative hairline */
  --smo-control-line: #8E8A7C;/* identifying control edge (3.1:1) */
  --smo-dark: #1B2622;
  --smo-on-dark: #FFFFFF;
  --smo-on-dark-muted: #C9D1CB;

  --smo-font-display: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, Palatino, Georgia, serif;
  --smo-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --smo-wrap: 1200px;
  --smo-gutter: 20px;
  --smo-section: clamp(56px, 8vw, 96px);
  --smo-radius: 4px;
  --smo-callbar-h: 64px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-block: 110px 88px; }
body {
  margin: 0;
  background: var(--smo-ground);
  color: var(--smo-ink);
  font-family: var(--smo-font-body);
  font-size: 1rem;
  line-height: 1.6;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: break-word; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--smo-action); }
button { font: inherit; }
::selection { color: var(--smo-ink); background: var(--smo-tint); }
:focus-visible { outline: 3px solid var(--smo-action); outline-offset: 2px; }
main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- utilities: type + spacing live on elements ---------- */
.ff-display { font-family: var(--smo-font-display); }
.ff-body { font-family: var(--smo-font-body); }
.fs-12 { font-size: 0.75rem; }
.fs-14 { font-size: 0.875rem; }
.fs-16 { font-size: 1rem; }
.fs-18 { font-size: 1.125rem; }
.fs-20 { font-size: 1.25rem; }
.fs-24 { font-size: 1.5rem; }
.fs-32 { font-size: 2rem; }
.fs-40 { font-size: 2.5rem; }
.fs-44 { font-size: clamp(2.25rem, 8vw, 2.75rem); }
.fs-52 { font-size: 3.25rem; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.lh-11 { line-height: 1.1; }
.lh-12 { line-height: 1.2; }
.lh-13 { line-height: 1.3; }
.lh-14 { line-height: 1.4; }
.lh-15 { line-height: 1.5; }
.lh-16 { line-height: 1.6; }
.tt-u { text-transform: uppercase; }
.ls-wide { letter-spacing: 0.08em; }
.tnum { font-variant-numeric: tabular-nums; }
.d-block { display: block; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

@media (min-width: 768px) {
  .md\:fs-20 { font-size: 1.25rem; }
  .md\:fs-32 { font-size: 2rem; }
  .md\:fs-40 { font-size: 2.5rem; }
  .md\:fs-52 { font-size: 3.25rem; }
  .md\:fs-64 { font-size: clamp(3.25rem, 5vw, 4rem); }
}

/* ---------- shared ---------- */
.smo-wrap { width: 100%; max-width: var(--smo-wrap); margin-inline: auto; padding-inline: var(--smo-gutter); }
@media (min-width: 768px) { :root { --smo-gutter: 24px; } }
.smo-muted { color: var(--smo-muted); }
.smo-measure { max-width: 62ch; }
.smo-link { color: var(--smo-action); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.smo-link:hover { text-decoration-thickness: 2px; }

.smo-skip { position: absolute; left: 12px; top: -100px; z-index: 100; background: var(--smo-dark); color: var(--smo-on-dark); padding: 12px 16px; border-radius: var(--smo-radius); }
.smo-skip:focus { top: 12px; }

.smo-config-note { border: 1px dashed var(--smo-control-line); background: var(--smo-surface); color: var(--smo-muted); padding: 12px 16px; border-radius: var(--smo-radius); max-width: 62ch; }

/* buttons */
.smo-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.smo-actions--stack { flex-direction: column; }
.smo-actions > * { max-width: 100%; }
.smo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 48px; padding: 10px 20px; border-radius: var(--smo-radius);
  text-decoration: none; border: 1px solid transparent; text-align: center;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.smo-btn--call { background: var(--smo-action); color: var(--smo-on-action); }
.smo-btn--call:hover { background: var(--smo-action-hover); }
.smo-btn--quiet { background: transparent; color: var(--smo-action); border-color: var(--smo-control-line); }
.smo-btn--quiet:hover { border-color: var(--smo-action); }
.smo-btn--call:focus-visible, .smo-callbar__btn--call:focus-visible { outline-offset: 4px; }
.smo-btn__num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* images + demo label */
.smo-media { position: relative; }
.smo-media img { width: 100%; height: 100%; object-fit: cover; }
.smo-demo-tag { position: absolute; left: 12px; bottom: 12px; background: rgba(27, 38, 34, 0.85); color: var(--smo-on-dark); padding: 4px 8px; border-radius: var(--smo-radius); }

/* ---------- header ---------- */
.smo-header { background: var(--smo-ground); border-bottom: 1px solid var(--smo-line); position: sticky; top: 0; z-index: 50; }
/* Logged-in editors: the fixed admin bar is 32px, 46px below 783px, and scrolls away below 601px. */
.admin-bar .smo-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .smo-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .smo-header { top: 0; } }
.smo-header__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 84px; padding-block: 14px; }
.smo-brand { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--smo-ink); text-decoration: none; }
.smo-brand__place { color: var(--smo-leaf); }
.smo-menu-toggle { display: none; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; background: transparent; color: var(--smo-ink); border: 1px solid var(--smo-control-line); border-radius: var(--smo-radius); cursor: pointer; }
.smo-menu-toggle__bars, .smo-menu-toggle__bars::before, .smo-menu-toggle__bars::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.smo-menu-toggle__bars::before, .smo-menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.smo-menu-toggle__bars::before { top: -6px; }
.smo-menu-toggle__bars::after { top: 6px; }
.smo-menu-toggle[aria-expanded="true"] .smo-menu-toggle__bars { background: transparent; }
.smo-menu-toggle[aria-expanded="true"] .smo-menu-toggle__bars::before { top: 0; transform: rotate(45deg); }
.smo-menu-toggle[aria-expanded="true"] .smo-menu-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.smo-header__nav { display: flex; align-items: center; gap: 12px 20px; }
.smo-nav__list { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.smo-nav__list a { display: inline-flex; align-items: center; min-height: 44px; color: var(--smo-ink); text-decoration: none; border-bottom: 2px solid transparent; }
.smo-nav__list a:hover, .smo-nav__list .current-menu-item > a, .smo-nav__list .current-menu-ancestor > a, .smo-nav__list .current_page_item > a { border-bottom-color: var(--smo-leaf); }
.smo-nav, .smo-lang { min-width: 0; }
.smo-lang ul { display: flex; gap: 4px; }
.smo-lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--smo-muted); text-decoration: none; border-radius: var(--smo-radius); }
.smo-lang a[aria-current] { color: var(--smo-ink); background: var(--smo-tint); }
.smo-header__call { min-height: 44px; }

@media (max-width: 1149px) {
  .smo-header__bar { min-height: 76px; }
  .smo-header.is-enhanced .smo-menu-toggle { display: inline-flex; }
  .smo-header.is-enhanced .smo-header__nav { display: none; }
  .smo-header.is-enhanced .smo-header__nav.is-open { display: flex; }
  .smo-header:has(.smo-header__nav.is-open) { box-shadow: 0 12px 24px rgb(27 38 34 / 8%); }
  .smo-header__nav { flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 16px; }
  .smo-header.is-enhanced .smo-header__nav { max-height: calc(100dvh - 180px - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
  .smo-nav__list { flex-direction: column; gap: 0; }
  .smo-nav__list a { width: 100%; min-height: 48px; border-bottom: 1px solid var(--smo-line); }
  .smo-lang ul { flex-wrap: wrap; }
  .smo-header__call { align-self: flex-start; }
}
@media (max-width: 767px) {
  .smo-header__call { display: none; } /* the bottom call bar carries it on phones */
  /* Without enhancement, long navigation scrolls with the page instead of pinning it. */
  .smo-header:not(.is-enhanced) { position: relative; }
}

/* ---------- hero ---------- */
.smo-hero { padding-block: clamp(36px, 5vw, 64px) clamp(56px, 7vw, 88px); }
.smo-hero__grid { display: grid; gap: 40px; align-items: center; }
.smo-hero__copy { min-width: 0; }
.smo-hero h1 { max-width: 17ch; }
.smo-eyebrow { color: var(--smo-leaf); }
.smo-hero__lede { color: var(--smo-muted); max-width: 52ch; }
.smo-hero__hours { color: var(--smo-muted); }
.smo-hero__media { aspect-ratio: 4 / 3; margin-inline-start: 16px; }
.smo-hero__media::before { content: ""; position: absolute; inset: 16px 16px -16px -16px; background: var(--smo-leaf-block); z-index: -1; }
.smo-hero__media { isolation: isolate; }
@media (min-width: 900px) {
  .smo-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
  .smo-hero__media { aspect-ratio: 6 / 5; }
}
@media (max-width: 767px) {
  .smo-actions--hero { flex-direction: column; align-items: flex-start; }
}

/* ---------- facts strip ---------- */
.smo-facts { background: var(--smo-dark); color: var(--smo-on-dark); }
.smo-facts__list { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 28px; padding-block: 24px; }
.smo-facts__list li { display: flex; align-items: center; gap: 10px; }
.smo-facts__list li::before { content: ""; width: 8px; height: 8px; background: var(--smo-leaf-block); flex: none; }

/* ---------- sections ---------- */
.smo-section { padding-block: var(--smo-section); }
.smo-section--tint { background: var(--smo-tint); }
.smo-section--flush { padding-top: 0; }
.smo-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.smo-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 900px) { .smo-split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; } }

.smo-checklist li { position: relative; padding-left: 28px; padding-block: 8px; border-bottom: 1px solid var(--smo-line); }
.smo-checklist li::before { content: ""; position: absolute; left: 2px; top: 0.95em; width: 12px; height: 7px; border-left: 2px solid var(--smo-leaf); border-bottom: 2px solid var(--smo-leaf); transform: rotate(-45deg); }

/* treatment index */
.smo-tindex { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 900px) { .smo-tindex { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; } }
.smo-tindex__label { color: var(--smo-leaf); padding-bottom: 8px; border-bottom: 2px solid var(--smo-leaf); }
.smo-tindex__item { display: grid; gap: 8px; padding-block: 20px; padding-inline-end: 32px; border-bottom: 1px solid var(--smo-line); color: var(--smo-ink); text-decoration: none; position: relative; }
.smo-tindex__item::after { content: ""; position: absolute; inset-inline-end: 4px; top: 28px; width: 9px; height: 9px; border-top: 1.5px solid var(--smo-action); border-right: 1.5px solid var(--smo-action); transform: rotate(45deg); transition: translate 0.18s ease; }
.smo-tindex__item:hover::after { translate: 3px 0; }
.smo-tindex__name { color: var(--smo-ink); }
.smo-tindex__item:hover .smo-tindex__name { color: var(--smo-action); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
.smo-tindex__desc { color: var(--smo-muted); }
.smo-related { display: grid; gap: 0 48px; }
@media (min-width: 900px) { .smo-related { grid-template-columns: repeat(3, 1fr); } }

/* team */
.smo-team { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 768px) { .smo-team { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; } }
.smo-team__card { display: flex; gap: 24px; align-items: flex-start; background: var(--smo-surface); padding: 32px; border-top: 2px solid var(--smo-leaf); }
.smo-team__details { min-width: 0; }
.smo-team__mono, .smo-team__photo { flex: none; width: 72px; height: 72px; }
.smo-team__mono { display: grid; place-items: center; background: var(--smo-leaf); color: var(--smo-on-action); }
.smo-team__photo { object-fit: cover; }
@media (max-width: 899px) {
  .smo-team__card { padding: 24px; gap: 16px; }
  .smo-team__mono, .smo-team__photo { width: 56px; height: 56px; }
}

/* before / after */
.smo-cases { display: grid; gap: 40px; }
@media (min-width: 768px) { .smo-cases { grid-template-columns: repeat(2, 1fr); gap: 40px 32px; } }
@media (min-width: 1100px) { .smo-cases { grid-template-columns: repeat(3, 1fr); } }
.smo-case__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.smo-case__shot { position: relative; aspect-ratio: 4 / 3; background: var(--smo-surface); overflow: hidden; }
.smo-case__shot img { width: 100%; height: 100%; object-fit: cover; }
.smo-case__placeholder { display: grid; place-items: center; height: 100%; color: var(--smo-muted); border: 1px dashed var(--smo-control-line); background: repeating-linear-gradient(135deg, var(--smo-surface) 0 10px, var(--smo-ground) 10px 20px); }
.smo-case[hidden] { display: none; }
.smo-case__title { color: var(--smo-ink); text-decoration: none; }
.smo-case__title:hover { color: var(--smo-action); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
.smo-filter { display: none; flex-wrap: wrap; gap: 8px; }
.smo-cases-wrap.is-enhanced .smo-filter { display: flex; }
.smo-filter__btn { min-height: 44px; padding: 8px 16px; background: var(--smo-surface); color: var(--smo-ink); border: 1px solid var(--smo-control-line); border-radius: var(--smo-radius); cursor: pointer; }
.smo-filter__btn:hover { border-color: var(--smo-action); }
.smo-filter__btn[aria-pressed="true"] { background: var(--smo-action); color: var(--smo-on-action); border-color: var(--smo-action); }
.smo-case__label { position: absolute; left: 8px; top: 8px; background: var(--smo-dark); color: var(--smo-on-dark); padding: 2px 8px; }

/* steps */
.smo-steps { display: grid; gap: 32px; counter-reset: none; }
@media (min-width: 768px) { .smo-steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .smo-steps { grid-template-columns: repeat(4, 1fr); } }
.smo-steps__item { border-top: 2px solid var(--smo-ink); padding-top: 16px; }
.smo-steps__num { display: block; color: var(--smo-leaf); margin-bottom: 12px; }

/* visit */
.smo-visit { background: var(--smo-surface); border-top: 1px solid var(--smo-line); }
.smo-visit__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 900px) { .smo-visit__grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 64px; } }
.smo-visit__links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.smo-hours__row { display: flex; justify-content: space-between; gap: 16px; padding-block: 10px; border-bottom: 1px solid var(--smo-line); }
.smo-hours dd { text-align: right; }
.smo-hours dt, .smo-hours dd { min-width: 0; overflow-wrap: break-word; }

/* call band */
.smo-band { background: var(--smo-dark); color: var(--smo-on-dark); padding-block: clamp(48px, 7vw, 80px); }
.smo-band__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; }
@media (min-width: 1100px) { .smo-band__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: 64px; } }
.smo-actions--band { align-items: flex-start; }
.smo-band .smo-measure { color: var(--smo-on-dark-muted); }
.smo-band .smo-btn--call { background: var(--smo-on-dark); color: var(--smo-dark); }
.smo-band .smo-btn--call:hover { background: var(--smo-tint); }
.smo-band .smo-btn--quiet { color: var(--smo-on-dark); border-color: var(--smo-on-dark-muted); }
.smo-band :focus-visible, .smo-facts :focus-visible, .smo-footer :focus-visible { outline-color: var(--smo-on-dark); }

/* about */
.smo-about { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start; padding-bottom: var(--smo-section); }
.smo-about__media { aspect-ratio: 4 / 3; }
@media (min-width: 900px) {
  .smo-about { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: 64px; }
  .smo-about__media { position: sticky; top: 120px; }
}

/* page heads + treatment */
.smo-page-head { padding-block: clamp(32px, 6vw, 64px) 32px; }
.smo-page-head h1 { max-width: 24ch; }
.smo-page-head .smo-measure { color: var(--smo-muted); }
.smo-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--smo-muted); }
.smo-crumbs a { display: inline-flex; align-items: center; min-height: 32px; }
.smo-treatment__media { aspect-ratio: 16 / 5; margin-bottom: 48px; }
.smo-treatment__media img { height: 100%; }
.smo-treatment__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding-bottom: var(--smo-section); }
@media (min-width: 900px) {
  .smo-treatment__grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 64px; align-items: start; }
  .smo-treatment__aside { position: sticky; top: 108px; }
}
.smo-treatment__aside { background: var(--smo-surface); padding: 24px; border-top: 4px solid var(--smo-leaf-block); }
@media (max-width: 767px) { .smo-treatment__media { aspect-ratio: 4 / 3; margin-bottom: 32px; } }
.smo-disclaimer { color: var(--smo-muted); border-top: 1px solid var(--smo-line); padding-top: 16px; }

/* editor content: block markup cannot take utility classes (documented exception) */
.smo-prose { max-width: 68ch; overflow-wrap: break-word; }
.smo-prose > * + * { margin-top: 1em; }
.smo-prose h2 { font-family: var(--smo-font-display); font-weight: 500; font-size: 1.75rem; line-height: 1.2; margin-top: 1.6em; }
.smo-prose h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; margin-top: 1.4em; }
.smo-prose ul { list-style: disc; padding-left: 1.25em; }
.smo-prose ol { list-style: decimal; padding-left: 1.25em; }
.smo-prose li + li { margin-top: 0.4em; }
.smo-prose a { color: var(--smo-action); text-underline-offset: 0.2em; }

/* ---------- footer ---------- */
.smo-footer { background: var(--smo-dark); color: var(--smo-on-dark); padding-top: 56px; }
.smo-footer a { color: var(--smo-on-dark); }
.smo-footer .smo-muted { color: var(--smo-on-dark-muted); }
.smo-footer .smo-hours__row { border-color: rgba(255, 255, 255, 0.18); }
.smo-footer__grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .smo-footer__grid { grid-template-columns: 1.3fr 1fr 1fr; gap: 64px; } }
.smo-footer__menu { display: grid; gap: 4px; }
.smo-footer__menu a { display: inline-flex; min-height: 32px; align-items: center; }
.smo-footer__col > p > a { display: inline-flex; align-items: center; min-height: 36px; }
.smo-footer__credits { color: var(--smo-on-dark-muted); }
.smo-footer__base { display: grid; gap: 4px; margin-top: 48px; padding-block: 24px; border-top: 1px solid rgba(255, 255, 255, 0.18); }

/* ---------- mobile call bar ---------- */
.smo-callbar { display: none; }
@media (max-width: 767px) {
  .smo-callbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px;
    position: fixed; inset: auto 0 0 0; z-index: 60;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: var(--smo-surface); border-top: 1px solid var(--smo-line);
    transition: transform 0.25s ease;
  }
  .smo-callbar.is-hidden { transform: translateY(calc(100% + 1px)); }
  .smo-callbar__btn { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: var(--smo-radius); text-decoration: none; color: var(--smo-action); border: 1px solid var(--smo-control-line); }
  .smo-callbar__btn--call { background: var(--smo-action); color: var(--smo-on-action); border-color: var(--smo-action); }
  .smo-has-callbar { padding-bottom: calc(var(--smo-callbar-h) + env(safe-area-inset-bottom)); }
}

/* Keep sticky reading panels below the editor's toolbar. */
@media (min-width: 900px) {
  .admin-bar .smo-treatment__aside { top: 140px; }
  .admin-bar .smo-about__media { top: 152px; }
}
