/* ส่วนกลางของหน้าเว็บที่ออกแบบ: แอนิเมชัน สไลด์ แท็บ ดูรูปขยาย ปุ่มกลับขึ้นบน (ใช้ตัวแปรธีม --s-*) */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* แอนิเมชันตอนเลื่อนถึง — ซ่อนก่อนเฉพาะเมื่อเบราว์เซอร์รันสคริปต์ได้ (ปิด JS แล้วยังเห็นเนื้อหาครบ) */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  [data-anim] { transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
  [data-anim]:not(.is-in) { opacity: 0; }
  [data-anim="fade-up"]:not(.is-in) { transform: translateY(34px); }
  [data-anim="zoom-in"]:not(.is-in) { transform: scale(.9); }
  [data-anim="slide-left"]:not(.is-in) { transform: translateX(-46px); }
  [data-anim="slide-right"]:not(.is-in) { transform: translateX(46px); }
}

/* สไลด์โชว์ — เลื่อนนิ้วได้แม้ไม่มีสคริปต์ */
.s-slider { position: relative; overflow: hidden; }
.s-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.s-slides::-webkit-scrollbar { display: none; }
.s-slide { flex: 0 0 100%; scroll-snap-align: start; }
.s-dots { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; gap: 8px; justify-content: center; z-index: 2; }
.s-dots button { width: 10px; height: 10px; border-radius: 99px; border: 0; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; transition: width .3s; }
.s-dots button.on { width: 28px; background: #fff; }
.s-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border-radius: 99px; border: 0; cursor: pointer;
  background: rgba(0,0,0,.28); color: #fff; font-size: 28px; line-height: 1; }
.s-arrow:hover { background: rgba(0,0,0,.45); }
.s-arrow-prev { left: 14px; } .s-arrow-next { right: 14px; }
@media (max-width: 760px) { .s-arrow { display: none; } }

/* แท็บ (CSS ล้วน: input radio + label + .s-tab-panel) */
.s-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.s-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.s-tabs > label { order: 0; cursor: pointer; padding: 10px 18px; border-radius: 999px; font-weight: 600; background: var(--s-soft, #eee); color: var(--s-text, #222); }
.s-tabs > input:checked + label { background: var(--s-primary, #7c3aed); color: #fff; }
.s-tabs > .s-tab-panel { order: 1; width: 100%; display: none; padding-top: 18px; }
.s-tabs > input:checked + label + .s-tab-panel { display: block; }

/* ดูรูปขยาย */
.s-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(5,6,12,.9); display: flex; align-items: center; justify-content: center; padding: 30px; }
.s-lb[hidden] { display: none; }
.s-lb img { max-width: 100%; max-height: 88vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.s-lb button { position: absolute; border: 0; cursor: pointer; background: rgba(255,255,255,.12); color: #fff; width: 48px; height: 48px; border-radius: 99px; font-size: 30px; line-height: 1; }
.s-lb-close { top: 16px; right: 16px; } .s-lb-prev { left: 16px; top: 50%; } .s-lb-next { right: 16px; top: 50%; }
.s-lb-open { overflow: hidden; }

/* ปุ่มกลับขึ้นบน */
.s-backtop { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 50; width: 46px; height: 46px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 22px; font-weight: 700; color: #fff;
  background: var(--s-primary, #7c3aed); box-shadow: 0 10px 30px -8px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .3s; }
.s-backtop.show { opacity: 1; pointer-events: auto; transform: none; }

/* เมนูมีเงาเมื่อเลื่อน */
.s-nav { transition: box-shadow .3s; }
.s-nav.is-scrolled { box-shadow: 0 10px 30px -18px rgba(0,0,0,.45); }
