:root {
  --bg-deep: #1e2b24;
  --green-main: #2e4036;
  --green-surface: #384d42;
  --green-soft: #45594f;
  --cream: #f5f1e8;
  --sage: #dce3d7;
  --clay: #bd9470;
  --clay-light: #dfbe9f;
  --line: rgba(245, 241, 232, 0.14);
  --font-main: 'Google Sans', 'Google Sans Text', system-ui, -apple-system, sans-serif;
  --font-decor: 'Cormorant Garamond', Georgia, serif;
  --gutter: clamp(18px, 5vw, 80px);
  --radius-lg: 22px;
  --radius-md: 12px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  background-color: var(--bg-deep);
  background-image: radial-gradient(circle at 50% 0%, var(--green-main) 0%, var(--bg-deep) 75%);
  color: var(--cream);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img, svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--clay);
  color: var(--bg-deep);
}

/* =====================================================
   1. Magic Starfield (พร้อมระบบหยุดแอนิเมชันเมื่อเลื่อนถึงแกลเลอรี)
   ===================================================== */
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  transition: opacity 0.5s ease;
}

/* เมื่อเลื่อนถึง Gallery ให้พักแอนิเมชันทั้งหมดเพื่อลดภาระ GPU/CPU */
.starfield.is-paused {
  opacity: 0.25;
}

.starfield.is-paused .ambient-orb,
.starfield.is-paused .star-drifter,
.starfield.is-paused .star-asterisk {
  animation-play-state: paused !important;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  animation: orbFloat 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: var(--clay);
  top: 8%;
  left: -8%;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: #5b7a69;
  bottom: 10%;
  right: -10%;
  animation-delay: -9s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -50px) scale(1.15); }
}

.star-layer {
  position: absolute;
  inset: -25vh 0;
  will-change: transform;
}

.star-drifter {
  position: absolute;
  top: 0;
  height: 100%;
  animation: floatUpSlow var(--rise-dur, 30s) linear infinite;
  animation-delay: var(--rise-delay, 0s);
}

@keyframes floatUpSlow {
  0% {
    transform: translate3d(0, 115vh, 0);
  }
  100% {
    transform: translate3d(14px, -15vh, 0);
  }
}

.star-asterisk {
  display: block;
  color: #ffffff;
  font-family: var(--font-main);
  font-weight: 700;
  line-height: 1;
  user-select: none;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.55);
  animation: twinkle var(--twinkle-dur, 4s) ease-in-out infinite alternate;
  animation-delay: var(--twinkle-delay, 0s);
}

@keyframes twinkle {
  0% {
    opacity: var(--star-min-op, 0.12);
    transform: scale(0.8) rotate(0deg);
  }
  100% {
    opacity: var(--star-max-op, 0.7);
    transform: scale(1.18) rotate(35deg);
  }
}

/* ประกายดาวตามเมาส์/นิ้วแตะ */
.magic-cursor-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.cursor-sparkle {
  position: absolute;
  color: var(--clay-light);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(223, 190, 159, 0.9);
  animation: sparkleFade 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sparkleFade {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--sc, 1)) rotate(90deg);
  }
}

/* Scroll Reveal */
.reveal-magic {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-magic.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* จัดเนื้อหาให้อยู่เหนือพื้นหลังดาว */
.site-header,
main {
  position: relative;
  z-index: 2;
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-main);
  font-weight: 700;
  line-height: 1.3;
  color: var(--cream);
}

.decor-text {
  font-family: var(--font-decor);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 82px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 43, 36, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.brand-logo-img.is-missing {
  display: none;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sage);
}

.nav-links a {
  position: relative;
  padding: 6px 0;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #ffffff;
}

.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:not(.nav-cta):hover::after {
  transform: scaleX(1);
}

.nav-cta {
  padding: 10px 22px !important;
  border: 1px solid var(--clay);
  border-radius: 999px;
  background: var(--clay);
  color: var(--bg-deep) !important;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s !important;
}

.nav-cta:hover {
  background: var(--clay-light);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(223, 190, 159, 0.45);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 18px;
  height: 1.5px;
  background: var(--cream);
  transition: 0.2s;
}

/* Placeholder Image Wrapper */
.photo-slot {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(69, 89, 79, 0.45) 0%, rgba(46, 64, 54, 0.78) 50%, rgba(220, 227, 215, 0.16) 100%);
  border: 1px solid rgba(245, 241, 232, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-slot::before {
  content: attr(data-placeholder);
  position: absolute;
  font-size: clamp(10px, 2.2vw, 12px);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(245, 241, 232, 0.48);
  pointer-events: none;
  z-index: 1;
}

.photo-slot img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.3s ease;
}

.photo-slot img.is-missing {
  opacity: 0;
}

/* =====================================================
   2. Hero Section & Magic Slideshow (5 ภาพ ภาพละ 3 วินาที)
   ===================================================== */
.hero {
  max-width: 1440px;
  margin: 0 auto;
  padding: 52px var(--gutter) 76px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}

.hero-logo-box {
  margin-bottom: 24px;
}

.hero-logo-img {
  width: 160px;
  height: auto;
  object-fit: contain;
}

.hero-logo-img.is-missing {
  display: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  color: var(--clay-light);
  margin-bottom: 14px;
}

.hero-badge::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--clay-light);
}

.hero h1 {
  font-size: clamp(36px, 4.6vw, 62px);
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

.hero h1 .underline-accent {
  position: relative;
  display: inline-block;
}

.hero h1 .underline-accent svg {
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 14px;
  stroke: var(--clay);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(189, 148, 112, 0.5));
}

.hero-lead {
  font-size: 16px;
  color: var(--sage);
  max-width: 540px;
  line-height: 1.9;
}

.hero-visual {
  position: relative;
}

.hero-arch-wrapper {
  position: relative;
  max-width: 500px;
  margin-left: auto;
}

.hero-magic-aura {
  position: absolute;
  inset: -18px;
  border-radius: 280px 280px 28px 28px;
  background: radial-gradient(circle at 50% 35%, rgba(223, 190, 159, 0.28), rgba(69, 89, 79, 0.15) 60%, transparent 78%);
  filter: blur(22px);
  z-index: 0;
  pointer-events: none;
  animation: auraPulse 6s ease-in-out infinite alternate;
}

@keyframes auraPulse {
  0% { opacity: 0.55; transform: scale(0.97); }
  100% { opacity: 0.95; transform: scale(1.03); }
}

.hero-arch {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 4 / 4.8;
  max-height: 600px;
  border-radius: 260px 260px 18px 18px;
  overflow: hidden;
  background: var(--green-main);
  border: 1px solid rgba(245, 241, 232, 0.22);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.45), 0 0 40px rgba(189, 148, 112, 0.15);
  transition: transform 0.25s ease-out;
}

.hero-arch::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(245, 241, 232, 0.38);
  border-radius: 250px 250px 12px 12px;
  pointer-events: none;
  z-index: 6;
}

.hero-slide {
  position: absolute;
  inset: 0;
  border: none;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  filter: brightness(1.35) blur(6px);
  transform: scale(1.08);
  transition: opacity 1.15s cubic-bezier(0.22, 1, 0.36, 1),
              filter 1.15s cubic-bezier(0.22, 1, 0.36, 1),
              transform 3.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
  filter: brightness(1) blur(0px);
  transform: scale(1);
}

.hero-shimmer-veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(255, 250, 235, 0.45) 0%, rgba(223, 190, 159, 0.18) 45%, transparent 75%);
  opacity: 0;
  mix-blend-mode: screen;
}

.hero-shimmer-veil.is-glowing {
  animation: heroDreamFlash 1.1s ease-out forwards;
}

@keyframes heroDreamFlash {
  0% { opacity: 0.85; transform: scale(0.92); }
  100% { opacity: 0; transform: scale(1.15); }
}

.hero-dots {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}

.hero-dot {
  color: var(--sage);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.35;
  padding: 4px;
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}

.hero-dot:hover {
  opacity: 0.75;
  transform: scale(1.15);
}

.hero-dot.is-active {
  color: var(--clay-light);
  opacity: 1;
  transform: scale(1.35) rotate(45deg);
  text-shadow: 0 0 12px rgba(223, 190, 159, 0.9);
}

/* Story / Highlights Overview */
.story-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(46, 64, 54, 0.45);
  backdrop-filter: blur(8px);
  padding: 64px var(--gutter);
}

.story-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.story-card {
  padding: 28px 30px;
  background: rgba(30, 43, 36, 0.68);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s ease-out;
}

.story-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
  pointer-events: none;
}

.story-card:hover::after {
  left: 140%;
}

.story-card:hover {
  border-color: rgba(223, 190, 159, 0.5);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3), 0 0 25px rgba(189, 148, 112, 0.12);
}

.story-num {
  font-family: var(--font-decor);
  font-size: 26px;
  color: var(--clay-light);
  line-height: 1;
}

.story-card h2 {
  font-size: 21px;
  margin-bottom: 8px;
}

.story-card p {
  font-size: 14.5px;
  color: var(--sage);
  line-height: 1.85;
}

.story-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--clay-light);
  margin-top: 6px;
}

/* Gallery Section */
.gallery-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 76px var(--gutter) 90px;
}

.gallery-tabs-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}

.gallery-tabs {
  display: grid;
  grid-template-columns: repeat(3, auto);
  align-items: center;
  gap: clamp(6px, 1.8vw, 14px);
  width: 100%;
  max-width: 640px;
  background: rgba(46, 64, 54, 0.72);
  backdrop-filter: blur(8px);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.tab-btn {
  padding: clamp(9px, 2vw, 13px) clamp(8px, 2.5vw, 24px);
  border-radius: 999px;
  color: var(--sage);
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  color: #ffffff;
}

.tab-btn.is-active {
  background: var(--clay);
  color: var(--bg-deep);
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), 0 0 18px rgba(189, 148, 112, 0.4);
}

.gallery-panel {
  display: none;
}

.gallery-panel.is-active {
  display: block;
  animation: panelMagicIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelMagicIn {
  0% {
    opacity: 0;
    filter: brightness(1.5) blur(4px);
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    filter: brightness(1) blur(0);
    transform: scale(1);
  }
}

/* 3x3 Grid ทั้งบนเดสก์ท็อปและมือถือ พร้อมเฟรมหลากหลายทรงที่ตัดขอบรูปให้อัตโนมัติ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 2vw, 22px);
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1.08;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.gallery-item:nth-child(2),
.gallery-item:nth-child(8) {
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
}

.gallery-item:nth-child(4) {
  border-radius: 42% 14% 42% 14%;
}

.gallery-item:nth-child(5) {
  border-radius: 38%;
}

.gallery-item:nth-child(6) {
  border-radius: 14% 42% 14% 42%;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(223, 190, 159, 0.7);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4), 0 0 22px rgba(189, 148, 112, 0.25);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(circle at center, rgba(223, 190, 159, 0.18) 0%, rgba(20, 30, 25, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: clamp(8px, 1.8vw, 18px);
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
  opacity: 1;
}

.zoom-badge {
  width: clamp(24px, 4vw, 34px);
  height: clamp(24px, 4vw, 34px);
  border-radius: 50%;
  background: var(--cream);
  color: var(--bg-deep);
  display: grid;
  place-items: center;
  font-size: clamp(11px, 2vw, 14px);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* =====================================================
   3. Visit, Map & Contact Section
   ===================================================== */
.visit-section {
  background: rgba(22, 32, 27, 0.85);
  border-top: 1px solid var(--line);
  color: var(--cream);
  padding: 84px var(--gutter) 48px;
}

.visit-container {
  max-width: 1440px;
  margin: 0 auto;
}

.visit-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 36px;
  align-items: stretch;
}

/* Card รวมการเดินทางมาร้าน + เวลาเปิดให้บริการ */
.visit-info-card {
  background: rgba(46, 64, 54, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.visit-card-head .section-eyebrow {
  color: var(--clay-light);
  display: block;
  margin-bottom: 6px;
  font-size: 20px;
}

.visit-card-head h2 {
  color: var(--cream);
  font-size: clamp(26px, 3vw, 36px);
  margin-bottom: 14px;
}

.visit-subtext {
  color: var(--sage);
  font-size: 15px;
  line-height: 1.85;
}

.info-block h2 {
  font-size: 22px;
  color: var(--cream);
  margin-bottom: 4px;
}

.info-block h3 {
  color: var(--clay-light);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

/* คอลัมน์ฝั่งขวา: แผนที่ + ปุ่มนำทางด้านล่าง */
.map-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.map-embed-frame {
  flex: 1;
  background: var(--green-surface);
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: var(--radius-lg);
  min-height: 340px;
  display: flex;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.map-embed-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 12px;
}

.map-cta-box {
  width: 100%;
}

.btn-google-maps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 24px;
  background: var(--clay);
  color: var(--bg-deep);
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-google-maps:hover {
  background: var(--clay-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(189, 148, 112, 0.35);
}

.btn-google-maps svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}

.contact-standalone {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(46, 64, 54, 0.65) 0%, rgba(30, 43, 36, 0.85) 100%);
  border: 1px solid rgba(223, 190, 159, 0.25);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.contact-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.hours-list {
  border-top: 1px solid var(--line);
}

.hours-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.hours-row strong {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}

.hours-unit {
  font-size: 14px;
  font-weight: 400;
}

.phone-link {
  display: inline-block;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  margin: 2px 0 8px;
  transition: color 0.2s;
}

.phone-link:hover {
  color: var(--clay-light);
}

.contact-note {
  font-size: 14px;
  color: var(--sage);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 14px;
  font-size: 14px;
}

.social-row a {
  border-bottom: 1px solid rgba(245, 241, 232, 0.35);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.social-row a:hover {
  border-color: var(--clay-light);
  color: var(--clay-light);
}

/* Footer */
.site-footer {
  max-width: 1440px;
  margin: 60px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.7);
  flex-wrap: wrap;
  gap: 16px;
}

.back-to-top {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}

.back-to-top:hover {
  background: rgba(245, 241, 232, 0.1);
  border-color: var(--cream);
}

/* =====================================================
   4. Floating Facebook Messenger Bubble มุมล่างขวา
   ===================================================== */
.floating-chat-bubble {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 10px;
  background: rgba(30, 43, 36, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(223, 190, 159, 0.55);
  border-radius: 999px;
  color: var(--cream);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55), 0 0 24px rgba(189, 148, 112, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(24px) scale(0.9);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.4s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}

.floating-chat-bubble.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.floating-chat-bubble:hover {
  border-color: var(--clay-light);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65), 0 0 30px rgba(223, 190, 159, 0.45);
}

.chat-bubble-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 1px solid rgba(223, 190, 159, 0.45);
  opacity: 0;
  pointer-events: none;
  animation: chatPulse 2.8s ease-out infinite;
}

@keyframes chatPulse {
  0% {
    opacity: 0.75;
    transform: scale(0.98);
  }
  100% {
    opacity: 0;
    transform: scale(1.12, 1.28);
  }
}

.chat-bubble-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clay-light) 0%, var(--clay) 100%);
  color: var(--bg-deep);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.chat-bubble-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.chat-bubble-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.chat-bubble-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--cream);
}

.chat-bubble-text small {
  font-size: 11.5px;
  color: var(--clay-light);
}

/* =====================================================
   5. Storybook Lightbox
   ===================================================== */
.storybook-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.storybook-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(24, 36, 30, 0.88) 0%, rgba(8, 13, 10, 0.96) 100%);
  backdrop-filter: blur(12px);
}

.lb-close {
  position: absolute;
  top: clamp(16px, 3vw, 28px);
  right: clamp(16px, 4vw, 36px);
  z-index: 10;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(245, 241, 232, 0.1);
  border: 1px solid rgba(245, 241, 232, 0.25);
  color: var(--cream);
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s;
}

.lb-close:hover {
  background: var(--clay);
  color: var(--bg-deep);
  transform: rotate(90deg);
}

.lb-book-stage {
  position: relative;
  z-index: 5;
  width: 100vw;
  height: 76dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1600px;
  overflow: hidden;
}

.lb-main-spread {
  position: relative;
  z-index: 4;
  width: min(74vw, 820px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}

.lb-flash-aura {
  position: absolute;
  inset: -40px;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(circle, rgba(255, 250, 235, 0.85) 0%, rgba(223, 190, 159, 0.35) 35%, transparent 70%);
  opacity: 0;
  mix-blend-mode: screen;
}

.lb-flash-aura.is-flashing {
  animation: magicBurst 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes magicBurst {
  0% {
    opacity: 0.95;
    transform: scale(0.5);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

.lb-main-spread.magic-pop {
  animation: pageFlashAppear 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.lb-main-spread.flip-next {
  animation: pageTurnNext 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.lb-main-spread.flip-prev {
  animation: pageTurnPrev 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageFlashAppear {
  0% {
    opacity: 0;
    transform: scale(0.84) rotateY(-12deg);
    filter: brightness(2.2) blur(10px);
  }
  50% {
    filter: brightness(1.3) blur(0px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
    filter: brightness(1) blur(0px);
  }
}

@keyframes pageTurnNext {
  0% {
    opacity: 0;
    transform: translateX(65px) rotateY(-28deg) scale(0.92);
    filter: brightness(1.9) blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotateY(0deg) scale(1);
    filter: brightness(1) blur(0);
  }
}

@keyframes pageTurnPrev {
  0% {
    opacity: 0;
    transform: translateX(-65px) rotateY(28deg) scale(0.92);
    filter: brightness(1.9) blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotateY(0deg) scale(1);
    filter: brightness(1) blur(0);
  }
}

.lb-page-card {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lb-page-card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.75), 0 0 35px rgba(223, 190, 159, 0.14);
}

.lb-page-card:has(img.is-missing) {
  max-width: 560px;
  max-height: 620px;
  aspect-ratio: 1 / 1.08;
  background: linear-gradient(135deg, rgba(69, 89, 79, 0.55) 0%, rgba(46, 64, 54, 0.9) 60%, rgba(189, 148, 112, 0.25) 100%);
  border: 1px solid rgba(245, 241, 232, 0.2);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7);
}

.lb-page-card:has(img.is-missing)::after {
  content: 'พื้นที่สำหรับภาพถ่ายจริง';
  color: rgba(245, 241, 232, 0.5);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.lb-page-card img.is-missing {
  display: none;
}

.lb-peek {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: min(50vw, 480px);
  height: 62dvh;
  opacity: 0.34;
  filter: blur(1.5px) brightness(0.7);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
}

.lb-peek-prev {
  left: 0;
  transform: translate(-74%, -50%) perspective(1000px) rotateY(24deg) scale(0.88);
  transform-origin: right center;
}

.lb-peek-next {
  right: 0;
  transform: translate(74%, -50%) perspective(1000px) rotateY(-24deg) scale(0.88);
  transform-origin: left center;
}

.lb-peek-prev:hover {
  opacity: 0.68;
  filter: blur(0px) brightness(0.9);
  transform: translate(-68%, -50%) perspective(1000px) rotateY(18deg) scale(0.91);
}

.lb-peek-next:hover {
  opacity: 0.68;
  filter: blur(0px) brightness(0.9);
  transform: translate(68%, -50%) perspective(1000px) rotateY(-18deg) scale(0.91);
}

.lb-controls {
  position: relative;
  z-index: 6;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.lb-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(245, 241, 232, 0.08);
  border: 1px solid rgba(245, 241, 232, 0.22);
  color: var(--cream);
  font-size: 17px;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.lb-nav-btn:hover {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--bg-deep);
  transform: scale(1.08);
}

.lb-page-indicator {
  font-size: 20px;
  color: var(--clay-light);
  min-width: 64px;
  text-align: center;
}

/* =====================================================
   Responsive & Mobile Hero Centering + White Space
   ===================================================== */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 48px;
    padding-bottom: 64px;
  }
  .hero-arch-wrapper {
    margin: 0 auto;
  }
  .story-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .visit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 82px;
    left: 0;
    right: 0;
    background: var(--green-main);
    border-bottom: 1px solid var(--line);
    padding: 18px var(--gutter) 26px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-cta {
    text-align: center;
  }

  /* จัดกึ่งกลางเนื้อหาช่วง Hero บนมือถือ พร้อมเพิ่ม White Space บน-ล่าง และจัดตำแหน่งโลโก้/subtext ให้ตรงกลางเป๊ะ */
  .hero {
    padding-top: 68px;
    padding-bottom: 84px;
    gap: 52px;
    text-align: center;
  }
  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 0;
  }
  .hero-logo-box {
    margin-bottom: 28px;
    display: flex;
    justify-content: center;
    width: 100%;
  }
  .hero-logo-img {
    margin: 0 auto;
    display: block;
  }
  .hero-badge {
    justify-content: center;
    text-align: center;
    margin-bottom: 18px;
    width: 100%;
  }
  .hero-badge::before {
    display: none;
  }
  .hero h1 {
    margin-bottom: 26px;
  }
  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .gallery-item {
    border-radius: 12px;
  }
  .gallery-item:nth-child(2),
  .gallery-item:nth-child(8) {
    border-radius: 999px 999px 12px 12px;
  }
  .visit-info-card,
  .contact-standalone {
    padding: 24px;
  }
  .lb-main-spread {
    width: 78vw;
  }
  .lb-peek {
    width: 60vw;
    height: 54dvh;
    opacity: 0.28;
  }
  .lb-peek-prev {
    transform: translate(-84%, -50%) perspective(800px) rotateY(22deg) scale(0.85);
  }
  .lb-peek-next {
    transform: translate(84%, -50%) perspective(800px) rotateY(-22deg) scale(0.85);
  }
}