/* ==========================================================================
   ISAN NEW TASTE — Shared Stylesheet
   ใช้ร่วมกันทุกหน้า (index / ep1 / ep2 / ep3 / about)
   จัดกลุ่ม: 0.Fonts&Vars  1.Base  2.Nav+Mobile  3.PageTransition&ScrollFX
   4.Hero(home)  5.Cards(home)  6.Map(home)  7.Timeline(home)
   8.AboutHero&Team  9.EP-Hero  10.Origin/Quote/Gallery/Blur/Tips(EP)
   11.NextEp&Footer  12.VideoModal  13.Contact/Comment  14.Utilities
   15.Responsive
   ========================================================================== */

/* ---------- 0. CSS VARIABLES ---------- */
:root {
  --bg-dark: #121212;
  --bg-darker: #0a0a0a;
  --bg-card: rgba(30, 30, 30, 0.6);
  --gold: #dfc889;
  --gold-hover: #b5952f;
  --gold-soft: rgba(223, 200, 137, 0.35);
  --text-main: #ffffff;
  --text-muted: #a0a0a0;
  --text-dark: #888888;
  --btn-red: #7b1c1c;
  --btn-red-hover: #5a1414;

  /* จับคู่ฟอนต์: Prompt = หัวข้อหลัก (แสดงตัวตน, เรขาคณิต, มีคาแรกเตอร์)
     Sarabun = เนื้อหา/หัวข้อรอง (อ่านง่ายในขนาดเล็ก ตัดกับ Prompt ชัดเจน) */
  --font-heading: 'Prompt', sans-serif;
  --font-body: 'Sarabun', sans-serif;

  /* smooth easing curve ใช้ร่วมกันทุก transition (เข้า-ออกนุ่มนวลแบบเว็บ interactive) */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 1. BASE ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.logo, .nav-links a,
.play-btn, .card-content h3, .card-btn,
.map-title, .map-subtitle,
.section-title, .node-year, .node-title,
.episode-info h3, .origin-text h2, .quote-box h3,
.blur-content h2, .tips-text h2, .tips-text h4,
.next-ep-title, .mini-card-text h5, .back-to-top,
.nutri-item h4, .comment-title, .comment-name,
.form-title {
  font-family: var(--font-heading);
}

p, li, span, input, textarea, button {
  font-family: var(--font-body);
}

a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- 2. NAVIGATION + MOBILE MENU ---------- */
nav {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  padding: 12px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  z-index: 1000;
  transition: background 0.3s, border-radius 0.3s;
}

nav.scrolled {
  background: rgba(18, 18, 18, 0.9);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.logo {
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  z-index: 1002;
  position: relative;
}

.logo span {
  font-size: 24px;
  color: var(--gold);
  display: inline-block;
  transition: transform 0.6s ease;
}

.logo:hover span {
  transform: rotate(90deg);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
}

.nav-links li a {
  position: relative;
  color: var(--text-main);
  text-decoration: none;
  font-size: 13px;
  text-transform: uppercase;
  transition: color 0.3s;
  font-weight: 400;
  letter-spacing: 1px;
  padding-bottom: 4px;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--gold);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
  width: 100%;
}

/* Hamburger — ซ่อนบนจอใหญ่ */
.nav-toggle {
  display: none;
  width: 26px;
  height: 20px;
  position: relative;
  z-index: 1002;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: 0.3s ease;
}

.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }

.nav-toggle.open span:nth-child(1) { top: 9px; transform: rotate(45deg); background: var(--gold); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 9px; transform: rotate(-135deg); background: var(--gold); }

/* ---------- 3. PAGE TRANSITION + SCROLL FX ---------- */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--bg-darker);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.55s var(--ease-smooth), clip-path 0.6s var(--ease-smooth);
  clip-path: circle(150% at 50% 50%);
}

.page-transition.hide {
  opacity: 0;
  clip-path: circle(0% at 50% 50%);
}

.page-transition.leaving {
  opacity: 1;
  clip-path: circle(150% at 50% 50%);
  pointer-events: all;
}

.page-transition .pt-mark {
  font-size: 28px;
  color: var(--gold);
  animation: pt-spin 1s linear infinite;
  transform: scale(1);
  opacity: 1;
  transition: transform 0.5s var(--ease-smooth), opacity 0.5s var(--ease-smooth);
}

.page-transition.hide .pt-mark { transform: scale(0.7); opacity: 0; }

@keyframes pt-spin {
  from { transform: rotate(0deg); opacity: .5; }
  50% { opacity: 1; }
  to { transform: rotate(360deg); opacity: .5; }
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-hover), var(--gold));
  z-index: 10001;
  transition: width 0.1s linear;
}

/* Reveal-on-scroll */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--ease-smooth), transform 0.9s var(--ease-smooth);
}

[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="left"] { transform: translateX(-48px); }
[data-reveal="left"].in-view { transform: translateX(0); }
[data-reveal="right"] { transform: translateX(48px); }
[data-reveal="right"].in-view { transform: translateX(0); }
[data-reveal="zoom"] { transform: scale(0.92); }
[data-reveal="zoom"].in-view { transform: scale(1); }

/* stagger children — เพิ่ม clip-path wipe ให้รูปภาพในกลุ่มดูพรีเมียมขึ้น */
[data-reveal-group] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth), clip-path 0.8s var(--ease-smooth);
}
[data-reveal-group].in-view > * {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-group] > .gallery-item,
.place-gallery[data-reveal-group] > .gallery-item {
  clip-path: inset(0 0 0 100%);
}
[data-reveal-group].in-view > .gallery-item {
  clip-path: inset(0 0 0 0%);
}
[data-reveal-group].in-view > *:nth-child(1) { transition-delay: 0s; }
[data-reveal-group].in-view > *:nth-child(2) { transition-delay: .12s; }
[data-reveal-group].in-view > *:nth-child(3) { transition-delay: .24s; }
[data-reveal-group].in-view > *:nth-child(4) { transition-delay: .36s; }
[data-reveal-group].in-view > *:nth-child(5) { transition-delay: .48s; }
[data-reveal-group].in-view > *:nth-child(6) { transition-delay: .6s; }
[data-reveal-group].in-view > *:nth-child(7) { transition-delay: .72s; }

/* Hero heading word-stagger reveal (แยกคำ ทยอยเด้งขึ้นทีละคำตอนโหลดหน้า) */
.word-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}
h1.words-in .word-reveal { opacity: 1; transform: translateY(0); }

/* Back-to-top visibility toggle */
.back-to-top { opacity: 0; transform: translateY(10px); pointer-events: none; }
.back-to-top.show { opacity: 1; transform: translateY(0); pointer-events: all; }

/* Tilt-able cards / gallery / thumbnails */
.tilt {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---------- 4. HERO (HOME) ---------- */
/* ความสูงปรับตามเนื้อหา (ไม่ fix 90vh) + เว้น padding ล่างให้การ์ด EP ที่ซ้อนขึ้นมา 120px
   (.cards-container margin-top: -120px) จึงไม่ทับข้อความ ไม่ว่าจอจะสูงเตี้ยแค่ไหน */
.hero {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 150px 10% 190px;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* วิดีโอพื้นหลัง Home: ขยายเต็มกรอบ .hero เสมอ (ตัดขอบส่วนเกินด้วย cover ไม่บีบภาพ)
   ใช้ !important กันกรณี CSS อื่น/แคชเก่าทำให้วิดีโอไปวางเป็นกล่องปกติ */
.hero>.hero-video {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 60%;
  background: linear-gradient(to bottom, rgba(18, 18, 18, 0) 0%, rgba(18, 18, 18, 0.8) 50%, rgba(18, 18, 18, 1) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
}

.hero-content h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.1;
  margin-bottom: 20px;
  font-weight: 500;
}

.hero-line {
  width: 100%;
  max-width: 260px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.3);
  margin: 30px 0;
}

.hero-content p {
  font-size: 15px;
  color: #e0e0e0;
  line-height: 1.8;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  max-width: 860px;
}

/* ---------- 5. HORIZONTAL CARDS (HOME) ---------- */
.cards-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: -120px;
  position: relative;
  z-index: 10;
  padding: 0 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.card {
  display: flex;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  width: 33.33%;
  height: 160px;
  cursor: pointer;
  transition: transform 0.35s ease, border-color 0.3s, box-shadow 0.35s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-soft);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.card-img-wrapper {
  width: 45%;
  padding: 10px;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.5s ease;
}

.card:hover .card-img {
  transform: scale(1.08);
}

.card-content {
  width: 55%;
  padding: 15px 15px 15px 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-content h3 {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 5px;
  font-weight: 500;
}

.card-content p {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-btn {
  background-color: var(--btn-red);
  color: #fff;
  border: none;
  padding: 6px 0;
  width: 90px;
  font-size: 11px;
  border-radius: 4px;
  text-align: center;
  transition: 0.3s;
}

.card:hover .card-btn {
  background-color: var(--btn-red-hover);
}

/* ---------- 6. MAP SECTION (HOME) ---------- */
.map-section {
  position: relative;
  padding: 120px 0 80px 0;
  background-image: url('../../assets/images/home/isan-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.map-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(18, 18, 18, 1) 0%, rgba(18, 18, 18, 0.75) 30%, rgba(18, 18, 18, 0.75) 70%, rgba(18, 18, 18, 1) 100%);
}

.map-container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.map-text-box { width: 55%; }

.map-title {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 5px;
}

.map-subtitle {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  color: #fff;
  font-weight: 400;
  margin-bottom: 5px;
}

.map-subtext {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 30px;
}

.map-desc {
  font-size: 14px;
  color: #ccc;
  line-height: 1.8;
  text-align: justify;
}

.map-graphic { width: 40%; text-align: right; }

/* แผนที่: แสดงสีตามไฟล์ map.png จริง (ไม่ย้อมสีด้วย sepia/hue-rotate แล้ว)
   คง opacity ของเลเยอร์เดิม (0.9) และ drop-shadow เดิมไว้ */
.map-graphic img {
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  opacity: 0.9;
  filter: drop-shadow(0px 10px 20px rgba(0, 0, 0, 0.8));
  transition: transform 0.6s ease;
}

.map-graphic:hover img { transform: scale(1.03) rotate(-1deg); }

/* ---------- 7. TIMELINE (HOME) ---------- */
.timeline-section {
  padding: 80px 0 100px 0;
  background-color: var(--bg-dark);
  position: relative;
  z-index: 2;
}

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: var(--gold);
  margin-bottom: 80px;
}

.timeline-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  padding: 0 20px;
}

.timeline-track {
  position: absolute;
  top: 50%;
  left: 5%;
  width: 90%;
  height: 2px;
  background: #333;
  transform: translateY(-50%);
}

.timeline-progress {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 66%;
  background: linear-gradient(90deg, #fff 0%, var(--gold) 100%);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.4s cubic-bezier(.22,.9,.34,1);
}

.timeline-progress.animate { transform: scaleX(1); }

.timeline-nodes {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.node { width: 28%; text-align: center; position: relative; }
.node.top { padding-bottom: 40px; }
.node.bottom { padding-top: 40px; margin-top: 80px; }

.node-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.node.top .node-dot { bottom: -7px; }
.node.bottom .node-dot { top: -7px; }
.node.future .node-dot { background: #555; box-shadow: none; }
.node.future .node-year { color: #555; }
.node.future .node-title { color: #777; }

.node-quote { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.node-year { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: 1px; }
.node-title { font-size: clamp(1.15rem, 2vw, 1.5rem); color: #fff; font-weight: 500; margin-bottom: 5px; }
.node-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* ---------- 8. ABOUT HERO + TEAM ---------- */
/* พื้นหลังภาพเต็มจอ: footer ถูกย้ายมาอยู่ใน .hero-about แล้ว จึงไม่มีแถบดำใต้ภาพ
   background-attachment: fixed ทำให้ภาพพอดีกับหน้าจอ (cover) ไม่ถูกยืดตามความสูงของหน้า */
.hero-about {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 140px 20px 0;
}

.hero-about::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.85);
  z-index: 1;
}

.hero-about > footer { margin-top: auto; margin-bottom: 40px; }

.about-container { position: relative; z-index: 2; max-width: 900px; text-align: center; }

.hero-about h1 { color: var(--gold); margin-bottom: 20px; font-size: clamp(1.5rem, 3.4vw, 2rem); }
.hero-about p.intro { color: #fff; font-size: 16px; margin-bottom: 30px; font-weight: 400; }
.hero-about p.desc { color: var(--text-muted); font-size: 14px; margin-bottom: 60px; line-height: 1.8; }

.team-grid {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.team-member { text-align: center; width: 220px; }

.circle-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  margin: 0 auto 20px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.team-member:hover .circle-img {
  transform: translateY(-6px);
  box-shadow: 0 12px 26px rgba(223, 200, 137, 0.25);
}

.circle-img img { width: 100%; height: 100%; object-fit: cover; }

.team-member h4 { color: #fff; font-size: 15px; margin-bottom: 5px; }
.team-member p { color: var(--gold); font-size: 11px; margin-bottom: 5px; line-height: 1.5; }
.team-member span { font-size: 10px; color: #777; }

/* ---------- 9. HERO (EPISODE PAGES) ---------- */
.ep-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0 10%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.ep-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.ep-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 60%;
  background: linear-gradient(to bottom, rgba(18, 18, 18, 0) 0%, rgba(18, 18, 18, 0.9) 70%, rgba(18, 18, 18, 1) 100%);
  z-index: 2;
}

.ep-hero .hero-content {
  position: relative;
  z-index: 3;
  max-width: 1000px;
  padding-top: 20vh;
}

.ep-hero .hero-content h1 {
  font-size: clamp(2.4rem, 7vw, 5.3rem);
  line-height: 1.1;
  margin-bottom: 15px;
  font-weight: 600;
  letter-spacing: -1px;
}

.ep-hero .hero-content p.meta {
  font-size: 14px;
  color: #ddd;
  margin-bottom: 25px;
  letter-spacing: 1px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 12px 30px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.4s var(--ease-smooth);
  text-decoration: none;
  margin-bottom: 50px;
  backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
}

.play-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.35), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.play-btn:hover::after { opacity: 1; }

.play-btn:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  transform: translateY(-2px);
}

.play-icon {
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #fff;
  transition: 0.3s;
}

.play-btn:hover .play-icon { border-left-color: #000; }

.episode-info h3 { font-size: 22px; color: var(--gold); margin-bottom: 10px; font-weight: 500; }
.episode-info p.desc { font-size: 14px; color: #ccc; line-height: 1.8; max-width: 550px; text-align: justify; }

.hero-gif-box {
  position: absolute;
  bottom: 8%;
  right: 8%;
  width: 260px;
  height: 150px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.hero-gif-box img,
.hero-gif-box video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 10. ORIGIN / QUOTE / GALLERY / BLUR / TIPS (EP PAGES) ---------- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 30px;
  position: relative;
  z-index: 5;
}

.origin-section {
  display: flex;
  gap: 50px;
  align-items: center;
  padding: 70px 0 40px;
}

.origin-img { width: 40%; position: relative; overflow: hidden; border-radius: 8px; }

.origin-img img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 1s var(--ease-smooth);
  clip-path: inset(0 0 0 0);
}

.origin-img.in-view img { animation: img-wipe-x 1s var(--ease-smooth); }

@keyframes img-wipe-x {
  from { clip-path: inset(0 0 0 100%); }
  to { clip-path: inset(0 0 0 0%); }
}

.origin-text { width: 60%; }
.origin-text h2 {
  color: var(--gold);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 22px;
  position: relative;
  padding-left: 24px;
}
.origin-text h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left;
  width: 16px;
  height: 2px;
  background: var(--gold);
  transition: transform 0.6s var(--ease-smooth) 0.3s;
}
.origin-text.in-view h2::before { transform: translateY(-50%) scaleX(1); }
.origin-text p { font-size: 13px; color: var(--text-muted); line-height: 1.8; margin-bottom: 15px; text-align: justify; }

.quote-container { position: relative; margin-top: 80px; margin-bottom: 100px; }

.quote-box {
  border: 1px solid var(--gold);
  padding: 50px 50px 50px 50px;
  border-radius: 8px;
  background: rgba(30, 30, 30, 0.4);
  backdrop-filter: blur(5px);
}

.quote-box.has-portrait { padding-right: 280px; }
.quote-box.centered { text-align: center; }

.quote-box h3 { font-size: 16px; color: var(--text-main); margin-bottom: 15px; font-weight: 500; letter-spacing: 1px; }
.quote-box p { font-size: 13px; color: var(--text-muted); line-height: 1.8; text-align: justify; }
.quote-box.centered p { text-align: center; max-width: 800px; margin: 0 auto; font-size: 16px; color: #fff; }
.quote-box.centered h3 { font-size: 26px; color: var(--gold); }

.portrait-img {
  position: absolute;
  right: 40px;
  bottom: -20px;
  width: 220px;
  height: 280px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Expert / interview profile block — photo + quote, alternating sides */
.expert-block {
  display: flex;
  gap: 45px;
  align-items: center;
  margin-bottom: 60px;
}

.expert-block.reverse { flex-direction: row-reverse; }

.expert-photo { width: 38%; flex-shrink: 0; overflow: hidden; border-radius: 8px; }

.expert-photo img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  clip-path: inset(0 0 0 0);
}

.expert-block.in-view .expert-photo img { animation: img-wipe-x 1s var(--ease-smooth); }

.expert-text { width: 62%; }
.expert-text .expert-name {
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  position: relative;
  padding-left: 24px;
}
.expert-text .expert-name::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left;
  width: 16px; height: 2px;
  background: var(--gold);
  transition: transform 0.6s var(--ease-smooth) 0.3s;
}
.expert-block.in-view .expert-name::before { transform: translateY(-50%) scaleX(1); }
.expert-text .expert-title { color: var(--text-dark); font-size: 12px; margin-bottom: 16px; }
.expert-text p { font-size: 13px; color: var(--text-muted); line-height: 1.8; text-align: justify; }
.expert-text p.quote-lead { color: #eee; font-size: 15px; font-style: italic; margin-bottom: 14px; }

/* Restaurant / place profile card (e.g. หมก MOK) */
.place-card {
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.5);
  backdrop-filter: blur(5px);
  padding: 40px;
  margin-bottom: 60px;
}

.place-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(223, 200, 137, 0.2);
  padding-bottom: 18px;
}

.place-card-head h3 {
  color: var(--text-main);
  font-size: 22px;
  font-weight: 500;
  position: relative;
  padding-left: 24px;
}
.place-card-head h3::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left;
  width: 16px; height: 2px;
  background: var(--gold);
  transition: transform 0.6s var(--ease-smooth) 0.3s;
}
.place-card.in-view h3::before { transform: translateY(-50%) scaleX(1); }

.place-badge {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 5px 14px;
  border-radius: 20px;
  text-transform: uppercase;
}

.place-card p.place-desc { font-size: 13px; color: var(--text-muted); line-height: 1.8; text-align: justify; margin-bottom: 24px; }

.place-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 26px;
}

.place-meta-item h5 { color: var(--gold); font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; text-transform: uppercase; }
.place-meta-item p { color: #ddd; font-size: 13px; line-height: 1.6; }

.place-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.place-gallery .gallery-item { height: 120px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 100px;
}

.gallery-item {
  background: #222;
  border-radius: 6px;
  overflow: hidden;
  height: 140px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.4s;
}

.gallery-item:hover img { transform: scale(1.1); }
.gallery-item.wide { grid-column: span 2; }
.gallery-item.tall { grid-row: span 2; height: auto; }

/* Gallery lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
  padding: 40px;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 10px;
  border: 1px solid var(--gold-soft);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.blur-section {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  padding: 80px 40px;
  text-align: center;
  margin-bottom: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.blur-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(15px) brightness(0.25);
  z-index: 1;
  transform: scale(1.1);
}

.blur-content { position: relative; z-index: 2; }
.blur-content h2 { font-size: 28px; color: var(--gold); font-weight: 600; margin-bottom: 20px; letter-spacing: 2px; }
.blur-content p { font-size: 13px; color: #ddd; line-height: 1.8; max-width: 800px; margin: 0 auto 15px auto; text-align: justify; }

.tips-section { display: flex; gap: 50px; align-items: center; margin-bottom: 100px; }
.tips-text { width: 55%; }
.tips-text h2 { font-size: 24px; font-weight: 500; margin-bottom: 20px; }
.tips-text h4 { font-size: 14px; color: var(--gold); margin-bottom: 10px; margin-top: 20px; }
.tips-text p, .tips-text ul { font-size: 13px; color: var(--text-muted); line-height: 1.8; text-align: justify; }
.tips-text ul { margin-left: 20px; margin-top: 10px; }
.tips-text li { margin-bottom: 10px; }

.tips-img { width: 45%; position: relative; }

/* ไม่ใส่ overflow:hidden ที่กรอบ เพื่อให้ปุ่มลูกศรที่คร่อมขอบ (left/right: -20px) แสดงเต็มวง ไม่ถูกตัด
   — มุมโค้งของรูปใช้ border-radius ที่ตัวรูปแทน */
.tips-img .slider-track { position: relative; width: 100%; aspect-ratio: 4/5; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1); }

.tips-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.tips-img img.active { opacity: 1; }

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 22px;
  color: var(--gold);
  cursor: pointer;
  z-index: 4;
  transition: 0.25s;
}

.slider-arrow:hover { background: var(--gold); color: #000; }
.slider-arrow.left { left: -20px; }
.slider-arrow.right { right: -20px; }

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.slider-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: 0.25s;
}

.slider-dots span.active { background: var(--gold); width: 18px; border-radius: 4px; }

/* ---------- 11. NEXT EPISODE + FOOTER ---------- */
.next-ep-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
  flex-wrap: wrap;
}

.next-ep-title { font-size: 14px; color: var(--gold); margin-bottom: 20px; }
.next-cards { display: flex; gap: 20px; flex-wrap: wrap; }

.mini-card {
  display: flex;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  width: 260px;
  height: 80px;
  overflow: hidden;
  text-decoration: none;
  transition: 0.3s;
}

.mini-card:hover { border-color: var(--gold); background: rgba(50, 50, 50, 0.8); transform: translateY(-3px); }
.mini-card img { width: 40%; height: 100%; object-fit: cover; }
.mini-card-text { width: 60%; padding: 10px 15px; display: flex; flex-direction: column; justify-content: center; }
.mini-card-text h5 { color: #fff; font-size: 13px; font-weight: 500; }
.mini-card-text p { color: var(--btn-red); font-size: 11px; margin-top: 5px; font-weight: 600; }

.back-to-top {
  width: 60px; height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  font-size: 10px;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
  transition: 0.3s;
  flex-shrink: 0;
  cursor: pointer;
  background: none;
}

.back-to-top:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-3px); }

/* Footer แบบเม็ดยา (pill) — ใช้เหมือนกันทุกหน้า: Home / EP.1–3 / About */
footer {
  margin: 0 auto 40px auto;
  max-width: 400px;
  padding: 12px 25px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 5;
}

.footer-logo { font-size: 14px; color: var(--gold); }
footer p { font-size: 11px; color: #aaa; letter-spacing: 1px; margin: 0; }

/* ---------- 12. VIDEO MODAL ---------- */
/* พื้นหลังโปร่งใส (opacity) 50% / วิดีโออยู่กึ่งกลางจอทั้งแนวตั้งและแนวนอน */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  margin: 0;
  /* กว้างไม่เกิน 1000px และสูงไม่เกินจอ (เหลือที่ให้ปุ่มปิดด้านบน) */
  width: min(90vw, 1000px, calc((100vh - 140px) * 16 / 9));
  aspect-ratio: 16/9;
}

/* ปุ่มปิด (กากบาท) — วาดเครื่องหมาย × ด้วย ::before/::after
   จึงอยู่กึ่งกลางวงกลมพอดีทุกฟอนต์/ทุกอุปกรณ์ */
.modal .close {
  position: absolute;
  right: 0;
  top: -50px;
  width: 40px;
  height: 40px;
  font-size: 0;
  line-height: 0;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.modal .close::before,
.modal .close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.modal .close::before { transform: translate(-50%, -50%) rotate(45deg); }
.modal .close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.modal .close:hover { color: var(--gold); border-color: var(--gold); transform: scale(1.05); }

#videoMediaWrap {
  width: 100%;
  height: 100%;
}

.modal-content iframe,
.modal-content video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  border-radius: 12px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  background: #000;
}

/* ---------- 13. CONTACT / COMMENT SECTION ---------- */
.contact-section {
  margin: 40px auto 100px;
  max-width: 900px;
  position: relative;
  z-index: 2;
}

.contact-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--gold-soft);
  border-radius: 16px;
  padding: 50px 45px;
  backdrop-filter: blur(10px);
}

.form-title {
  color: var(--gold);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
  text-align: center;
}

.form-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.7;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.contact-form .full-width { grid-column: 1 / -1; }

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-group label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.field-group input,
.field-group textarea,
.field-group select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  font-size: 13px;
  font-family: var(--font-body);
  transition: border-color 0.25s, background 0.25s;
  resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.field-group textarea { min-height: 110px; }

.contact-submit {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 6px;
  background: var(--gold);
  color: #1a1a1a;
  border: none;
  padding: 13px 46px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: 0.3s;
  letter-spacing: 0.5px;
}

.contact-submit {
  position: relative;
  overflow: hidden;
  transition: background 0.3s, color 0.3s, transform 0.4s var(--ease-smooth);
}
.contact-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.4), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.contact-submit:hover::after { opacity: 1; }
.contact-submit:hover { background: var(--gold-hover); color: #fff; transform: translateY(-2px); }
.contact-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }

.form-status {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  min-height: 18px;
}

.form-status.success { color: #7fd39a; }
.form-status.error { color: #e07a7a; }

.comment-list {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 340px;
  overflow-y: auto;
}

.comment-list::-webkit-scrollbar { width: 5px; }
.comment-list::-webkit-scrollbar-thumb { background: var(--gold-soft); border-radius: 4px; }

.comment-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 16px;
}

.comment-item .comment-name { color: var(--gold); font-size: 13px; margin-bottom: 4px; }
.comment-item .comment-text { color: #ddd; font-size: 12.5px; line-height: 1.6; }
.comment-item .comment-time { color: #666; font-size: 10px; margin-top: 6px; }

.comment-empty { text-align: center; color: #666; font-size: 12px; padding: 10px 0; }

/* ---------- 14. UTILITIES ---------- */
.mt-0 { margin-top: 0 !important; }
.text-center { text-align: center; }

/* ---------- 15. RESPONSIVE ---------- */
@media (max-width: 991px) {
  nav { padding: 12px 22px; top: 16px; width: 92%; }

  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(.4,0,.2,1);
    z-index: 1001;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-links.open { transform: translateX(0); }
  .nav-links li { width: 100%; }
  .nav-links li a { font-size: 16px; display: block; }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .nav-overlay.show { opacity: 1; pointer-events: all; }

  .hero { padding-top: 120px; padding-bottom: 130px; }

  /* กล่องพรีวิววิดีโอ (hero-gif-box): ย้ายลงมาอยู่ใต้ข้อความ ชิดขวา ไม่ลอยทับเนื้อหา */
  .ep-hero { flex-direction: column; padding-bottom: 56px; }
  .hero-gif-box {
    --gif-w: min(46vw, 230px);
    position: relative;
    bottom: auto;
    right: auto;
    align-self: flex-end;
    width: var(--gif-w);
    height: calc(var(--gif-w) * 0.5625);
    margin: 30px 0 0;
    flex-shrink: 0;
  }
  .cards-container { flex-direction: column; margin-top: -60px; }
  .card { width: 100%; height: auto; min-height: 150px; }

  .map-container { flex-direction: column; text-align: center; }
  .map-text-box, .map-graphic { width: 100%; }
  .map-graphic { text-align: center; margin-top: 30px; }
  .map-graphic img { margin: 0 auto; }
  .map-desc { text-align: left; }
  .map-section { background-attachment: scroll; }

  /* มือถือ/แท็บเล็ต (iOS ไม่รองรับ fixed) — ใช้ scroll แทน */
  .hero-about { background-attachment: scroll; }

  .timeline-track { display: none; }
  .timeline-nodes { flex-direction: column; gap: 50px; }
  .node { width: 100%; padding: 0 !important; margin: 0 !important; }
  .node-dot { display: none; }

  .origin-section { flex-direction: column; }
  .origin-img, .origin-text { width: 100%; }

  .quote-box.has-portrait { padding: 40px 30px 160px; }
  .portrait-img {
    width: 160px; height: 200px;
    right: 50%; transform: translateX(50%);
    bottom: -30px;
  }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item.wide { grid-column: span 2; }

  .tips-section { flex-direction: column; }
  .tips-text, .tips-img { width: 100%; }
  .tips-img { max-width: 380px; margin: 0 auto; }

  .contact-form { grid-template-columns: 1fr; }
  .contact-card { padding: 36px 24px; }

  .expert-block, .expert-block.reverse { flex-direction: column; }
  .expert-photo, .expert-text { width: 100%; }
  .expert-photo img { height: 260px; }

  .place-card { padding: 30px 22px; }
  .place-meta { grid-template-columns: 1fr; gap: 14px; }
  .place-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .hero-content h1, .ep-hero .hero-content h1 { letter-spacing: -0.5px; }
  .ep-hero .hero-content { padding-top: 26vh; }

  .quote-box { padding: 34px 24px; }
  .blur-section { padding: 50px 22px; }
  .blur-content h2 { font-size: 22px; }

  .next-ep-section { flex-direction: column; align-items: flex-start; }
  .next-cards { width: 100%; }
  .mini-card { width: 100%; }
  .back-to-top { align-self: center; }

  footer { max-width: 92%; flex-wrap: wrap; text-align: center; }

  .modal-content { width: min(94vw, calc((100vh - 140px) * 16 / 9)); }
  .modal .close { top: -48px; right: 0; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery-item { height: 110px; }
  .card-content p { -webkit-line-clamp: 3; }
}
