/* ===========================================================
   BY Dent — Warm Minimal
   Palette: Ivory #F6EFE9 / Cream #E7D8CC / Gold #C7A487
            Cocoa #4A3A30 / Charcoal #2F2925
   =========================================================== */

:root {
  --ivory: #F6EFE9;
  --cream: #E7D8CC;
  --gold: #C7A487;
  --gold-dark: #B08E70;
  --cocoa: #4A3A30;
  --charcoal: #2F2925;
  --white: #FFFFFF;
  --shadow: 0 10px 40px rgba(74, 58, 48, 0.08);
  --shadow-soft: 0 4px 20px rgba(74, 58, 48, 0.06);
  --radius: 18px;
  --radius-lg: 28px;
  --maxw: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans Thai', system-ui, -apple-system, sans-serif;
  color: var(--cocoa);
  background: var(--ivory);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'IBM Plex Sans Thai', system-ui, sans-serif;
  color: var(--charcoal);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }
a { color: var(--gold-dark); text-decoration: none; transition: color .2s; }
a:hover { color: var(--cocoa); }
img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section--cream { background: var(--cream); }
.section--cocoa { background: var(--cocoa); color: var(--ivory); }
.section--cocoa h2, .section--cocoa h3 { color: var(--white); }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 14px;
}
.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.section-head p { color: var(--cocoa); opacity: .85; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 30px; border-radius: 100px;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  border: 1.5px solid transparent; transition: all .25s;
}
.btn--primary { background: var(--gold); color: var(--white); }
.btn--primary:hover { background: var(--gold-dark); color: var(--white); transform: translateY(-2px); }
.btn--ghost { background: transparent; border-color: var(--gold); color: var(--cocoa); }
.btn--ghost:hover { background: var(--gold); color: var(--white); }
.btn--light { background: var(--ivory); color: var(--cocoa); }
.btn--light:hover { background: var(--white); }

/* ---- Header ---- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,239,233,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(199,164,135,.25);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; color: var(--charcoal); }
.brand span { color: var(--gold-dark); }
.brand-name { white-space: nowrap; }
.brand-logo { height: 56px; width: auto; }
.nav-links { display: flex; gap: 28px; align-items: center; list-style: none; }
.nav-links a { color: var(--cocoa); font-size: .98rem; font-weight: 500; }
.nav-links a:hover { color: var(--gold-dark); }
.nav-cta { padding: 10px 22px; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; color: var(--cocoa); cursor: pointer; }

/* ---- Hero ---- */
.hero { padding: 72px 0 84px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--gold-dark); }
.hero-lead { font-size: 1.15rem; opacity: .9; margin-bottom: 28px; max-width: 540px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-photo {
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); aspect-ratio: 4/5; background: var(--cream);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo--logo {
  background: linear-gradient(160deg, #FBF7F2 0%, var(--cream) 100%);
}
.hero-photo--logo img {
  width: 74%; height: auto; max-height: 76%; object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(74,58,48,.14));
}

.placeholder {
  width: 100%; height: 100%; min-height: 200px;
  background: repeating-linear-gradient(45deg, var(--cream), var(--cream) 14px, #ddccbe 14px, #ddccbe 28px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--cocoa); font-size: .9rem; padding: 20px; opacity: .8;
}

/* ---- Trust bar ---- */
.trust { background: var(--cocoa); color: var(--ivory); padding: 26px 0; }
.trust-grid { display: flex; justify-content: space-around; gap: 24px; flex-wrap: wrap; text-align: center; }
.trust-item .num { font-size: 1.9rem; font-weight: 700; color: var(--gold); display: block; }
.trust-item .lbl { font-size: .9rem; opacity: .85; }

/* ---- Services ---- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--white); border-radius: var(--radius); padding: 32px 28px;
  box-shadow: var(--shadow-soft); transition: transform .25s, box-shadow .25s;
  border: 1px solid rgba(199,164,135,.18);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .ico { font-size: 1.8rem; margin-bottom: 14px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: .96rem; opacity: .85; margin-bottom: 14px; }
.card a { font-weight: 600; font-size: .95rem; }

/* ---- Why / USP ---- */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.why-item { display: flex; gap: 18px; align-items: flex-start; }
.why-item .ico {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px;
  background: var(--gold); color: var(--white); display: flex;
  align-items: center; justify-content: center; font-size: 1.4rem;
}
.why-item h3 { margin-bottom: 6px; }
.why-item p { font-size: .96rem; opacity: .85; margin: 0; }

/* ---- Team ---- */
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.team-card { display: flex; gap: 22px; align-items: center; background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-soft); }
.team-photo { flex-shrink: 0; width: 156px; height: 195px; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #FBF7F2, var(--cream)); }
.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-info h3 { margin-bottom: 4px; }
.team-role { color: var(--gold-dark); font-weight: 600; font-size: .92rem; margin-bottom: 8px; }
.team-info p { font-size: .92rem; opacity: .85; margin: 0; }

/* ---- Gallery (บรรยากาศคลินิก) ---- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.gallery-item {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4;
  box-shadow: var(--shadow-soft); border: 1px solid rgba(199,164,135,.18);
  cursor: zoom-in; position: relative;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.2,.7,.3,1); }
.gallery-item:hover img { transform: scale(1.05); }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (max-width: 640px) { .gallery-grid { grid-template-columns: 1fr; } .gallery-item { aspect-ratio: 4/3; } }

/* ---- Cases ---- */
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 920px; margin: 0 auto; }
.case {
  border-radius: var(--radius); overflow: hidden; background: var(--white);
  box-shadow: var(--shadow-soft); border: 1px solid rgba(199,164,135,.18);
}
.case-img { aspect-ratio: 6/5; background: var(--cream); }
.case-img img { width: 100%; height: 100%; object-fit: cover; }
.case-body { padding: 18px 20px; }
.case-body .tag { display: inline-block; font-size: .78rem; color: var(--gold-dark); font-weight: 600; margin-bottom: 6px; }
.case-body p { font-size: .92rem; opacity: .85; margin: 0; }

/* ---- FAQ ---- */
.faq { max-width: 800px; margin: 0 auto; }
.faq details {
  background: var(--white); border-radius: 14px; padding: 4px 24px;
  margin-bottom: 14px; box-shadow: var(--shadow-soft); border: 1px solid rgba(199,164,135,.18);
}
.faq summary {
  cursor: pointer; padding: 18px 0; font-weight: 600; color: var(--charcoal);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.5rem; color: var(--gold-dark); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 18px; margin: 0; opacity: .88; font-size: .97rem; }

/* ---- Contact / CTA ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }
.contact-info h3 { margin-bottom: 18px; }
.contact-list { list-style: none; }
.contact-list li { display: flex; gap: 14px; margin-bottom: 16px; align-items: flex-start; }
.contact-list .ico { color: var(--gold); font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.map-embed { border-radius: var(--radius); overflow: hidden; min-height: 320px; background: var(--cream); box-shadow: var(--shadow-soft); }
.map-embed iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }

.cta-band { text-align: center; }
.cta-band h2 { color: var(--white); margin-bottom: 14px; }
.cta-band p { color: var(--ivory); opacity: .9; max-width: 540px; margin: 0 auto 28px; }

/* ---- Footer ---- */
.footer { background: var(--charcoal); color: var(--cream); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 36px; }
.footer h4 { color: var(--white); margin-bottom: 14px; font-size: 1rem; }
.footer a { color: var(--cream); opacity: .85; display: block; margin-bottom: 8px; font-size: .94rem; }
.footer a:hover { opacity: 1; color: var(--gold); }
.footer .brand { color: var(--white); margin-bottom: 12px; }
.footer p { font-size: .92rem; opacity: .8; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px; text-align: center; font-size: .85rem; opacity: .7; }

/* ---- Page hero (หน้าย่อย) ---- */
.page-hero { background: var(--cream); padding: 64px 0 56px; }
.breadcrumb { font-size: .88rem; color: var(--gold-dark); margin-bottom: 16px; }
.breadcrumb a { color: var(--gold-dark); }
.breadcrumb span { opacity: .6; }
.page-hero h1 { max-width: 760px; margin-bottom: 16px; }
.page-hero p { max-width: 680px; font-size: 1.12rem; opacity: .9; margin-bottom: 26px; }

/* ---- Steps ---- */
.steps { counter-reset: step; display: grid; gap: 20px; max-width: 820px; margin: 0 auto; }
.step { display: flex; gap: 20px; align-items: flex-start; background: var(--white); padding: 24px 28px; border-radius: var(--radius); box-shadow: var(--shadow-soft); border: 1px solid rgba(199,164,135,.18); }
.step::before {
  counter-increment: step; content: counter(step);
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold); color: var(--white); font-weight: 700; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { margin-bottom: 5px; }
.step p { margin: 0; font-size: .96rem; opacity: .85; }

/* ---- Rich text block ---- */
.prose { max-width: 760px; margin: 0 auto; }
.prose p { opacity: .9; }
.prose ul { margin: 0 0 1rem 1.2rem; }
.prose li { margin-bottom: 8px; opacity: .9; }

/* ---- Two-column feature ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.split .placeholder { border-radius: var(--radius-lg); aspect-ratio: 4/3; box-shadow: var(--shadow-soft); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 28px; } }

/* ---- Motion: reveal on scroll (ทำงานเฉพาะเมื่อ JS พร้อม — html.js) ---- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- Motion: hero fade-in on load ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.hero-text { animation: fadeUp .9s ease both; }
.hero-photo { animation: fadeUp 1s ease .15s both; }

/* ---- Motion: case image zoom on hover ---- */
.case-img { overflow: hidden; }
.case-img img { transition: transform .55s cubic-bezier(.2,.7,.3,1); }
.case:hover .case-img img { transform: scale(1.06); }

/* ---- Before / After slider ---- */
.ba {
  position: relative; max-width: 800px; margin: 0 auto 16px;
  aspect-ratio: 940 / 250; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); touch-action: none; background: var(--cocoa);
}
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ba .before { clip-path: inset(0 calc(100% - var(--p, 50%)) 0 0); }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--p, 50%); width: 3px; background: var(--ivory); transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 10px rgba(0,0,0,.35); }
.ba-knob {
  position: absolute; top: 50%; left: var(--p, 50%); transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%; background: var(--ivory); border: 3px solid var(--gold);
  display: flex; align-items: center; justify-content: center; color: var(--gold-dark); font-size: 1rem;
  pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 2;
}
.ba-tag {
  position: absolute; bottom: 14px; padding: 5px 15px; border-radius: 100px;
  font-size: .82rem; font-weight: 600; color: #fff; background: rgba(47,41,37,.55);
  backdrop-filter: blur(4px); pointer-events: none; z-index: 2;
}
.ba-tag.before { left: 14px; } .ba-tag.after { right: 14px; }
.ba input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba-caption { text-align: center; font-size: .92rem; opacity: .8; margin-bottom: 40px; }
/* รูปเคสมุมหน้าตรง (3:2) — ใช้ aspect ratio สูงกว่าเพื่อให้เห็นฟันเต็มซี่ */
.ba--photo { aspect-ratio: 3 / 2; max-width: 560px; }

/* ---- Lightbox: กดรูปเคสแล้วเปิด slider ใหญ่ ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(47,41,37,.85);
  display: none; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; animation: fadeUp .3s ease both; }
.lightbox-inner { width: min(960px, 100%); text-align: center; }
.lightbox-img {
  max-width: 100%; max-height: 84vh; object-fit: contain;
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.4); margin: 0 auto 14px;
}
.lightbox-caption { color: var(--ivory); text-align: center; font-size: .95rem; }
.lightbox-close {
  position: absolute; top: 14px; right: 20px; background: none; border: none;
  color: var(--ivory); font-size: 2.4rem; cursor: pointer; line-height: 1; z-index: 2;
}
.lightbox-close:hover { color: var(--gold); }
.case-img { position: relative; }
.ba-hint {
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
  background: rgba(47,41,37,.55); color: #fff; font-size: .75rem;
  padding: 4px 12px; border-radius: 100px; backdrop-filter: blur(4px); pointer-events: none;
}

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-text, .hero-photo { animation: none !important; }
  .case-img img { transition: none !important; }
  .case:hover .case-img img { transform: none !important; }
}

/* ---- Floating contact ---- */
.float-line {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  background: #06C755; color: #fff; padding: 14px 22px; border-radius: 100px;
  font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); display: flex; gap: 8px; align-items: center;
}
.float-line:hover { color: #fff; transform: translateY(-2px); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { aspect-ratio: 16/11; max-height: 360px; }
  .cards, .case-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid, .team-grid, .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--ivory); padding: 20px 24px; gap: 16px; box-shadow: var(--shadow);
  }
  .cards, .case-grid { grid-template-columns: 1fr; }
  .trust-grid { gap: 18px; }
  .trust-item { flex: 1 1 40%; }
}
