/* ============================================================================
   web-02 · สไมล์เฮ้าส์ ทันตกรรม

   Concept: patients here are not only afraid of the drill, they are afraid of
   the bill. What the clinic sells is transparency, so the visual system is built
   from a ruler, not from tooth icons and rounded blue cards. Teal and mint —
   the default palette of every dental site — are deliberately absent; the ground
   is warm porcelain and the accent is coral. Mint appears in exactly one role:
   marking what social security covers.

   Signature: the price bar (.bar). Every service sits on the same 0–50,000 THB
   scale so two services can be compared by eye. A price that overruns the scale
   is cut with a zigzag and labelled with the real number — the scale is never
   squeezed to make something fit.
   ============================================================================ */

:root {
  --porcelain: #FAF6F3;
  --porcelain-2: #F0E8E3;
  --plum: #38293D;
  --coral: #E8654F;
  --mint: #4A8C7A;
  --grey: #8B8189;

  --scale-max: 50000;
  --container: 1080px;
  --pad: clamp(20px, 5vw, 48px);
  --gap: clamp(72px, 10vw, 128px);
}

body {
  background: var(--porcelain);
  color: var(--plum);
  font-family: 'Sarabun', system-ui, sans-serif;
  line-height: 1.8;
}

.mono, .num { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: 'Anuphan', system-ui, sans-serif; font-weight: 600; line-height: 1.35; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.5rem); }
h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); }

.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--gap); }
.section--alt { background: var(--porcelain-2); }
.section--dark { background: var(--plum); color: var(--porcelain); }
.lede { color: var(--grey); max-width: 54ch; }
.rule { width: 48px; height: 3px; background: var(--coral); border: 0; margin: 0 0 20px; }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; }
.section--dark :focus-visible { outline-color: var(--coral); }

/* -- buttons ---------------------------------------------------------------- */
.btn { display: inline-block; padding: 15px 30px; border-radius: 4px; text-decoration: none; font-weight: 600; transition: background .2s, color .2s; }
.btn--primary { background: var(--coral); color: var(--porcelain); }
.btn--primary:hover { background: #d4573f; }
.btn--dark { background: var(--plum); color: var(--porcelain); }
.btn--ghost { border: 1px solid currentColor; }
.btn--ghost:hover { background: var(--plum); color: var(--porcelain); border-color: var(--plum); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* -- header ----------------------------------------------------------------- */
.header { position: sticky; top: 0; z-index: 30; background: var(--porcelain); border-bottom: 1px solid transparent; transition: border-color .2s; }
.header.is-stuck { border-bottom-color: rgba(56,41,61,.12); }
.header__inner { max-width: var(--container); margin-inline: auto; padding: 12px var(--pad); display: flex; align-items: center; gap: 24px; }
.brand { font-family: 'Anuphan', sans-serif; font-weight: 600; font-size: 1.25rem; text-decoration: none; position: relative; }
.brand::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--coral); }
.header__cta { margin-left: auto; padding: 10px 20px; font-size: .9375rem; }

.nav { display: flex; gap: 20px; margin-left: 20px; }
.nav__link { text-decoration: none; font-size: .9375rem; padding-block: 4px; border-bottom: 2px solid transparent; }
.nav__link.is-active { color: var(--coral); border-bottom-color: var(--coral); }
.nav__link:hover { color: var(--coral); }

.burger { display: none; flex-direction: column; gap: 5px; padding: 8px; margin-left: auto; }
.burger span { display: block; width: 22px; height: 2px; background: var(--plum); }

@media (max-width: 900px) {
  .burger { display: flex; }
  .header__cta { display: none; }
  .nav { position: fixed; inset: 0; z-index: 40; flex-direction: column; justify-content: center; align-items: center; gap: 26px; margin: 0; background: var(--porcelain); transform: translateY(-100%); transition: transform .3s; }
  .nav.is-open { transform: none; }
  .nav__link { font-size: 1.25rem; }
  body.nav-open { overflow: hidden; }
}

/* -- SIGNATURE: the price bar ------------------------------------------------- */
/* --lo/--hi are percentages of the shared 0–50,000 scale, computed in the page markup so the
   bar is correct with CSS alone; nothing here depends on JavaScript running. */
.bar { --lo: 0%; --hi: 100%; }
.bar__track { position: relative; height: 8px; background: var(--porcelain-2); border-radius: 4px; overflow: hidden; }
.section--alt .bar__track, .section--dark .bar__track { background: rgba(56,41,61,.14); }
.section--dark .bar__track { background: rgba(250,246,243,.16); }
.bar__fill {
  position: absolute; top: 0; bottom: 0;
  left: var(--lo); right: calc(100% - var(--hi));
  background: var(--coral); border-radius: 4px;
  transform-origin: left; transform: scaleX(0);
  animation: bar-in .5s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes bar-in { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .bar__fill { transform: none; animation: none; } }

/* a single price rather than a range reads as a dot, so it is never mistaken for a range */
.bar__fill--point { left: var(--lo); right: auto; width: 12px; height: 12px; top: -2px; border-radius: 50%; }

/* over-scale: the fill runs to the edge and is torn off, with the true figure alongside */
.bar--over .bar__fill { right: 0; }
.bar--over .bar__track::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 10px;
  background: linear-gradient(-45deg, var(--porcelain) 25%, transparent 25%, transparent 50%, var(--porcelain) 50%, var(--porcelain) 75%, transparent 75%);
  background-size: 6px 6px;
}
.section--alt .bar--over .bar__track::after { background-color: var(--porcelain-2); }
.bar__nums { display: flex; justify-content: space-between; margin-top: 6px; font-size: .8125rem; color: var(--grey); }

/* covered-by-social-security tick sitting on the bar */
.bar__cover { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--mint); }
.tag-mint { color: var(--mint); font-size: .75rem; }

/* -- price rows --------------------------------------------------------------- */
.prices { max-width: 820px; margin-top: 40px; }
.price { padding: 22px 0; border-bottom: 1px solid rgba(56,41,61,.12); }
.price__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.price__name { font-family: 'Anuphan', sans-serif; font-weight: 600; font-size: 1.125rem; }
.price__figure { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price__note { margin-top: 8px; font-size: .9375rem; color: var(--grey); }

/* sticky reference scale — the reason a shared scale means anything while you scroll a long list */
.scale { max-width: 820px; position: sticky; top: 60px; z-index: 10; background: var(--porcelain); padding: 12px 0 14px; margin-top: 28px; }
.section--alt .scale { background: var(--porcelain-2); }
.scale__track { position: relative; height: 8px; background: rgba(56,41,61,.10); border-radius: 4px; }
.scale__tick { position: absolute; top: -4px; bottom: -4px; width: 1px; background: rgba(56,41,61,.3); }
.scale__nums { position: relative; height: 1.2em; margin-top: 6px; font-size: .75rem; color: var(--grey); }
.scale__nums span { position: absolute; transform: translateX(-50%); }
.scale__nums span:first-child { transform: none; }
.scale__nums span:last-child { transform: translateX(-100%); }
@media (max-width: 640px) { .scale__nums span.is-mid { display: none; } }

/* -- hero --------------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(28px,4vw,56px); }
.hero__text { padding: clamp(48px,7vw,104px) 0; }
.hero__img img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.hero__bar { max-width: 420px; margin-top: 28px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 32px; font-size: .875rem; color: var(--grey); }
.hero__facts li { padding-right: 24px; border-right: 1px solid rgba(56,41,61,.15); }
.hero__facts li:last-child { border-right: 0; padding-right: 0; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero__img { order: -1; }
  .hero__img img { aspect-ratio: 3/2; }
  .hero__text { padding: 40px 0 56px; }
}

/* -- first-visit rail: widths are the real minutes ----------------------------- */
.rail { display: grid; grid-template-columns: 22fr 45fr 33fr; gap: 4px; margin-top: 40px; }
.rail__seg { }
.rail__bar { height: 8px; border-radius: 4px; background: var(--coral); }
.rail__seg:nth-child(2) .rail__bar { background: color-mix(in srgb, var(--coral) 78%, white); }
.rail__seg:nth-child(3) .rail__bar { background: color-mix(in srgb, var(--coral) 56%, white); }
.rail__mins { font-family: 'IBM Plex Mono', monospace; font-size: .8125rem; color: var(--grey); margin-top: 8px; }
.rail__name { font-family: 'Anuphan', sans-serif; font-weight: 600; font-size: 1.0625rem; margin-top: 2px; }
.rail__desc { font-size: .9375rem; color: var(--grey); max-width: 34ch; margin-top: 6px; }
@media (max-width: 780px) { .rail { grid-template-columns: 1fr; gap: 28px; } }

/* -- reviews ------------------------------------------------------------------- */
.reviews { display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; }
@media (max-width: 900px) { .reviews { grid-template-columns: 1fr; gap: 32px; } }
.review::before { content: ''; display: block; width: 32px; height: 2px; background: var(--coral); margin-bottom: 18px; }
.review p { line-height: 1.85; }
.review cite { display: block; margin-top: 14px; font-style: normal; color: var(--coral); font-size: .875rem; }

/* -- generic ------------------------------------------------------------------- */
.cols-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; margin-top: 44px; }
.cols-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 40px; margin-top: 44px; }
@media (max-width: 900px) { .cols-3, .cols-2 { grid-template-columns: 1fr; gap: 28px; } }
.col-lines { height: 8px; background: var(--coral); border-radius: 4px; margin-bottom: 18px; }
.col h3 { font-size: 1.25rem; margin-bottom: 8px; }
.col p { color: var(--grey); font-size: .9375rem; max-width: 34ch; }
.section--dark .col p { color: rgba(250,246,243,.78); }

.people { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; margin-top: 44px; }
@media (max-width: 860px) { .people { grid-template-columns: 1fr; max-width: 420px; } }
.person img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 4px; filter: grayscale(1); }
.person__wrap { position: relative; border-radius: 4px; overflow: hidden; }
.person__wrap::after { content: ''; position: absolute; inset: 0; background: var(--coral); mix-blend-mode: multiply; opacity: .15; }
.person h3 { font-size: 1.125rem; margin-top: 14px; }
.person__role { color: var(--coral); font-size: .875rem; }
.person__cv { color: var(--grey); font-size: .9375rem; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; margin-top: 40px; }
@media (max-width: 780px) { .facts { grid-template-columns: 1fr; } }
.facts h3 { font-family: 'IBM Plex Mono', monospace; font-size: .8125rem; color: var(--coral); font-weight: 400; margin-bottom: 6px; }
.facts p { color: rgba(250,246,243,.8); font-size: .9375rem; }
.facts strong { color: var(--porcelain); font-family: 'IBM Plex Mono', monospace; font-weight: 500; }

/* -- accordion ------------------------------------------------------------------ */
.faq { max-width: 760px; margin-top: 40px; }
.faq details { border-bottom: 1px solid rgba(56,41,61,.12); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 0; display: flex; align-items: center; gap: 14px; font-family: 'Anuphan', sans-serif; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: ''; flex: none; width: 12px; height: 3px; background: var(--coral); border-radius: 2px; transition: transform .2s; }
.faq details[open] summary::before { transform: rotate(90deg); }
.faq p { padding: 0 0 20px 26px; color: var(--grey); }

/* -- channels / contact ---------------------------------------------------------- */
.channels { display: grid; grid-template-columns: repeat(4,1fr); gap: 28px; margin-top: 44px; }
@media (max-width: 1024px) { .channels { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .channels { grid-template-columns: 1fr; } }
.channel { display: block; text-decoration: none; }
.channel__rule { height: 8px; border-radius: 4px; background: var(--porcelain-2); transition: background .22s; }
.channel:hover .channel__rule, .channel:focus-visible .channel__rule { background: var(--coral); }
.channel__label { display: block; margin-top: 14px; font-size: .875rem; color: var(--grey); }
.channel__value { display: block; font-family: 'Anuphan', sans-serif; font-weight: 600; font-size: 1.25rem; margin: 2px 0 6px; }
.channel__note { color: var(--grey); font-size: .9375rem; }

.two-col { display: grid; grid-template-columns: 46fr 54fr; gap: clamp(28px,4vw,56px); align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .two-col > .is-map { order: -1; } }
.locator { width: 100%; border-radius: 4px; border: 1px solid rgba(56,41,61,.14); display: block; }

.dl__row { padding: 14px 0; border-top: 1px solid rgba(56,41,61,.12); }
.dl__row:last-child { border-bottom: 1px solid rgba(56,41,61,.12); }
.dl__label { font-family: 'IBM Plex Mono', monospace; font-size: .75rem; color: var(--coral); }

.hours { max-width: 540px; margin-top: 24px; }
.hours tr { border-top: 1px solid rgba(56,41,61,.12); }
.hours tr:last-child { border-bottom: 1px solid rgba(56,41,61,.12); }
.hours th, .hours td { padding: 12px 0; font-weight: 400; }
.hours td { text-align: right; font-family: 'IBM Plex Mono', monospace; }
.hours tr.is-today th { font-weight: 600; }
.hours tr.is-today th::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); margin-right: 8px; vertical-align: middle; }

/* rota shown as seven dots — reads faster than seven day names */
.rota { margin-top: 24px; }
.rota__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid rgba(56,41,61,.12); }
.rota__dots { display: flex; gap: 5px; }
.rota__dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--porcelain-2); }
.rota__dots span.on { background: var(--coral); }

.checklist { margin-top: 24px; }
.checklist li { position: relative; padding-left: 24px; margin-bottom: 10px; color: var(--grey); }
.checklist li::before { content: ''; position: absolute; left: 0; top: .8em; width: 12px; height: 3px; background: var(--coral); border-radius: 2px; }

.callout { background: var(--plum); color: var(--porcelain); padding: 28px; border-radius: 4px; margin-top: 32px; }
.callout p { max-width: 60ch; }

/* -- CTA band -------------------------------------------------------------------- */
.band { background: var(--coral); color: var(--porcelain); padding-block: clamp(56px,7vw,88px); text-align: center; }
.band h2, .band p { color: inherit; }
.band .btn-row { justify-content: center; }
.band .btn--dark { background: var(--plum); }
.band .btn--ghost { border-color: var(--porcelain); color: var(--porcelain); }
.band .btn--ghost:hover { background: var(--porcelain); color: var(--coral); border-color: var(--porcelain); }

/* -- footer ---------------------------------------------------------------------- */
.footer { background: var(--porcelain-2); padding-block: 56px 28px; }
.footer__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; font-size: .9375rem; color: var(--grey); }
@media (max-width: 800px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__brand { font-family: 'Anuphan', sans-serif; font-weight: 600; font-size: 1.125rem; color: var(--plum); margin-bottom: 8px; }
.footer__label { font-size: .8125rem; color: var(--coral); margin-bottom: 6px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer__bar { max-width: 460px; margin-top: 40px; }
.footer__note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(56,41,61,.12); font-size: .8125rem; color: var(--grey); }

/* -- mobile bar -------------------------------------------------------------------- */
.mobilebar { display: none; }
@media (max-width: 640px) {
  .mobilebar { display: grid; grid-template-columns: 1fr auto; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--coral); }
  .mobilebar .btn { padding: 12px 18px; text-align: center; font-size: .9375rem; }
  .mobilebar .btn--ghost { border-color: var(--porcelain); color: var(--porcelain); }
  body { padding-bottom: 72px; }
  .scale { top: 56px; }
}
