/* ==========================================================================
   The Urban Pavilions — custom styles
   Tailwind handles layout/spacing; this file holds reusable components,
   motion and anything that needs real CSS (pseudo-elements, keyframes).
   ========================================================================== */

:root {
  --navy: #1B2A4A;
  --navy-900: #0F1B33;
  --gold: #C9A96E;
  --gold-light: #E3CDA2;
  --cream: #F5F1EA;
  --ease: cubic-bezier(.22, 1, .36, 1);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html { scroll-padding-top: 92px; -webkit-text-size-adjust: 100%; }
body { min-height: 100%; }
html[lang="th"] body { font-family: "Sarabun", "Inter", system-ui, sans-serif; }
html[lang="th"] .font-display { line-height: 1.15; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
#header.is-scrolled { background: rgba(15, 27, 51, .97); box-shadow: 0 10px 40px -20px rgba(0,0,0,.7); }
#header.is-scrolled .h-14 { height: 2.75rem; width: 2.75rem; }

.nav-link {
  position: relative; font-size: .95rem; letter-spacing: .02em;
  color: rgba(245, 241, 234, .82); padding: .25rem 0; transition: color .3s;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav-link:hover, .nav-link.is-active { color: var(--cream); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

.lang-btn { padding: .25rem .35rem; border-radius: .25rem; transition: color .2s; }
.lang-btn[aria-pressed="true"] { color: var(--gold-light); font-weight: 600; }
.lang-btn:hover { color: var(--cream); }

/* Burger */
.burger, .burger::before, .burger::after {
  content: ""; display: block; width: 22px; height: 1.5px; background: currentColor;
  position: relative; transition: transform .4s var(--ease), opacity .3s;
}
.burger::before { position: absolute; top: -7px; }
.burger::after  { position: absolute; top:  7px; }
#menuBtn[aria-expanded="true"] .burger { background: transparent; }
#menuBtn[aria-expanded="true"] .burger::before { transform: translateY(7px) rotate(45deg); }
#menuBtn[aria-expanded="true"] .burger::after  { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { background: var(--navy-900); border-top: 1px solid rgba(255,255,255,.06); animation: menuIn .4s var(--ease); }
.mobile-link {
  display: block; padding: .9rem .25rem; font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem; color: var(--cream); border-bottom: 1px solid rgba(255,255,255,.06);
}
.mobile-link:hover { color: var(--gold-light); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn-gold, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .8rem 1.5rem; border-radius: .5rem; font-weight: 500; font-size: .95rem;
  letter-spacing: .02em; white-space: nowrap; cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .3s, color .3s, border-color .3s;
}
.btn-gold { background: var(--gold); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(201,169,110,.9); }
.btn-outline { border: 1px solid rgba(201,169,110,.6); color: var(--cream); }
.btn-outline:hover { border-color: var(--gold); background: rgba(201,169,110,.1); transform: translateY(-2px); }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn-gold:focus-visible, .btn-outline:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px;
}

/* ---------- Hero ---------- */
.hero-glow {
  background:
    radial-gradient(60% 60% at 15% 30%, rgba(201,169,110,.10), transparent 60%),
    radial-gradient(40% 50% at 80% 90%, rgba(201,169,110,.06), transparent 60%);
}
.hero-item { opacity: 0; transform: translateY(18px); animation: heroIn 1s var(--ease) forwards; }
.hero-item:nth-child(1) { animation-delay: .15s }
.hero-item:nth-child(2) { animation-delay: .3s }
.hero-item:nth-child(3) { animation-delay: .45s }
.hero-item:nth-child(4) { animation-delay: .55s }
.hero-item:nth-child(5) { animation-delay: .65s }
.hero-item:nth-child(6) { animation-delay: .8s }
.hero-img { opacity: 0; transform: scale(1.06); animation: heroImg 1.6s var(--ease) forwards; }
@keyframes heroIn  { to { opacity: 1; transform: none; } }
@keyframes heroImg { to { opacity: 1; transform: none; } }

/* ---------- Scroll reveal ---------- */
.reveal, .reveal-stagger > * {
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.is-visible, .reveal-stagger.is-visible > * { opacity: 1; transform: none; }
.reveal-stagger.is-visible > :nth-child(2) { transition-delay: .1s }
.reveal-stagger.is-visible > :nth-child(3) { transition-delay: .2s }
.reveal-stagger.is-visible > :nth-child(4) { transition-delay: .3s }
.reveal-stagger.is-visible > :nth-child(5) { transition-delay: .4s }

/* ---------- Services strip ---------- */
.service-item { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; font-size: 1.05rem; color: var(--navy); }
.service-icon {
  display: grid; place-items: center; height: 6.5rem; width: 6.5rem; border-radius: 9999px;
  background: var(--navy); color: var(--gold); transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.service-icon svg { height: 3rem; width: 3rem; }
.service-item:hover .service-icon { transform: translateY(-6px); box-shadow: 0 22px 40px -22px rgba(27,42,74,.8); }

/* ---------- Treatment cards ---------- */
.treatment {
  position: relative; display: flex; flex-direction: column; border-radius: 1.25rem; overflow: hidden;
  background: linear-gradient(160deg, #1D2E52 0%, #14213C 100%);
  border: 1px solid rgba(201,169,110,.22); color: var(--cream);
  transition: transform .5s var(--ease), border-color .5s, box-shadow .5s var(--ease);
}
.treatment:hover { transform: translateY(-4px); border-color: rgba(201,169,110,.5); box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); }
.treatment__media { position: relative; height: 15rem; overflow: hidden; background: #14213C; }
/* Blurred copy of the photo fills the frame, so the sharp image can be shown whole. */
.treatment__media .treatment__blur {
  position: absolute; inset: 0; height: 100%; width: 100%;
  object-fit: cover; filter: blur(22px) saturate(.9) brightness(.55); transform: scale(1.25);
}
.treatment__media .treatment__photo {
  position: relative; height: 100%; width: 100%;
  object-fit: contain; object-position: center;
  transition: transform 1.2s var(--ease);
}
.treatment:hover .treatment__media .treatment__photo { transform: scale(1.05); }
.treatment__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, #14213C 0%, rgba(20,33,60,.35) 28%, transparent 60%);
}
.treatment__price {
  position: absolute; right: 1.25rem; bottom: 1rem; font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.6rem; line-height: 1; color: var(--gold-light); text-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.treatment__price small { font-size: 1.4rem; margin-left: .1em; }
.treatment__body { padding: 1.5rem 1.5rem 1.75rem; display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.treatment__title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.85rem; letter-spacing: .04em; line-height: 1.1; }
.treatment__areas { font-size: .78rem; letter-spacing: .14em; color: var(--gold-light); }
.treatment__areas span + span::before { content: "•"; margin: 0 .55em; color: rgba(201,169,110,.6); }
.treatment__desc { color: rgba(245,241,234,.78); line-height: 1.65; font-size: .95rem; }

.journey { display: flex; flex-direction: column; gap: 0; padding-top: .25rem; border-top: 1px solid rgba(255,255,255,.08); }
.journey > summary {
  list-style: none; cursor: pointer; padding: .9rem 0 .5rem; font-size: .8rem; letter-spacing: .2em;
  color: var(--gold-light); display: flex; justify-content: space-between; align-items: center;
}
.journey > summary::-webkit-details-marker { display: none; }
.journey > summary::after { content: "+"; font-size: 1.1rem; transition: transform .3s; }
.journey[open] > summary::after { transform: rotate(45deg); }
.journey ol { position: relative; margin: .25rem 0 .5rem; padding-left: 1.4rem; display: grid; gap: .65rem; }
.journey ol::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: rgba(201,169,110,.4); }
.journey li { position: relative; display: grid; grid-template-columns: 5.2rem 1fr; gap: .5rem; font-size: .88rem; color: rgba(245,241,234,.85); animation: stepIn .5s var(--ease) both; }
.journey li:nth-child(2) { animation-delay: .06s } .journey li:nth-child(3) { animation-delay: .12s }
.journey li:nth-child(4) { animation-delay: .18s } .journey li:nth-child(5) { animation-delay: .24s } .journey li:nth-child(6) { animation-delay: .3s }
.journey li::before { content: ""; position: absolute; left: -1.4rem; top: .38rem; height: 11px; width: 11px; border-radius: 50%; border: 1.5px solid var(--gold); background: #14213C; }
.journey li time { color: var(--gold-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes stepIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

.highlights { margin-top: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.highlights span {
  font-size: .75rem; letter-spacing: .04em; padding: .4rem .7rem; border-radius: 9999px;
  border: 1px solid rgba(201,169,110,.35); color: var(--gold-light); background: rgba(201,169,110,.06);
}
.treatment .btn-gold { width: 100%; margin-top: .5rem; }

/* ---------- About stats ---------- */
.stat dt { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(34,48,74,.6); }
.stat dd { margin-top: .35rem; font-family: "Cormorant Garamond", Georgia, serif; font-size: 2.6rem; line-height: 1; color: var(--navy); }

/* ---------- Gallery ---------- */
.gallery-item { position: relative; border-radius: 1rem; overflow: hidden; aspect-ratio: 4/3; background: var(--navy); }
.gallery-item img { height: 100%; width: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.gallery-item figcaption {
  position: absolute; inset-x: 0; bottom: 0; left: 0; right: 0; padding: 2rem .9rem .8rem; font-size: .82rem; color: var(--cream);
  background: linear-gradient(to top, rgba(15,27,51,.85), transparent);
}
.gallery-item:hover img { transform: scale(1.06); }

/* ---------- Reviews ---------- */
.review { border-radius: 1.25rem; background: #fff; border: 1px solid rgba(27,42,74,.08); padding: 1.75rem; display: flex; flex-direction: column; gap: .9rem; }
.review .stars { color: var(--gold); letter-spacing: .15em; font-size: .95rem; }
.review blockquote { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.3rem; line-height: 1.45; color: var(--navy); }
html[lang="th"] .review blockquote { font-family: "Sarabun", sans-serif; font-size: 1.05rem; }
.review cite { font-style: normal; font-size: .85rem; color: rgba(34,48,74,.6); }

/* ---------- Footer ---------- */
.contact-row { display: flex; gap: .9rem; align-items: flex-start; }
.contact-row svg { height: 1.5rem; width: 1.5rem; flex: none; color: var(--gold); margin-top: .1rem; }
.social { display: grid; place-items: center; height: 2.6rem; width: 2.6rem; border-radius: 9999px; border: 1px solid rgba(255,255,255,.15); color: var(--cream); transition: all .3s; }
.social svg { height: 1.2rem; width: 1.2rem; }
.social:hover { border-color: var(--gold); color: var(--gold-light); transform: translateY(-2px); }

/* ---------- Leaf decoration ---------- */
.leaf-deco {
  border-radius: 100% 0 100% 0; border: 1px solid var(--gold);
  background: repeating-linear-gradient(135deg, transparent 0 22px, rgba(201,169,110,.5) 22px 23px);
  transform: rotate(-20deg);
}

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .modal { align-items: center; padding: 1.5rem; } }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,19,38,.75); backdrop-filter: blur(4px); animation: fadeIn .3s both; }
.modal-panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 1100px;
  height: 92svh; max-height: 900px; overflow: hidden; background: var(--cream);
  border-radius: 1.25rem 1.25rem 0 0; box-shadow: 0 40px 80px -30px rgba(0,0,0,.8);
  animation: panelIn .5s var(--ease) both;
}
@media (min-width: 640px) { .modal-panel { border-radius: 1.25rem; height: 88vh; } }
.modal-panel header { padding-top: calc(.75rem + env(safe-area-inset-top, 0px)); }
@keyframes fadeIn { from { opacity: 0 } }
@keyframes panelIn { from { opacity: 0; transform: translateY(40px) scale(.98); } }
.spinner { height: 2.5rem; width: 2.5rem; border-radius: 50%; border: 2px solid rgba(27,42,74,.15); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
body.modal-open { overflow: hidden; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-item, .hero-img, .reveal, .reveal-stagger > * { opacity: 1; transform: none; }
}
