/*
 * หน้าแรก Yulgang Idle (child theme) — โครง section แทนแถวของ WPBakery
 * สีและหน้าตาภายในแต่ละ section (class wp-*) ยังมาจากไฟล์เดิมที่โหลดทุกหน้า:
 *   /theme/style.css (Theme Panel → Custom HTML), Custom CSS ใน Theme Panel, /pre-reg/css/style.css (HFCM #13)
 * ขั้นถัดไปจะรวม CSS ชุดนั้นเข้ามาที่นี่แล้วเลิกโหลดทุกหน้า
 */

/* ---------- ความกว้างเนื้อหา เท่ากับ td-container ของ Newspaper ---------- */
.ygfd-container {
  width: 1068px;
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
}
@media (min-width: 1019px) and (max-width: 1140px) {
  .ygfd-container { width: 980px; }
}
@media (min-width: 768px) and (max-width: 1018px) {
  .ygfd-container { width: 740px; }
}
@media (max-width: 767px) {
  .ygfd-container { width: 100%; }
}

/* flow-root: ระยะล่างของ slider (ตั้งใน Slider Revolution เช่น feature-id 30px) อยู่ใน section เหมือนแถว WPBakery เดิม ไม่หลุดออกนอก section */
.ygfd-sec { position: relative; display: flow-root; }

/* Hero: slider อยู่ในกรอบกว้างเท่า td-container (สีพื้นข้าง slider ตั้งได้ในหลังบ้าน) */
.ygfd-sec--hero .ygfd-container { position: relative; }

/* Milestone: กว้างเกินจอข้างละเท่าระยะ td-pb-row (24 / 20 / 14 px) เหมือนแถวเดิม — พื้นหลังจึงครอบเหมือนเดิม */
.ygfd-col { position: relative; min-height: 1px; }

/* ข่าว และ Game Features: พื้นหลังลายไม้ เว้นบน 35px รูปหัวข้อกลาง (เหมือน section ของ WPBakery เดิม) */
.ygfd-sec--news,
.ygfd-sec--features {
  padding-top: 35px;
  background: url("https://yulgangidle.playpark.com/wp-content/uploads/2026/03/Footer.jpg?id=388") center / cover no-repeat;
}
.ygfd-sec__title {
  margin-bottom: 35px;
  text-align: center;
  line-height: 0;
}
.ygfd-sec__title img {
  max-width: 100%;
  height: auto;
}

/* ข่าว: เว้นที่ให้รูปตกแต่งท้ายแท็บ (สูง 50px ลอยชิดขวา) ไม่ให้ทับชื่อแท็บยาว ๆ เช่นภาษาไทย — จอเล็กกว่า 992px รูปถูกซ่อนอยู่แล้ว */
@media (min-width: 992px) {
  .ygfd-home .wp-news-tab { flex-wrap: wrap; row-gap: 0.5rem; }
  .ygfd-home .wp-news-tab:has(.wp-news-tab-icon) { padding-right: 60px; }
}

/* ---------- ข่าว: แบนเนอร์เลื่อน (แทน Owl Carousel) ---------- */
.ygfd-banner { position: relative; }
.ygfd-banner__viewport { overflow: hidden; touch-action: pan-y; }
.ygfd-banner__track {
  display: flex;
  transition: transform 0.8s ease;
  will-change: transform;
}
.ygfd-banner__slide { flex: 0 0 100%; min-width: 0; }
.ygfd-banner__slide img { display: block; width: 100%; height: auto; }
/* ปุ่มก่อนหน้า / ถัดไป และจุด — ตำแหน่งและสีตาม #wp-news-banner-carousel ใน /theme/style.css */
.ygfd-banner .owl-nav {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 15px;
  pointer-events: none;
  z-index: 10;
}
.ygfd-banner .owl-nav button {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.ygfd-banner .owl-nav button:hover { transform: scale(1.1); }
.ygfd-banner .owl-dots {
  position: absolute;
  right: 15px;
  bottom: 10px;
  display: flex;
  align-items: center;
}
.ygfd-banner .owl-dot {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}
.ygfd-banner .owl-dot span {
  display: block;
  width: 8px;
  height: 8px;
  margin: 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}
.ygfd-banner .owl-dot.active span,
.ygfd-banner .owl-dot:hover span {
  width: 20px;
  background: #be9270;
}

/* ไอคอน SVG ในเมนูด้านข้าง (เดิม Font Awesome) */
.ygfd-ico {
  display: inline-block;
  width: auto;
  height: 1em;
  overflow: visible;
  vertical-align: -0.125em;
}

/* modal ซ่อนตั้งแต่แรก แม้ Bootstrap CSS ท้ายหน้ายังโหลดไม่เสร็จ */
.ygfd-home .modal:not(.show) { display: none; }

/* ตัวละคร: สลับรูปและข้อความแบบจางออก-จางเข้า 0.3 วินาที (แทน fadeOut/fadeIn ของ jQuery เดิม) */
.ygfd-home .wp-char-bg img,
.ygfd-home .wp-char-title img,
.ygfd-home .wp-char-gif img,
.ygfd-home .wp-char-desc p {
  transition: opacity 0.3s ease;
}
.ygfd-home .ygfd-fading { opacity: 0; }
