/* ==============================================
   PAIDEE MADEE — หน้าแรก
   ใช้กับ resources/views/th/page/home.blade.php
============================================== */

/* หน้าแรกไม่เว้นระยะบนของบล็อก intro (style.css ตั้งไว้ 60px) */
.coffin-intro-section { margin-top: 0; }

/* =========================================================
   GALLERY — ผลงานของเรา (ไม่มีกรอบ)
========================================================= */

/* =========================================================
   สินค้าและบริการ - รูปซ้าย ข้อความขวา (เฉพาะหน้านี้)
========================================================= */
/* มีแค่ 2 การ์ด คอลัมน์ col-6 จึงกว้างเกินไป — จำกัดความกว้างแล้วจัดกึ่งกลาง
   ผูกกับ #services เพื่อไม่ให้ไปโดนการ์ดชนิดเดียวกันในหน้าอื่น */
#services .coffin-type-card {
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
/* จอกลางขึ้นไป: ดันการ์ดซ้ายไปชิดขวา การ์ดขวาไปชิดซ้าย ให้อยู่ใกล้กัน */
@media (min-width: 768px) {
  #services .row > div:first-child .coffin-type-card { margin-right: 0; }
  #services .row > div:last-child .coffin-type-card { margin-left: 0; }
}

/* ภาพอยู่บน ข้อความอยู่ล่าง — คุมความสูงรูปไว้ไม่ให้การ์ดใหญ่เกิน */
.coffin-type-card {
  display: flex;
  flex-direction: column;
}
.coffin-type-img {
  /* flex: 0 0 280px; */
  /* height: 280px; */
  position: relative;
  overflow: hidden;
}
.coffin-type-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coffin-type-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
/* หัวข้อและปุ่มจัดกึ่งกลาง เหมือนการ์ดในหน้า pet-coffin.html */
.coffin-type-body h3 { text-align: center; }
/* ขนาดปุ่มใช้ค่ากลางของ .btn-pm-primary (13px 30px / 17px) เท่าหน้า pet-coffin.html */
.coffin-type-body .btn {
  margin-top: auto;
  align-self: center;
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* จอเล็ก: การ์ดเต็มความกว้าง แถวละ 1 ใบ */
@media (max-width: 767.98px) {
  .coffin-type-card { flex-direction: column; }
  .coffin-type-img { flex: 0 0 auto; height: 220px; }
  .coffin-type-body { padding: 16px 14px; align-items: center; text-align: center; }
  .coffin-type-body h3 { font-size: 17px; margin-bottom: 6px; }
  .coffin-type-body p { font-size: 14px; line-height: 1.55; margin-bottom: 14px; }
  .coffin-type-body .btn { align-self: center; }
}

/* =========================================================
   PACKAGE CARD — แสดงเฉพาะรูป ให้ภาพชนขอบการ์ดทั้งสี่ด้าน
========================================================= */
.pkg-card { padding-bottom: 0; }
.pkg-visual { margin: -38px -28px 0; }

/* =========================================================
   HERO SLIDES — รูปพื้นหลังแบนเนอร์จากเมนู "สไลด์รูปภาพ"
   วางเป็นชั้นล่างสุดของ .hero-section แทน background-image เดิม
   ตัว section เป็น carousel เอง จุดเปลี่ยนรูปจึงลอยเหนือ overlay ได้
========================================================= */
/* มีสไลด์แล้วไม่ต้องโหลดรูปตั้งต้นของธีม ใส่สีเขียวรองไว้ระหว่างรอรูปโหลด */
.hero-section--slides {
  background-image: none;
  background-color: var(--pm-green-deep);
}
.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;                 /* ใต้ overlay ดาว และข้อความ */
}
.hero-slides .carousel-item { height: 100%; }
.hero-slides img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;   /* เท่ากับ background-position เดิมใน style.css */
}
/* ค่อย ๆ จางเปลี่ยนรูปช้ากว่าค่าตั้งต้นของ bootstrap (.6s) ให้นุ่มขึ้น
   รูปเก่าต้องค้างไว้จนรูปใหม่ขึ้นเต็มก่อน ไม่งั้นจะเห็นพื้นเขียวแวบตรงกลาง */
.hero-section .hero-slides .carousel-item { transition-duration: 1.2s; }
.hero-section .hero-slides .active.carousel-item-start,
.hero-section .hero-slides .active.carousel-item-end { transition: opacity 0s 1.2s; }
@media (prefers-reduced-motion: reduce) {
  .hero-section .hero-slides .carousel-item,
  .hero-section .hero-slides .active.carousel-item-start,
  .hero-section .hero-slides .active.carousel-item-end { transition: none; }
}

/* ข้อความของแต่ละสไลด์ซ้อนกันในช่องเดียว (grid ช่องเดียว) ความสูงเท่าชุดที่ยาวที่สุด
   ชุดเก่าจางออกเร็ว ชุดใหม่ค่อยขึ้นตามหลัง ไม่ให้ตัวหนังสือสองชุดทับกันกลางทาง
   รวมเวลาแล้วจบพร้อมรูป (1.2s) */
.hero-texts { display: grid; }
.hero-text {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  /*transition: opacity .4s ease, visibility 0s .4s;*/
}
.hero-text.is-active {
  opacity: 1;
  visibility: visible;
  /*transition: opacity .8s ease .4s, visibility 0s;*/
}
@media (prefers-reduced-motion: reduce) {
  .hero-text,
  .hero-text.is-active { transition: none; }
}

/* จุดบอกตำแหน่งรูป ขอบใสรอบจุดขยายพื้นที่กดเป็น 24px ให้กดง่ายบนมือถือ */
.hero-indicators {
  z-index: 4;
  margin-bottom: 1.5rem;
}
.hero-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  margin: 0 2px;
  border: 7px solid transparent;
  border-radius: 12px;
  background-color: var(--pm-white);
  opacity: .55;
  transition: width .3s ease, opacity .3s ease, background-color .3s ease;
}
.hero-indicators .active {
  width: 26px;
  opacity: 1;
  background-color: var(--pm-cream);
}

/* =========================================================
   HERO ANIMALS — ภาพขาว + พลิกด้านให้หันไปทางซ้าย (เฉพาะหน้านี้)
========================================================= */
.hero-animals {
  filter: brightness(0) invert(1);
  opacity: .55;                                   /* เดิม .22 ทำให้ขาวจนดูออกครีม */
  right: 120px;                                   /* เดิม -20px ขยับเข้ามาทางซ้าย */
  transform: translateY(-50%) scaleX(-1);
  animation: floatY-flip 7s ease-in-out infinite;
}
@keyframes floatY-flip {
  0%, 100% { transform: translateY(-50%) scaleX(-1); }
  50%      { transform: translateY(-54%) scaleX(-1); }
}
/* มือถือ: เดิมซ่อนทั้งภาพ เปลี่ยนเป็นโผล่มาจากขอบขวาหน่อยๆ */
@media (max-width: 991.98px) {
  .hero-animals {
    display: block;
    width: min(62%, 300px);
    right: -22%;
    opacity: .3;
  }
}

/* =========================================================
   HERO STARS — ดาวขาวระยิบระยับทั่วแบนเนอร์ (เฉพาะหน้านี้)
========================================================= */
   /* ข้อความ+ปุ่มอยู่เหนือดาวเสมอ */
.hero-section .star-float {
  filter: drop-shadow(0 0 6px rgba(255,255,255,.7));
  z-index: 1;                 /* ต่ำกว่า .hero-animals (z-index: 2) */
}
@keyframes twinkle-sky {
  0%, 100% { opacity: 1;   transform: scale(1) rotate(0deg); }
  50%      { opacity: .15; transform: scale(.45) rotate(25deg); }
}
.hero-section .hs1 { top: 14%; left: 6%; animation: twinkle-sky 3.2s ease-in-out infinite 0s; }
.hero-section .hs2 { top: 22%; left: 15%; animation: twinkle-sky 4.1s ease-in-out infinite 1.1s; }
.hero-section .hs3 { top: 34%; left: 3%; animation: twinkle-sky 5s ease-in-out infinite 0.6s; }
.hero-section .hs4 { top: 46%; left: 11%; animation: twinkle-sky 2.8s ease-in-out infinite 1.8s; }
.hero-section .hs5 { bottom: 30%; left: 7%; animation: twinkle-sky 3.7s ease-in-out infinite 0.4s; }
.hero-section .hs6 { bottom: 18%; left: 17%; animation: twinkle-sky 4.4s ease-in-out infinite 2.2s; }
.hero-section .hs7 { bottom: 10%; left: 4%; animation: twinkle-sky 3.4s ease-in-out infinite 1.4s; }
.hero-section .hs8 { top: 9%; left: 27%; animation: twinkle-sky 4.8s ease-in-out infinite 0.9s; }
.hero-section .hs9 { bottom: 14%; left: 30%; animation: twinkle-sky 3.1s ease-in-out infinite 2.6s; }
.hero-section .hs10 { top: 23%; right: 6%; animation: twinkle-sky 4.6s ease-in-out infinite 0.3s; }
.hero-section .hs11 { top: 21%; right: 13%; animation: twinkle-sky 3.3s ease-in-out infinite 1.6s; }
.hero-section .hs12 { top: 14%; right: 39%; animation: twinkle-sky 5.2s ease-in-out infinite 2.1s; }
.hero-section .hs13 { top: 62%; right: 3.5%; animation: twinkle-sky 2.9s ease-in-out infinite 0.8s; }
.hero-section .hs14 { bottom: 7%; right: 56%; animation: twinkle-sky 4.2s ease-in-out infinite 1.9s; }
.hero-section .hs15 { bottom: 13%; right: 38%; animation: twinkle-sky 3.6s ease-in-out infinite 2.4s; }
.hero-section .hs16 { bottom: 5%; right: 4%; animation: twinkle-sky 4.9s ease-in-out infinite 1.2s; }
.hero-section .hs17 { top: 17%; right: 55%; animation: twinkle-sky 4.3s ease-in-out infinite 0.5s; }
.hero-section .hs18 { top: 34%; right: 2%; animation: twinkle-sky 3s ease-in-out infinite 1.7s; }
.hero-section .hs19 { top: 23%; right: 31%; animation: twinkle-sky 4.7s ease-in-out infinite 0.2s; }
.hero-section .hs20 { bottom: 4%; right: 37%; animation: twinkle-sky 5.4s ease-in-out infinite 1.3s; }
.hero-section .hs21 { top: 22%; right: 1.5%; animation: twinkle-sky 2.7s ease-in-out infinite 2.3s; }
.hero-section .hs22 { top: 47%; right: 3%; animation: twinkle-sky 3.9s ease-in-out infinite 0.7s; }
.hero-section .hs23 { top: 21%; right: 47%; animation: twinkle-sky 4.5s ease-in-out infinite 1.9s; }
.hero-section .hs24 { bottom: 14%; right: 25%; animation: twinkle-sky 5.6s ease-in-out infinite 1s; }
.hero-section .hs25 { bottom: 28%; right: 2%; animation: twinkle-sky 3.3s ease-in-out infinite 2.5s; }
.hero-section .hs26 { bottom: 7%; right: 31%; animation: twinkle-sky 4s ease-in-out infinite 1.5s; }
.hero-section .hs27 { top: 14%; right: 5%; animation: twinkle-sky 5.1s ease-in-out infinite 0.4s; }
.hero-section .hs28 { bottom: 12%; right: 50%; animation: twinkle-sky 4.4s ease-in-out infinite 1.6s; }
.hero-section .hs29 { bottom: 5%; right: 18%; animation: twinkle-sky 5.8s ease-in-out infinite 1s; }
.hero-section .hs30 { bottom: 13%; right: 10%; animation: twinkle-sky 4.7s ease-in-out infinite 2.2s; }
.hero-section .hs31 { bottom: 6%; right: 44%; animation: twinkle-sky 5.3s ease-in-out infinite 1.3s; }
.hero-section .hs32 { bottom: 14%; right: 62%; animation: twinkle-sky 4.9s ease-in-out infinite 0.6s; }
.hero-section .hs33 { top: 16%; right: 22%; animation: twinkle-sky 5.5s ease-in-out infinite 1.9s; }
/* มือถือ: ตัดดาวออกให้เหลือน้อยลง โดยเฉพาะแถบล่างที่แน่นเกินไป
   แถบล่างเหลือ 5 ดวง เรียงสลับใหญ่–เล็ก 48 / 14 / 23 / 34 / 18 px */
@media (max-width: 767.98px) {

  .hero-section .hs13,
  .hero-section .hs18,
  .hero-section .hs21,
  .hero-section .hs22,
  .hero-section .hs25,

  .hero-section .hs2,
  .hero-section .hs3,
  .hero-section .hs4,
  .hero-section .hs5,
  .hero-section .hs6,
  .hero-section .hs8,
  .hero-section .hs9,

  .hero-section .hs11,
  .hero-section .hs19,
  .hero-section .hs23,
  /* แถบล่าง — ตัดออก 6 ดวง */
  .hero-section .hs14,
  .hero-section .hs15,
  .hero-section .hs16,
  .hero-section .hs20,
  .hero-section .hs30,
  .hero-section .hs32 { display: none; }

  /* ดาวแถบบนอยู่ใต้แถบเมนูอยู่แล้ว (hero padding-top ~230px) ซ่อนทิ้ง */
  .hero-section .hs1,
  .hero-section .hs10,
  .hero-section .hs12,
  .hero-section .hs17,
  .hero-section .hs27,
  .hero-section .hs33 { display: none; }

  /* ย่อดาวดวงใหญ่ให้พอดีจอเล็ก (เดสก์ท็อปยังเท่าเดิม) */
  .hero-section .hs29 { width: 28px; height: 28px; }
  .hero-section .hs31 { width: 20px; height: 20px; }

  /* ย้ายดาวที่เหลือลงไปริมล่างสุด ให้พ้นปุ่มแน่นอน เรียงสลับใหญ่–เล็ก */
  .hero-section .hs29 { bottom: 3%;  right: 8%;  top: auto; }
  .hero-section .hs24 { bottom: 8%;  right: 20%; top: auto; }
  .hero-section .hs26 { bottom: 4%;  right: 31%; top: auto; }
  .hero-section .hs28 { bottom: 9%;  right: 43%; top: auto; }
  .hero-section .hs31 { bottom: 3%;  right: 54%; top: auto; }
  .hero-section .hs7  { bottom: 7%;  left: 9%;   top: auto; }
}

/* =========================================================
   บล็อก About — หัวข้อเป็น h1.story-title (สไตล์อยู่ใน style.css)
========================================================= */
/* หน้าแรกไม่มีแถวปุ่มใต้รายการ ไม่ต้องเว้นระยะล่างแบบหน้าอื่น (style.css ตั้งไว้ 20px) */
.coffin-intro-content .about-list { padding-bottom: 0; }

/* =========================================================
   ข้อความปิดท้าย — ใช้ค่าเดียวกับหน้า about.html
========================================================= */
/* ต้องระบุ .coffin-intro-content ด้วย ไม่งั้นโดน .coffin-intro-content p (17px) ใน style.css ทับ */
.coffin-intro-content p.story-signoff {
  margin-top: 24px;
  font-family: 'Averia Libre', serif;
  font-style: italic;
  color: var(--pm-text-muted);
  font-size: 20px;
  font-weight: 600;
}
