/* พอแล้วดี The Creator — front-end styles */

:root{ --y:#fcd400; --dark:#111827; }
*{ font-family:'Kanit',sans-serif; }
body{ color:#1f2937; margin:0; }

/* ===== Brand wordmark ===== */
.brand{ text-decoration:none; display:inline-flex; flex-direction:column; align-items:center; line-height:1; }
.brand .b-th{ font-weight:600; letter-spacing:.5px; }
.brand .b-en{ font-weight:400; letter-spacing:.35em; font-size:.5em; margin-top:4px; }

/* ===== Header (fixed, overlay) ===== */
#topnav{ position:fixed; top:0; left:0; right:0; z-index:1000; transition:all .3s ease; padding:18px 0; }
#topnav .nav-wrap{ display:flex; flex-direction:column; align-items:center; gap:12px; position:relative; }
#topnav .brand{ color:#1f2937; }
#topnav .brand .b-th{ font-size:2rem; }
#topnav .menu{ display:flex; gap:6px; align-items:center; justify-content:center; width:100%; }
#topnav .menu > .item > a{ color:#1f2937; text-decoration:none; font-weight:400; font-size:.95rem; padding:.4rem .8rem; display:inline-flex; align-items:center; gap:5px; }
#topnav .menu > .item > a:hover{ color:var(--y); }
#topnav .tools{ position:absolute; right:0; top:6px; display:flex; align-items:center; gap:14px; color:#1f2937; }
#topnav .tools a{ color:#1f2937; text-decoration:none; font-size:.9rem; }
#topnav .tools a:hover{ color:var(--y); }
.lang-pill a{ opacity:.55; color:#1f2937; } .lang-pill a.on{ opacity:1; font-weight:600; color:#000; }
.burger{ display:none; position:absolute; left:0; top:4px; background:none; border:none; color:#fff; font-size:1.4rem; }

/* dropdown */
.item.has-child{ position:relative; }
.dd{ position:absolute; top:100%; left:50%; transform:translateX(-50%); background:#fff; border-radius:12px; box-shadow:0 10px 34px rgba(0,0,0,.15); padding:.5rem; min-width:230px; opacity:0; visibility:hidden; transform:translateX(-50%) translateY(8px); transition:.18s; z-index:50; }
.item.has-child:hover .dd{ opacity:1; visibility:visible; transform:translateX(-50%) translateY(2px); }
.dd a{ display:block; padding:.5rem .8rem; border-radius:8px; color:#374151 !important; font-size:.92rem; text-decoration:none; white-space:nowrap; }
.dd a:hover{ background:#fff8d6; color:#000 !important; }
.dd .dd-head{ font-size:.7rem; text-transform:uppercase; letter-spacing:.05em; color:#9ca3af; padding:.5rem .8rem .2rem; font-weight:500; }
/* dropdown: หัวข้อใหญ่ vs sub */
.dd .dd-main{ font-weight:500; color:#111827 !important; font-size:.95rem; padding:.55rem .8rem; }
.dd .dd-main-head{ font-weight:500; color:#111827; padding:.55rem .8rem .25rem; font-size:.95rem; }
.dd .dd-sub{ padding-left:1.7rem !important; color:#4b5563 !important; font-weight:300; position:relative; }
.dd .dd-sub:before{ content:''; position:absolute; left:.95rem; top:50%; width:5px; height:5px; border-radius:50%; background:var(--y); transform:translateY(-50%); }

/* ===== Scrolled state ===== */
#topnav.scrolled{ background:#fff; box-shadow:0 2px 14px rgba(0,0,0,.08); padding:10px 0; }
#topnav.scrolled .nav-wrap{ flex-direction:row; justify-content:space-between; gap:0; align-items:center; }
#topnav.scrolled .menu{ width:auto; justify-content:flex-end; margin-left:auto; }
#topnav.scrolled .tools{ position:static; color:#374151; margin-left:22px; }
#topnav.scrolled .brand{ color:var(--dark); }
#topnav.scrolled .brand .b-th{ font-size:1.25rem; }
#topnav.scrolled .brand .b-en{ font-size:.42em; }
#topnav.scrolled .menu > .item > a{ color:#374151; }
#topnav.scrolled .menu > .item > a:hover{ color:#000; }
#topnav.scrolled .tools a{ color:#374151; }
#topnav.scrolled .burger{ color:var(--dark); }

/* ===== shared ===== */
.btn-y{ background:var(--y); color:#000; font-weight:500; border:none; } .btn-y:hover{ background:#e6c000; color:#000; }
.section-title{ font-weight:600; font-size:1.7rem; position:relative; display:inline-block; padding-bottom:10px; }
.section-title:after{ content:''; position:absolute; left:0; bottom:0; width:54px; height:4px; background:var(--y); border-radius:2px; }

/* hero ของหน้าอื่น (ไม่ใช่ home) — เผื่อ header overlay */
.page-hero{ background:var(--dark); color:#fff; padding:170px 0 60px; }
.page-hero .y{ color:var(--y); }

/* ===== Home slideshow ===== */
.hero-slider{ position:relative; height:100vh; min-height:620px; overflow:hidden; }
.hero-slide{ position:absolute; inset:0; opacity:0; transition:opacity 1s ease; background:#111827 center/cover no-repeat; display:flex; align-items:center; }
.hero-slide.active{ opacity:1; }
/* overlay removed per request */
.hero-slide .inner{ position:relative; color:#1f2937; max-width:680px; text-shadow:0 1px 6px rgba(255,255,255,.45); }
.hero-slide h1{ font-weight:600; font-size:2.8rem; line-height:1.15; }
.hero-dots{ position:absolute; bottom:90px; left:50%; transform:translateX(-50%); display:flex; gap:10px; z-index:5; }
.hero-dots button{ width:30px; height:5px; border:none; border-radius:3px; background:rgba(255,255,255,.5); cursor:pointer; }
.hero-dots button.on{ background:var(--y); }


/* ===== mobile menu (ซ่อนบน desktop, โผล่เฉพาะจอเล็ก) ===== */
.mobile-menu{ display:none; }
.mobile-backdrop{ display:none; }

@media (max-width:991px){
  .mobile-menu{ display:block; }

  #topnav .menu{ display:none; }
  #topnav .nav-wrap{ flex-direction:row; justify-content:center; }
  #topnav .burger{ display:block; }
  #topnav .tools{ top:8px; }
  /* mobile: ตอนเลื่อนลง (scrolled) logo อยู่กลางเหมือนตอนบนสุด — burger ซ้าย, tools ขวา (absolute) */
  #topnav.scrolled .nav-wrap{ flex-direction:row; justify-content:center; }
  #topnav.scrolled .tools{ position:absolute; right:0; top:50%; transform:translateY(-50%); margin-left:0; }
  #topnav.scrolled .burger{ position:absolute; left:0; top:50%; transform:translateY(-50%); }
  .mobile-menu{ position:fixed; inset:0 0 0 auto; width:78%; max-width:320px; background:#fff; z-index:1100; transform:translateX(100%); transition:.3s; padding:70px 20px 20px; overflow:auto; box-shadow:-8px 0 30px rgba(0,0,0,.2); }
  .mobile-menu.open{ transform:none; }
  .mobile-menu a{ display:block; color:#374151; text-decoration:none; padding:.6rem .4rem; border-bottom:1px solid #f1f1f1; }
  .mobile-menu .mm-head{ font-weight:600; margin-top:8px; }
  .mobile-menu .mm-sub-head{ font-size:.78rem; color:#9ca3af; padding:.5rem .4rem .1rem; font-weight:500; }
  .mobile-menu a{ padding-left:.4rem; }
  .mm-close{ position:absolute; top:16px; right:18px; font-size:1.5rem; background:none; border:none; }
  .mobile-backdrop{ position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:1090; display:none; }
  .mobile-backdrop.open{ display:block; }
  .hero-slide h1{ font-size:2rem; }
}

/* ===== footer ===== */

.pld-foot{ background:#fff; color:#1f2937; border-top:1px solid #f0f0f0; padding:60px 0 28px; margin-top:60px; }
.pld-foot .brand-foot{ display:inline-flex; flex-direction:column; line-height:1; color:#111827; }
.pld-foot .brand-foot .bf-th{ font-weight:600; font-size:1.9rem; }
.pld-foot .brand-foot .bf-en{ font-weight:400; letter-spacing:.35em; font-size:.7rem; margin-top:4px; }
.pld-foot .foot-label{ font-size:.72rem; letter-spacing:.06em; color:#9ca3af; font-weight:500; margin-bottom:10px; }
.pld-foot .foot-link{ color:#374151; text-decoration:none; }
.pld-foot .foot-link:hover{ color:#000; }

/* ===== brand logo (จัดการจากตั้งค่าเว็บไซต์) ===== */
.brand{ display:inline-flex; align-items:center; }
.brand-text{ display:inline-flex; flex-direction:column; align-items:center; line-height:1; }
.brand .brand-logo{ height:46px; width:auto; display:none; }
.brand.lt .on-dark{ display:inline-block; }
#topnav.scrolled .brand .brand-logo{ height:34px; }
#topnav.scrolled .brand .on-dark{ display:none; }
#topnav.scrolled .brand.dk .on-light{ display:inline-block; }
/* ซ่อน wordmark เมื่อมีโลโก้ในสถานะนั้น */
.brand.lt .brand-text{ display:none; }
#topnav.scrolled .brand.lt:not(.dk) .brand-text{ display:inline-flex; }
#topnav.scrolled .brand.dk .brand-text{ display:none; }
.brand.dk:not(.lt) .brand-text{ display:inline-flex; }

.pld-richtext img{ max-width:100%; height:auto; }
.pld-richtext{ line-height:1.4; }
/* บังคับระยะบรรทัดทับ inline line-height ที่ติดมากับเนื้อหาเก่า + เพิ่มระยะย่อหน้า/ลิสต์ */
.pld-richtext, .pld-richtext *{ line-height:1.4 !important; }
.pld-richtext p{ margin-bottom:.7em; }
.pld-richtext ul, .pld-richtext ol{ margin-bottom:.7em; }
.pld-richtext li{ margin-bottom:.3em; }

/* ===== บทความ: การ์ด + ป้าย Video + ฝังวิดีโอ ===== */
.article-card{ display:flex; flex-direction:column; height:100%; background:#fff; border-radius:14px; overflow:hidden; text-decoration:none; color:inherit; box-shadow:0 2px 10px rgba(0,0,0,.06); transition:transform .15s, box-shadow .15s; }
.article-card:hover{ transform:translateY(-4px); box-shadow:0 8px 24px rgba(0,0,0,.12); color:inherit; }
.article-thumb{ position:relative; padding-top:60%; background-size:cover; background-position:center; }
.vid-badge{ position:absolute; top:18px; left:-34px; transform:rotate(-45deg); transform-origin:center;
  background:#e11d48; color:#fff; font-size:.74rem; font-weight:600; letter-spacing:.5px;
  width:140px; text-align:center; padding:5px 0; box-shadow:0 2px 6px rgba(0,0,0,.3); z-index:2; }
.article-body{ padding:16px 18px 20px; flex:1; display:flex; flex-direction:column; }
.article-title{ font-weight:600; color:#1f2937; margin:0 0 8px; line-height:1.35; }
.article-excerpt{ color:#6b7280; font-size:.92rem; margin:0 0 12px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.article-date{ color:#9ca3af; font-size:.82rem; margin-top:auto; }
.video-embed{ position:relative; padding-bottom:56.25%; height:0; overflow:hidden; border-radius:12px; background:#000; }
.video-embed iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }

/* ===== iframe/วิดีโอที่ฝังในเนื้อหา (Summernote) ให้ responsive ===== */
.pld-richtext iframe,
.pld-richtext video,
.pld-richtext embed,
.pld-richtext object{ max-width:100%; }
/* iframe วิดีโอ (YouTube ฯลฯ) คุมอัตราส่วน 16:9 */
.pld-richtext iframe[src*="youtube"],
.pld-richtext iframe[src*="youtu.be"],
.pld-richtext iframe[src*="vimeo"],
.pld-richtext iframe[src*="facebook"],
.pld-richtext iframe[src*="player"],
.pld-richtext iframe[src*="tiktok"]{
  display:block; width:100%; height:auto; aspect-ratio:16/9; margin:1rem auto; border:0; border-radius:12px;
}
.pld-richtext img{ max-width:100%; height:auto; }

/* ===== วิทยากร: PNG พื้นใส แสดงเต็มรูป (วงกลมอยู่ในรูปแล้ว ไม่ครอปซ้ำ) ===== */
.trainer-item{ display:block; text-align:center; text-decoration:none; color:inherit; }
.trainer-circle{ width:200px; max-width:90%; aspect-ratio:1; margin:0 auto 14px;
  display:flex; align-items:center; justify-content:center; }
.trainer-circle img{ width:100%; height:100%; object-fit:contain; transition:transform .25s; }
.trainer-item:hover .trainer-circle img{ transform:scale(1.05); }
.trainer-name{ font-weight:600; color:#1f2937; margin:0 0 4px; }
.trainer-role{ font-size:.9rem; color:#6b7280; line-height:1.45; }

/* การ์ด "การสอนที่ผ่านมา" — รูปเต็มความกว้าง ไม่ครอป */
.exp-img{ width:100%!important; height:auto!important; object-fit:contain!important; display:block; }

/* ===== The Creators: ฟิลเตอร์ + แผนที่ + modal ===== */
.cr-filterbar{ background:#fff; border:1px solid #eef0f2; border-radius:16px; padding:18px; box-shadow:0 2px 12px rgba(0,0,0,.05); }
.cr-map-wrap{ background:#f8f9fa; border-radius:14px; padding:8px; }
.cr-map{ width:100%; height:auto; max-height:420px; display:block; }
.cr-map .rg{ fill:#e3e7ec; stroke:#fff; stroke-width:.4; }
.cr-map .mk{ display:none; }
.cr-group{ margin-top:14px; }
.cr-glabel{ font-weight:500; font-size:.9rem; color:#374151; margin-bottom:6px; }
.cr-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.cr-chip{ border:1px solid #d7dbe0; background:#fff; color:#374151; font-size:.85rem; padding:4px 12px; border-radius:20px; cursor:pointer; transition:all .15s; }
.cr-chip:hover{ border-color:#fcd400; }
.cr-chip.on{ background:#fcd400; border-color:#fcd400; color:#fff; }
.cr-item{ cursor:pointer; }
.cr-modal-photo{ width:160px; height:160px; display:flex; align-items:center; justify-content:center; }
.cr-modal-photo img{ width:100%; height:100%; object-fit:contain; }

/* ===== active / current menu ===== */
#topnav .menu .item.active > a{ color:#fcd400; position:relative; }
#topnav .menu .item.active > a::after{ content:""; position:absolute; left:0; right:0; bottom:-6px; height:3px; background:#fcd400; border-radius:2px; }
#topnav.scrolled .menu .item.active > a{ color:#111827; }

/* hero title อ่านง่ายบนรูปสว่าง (ไม่ใช้ overlay) */
.page-hero h1{ text-shadow:0 2px 14px rgba(0,0,0,.5); }

/* ===== บังคับ Kanit ทั้งเว็บ ทับ inline font จาก editor (ยกเว้นไอคอน FontAwesome) ===== */
body, body *:not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab):not(.fal){
  font-family:'Kanit',sans-serif !important;
}

/* สไลด์เสริม (คั่นกลางหน้าแรก) — สไลด์โชว์ crossfade ไม่ครอปรูป */
.home-extra-slider{ position:relative; display:grid; }
.home-extra-slider .es-slide{ grid-area:1/1; opacity:0; transition:opacity .8s ease; }
.home-extra-slider .es-slide.active{ opacity:1; }
.home-extra-slider .es-slide img{ width:100%; height:auto; display:block; }
.home-extra-slider .es-slide a{ display:block; }
.home-extra-slider .es-dots{ position:absolute; bottom:14px; left:50%; transform:translateX(-50%); display:flex; gap:8px; z-index:3; }
.home-extra-slider .es-dots button{ width:26px; height:5px; border:none; border-radius:3px; background:rgba(255,255,255,.6); cursor:pointer; }
.home-extra-slider .es-dots button.on{ background:#fcd400; }
.home-extra-slider .es-arrow{ position:absolute; top:50%; transform:translateY(-50%); z-index:3; width:44px; height:44px; border:none; border-radius:50%; background:rgba(0,0,0,.35); color:#fff; font-size:1.6rem; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s; }
.home-extra-slider .es-arrow:hover{ background:rgba(0,0,0,.6); }
.home-extra-slider .es-prev{ left:14px; }
.home-extra-slider .es-next{ right:14px; }
@media(max-width:576px){ .home-extra-slider .es-arrow{ width:36px; height:36px; font-size:1.3rem; } }

/* ===== utility: แสดง/ซ่อนตามจอ (ตัดที่ 768px) ===== */
/* mobile_on  = แสดงเฉพาะจอ <=768px (มือถือ) */
/* mobile_off = แสดงเฉพาะจอ >768px (เดสก์ท็อป) */
.mobile_on{ display:none !important; }
@media (max-width:768px){
  .mobile_on{ display:block !important; }
  .mobile_off{ display:none !important; }
}


/* === ลดน้ำหนัก Kanit ลง 1 ระดับ (regular ให้ดูบางลง) === */
body{ font-weight:300; }
h1,h2,h3,h4,h5,h6{ font-weight:500; }
b, strong, .fw-bold{ font-weight:600 !important; }
.fw-semibold, .fw-600{ font-weight:500 !important; }
.fw-medium, .fw-500{ font-weight:400 !important; }
.fw-normal{ font-weight:300 !important; }
.btn{ font-weight:400; }
.badge{ font-weight:500; }
.navbar, .nav-link, .form-label, .form-control, label, input, select, textarea, button{ font-weight:400; }

/* ปุ่มกรองบทความ (articles.php) */
.art-filter{ display:flex; justify-content:center; gap:10px; flex-wrap:wrap; margin-bottom:28px; }
.art-chip{ display:inline-flex; align-items:center; padding:8px 20px; border-radius:30px; border:1.5px solid #d7dbe0; background:#fff; color:#374151; text-decoration:none; font-size:.95rem; transition:all .15s; }
.art-chip:hover{ border-color:#fcd400; color:#111827; }
.art-chip.on{ background:#fcd400; border-color:#fcd400; color:#111827; font-weight:500; }

/* footer มือถือ: 1 คอลัมน์ + เมนูล่าง 1 ลิงก์/บรรทัด */
@media (max-width:991px){
  .pld-foot .row > div{ width:100%; flex:0 0 100%; max-width:100%; }
  .pld-foot .foot-bottom{ flex-direction:column; align-items:flex-start !important; gap:1rem !important; }
  .pld-foot .foot-menu{ flex-direction:column; gap:.55rem !important; width:100%; }
}
