/* มือถือไม่เกิน 768px คืนโค้งเดิมให้ดูนุ่ม จอกว้างคง 8px ให้เท่าเมนู */
/* หน้าอ่านข่าว แบบ R-B (เนื้อหา + แถบข้อมูลด้านขวา)
   ใช้กับ <main class="nw art rb"> เท่านั้น โหลดต่อจาก news.css / news-cover.css / news-extras.css
   สี #9e5da5 #7d4485 #ebdcee #fbf8fc · ฟอนต์ LINE Seed Sans TH (มีใน assets/fonts แล้ว)
   แบบเรียบ: ไม่มีเงาเรือง ไล่สี กระจก เส้นขอบ หรือแถบสีด้านข้าง · แอนิเมชันใช้แค่ transform / opacity
   ไม่แตะส่วนหัว เมนู ท้ายเว็บ และเมนูล่างมือถือ (M4) */
.nw.art.rb{--p:#9e5da5;--pd:#7d4485;--pl:#ebdcee;--bg:#fbf8fc;--ink:#2a2130;--mute:#6a5f70;
  font-family:"LINE Seed Sans TH",system-ui,sans-serif;color:var(--ink);line-height:1.8;
  padding:104px var(--g,24px) 0 calc(var(--g,24px) + 380px);box-sizing:border-box}
.rb *,.rb *::before,.rb *::after{box-sizing:border-box}
.rb .rb-hero,.rb .rb-grid,.rb .pn,.rb .rel{max-width:1240px;margin-left:auto;margin-right:auto}
.rb h1,.rb h2,.rb h3,.rb dl,.rb dd,.rb figure{margin:0}
.rb a{color:var(--pd)}
.rb img{max-width:100%}
.rb svg.ic{flex:0 0 auto}
.rb :focus-visible{outline:3px solid #7d4485;outline-offset:3px;border-radius:8px}
@media (max-width: 768px) {
  .rb :focus-visible { border-radius: 12px; }
}

.rb [hidden]{display:none!important}
.rb .tag{background:var(--pl);color:var(--pd);display:inline-flex;align-items:center;min-height:28px;padding:2px 14px;border-radius:8px;font-size:14px;font-weight:700;line-height:1.5}
@media (max-width: 768px) {
  .rb .tag { border-radius: 999px; }
}


/* ---------- ส่วนหัวข่าว: แบบเดิม ข้อความซ้าย ภาพขวา ไม่มีการ์ด ---------- */
/* ข้อความกินพื้นที่มากกว่าภาพ ไม่งั้นหัวข้อ 46px ตัดกลางคำไทย เช่น ทะเลดึกดำบรรพ์ */
.rb-hero{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(240px,.7fr);gap:40px;align-items:center;background:transparent;padding:0}
.rb-hero:not(:has(figure)){grid-template-columns:1fr}
.rb-hero .bc{display:flex;flex-wrap:wrap;gap:8px;font-size:14px;color:#6f6575;margin:0 0 18px}
.rb-hero .bc a{color:inherit;text-decoration:none}.rb-hero .bc a:hover{color:var(--pd)}
.rb-hero .meta{display:flex;align-items:center;gap:12px;font-size:15px;color:var(--mute);margin:0 0 14px}
.rb-hero h1{font-weight:800;font-size:clamp(28px,2.3vw,36px);line-height:1.3;color:#241c28;margin:4px 0 12px;text-wrap:balance}
.rb-hero .cx{font-size:17px;line-height:1.7;color:#4f4456;margin:12px 0 0}
.rb-hero .cx,.rb .tldr p,.rb .read .body p{
  word-break:keep-all;overflow-wrap:break-word;line-break:strict;text-wrap:pretty
}
.rb-hero h1{word-break:keep-all;overflow-wrap:break-word;line-break:strict;text-wrap:balance}
.rb-hero figure{margin:0}
/* ปุ่มปกไม่ใส่กรอบ/มุมมน — ภาพยังใช้ border-radius เหมือนก่อนมี lightbox */
.rb-hero .cover-open{display:block;width:100%;margin:0;padding:0;border:0;background:transparent;
  cursor:pointer;font:inherit;text-align:inherit;appearance:none;-webkit-appearance:none;color:inherit}
.rb-hero .cover-open:focus-visible{outline:2px solid #7d4485;outline-offset:2px;border-radius:8px}
.rb-hero figure img{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;border-radius:8px;
  pointer-events:none}
@media (max-width: 768px) {
  .rb-hero figure img { border-radius: 24px; }
}


/* ---------- ตาราง: สรุป + เนื้อหา (การ์ดขาว) | แถบข้างขวา ---------- */
.rb-grid{display:grid;grid-template-columns:minmax(0,1fr) 240px;column-gap:28px;margin-top:40px;align-items:start}
.rb-top{grid-column:1;grid-row:1;background:#fff;border-radius:8px 8px 0 0;padding:28px 32px 0}
@media (max-width: 768px) {
  .rb-top { border-radius: 28px 28px 0 0; }
}

.rb-top:not(:has(.tldr)){display:none}
.rb .read{grid-column:1;grid-row:2;background:#fff;border-radius:0 0 8px 8px;padding:20px 32px 36px;font-size:17px;line-height:1.75;max-width:none}
@media (max-width: 768px) {
  .rb .read { border-radius: 0 0 28px 28px; }
}

.rb-top:not(:has(.tldr)) ~ .read{border-radius:8px;padding-top:44px}
@media (max-width: 768px) {
  .rb-top:not(:has(.tldr)) ~ .read { border-radius: 28px; }
}

.rb-side{grid-column:2;grid-row:1 / span 2;align-self:start;position:sticky;top:96px}
.rb-stick{display:grid;gap:16px}

/* สรุปสั้น */
.rb .tldr{background:var(--bg);border:0;border-radius:8px;padding:16px 18px;margin:0}
@media (max-width: 768px) {
  .rb .tldr { border-radius: 24px; }
}

.rb .tldr h2{display:inline-flex;align-items:center;gap:8px;font-size:15px;line-height:1.4;color:var(--pd);margin:0 0 8px}
.rb .tldr h2::before{content:"";width:18px;height:18px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d4485' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z' /%3E %3Cpath d='M20 2v4' /%3E %3Cpath d='M22 4h-4' /%3E %3Ccircle cx='4' cy='20' r='2' /%3E%3C/svg%3E") center/18px no-repeat}
.rb .tldr p{font-size:17px;line-height:1.7;margin:0 0 8px}.rb .tldr p:last-child{margin:0}

/* เนื้อหาแบบ B: ระยะบรรทัด 1.7 ไม่ให้ย่อหน้าบวม และรายการไม่เป็นการ์ดทีละข้อ */
.rb .read .body p,.rb .read .embed{margin:0 0 16px}
.rb .read .lead-p{font-size:17px;line-height:1.75;font-weight:700;color:var(--ink);margin-bottom:16px}
.rb .read h2{font-size:24px;line-height:1.5;font-weight:700;margin:36px 0 14px;color:var(--ink)}
.rb .read h3{font-size:20px;line-height:1.5;font-weight:700;margin:28px 0 12px}
.rb .read .body ul,.rb .read .body ol{list-style:none;padding:0;margin:0 0 16px}
.rb .read .body li{background:transparent;border-radius:0;border-bottom:1px solid #eadff0;padding:8px 0 8px 18px;position:relative;margin:0;font-size:17px;line-height:1.6}
.rb .read .body li:last-child{border-bottom:0}

.rb .read .body li::before{content:"";position:absolute;left:0;top:1.15em;width:6px;height:6px;border-radius:50%;background:var(--p)}
.rb .read .body ol{counter-reset:rb}
.rb .read .body ol li{counter-increment:rb}
.rb .read .body ol li::before{content:counter(rb);width:auto;height:auto;background:none;color:var(--pd);font-weight:700;top:10px}
.rb .read .body img{border-radius:8px;height:auto}
@media (max-width: 768px) {
  .rb .read .body img { border-radius: 18px; }
}

.rb .read .embed iframe{width:100%;border:0}
.rb .reg{margin:8px 0 24px}
.rb .reg .btn{display:inline-flex;align-items:center;min-height:48px;padding:0 22px;border-radius:8px;background:var(--pd);color:#fff;text-decoration:none;font-weight:700}
@media (max-width: 768px) {
  .rb .reg .btn { border-radius: 999px; }
}

.rb .gallery ul{list-style:none;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px}
.rb .gallery img{display:block;width:100%;height:auto;border-radius:8px}
@media (max-width: 768px) {
  .rb .gallery img { border-radius: 14px; }
}


/* คำถามที่พบบ่อย: กดเปิด/ปิด (แสดงเฉพาะข่าวที่มี FAQ ซึ่ง PHP ทำอยู่แล้ว) */
.rb .faq{margin:44px 0 0}
.rb .faq h2{margin:0 0 16px}
.rb .faq details{background:var(--bg);border:0;border-radius:8px;margin:0 0 10px;padding:0}
@media (max-width: 768px) {
  .rb .faq details { border-radius: 20px; }
}

.rb .faq summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:60px;padding:12px 14px 12px 22px;cursor:pointer;font-weight:700;font-size:18px;line-height:1.5}
.rb .faq summary::-webkit-details-marker{display:none}
.rb .faq summary::after{content:"";flex:0 0 36px;height:36px;border-radius:50%;background:var(--pl) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d4485' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14' /%3E %3Cpath d='M12 5v14' /%3E%3C/svg%3E") center/18px no-repeat;transition:transform .25s}
.rb .faq summary:hover::after{background-color:var(--p);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14' /%3E %3Cpath d='M12 5v14' /%3E%3C/svg%3E")}
.rb .faq details[open] summary::after{transform:rotate(45deg)}
.rb .faq details>:not(summary){margin:0;padding:0 22px 18px;font-size:17px;line-height:1.8;color:var(--mute)}
.rb .faq details[open]>:not(summary){animation:rb-in .3s ease both}
@keyframes rb-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}

/* ท้ายเนื้อหา */
.rb .byline,.rb .src{font-size:15px;line-height:1.7;color:var(--mute);margin:32px 0 4px}
.rb .src{margin-top:0}.rb .src a{font-weight:700}
.rb .tags{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 24px}
.rb .tags a{display:inline-flex;min-height:36px;align-items:center;padding:4px 14px;border-radius:8px;background:var(--pl);color:var(--pd);text-decoration:none;font-size:15px;font-weight:700}
@media (max-width: 768px) {
  .rb .tags a { border-radius: 999px; }
}

.rb .tags a:hover{background:var(--p);color:#fff}
.rb .back{display:inline-flex;align-items:center;gap:8px;font-weight:700;text-decoration:none;font-size:16px;min-height:44px}
.rb .back .ia{transition:transform .2s}.rb .back:hover .ia{transform:translateX(-3px)}

/* ---------- การ์ดข้อมูลกิจกรรม (แสดงเฉพาะข่าวที่มีข้อมูลกิจกรรม) ---------- */
.rb-event{background:#fff;border-radius:8px;padding:22px;display:grid;grid-template-columns:auto 1fr;gap:14px 16px;align-items:center}
@media (max-width: 768px) {
  .rb-event { border-radius: 24px; }
}

.rb-event:not(:has(.rb-dtile)){grid-template-columns:1fr}
.rb-dtile{width:84px;border-radius:8px;background:var(--pd);color:#fff;text-align:center;padding:10px 6px 12px}
@media (max-width: 768px) {
  .rb-dtile { border-radius: 18px; }
}

.rb-dtile b{display:block;font-size:40px;line-height:1.15}
.rb-dtile span{display:block;font-size:13px;line-height:1.4}
.rb-event h2{font-size:18px;line-height:1.5}
.rb-event dl{grid-column:1/-1;display:grid;gap:8px}
.rb-event dl>div{display:flex;justify-content:space-between;align-items:center;gap:12px;background:var(--bg);border-radius:8px;padding:10px 14px;min-height:48px}
@media (max-width: 768px) {
  .rb-event dl>div { border-radius: 14px; }
}

.rb-event dt{display:inline-flex;align-items:center;gap:8px;font-size:14px;color:var(--mute);flex:0 0 auto}
.rb-event dt svg{width:17px;height:17px;color:var(--pd)}
.rb-event dd{font-size:15px;font-weight:700;text-align:right;line-height:1.5}
.rb-event dl>.rb-sr{position:absolute;width:1px;height:1px;min-height:0;padding:0;overflow:hidden;clip:rect(0 0 0 0)}
.rb-event .btn{grid-column:1/-1;display:flex;justify-content:center;align-items:center;min-height:48px;border-radius:8px;background:var(--pd);color:#fff;text-decoration:none;font-weight:700}
@media (max-width: 768px) {
  .rb-event .btn { border-radius: 14px; }
}


/* ---------- ปุ่มแชร์ ---------- */
.rb-share .sh-h{font-size:17px;font-weight:700;color:var(--ink);margin:0 0 14px;line-height:1.5}
.rb-share .sh-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
/* แถบข้างแคบ ปุ่มสองคอลัมน์ทำให้คำว่าคัดลอกลิงก์ตกบรรทัด เลยเรียงเต็มความกว้างทีละปุ่ม */
.rb-share-box .sh-row{grid-template-columns:1fr}
.rb-share-box .sb{justify-content:flex-start;width:100%;min-height:44px;padding:0 14px;white-space:nowrap}
.rb-share .sb,.rb-share .sb-native{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:46px;padding:0 10px;border:0;border-radius:8px;
  background:var(--pl);color:var(--pd);font:700 15px/1.2 "LINE Seed Sans TH",system-ui,sans-serif;text-decoration:none;cursor:pointer;transition:transform .2s,opacity .2s}
@media (max-width: 768px) {
  .rb-share .sb,.rb-share .sb-native { border-radius: 16px; }
}

.rb-share .sb:hover{background:var(--p);color:#fff}
.rb-share .sb:active,.rb-share .sb-native:active{transform:scale(.97)}
.rb-share svg{width:20px;height:20px;flex:0 0 auto}
.rb-share .sb-copy .i-ok{display:none}
.rb-share .sb-copy.ok{background:var(--pd);color:#fff}
.rb-share .sb-copy.ok .i-link{display:none}
.rb-share .sb-copy.ok .i-ok{display:block;animation:rb-pop .3s ease both}
@keyframes rb-pop{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
.rb-share .sb-native{display:none;background:var(--pd);color:#fff;width:100%;min-height:52px;font-size:16px;margin:0 0 10px}
.rb-share .sh-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.rb-share-box{background:#fff;border-radius:8px;padding:16px}
@media (max-width: 768px) {
  .rb-share-box { border-radius: 24px; }
}

.rb-share-mob{display:none;margin-top:32px;background:var(--bg);border-radius:8px;padding:16px}
@media (max-width: 768px) {
  .rb-share-mob { border-radius: 20px; }
}

.rb-share-mob .sh-h{font-size:15px;color:var(--mute);margin-bottom:10px}

/* ---------- ข่าวก่อนหน้า/ถัดไป + ข่าวที่เกี่ยวข้อง (news-article.js สร้างจาก api/news.php) ---------- */
.rb .pn{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:56px;margin-bottom:0;padding:0}
.rb .pn a{background:#fff;border-radius:8px;padding:20px 24px;text-decoration:none;color:var(--ink);line-height:1.6;transition:transform .2s}
@media (max-width: 768px) {
  .rb .pn a { border-radius: 22px; }
}

.rb .pn a:hover{background:var(--pl);transform:translateY(-2px)}
.rb .pn small{display:block;font-size:14px;font-weight:700;color:var(--pd);margin-bottom:4px}
.rb .pn b{font-size:17px}
.rb .pn .r{text-align:right}
.rb .rel{padding:72px 0 0}
.rb .rel h2{font-size:28px;font-weight:700;line-height:1.5;margin:0 0 20px}
.rb .trio{display:grid;grid-template-columns:repeat(3,1fr);gap:24px}
.rb .nc{display:flex;flex-direction:column;background:#fff;border-radius:8px;overflow:hidden;text-decoration:none;color:var(--ink);border:0}
@media (max-width: 768px) {
  .rb .nc { border-radius: 24px; }
}

.rb .nc .im{overflow:hidden;aspect-ratio:16/10;background:var(--pl)}
.rb .nc .im img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .4s}
.rb .nc:hover .im img{transform:scale(1.04)}
.rb .nc-b{display:flex;flex-direction:column;gap:8px;padding:18px 22px 24px}
.rb .nc .meta{display:flex;align-items:center;gap:10px;margin:0;font-size:14px;color:var(--mute)}
.rb .nc h3,.rb .nc h2{font-size:18px;line-height:1.6;margin:0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.rb .nc:hover h3{color:var(--pd)}
.rb .nc .ex{font-size:15px;line-height:1.7;color:var(--mute);margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.rb>:last-child{margin-bottom:72px}
/* ข่าวที่เกี่ยวข้องเป็นลูกคนสุดท้าย พอซ่อน margin หายไปกับกล่องนั้น เนื้อหาเลยชิดท้ายหน้า */
.rb:has(>.rel[hidden]){padding-bottom:72px}

/* ---------- จอกลาง (เมนูข้างยังอยู่ แต่ที่ไม่พอสองคอลัมน์) ---------- */
@media (max-width:1199px){
  .rb-hero{grid-template-columns:1fr;gap:24px}
  .rb-hero figure{order:-1}
  .rb-grid{grid-template-columns:minmax(0,1fr);row-gap:16px}
  .rb-top,.rb .read,.rb-side{grid-column:1;grid-row:auto;position:static}
  .rb-top{border-radius:8px;padding:28px 32px}
@media (max-width: 768px) {
  .rb-top { border-radius: 24px; }
}

  .rb .read{border-radius:8px;padding:32px}
@media (max-width: 768px) {
  .rb .read { border-radius: 24px; }
}

  .rb-share-box{display:none}
  .rb-side:not(:has(.rb-event)){display:none}
  .rb-share-mob{display:block}
  .rb .trio{grid-template-columns:1fr 1fr}
}
@media (max-width:900px){
  .nw.art.rb{padding:72px 16px 0}
  .rb:has(>.rel[hidden]){padding-bottom:72px}
}
/* ---------- มือถือ ---------- */
@media (max-width:768px){
  .rb-hero{padding:0;gap:14px;display:flex;flex-direction:column;align-items:stretch}
  .rb-hero .rb-ht{display:contents}
  .rb-hero .bc{order:1;margin-bottom:0}
  .rb-hero h1{order:2;font-size:26px;line-height:1.3;margin:0}
  .rb-hero figure{order:3}
  .rb-hero .meta{order:4;margin:0}
  .rb-hero .cx{order:5;font-size:16px;line-height:1.7;margin:0}
  .rb-hero figure img{border-radius:18px}
  .rb-top{padding:20px}
  .rb .tldr{padding:14px 16px}
  .rb .tldr p{font-size:16px}
  .rb .read{padding:20px;font-size:16px;line-height:1.75}
  .rb .read .body p,.rb .read .embed{margin-bottom:14px}
  .rb .read .lead-p{font-size:16px}
  .rb .read .body li{padding:10px 0 10px 18px;font-size:16px}
  .rb .faq summary{font-size:17px;padding-left:18px}
  .rb .pn{grid-template-columns:1fr;gap:12px;margin-top:40px}
  .rb .pn .r{text-align:left}
  .rb .rel{padding-top:48px}.rb .rel h2{font-size:24px}
  .rb .trio{grid-template-columns:1fr;gap:16px}
  .rb>:last-child{margin-bottom:96px}
  .rb:has(>.rel[hidden]){padding-bottom:96px}
  /* แชร์บนมือถือ: ปุ่มใหญ่เปิดหน้าต่างแชร์ของเครื่อง + 4 ปุ่มมีชื่อ */
  .rb-share-mob .sb-native{display:flex}
  .rb-share-mob .sh-row{grid-template-columns:repeat(4,1fr)}
  .rb-share-mob .sb{flex-direction:column;gap:4px;min-height:66px;padding:8px 2px;font-size:12.5px;white-space:nowrap;background:#fff}
}
/* ===== lightbox ปก/โปสเตอร์ ===== */
/* display:grid ทับ [hidden] ของ UA ทำให้รูปโผล่ท้ายหน้าเมื่อปิด — บังคับซ่อนเมื่อมี hidden */
.art-lightbox[hidden]{display:none!important}
.art-lightbox{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:16px;
  opacity:0;transition:opacity .2s ease}
.art-lightbox.is-open{opacity:1}
.art-lightbox-backdrop{position:absolute;inset:0;border:0;background:rgba(36,28,40,.72);cursor:pointer}
.art-lightbox-panel{position:relative;max-width:min(96vw,1200px);max-height:90vh;
  transform:scale(.96);opacity:0;transition:transform .2s ease,opacity .2s ease}
.art-lightbox.is-open .art-lightbox-panel{transform:scale(1);opacity:1}
.art-lightbox-close{position:absolute;top:8px;right:8px;z-index:1;width:44px;height:44px;border:0;
  border-radius:8px;background:#fff;color:#241c28;font-size:28px;line-height:1;cursor:pointer}
.art-lightbox-img{display:block;max-width:100%;max-height:90vh;width:auto;height:auto;margin:0 auto;
  border-radius:8px;background:#f6f1f7}
body.art-lightbox-on{overflow:hidden}

@media (prefers-reduced-motion:reduce){.rb *{animation:none!important;transition:none!important}}
