/* ==========================================================================
   ระบบข่าวสารและกิจกรรม รฟม. (mrta-news) - หน้าแรก + ชิ้นส่วนที่หน้ารายการ/รายละเอียดใช้ร่วม
   --------------------------------------------------------------------------
   ขนาดวัดจากแบบดีไซน์ (เฟรม 1920) แล้วแปลงเป็น clamp()/vw ให้ย่อตามจอ
   หน้าแรกเป็น 3 section เรียงลงมา หัวเรื่องกลางหน้ามีเส้นใต้ (.nw-heading):
     1. ข่าวสารล่าสุด          ตัวกรอง + ข่าวเด่น (สไลด์) | ข่าวล่าสุด 4 ข่าว
     2. กิจกรรมที่กำลังจะเกิดขึ้น  ปฏิทิน | การ์ดกิจกรรม 3 ใบ
     3. ประมวลภาพกิจกรรมย้อนหลัง  การ์ดอัลบั้ม 4 ใบ
   หน้ารายการ/รายละเอียด (news-list / news-detail / event-list / event-detail / gallery-list / gallery-detail)
   ใช้ตัวแปร ปุ่ม ป้าย รูป แถบเครื่องมือ กล่องแชร์ โครงการ์ดรายละเอียด ฯลฯ จากไฟล์นี้
   ========================================================================== */

:root {
    --nw-navy:        #16306b;   /* หัวเรื่อง / ตัวหนังสือหลัก */
    --nw-navy-deep:   #002777;   /* แถบ breadcrumb / การ์ดข่าวเด่น / ปุ่มทึบ */
    --nw-navy-soft:   #eaf0fb;   /* พื้นรูปที่ยังไม่มีภาพ */
    --nw-blue:        #5570d0;
    --nw-red:         #a8151c;   /* ป้าย / วันที่ / วันที่มีกิจกรรม - WCAG AAA: ขาวบนแดง 7.9:1 (เดิม #d82028 = 5:1) ค่าเดียวกับ portal */
    --nw-red-deep:    #8f1218;
    --nw-text:        #1f2a44;
    --nw-muted:       #454f69;   /* WCAG AAA 7:1 บนพื้นขาว (เดิม #636e88 = 5.1:1) - ค่าเดียวกับ portal / knowledge */
    --nw-faint:       #a9b4cc;
    --nw-line:        #e4eaf5;
    --nw-page:        #f5f8fd;
    --nw-shadow:      0 6px 28px rgba(22, 48, 107, .08);
    --nw-radius:      8px;
    --nw-radius-lg:   clamp(12px, .85vw, 16px);
    --nw-gap:         clamp(1.25rem, 2.1vw, 2.5rem);
}

/* ── โครงหน้า ─────────────────────────────────────────────────────────── */
.nw-page {
    background: var(--nw-page);
    color: var(--nw-text);
    padding-bottom: clamp(3rem, 5vw, 6rem);
}

.nw-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4.7vw, 5.75rem);
}

/* section ของหน้าแรก - ระยะห่างระหว่าง section ตามแบบ */
.nw-section { padding-top: clamp(2.25rem, 4.2vw, 5rem); }

/* หัวเรื่องกลางหน้า: เส้นเทาบาง มีขีดแดงหนาตรงกลาง (ชุดเดียวกับหน้าเกี่ยวกับเราของ portal) */
.nw-heading {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto clamp(1.5rem, 2.9vw, 3.5rem);
    padding-bottom: clamp(.7rem, 1vw, 1.1rem);
    color: var(--nw-navy-deep);
    font-family: var(--bs-font-primary);
    font-weight: 700;
    font-size: clamp(1.45rem, 2.3vw, 2.75rem);
    line-height: 1.35;
    text-align: center;
}
.nw-heading::before,
.nw-heading::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.nw-heading::before {
    bottom: 1px;
    width: max(100%, min(330px, 80vw));
    border-top: 1px solid #b9c3d8;
}
.nw-heading::after {
    bottom: 0;
    width: clamp(48px, 3.9vw, 75px);
    border-top: 4px solid var(--nw-red);
}

/* หัวข้อย่อย (หน้ารายละเอียด / คอลัมน์ข้าง) */
.nw-section-title {
    color: var(--nw-navy);
    font-family: var(--bs-font-primary);
    font-weight: 600;
    font-size: clamp(1.2rem, 1.4vw, 1.6rem);
    line-height: 1.4;
    margin: 0 0 clamp(.9rem, 1.3vw, 1.5rem);
}

.nw-card {
    background: #fff;
    border-radius: var(--nw-radius);
    box-shadow: var(--nw-shadow);
}

/* ── ปุ่ม ─────────────────────────────────────────────────────────────── */
.nw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .75rem 1.6rem;
    border: 1.5px solid transparent;
    border-radius: 6px;
    font-family: var(--bs-font-primary);
    font-size: clamp(.95rem, 1vw, 1.15rem);
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s, color .18s, border-color .18s;
}
.nw-btn .bi-arrow-right { font-size: 1.1em; -webkit-text-stroke: .4px currentColor; }

.nw-btn-pill  { border-radius: 50rem; padding-inline: clamp(1.4rem, 2vw, 2.4rem); }
.nw-btn-sm    { padding: .6rem 1.5rem; font-size: clamp(.9rem, .95vw, 1.05rem); }
.nw-btn-block { display: flex; width: 100%; }

.nw-btn-outline              { background: #fff; color: var(--nw-navy); border-color: var(--nw-navy); }
.nw-btn-outline:hover        { background: var(--nw-navy); color: #fff; }
.nw-btn-outline-light        { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .9); }
.nw-btn-outline-light:hover  { background: #fff; color: var(--nw-navy-deep); }
.nw-btn-red                  { background: var(--nw-red); color: #fff; }
.nw-btn-red:hover            { background: var(--nw-red-deep); color: #fff; }

/* ปุ่มทึบกรมท่าท้าย section ("ดูข่าวสารทั้งหมด" ฯลฯ) */
.nw-btn-navy {
    padding: clamp(.55rem, .6vw, .7rem) clamp(1.2rem, 1.6vw, 1.9rem);
    border-radius: 4px;
    background: var(--nw-navy-deep);
    color: #fff;
    font-size: clamp(.9rem, .9vw, 1.05rem);
}
.nw-btn-navy:hover { background: #0b3bb8; color: #fff; }

.nw-btn:focus-visible,
.nw-share:focus-visible,
.nw-cal-nav:focus-visible,
.nw-cal-day:focus-visible,
.nw-dot:focus-visible {
    outline: 3px solid rgba(85, 112, 208, .55);
    outline-offset: 2px;
}

.nw-section-foot {
    display: flex;
    justify-content: center;
    margin-top: clamp(1.25rem, 1.6vw, 1.9rem);
}

/* ปุ่มแชร์ (ไอคอนเปล่า) */
.nw-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--nw-navy);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color .18s;
}
.nw-share:hover       { background: var(--nw-navy-soft); }
.nw-share-light       { color: #fff; font-size: clamp(1.1rem, 1.3vw, 1.5rem); }
.nw-share-light:hover { background: rgba(255, 255, 255, .15); }

/* ป้ายหมวด */
.nw-badge {
    display: inline-block;
    padding: .3rem .75rem;
    border-radius: 6px;
    background: var(--nw-red);
    color: #fff;
    font-family: var(--bs-font-primary);
    font-size: clamp(.85rem, .9vw, 1.05rem);
    font-weight: 500;
    line-height: 1.35;
}
.nw-badge-sm {
    padding: .1rem .55rem;
    font-size: clamp(.78rem, .95vw, 1.15rem);
    font-weight: 600;
}

/* กรอบรูป - พื้นอ่อน + ไอคอนจาง ๆ ระหว่างรูปกำลังโหลด
   ไม่มีรูป/รูปโหลดไม่ขึ้น = ภาพแทนตามชนิด (component news/cover → helper news_placeholder) */
.nw-thumb,
.nw-featured-media,
.nw-album-media {
    position: relative;
    overflow: hidden;
    background: var(--nw-navy-soft);
}
.nw-thumb::before,
.nw-featured-media::before,
.nw-album-media::before {
    content: "\f4a3"; /* bi-newspaper */
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: bootstrap-icons;
    font-size: 2rem;
    color: #c3cfe9;
}
.nw-thumb-event::before { content: "\f1e8"; font-size: 2.6rem; } /* bi-calendar-event - การ์ดกิจกรรม */
.nw-thumb-album::before { content: "\f3ee"; font-size: 2.6rem; } /* bi-images - การ์ดอัลบั้มหน้าประมวลภาพ */
.nw-album-media::before { content: "\f3ee"; font-size: 2.6rem; } /* bi-images */
.nw-thumb img,
.nw-featured-media img,
.nw-album-media img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* แถวสถิติข่าว วันที่ | ยอดเข้าชม | ยอดแชร์ (component news/stats)
   ใช้ในหน้ารายการ/รายละเอียดข่าว ซึ่งเป็นสเกล px แบบ belib */
.nw-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--nw-navy-deep);
    font-size: 14px;
    line-height: 1.4;
}
.nw-stats li {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    white-space: nowrap;
}
.nw-stats li + li {
    margin-left: .5em;
    padding-left: .5em;
    border-left: 1px solid #c9d2e3;
}
.nw-stats i { font-size: .85em; }
.nw-stats-sm { font-size: 13px; }

/* ── หน้ารายการ: ข่าวสารทั้งหมด (news-list.css) / กิจกรรมทั้งหมด (event-list.css) ──
   สเกลเดียวกับหน้ารายการทรัพยากรของ belib (/book/all): เนื้อหาอยู่ใน .container (กว้างสุด 1320px)
   ขนาดเป็น px คงที่ ไม่ขยายตามจอแบบหน้าแรก news (ซึ่งวัดจากเฟรม 1920 ด้วย vw) */
/* หัวหน้ารายการ (component sub-banner) - หัวเรื่องกลาง .nw-heading แทนแบนเนอร์รูป ตามแบบ
   ระยะล่างของหัวเรื่องเป็นระยะถึงแถบเครื่องมือแล้ว .nw-listpage ที่ตามมาจึงไม่ต้องเว้นบนซ้ำ */
.nw-list-head { padding-top: clamp(2rem, 2.9vw, 3.5rem); }
.nw-list-head .nw-heading { margin-bottom: clamp(1.5rem, 2.1vw, 2.5rem); }
.nw-list-head + .nw-listpage { padding-top: 0; }
.nw-listpage { padding-top: 40px; }
.nw-listpage .pagination-custom { margin-top: 40px; }

/* แถบเครื่องมือ (component news/list-toolbar)
   ดรอปดาวน์ใช้ component select-dropdown แบบมีป้าย (.app-dd-labeled - main.css) */
.nw-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 30px;
}
.nw-toolbar:has(+ .nw-active) { margin-bottom: 16px; }
.nw-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}
.nw-toolbar .app-dd {
    width: 320px;
    min-width: 0;
}
.nw-toolbar .app-dd-toggle {
    height: 40px;
    font-size: 15px;
}

/* ปุ่มสลับมุมมอง - ยกมาจาก mrta-belib (products.css .btn-show-view) ขนาดเดียวกัน
   เป็นลิงก์ ?view= ไม่ต้องมี JS */
.nw-views {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-show-view {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-color: #EDF1F8;
    color: #B4BDCE;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.btn-show-view:hover { color: var(--nw-navy); }
.btn-show-view.active { background-color: var(--bs-secondary-900); color: #fff; }
.btn-show-view:focus-visible { outline: 3px solid rgba(85, 112, 208, .55); outline-offset: 2px; }

/* จำนวนที่พบ + ป้ายตัวกรองกดล้างได้ (news/list/_active_filters) */
.nw-active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 26px;
    color: var(--nw-muted);
    font-size: 14px;
}
.nw-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 12px;
    border-radius: 50rem;
    background: var(--nw-navy-soft);
    color: var(--nw-navy);
    font-size: 14px;
    text-decoration: none;
}
.nw-chip:hover { background: var(--nw-navy); color: #fff; }

@media (max-width: 767.98px) {
    /* ดรอปดาวน์เต็มแถว ปุ่มสลับมุมมองลงไปชิดขวาแถวถัดไป */
    .nw-toolbar-filters,
    .nw-toolbar .app-dd { width: 100%; }
    .nw-views { margin-left: auto; }
}

/* เนื้อหาจากตัวแก้ไขข้อความ (หน้ารายละเอียดข่าว / กิจกรรม) - คุมขนาดรูป/ตาราง/วิดีโอไม่ให้ล้นกรอบ */
.nw-prose {
    margin-top: clamp(1.25rem, 2vw, 2rem);
    color: var(--nw-text);
    font-size: clamp(1rem, 1.05vw, 1.15rem);
    line-height: 1.9;
    overflow-wrap: anywhere;
}
.nw-prose > :first-child { margin-top: 0; }
.nw-prose h2,
.nw-prose h3,
.nw-prose h4,
.nw-prose h5 {
    margin: 1.6em 0 .6em;
    color: var(--nw-navy);
    font-family: var(--bs-font-primary);
    font-weight: 600;
    line-height: 1.45;
}
.nw-prose img,
.nw-prose iframe { max-width: 100%; height: auto; border-radius: 4px; }
.nw-prose iframe { aspect-ratio: 16 / 9; width: 100%; border: 0; }
.nw-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.nw-prose th,
.nw-prose td { padding: .5rem .75rem; border: 1px solid var(--nw-line); }
.nw-prose blockquote {
    margin: 1.5em 0;
    padding: .5em 1.25em;
    border-left: 4px solid var(--nw-line);
    color: var(--nw-muted);
}
.nw-prose a { color: var(--nw-blue); }

/* กล่องแชร์ (component news/share-box) - หน้ารายละเอียดข่าว / กิจกรรม
   "Share :" แล้วตามด้วยปุ่มไอคอนกว้างเท่ากัน คั่นด้วยเส้นตั้ง */
.nw-sharebox {
    display: flex;
    align-items: center;
    align-self: stretch;
    min-height: 56px;
    padding: 0 6px 0 16px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(33, 48, 105, .12);
}
.nw-sharebox-label {
    flex: none;
    padding-right: 8px;
    color: var(--nw-text);
    font-size: 15px;
    white-space: nowrap;
}
.nw-sharebox-btn {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--nw-line);
    background: transparent;
    color: var(--nw-navy-deep);
    font-size: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s;
}
.nw-sharebox-label + .nw-sharebox-btn { border-left: 0; }
.nw-sharebox-btn:hover { color: var(--nw-red); }
.nw-sharebox-btn:focus-visible { outline: 3px solid rgba(85, 112, 208, .55); outline-offset: 2px; border-radius: 6px; }

/* หน้าต่าง QR */
.nw-qr {
    width: min(360px, calc(100% - 32px));
    padding: 0;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 20, 70, .3);
}
.nw-qr::backdrop { background: rgba(10, 25, 60, .55); }
.nw-qr-inner {
    position: relative;
    padding: 28px 24px 24px;
    text-align: center;
}
.nw-qr-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--nw-muted);
    font-size: 18px;
    cursor: pointer;
}
.nw-qr-close:hover { background: var(--nw-navy-soft); color: var(--nw-navy); }
.nw-qr-title {
    margin: 0 0 16px;
    color: var(--nw-navy-deep);
    font-family: var(--bs-font-primary);
    font-weight: 600;
    font-size: 18px;
}
.nw-qr-code { display: flex; justify-content: center; }
.nw-qr-code svg { width: 200px; height: 200px; }
.nw-qr-link {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}
.nw-qr-link input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #c9d2e3;
    border-radius: 6px;
    background: var(--nw-page);
    color: var(--nw-text);
    font-size: 13px;
}
.nw-qr-link .nw-btn {
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
}

@media (max-width: 575.98px) {
    .nw-sharebox { padding-left: 12px; }
    .nw-sharebox-btn { font-size: 18px; }
}

/* ── หน้ารายละเอียดแบบการ์ด: กิจกรรม (/events/{id}) และอัลบั้ม (/gallery/{id}) ──
   การ์ดขาวเนื้อหา (ซ้าย) | คอลัมน์ข้าง "ยอดนิยม" (ขวา) - สเกลเดียวกับหน้ารายละเอียดข่าว (ขนาด px)
   ส่วนเฉพาะของแต่ละหน้าอยู่ใน event-detail.css (.ed-*) / gallery-detail.css (.gd-*) */
.nw-detail { padding-top: 40px; }
.nw-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 40px;
}
/* คอลัมน์ข้างกว้างกว่าหน้าข่าว (380) เล็กน้อย - การ์ดยอดนิยมของกิจกรรมมีช่องวันที่เพิ่ม */
.nw-detail-layout.has-aside { grid-template-columns: minmax(0, 1fr) 400px; }
.nw-detail-card {
    min-width: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(33, 48, 105, .10);
}
.nw-detail-body { padding: 22px 26px 26px; }
.nw-detail-title {
    margin: 0 0 12px;
    color: var(--nw-navy-deep);
    font-family: var(--bs-font-primary);
    font-weight: 600;
    font-size: 24px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
/* กล่องแชร์ชิดขวาใต้เส้นคั่น - ไม่มีกรอบ/เงาแบบหน้าข่าว ปุ่มกว้างเท่ากัน */
.nw-detail-share {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--nw-line);
}
.nw-detail-share .nw-sharebox {
    min-height: 44px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}
.nw-detail-share .nw-sharebox-btn {
    flex: 0 0 60px;
    font-size: 18px;
}
.nw-detail-aside { min-width: 0; }
.nw-detail-aside-title {
    margin: 0 0 20px;
    color: var(--nw-navy-deep);
    font-family: var(--bs-font-primary);
    font-weight: 600;
    font-size: 24px;
    line-height: 1.35;
}

@media (max-width: 1399.98px) {
    .nw-detail-layout.has-aside { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1199.98px) {
    .nw-detail-title { font-size: 22px; }
}
/* คอลัมน์ข้างลงไปอยู่ใต้การ์ดเนื้อหา */
@media (max-width: 991.98px) {
    .nw-detail-layout.has-aside { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
    .nw-detail-body { padding: 18px; }
}
@media (max-width: 575.98px) {
    .nw-detail-title { font-size: 20px; }
    .nw-detail-share .nw-sharebox { flex: 1; }
    .nw-detail-share .nw-sharebox-btn { flex: 1 1 0; }
}

/* ══════════════════════════════════════════════════════════════════════
   HERO
   (breadcrumb ย้ายไปเป็นตัวกลางของทุกระบบ: components/mrta-breadcrumb + front/css/mrta-breadcrumb.css)
   ══════════════════════════════════════════════════════════════════════ */

/* แบนเนอร์หัวหน้ารายการ (component sub-banner) - ภาพท้องฟ้า banner-sub.png (1920×250)
   หัวเรื่องขาวกลางภาพ มีขีดแดงนำหน้า */
/* ใช้ในหน้าข่าวสารทั้งหมด (สเกลเดียวกับ belib) - ขนาดจึงเป็น px ไม่ขยายตาม vw แบบ hero หน้าแรก */
.nw-subhero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 24px 16px;
    background: #1747c9 var(--nw-subhero-image) center / cover no-repeat;
    text-align: center;
}
.nw-subhero-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #fff;
    font-family: var(--bs-font-primary);
    font-weight: 500;
    font-size: 36px;
    line-height: 1.3;
    text-shadow: 0 2px 14px rgba(0, 25, 90, .3);
}
.nw-subhero-title::before {
    content: "";
    flex: none;
    width: 8px;
    height: .82em;
    background: var(--nw-red);
}
@media (max-width: 767.98px) {
    .nw-subhero { min-height: 130px; }
    .nw-subhero-title { font-size: 28px; }
}

/* รูปตั้งต้น (placeholder/banner/banner.png) ฝั่งซ้ายเป็นฟ้าอ่อนเกือบขาว ภาพรถไฟฟ้าอยู่ฝั่งขวา - ตัวหนังสือกรมท่าวางฝั่งซ้าย
   (แบบเดียวกับหน้าติดต่อเราของ portal) รูปอยู่ใน ::after ไม่ใช่ background ของ section - ตัวตรวจ WCAG วัดคอนทราสต์ได้
   (กรมท่าบนพื้น #eef5fd 13:1 / แดง #c8102e 5:1 ผ่านเกณฑ์ตัวอักษรใหญ่) แทนที่จะขึ้นข้อควรระวัง "ข้อความอยู่บนรูปภาพพื้นหลัง" */
.nw-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(220px, 23.4vw, 450px);
    overflow: hidden;
    background: #eef5fd;
}
.nw-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: var(--nw-hero-image) right center / cover no-repeat;
}
.nw-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    /* หัวเรื่องในแบบเยื้องเข้ามามากกว่าเนื้อหาด้านล่าง */
    padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 8.5vw, 10.25rem) clamp(2rem, 4vw, 4.5rem);
    /* หัวเรื่องเยื้องเข้ามาจากตัวหนังสือของ breadcrumb ("หน้าหลัก" = หมุด 15px + ช่อง 8px = 23px) อีก 2vw */
    padding-left: calc(clamp(1rem, 8.5vw, 10.25rem) + 23px + 2vw);
}
.nw-hero-title {
    color: #002777;
    font-family: var(--bs-font-primary);
    font-weight: 700;
    font-size: clamp(2rem, 3.7vw, 4.5rem);
    line-height: 1.2;
    margin: 0 0 clamp(.6rem, 1.2vw, 1.4rem);
}
/* "กิจกรรม" สีแดงตามแบบ - หัวเรื่องเป็นตัวอักษรใหญ่ (2rem ขึ้นไป ตัวหนา) เกณฑ์ AAA 4.5:1 */
.nw-hero-accent { color: #c8102e; }
.nw-hero-desc {
    color: #002777;
    font-family: var(--bs-font-primary);
    font-size: clamp(.9rem, 1.1vw, 1.35rem);
    line-height: 1.95;
    margin: 0;
    max-width: 36em;
}

/* ══════════════════════════════════════════════════════════════════════
   1. ข่าวสารล่าสุด
   ══════════════════════════════════════════════════════════════════════ */

/* ── ตัวกรอง (หน้าแรกจัดกลาง / หน้ารายการชิดซ้าย) ── */
.nw-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem clamp(.75rem, 1.05vw, 1.25rem);
    margin-bottom: clamp(1.5rem, 3.1vw, 3.75rem);
}
.nw-section .nw-filter { justify-content: center; }

.nw-filter-search,
.nw-select select {
    height: clamp(2.9rem, 3.2vw, 3.8rem);
    background-color: #fff;
    border: 1px solid #c9d2e3;
    border-radius: 6px;
    color: var(--nw-navy);
    font-size: clamp(.92rem, .95vw, 1.1rem);
    transition: border-color .18s, box-shadow .18s;
}
.nw-filter-search {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: clamp(15rem, 19.4vw, 23.5rem);
    padding: 0 .5rem 0 1rem;
}
.nw-filter-search:focus-within,
.nw-select select:focus {
    border-color: var(--nw-blue);
    box-shadow: 0 0 0 3px rgba(85, 112, 208, .18);
    outline: 0;
}
.nw-filter-search > .bi-search { color: var(--nw-navy); font-size: 1.05rem; -webkit-text-stroke: .5px currentColor; }
.nw-filter-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    outline: 0;
}
.nw-filter-search input::placeholder { color: var(--nw-navy); opacity: .85; }
/* ปุ่ม × ของเราเอง - ซ่อนตัวของเบราว์เซอร์ไม่ให้ขึ้นซ้ำสองอัน */
.nw-filter-search input::-webkit-search-cancel-button { display: none; }
.nw-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--nw-navy);
    font-size: 1rem;
    -webkit-text-stroke: .6px currentColor;
    cursor: pointer;
}
.nw-filter-clear:hover { background: var(--nw-navy-soft); }

.nw-select { position: relative; margin: 0; }
/* ลูกศรลงของช่องเลือก - อยู่ที่ label ไม่ใช่ background-image ของ select (WCAG: ตัวเลือกไม่วางบนรูปพื้นหลัง) */
.nw-select::after {
    content: "";
    position: absolute;
    top: 50%;
    right: .9rem;
    width: .8rem;
    height: .8rem;
    transform: translateY(-50%);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2316306b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}
.nw-select:has(select:disabled)::after { opacity: .55; }
/* ปุ่มล้างคำค้นซ่อนด้วยคลาส ไม่ใช่ attribute hidden (ตัวตรวจ WCAG เตือนช่องที่ซ่อนด้วย hidden แต่มีป้ายกำกับ) */
.nw-filter-clear.is-hidden { display: none; }
.nw-select select {
    width: clamp(9rem, 9.5vw, 11.5rem);
    padding: 0 2.4rem 0 1rem;
    appearance: none;
    -webkit-appearance: none;
    text-overflow: ellipsis;
    cursor: pointer;
}
.nw-select-sm select { width: clamp(7rem, 7.5vw, 9rem); }
.nw-select select:disabled { opacity: .55; cursor: not-allowed; }

.nw-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-left: clamp(.25rem, 1vw, 1.25rem);
    color: var(--nw-navy);
    font-family: var(--bs-font-primary);
    font-size: clamp(.92rem, .95vw, 1.1rem);
    text-decoration: none;
}
.nw-filter-reset .bi { font-size: 1.15em; -webkit-text-stroke: .4px currentColor; }
.nw-filter-reset:hover,
.nw-filter-reset.is-active { color: var(--nw-red); }

/* ── กริด: ข่าวเด่น (700) | ข่าวล่าสุด (994) - แถวล่างเป็นจุดสไลด์ | ปุ่มดูทั้งหมด ── */
.nw-news-grid {
    display: grid;
    grid-template-columns: minmax(0, .705fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: var(--nw-gap);
    align-items: stretch;
}
.nw-featured-slider { grid-column: 1; grid-row: 1; }
.nw-slider-dots     { grid-column: 1; grid-row: 2; }
.nw-news-grid > .nw-news-list  { grid-column: 2; grid-row: 1; }
.nw-news-grid > .nw-section-foot { grid-column: 2; grid-row: 2; }

/* ── ข่าวเด่น (สไลด์ด้วย scroll-snap - JS แค่คุมจุด ดู home/_scripts) ── */
.nw-featured-slider {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: var(--nw-radius-lg);
    min-height: clamp(24rem, 36vw, 44rem);
}
.nw-featured-slider::-webkit-scrollbar { display: none; }
.nw-featured-slider:focus-visible { outline: 3px solid rgba(85, 112, 208, .45); outline-offset: 4px; }

.nw-featured {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border-radius: var(--nw-radius-lg);
    background: var(--nw-navy-deep);
    color: #fff;
    scroll-snap-align: start;
    /* รูปอยู่ชั้นล่างสุด (z-index:-1) ภายในการ์ด ลิงก์หัวข้อ (::after) จึงขยายเต็มทั้งการ์ดได้ */
    isolation: isolate;
}
.nw-featured-media {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: -1;
    height: 58%;
}
/* รูปจางลงไปเป็นพื้นกรมท่าของส่วนข้อความ ตามแบบ */
.nw-featured-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 39, 119, 0) 62%, rgba(0, 39, 119, .7) 86%, var(--nw-navy-deep) 100%);
}
.nw-featured > .nw-badge {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    margin: clamp(1rem, 2.1vw, 2.5rem) 0 auto clamp(1rem, 2.1vw, 2.5rem);
    padding: .4rem 1.05rem;
    font-size: clamp(.9rem, 1.15vw, 1.375rem);
    font-weight: 600;
}
.nw-featured-body {
    padding: 0 clamp(1.1rem, 2.1vw, 2.5rem) clamp(1.3rem, 2.3vw, 2.75rem);
}
.nw-featured-title {
    margin: 0 0 .6rem;
    font-family: var(--bs-font-primary);
    font-weight: 700;
    font-size: clamp(1.3rem, 1.9vw, 2.25rem);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nw-featured-title a { color: #fff; text-decoration: none; }
/* ลิงก์หัวข้อขยายเต็มการ์ด - ปุ่มแชร์ยกขึ้นมาเหนือ (z-index) ยังกดได้ */
.nw-featured-title a::after { content: ""; position: absolute; inset: 0; }
.nw-featured:hover .nw-featured-title a { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.nw-featured-excerpt {
    margin: 0;
    font-size: clamp(.92rem, 1.15vw, 1.375rem);
    line-height: 1.75;
    opacity: .95;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nw-featured-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: clamp(1.25rem, 3.4vw, 4rem);
}
.nw-featured-foot > * { position: relative; z-index: 1; }
.nw-featured-foot .nw-btn { padding: clamp(.5rem, .55vw, .65rem) clamp(1.1rem, 1.4vw, 1.6rem); font-size: clamp(.88rem, .9vw, 1.05rem); }

/* จุดบอกสไลด์ใต้ข่าวเด่น */
.nw-slider-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(.1rem, .3vw, .4rem); /* จุดมี padding ล้อมแล้ว (ดู .nw-dot) ระยะที่ตาเห็นใกล้เคียงเดิม */
    margin-top: clamp(1.25rem, 2.2vw, 2.6rem);
    align-self: start;
}
/* พื้นที่กดอย่างน้อย 24x24px (WCAG 2.5.8) - จุดที่เห็นยังเล็กเท่าเดิม: padding ใส แล้วระบายสีเฉพาะ content-box
   (สีตอน hover/active ใช้ background-color ห้ามใช้ background ย่อ ไม่งั้น background-clip ถูกรีเซ็ต) */
.nw-dot {
    box-sizing: content-box;
    width: clamp(10px, .8vw, 15px);
    height: clamp(10px, .8vw, 15px);
    padding: max(0px, calc((24px - clamp(10px, .8vw, 15px)) / 2));
    border: 0;
    border-radius: 50%;
    background-color: #d5dae5;
    background-clip: content-box;
    cursor: pointer;
    transition: background-color .18s, transform .18s;
}
.nw-dot:hover     { background-color: #b9c1d3; }
.nw-dot.is-active { background-color: #3f6de0; }

/* ── ข่าวล่าสุด (แถวข่าว - ใช้ในหน้าอ่านข่าวด้วย) ── */
.nw-news-list {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 1.67vw, 2rem);
}
.nw-news-item {
    position: relative;
    display: flex;
    gap: clamp(.75rem, .85vw, 1rem);
    align-items: stretch;
}
.nw-news-item .nw-thumb {
    flex: 0 0 clamp(6.5rem, 10.4vw, 12.5rem);
    aspect-ratio: 1;
    border-radius: 10px;
}
.nw-news-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
    padding-top: clamp(0rem, .9vw, 1rem);
}
.nw-news-title {
    margin: clamp(.2rem, .6vw, .6rem) 0 .35rem;
    font-family: var(--bs-font-primary);
    font-weight: 600;
    font-size: clamp(.95rem, 1.15vw, 1.375rem);
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nw-news-title a { color: var(--nw-navy-deep); text-decoration: none; }
.nw-news-title a::after { content: ""; position: absolute; inset: 0; }
.nw-news-item:hover .nw-news-title a { color: var(--nw-red); }
.nw-news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    align-self: stretch;
    gap: .75rem;
    margin-top: auto;
    color: var(--nw-navy);
    font-size: clamp(.82rem, 1.15vw, 1.375rem);
}
.nw-views { display: inline-flex; align-items: center; gap: .45rem; color: var(--nw-navy); white-space: nowrap; }

/* ── ยังไม่มีข่าว / กรองแล้วไม่เจอ ──
   โครงจาง ๆ รูปทรงเดียวกับข่าวเด่น + แถวข่าว (ให้ section สูงเท่าตอนมีข่าว) แล้ววางข้อความทับกลางกล่อง
   ซ้อนด้วย grid ช่องเดียวกัน ไม่ใช้ position: absolute (ตัวตรวจ WCAG วัดคอนทราสต์ของข้อความที่ absolute ไม่ได้) */
.nw-empty {
    position: relative;
    display: grid;
    overflow: hidden;
    border-radius: var(--nw-radius-lg);
    background: #fff;
    box-shadow: var(--nw-shadow);
}
.nw-empty > .nw-empty-ghost,
.nw-empty > .nw-empty-body { grid-area: 1 / 1; }
.nw-empty-ghost {
    display: grid;
    grid-template-columns: minmax(0, .705fr) minmax(0, 1fr);
    gap: var(--nw-gap);
    padding: clamp(1rem, 1.6vw, 2rem);
    opacity: .6;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .3) 40%, rgba(0, 0, 0, .3) 65%, #000 100%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .3) 40%, rgba(0, 0, 0, .3) 65%, #000 100%);
}
.nw-empty-ghost .g-card { border-radius: var(--nw-radius-lg); background: #e8eef9; min-height: clamp(16rem, 24vw, 28rem); }
.nw-empty-ghost .g-list { display: flex; flex-direction: column; gap: clamp(1rem, 1.6vw, 2rem); }
.nw-empty-ghost .g-row  { display: flex; gap: 1rem; }
.nw-empty-ghost .g-img  { flex: 0 0 clamp(5rem, 7.5vw, 9rem); aspect-ratio: 1; border-radius: 10px; background: #e8eef9; }
.nw-empty-ghost .g-lines { flex: 1; display: flex; flex-direction: column; gap: .7rem; padding-top: .4rem; }
.nw-empty-ghost .g-lines span { height: 11px; border-radius: 6px; background: #e8eef9; }
.nw-empty-ghost .g-lines span:nth-child(1) { width: 18%; }
.nw-empty-ghost .g-lines span:nth-child(2) { width: 92%; }
.nw-empty-ghost .g-lines span:nth-child(3) { width: 64%; }

.nw-empty-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}
.nw-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(64px, 4.6vw, 88px);
    height: clamp(64px, 4.6vw, 88px);
    margin-bottom: 1.1rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 30px rgba(22, 48, 107, .14);
    color: var(--nw-navy-deep);
    font-size: clamp(1.6rem, 1.9vw, 2.3rem);
}
.nw-empty-title {
    margin: 0 0 .4rem;
    color: var(--nw-navy-deep);
    font-family: var(--bs-font-primary);
    font-weight: 700;
    font-size: clamp(1.1rem, 1.35vw, 1.6rem);
}
.nw-empty-text {
    margin: 0 0 1.4rem;
    max-width: 34em;
    color: var(--nw-muted);
    font-size: clamp(.9rem, 1vw, 1.15rem);
    line-height: 1.75;
}

/* ══════════════════════════════════════════════════════════════════════
   2. กิจกรรมที่กำลังจะเกิดขึ้น: ปฏิทิน (996) | การ์ดกิจกรรม (700)
   ══════════════════════════════════════════════════════════════════════ */
/* ปฏิทินกว้างกว่าคอลัมน์การ์ดเล็กน้อย - ย่อลงจากแบบเดิม (1.42 : 1) ที่ดูใหญ่เกินไป */
.nw-cal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    column-gap: var(--nw-gap);
    align-items: start;
}
.nw-cal-layout[aria-busy="true"] { opacity: .5; transition: opacity .15s; }

.nw-cal-card {
    padding: clamp(.9rem, 1.4vw, 1.7rem) clamp(.9rem, 1.7vw, 2rem) clamp(.8rem, 1.1vw, 1.35rem);
    border-radius: var(--nw-radius-lg);
    box-shadow: 0 8px 30px rgba(22, 48, 107, .09);
}
.nw-cal-head {
    margin-top: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(.4rem, .9vw, 1.1rem);
    margin-bottom: clamp(.5rem, .9vw, 1.1rem);
}
.nw-cal-title {
    margin: 0;
    min-width: 7.5em;
    color: var(--nw-navy-deep);
    font-family: var(--bs-font-primary);
    font-weight: 700;
    font-size: clamp(1.15rem, 1.5vw, 1.8rem);
    line-height: 1.2;
    text-align: center;
}
.nw-cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    color: var(--nw-navy-deep);
    font-size: clamp(1rem, 1.1vw, 1.3rem);
    -webkit-text-stroke: .8px currentColor;
    text-decoration: none;
}
.nw-cal-nav:hover { background: var(--nw-navy-soft); color: var(--nw-navy-deep); }

.nw-cal-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: center;
}
.nw-cal-table th {
    padding: 0 0 clamp(.35rem, .6vw, .75rem);
    color: var(--nw-navy-deep);
    font-family: var(--bs-font-primary);
    font-weight: 700;
    font-size: clamp(.88rem, 1vw, 1.2rem);
}
.nw-cal-table td { padding: clamp(.12rem, .3vw, .4rem) 0; }
.nw-cal-day {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.9rem, 1.9vw, 2.3rem);
    height: clamp(1.9rem, 1.9vw, 2.3rem);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--nw-navy-deep);
    font-size: clamp(.88rem, .95vw, 1.15rem);
    line-height: 1;
}
.nw-cal-day.is-muted { color: var(--nw-faint); }
/* วันนี้: วงแหวนกรมท่า (แบบไม่ได้กำหนด - ให้เห็นแต่ไม่แย่งสีกับวันที่มีกิจกรรม) */
.nw-cal-day.is-today { box-shadow: inset 0 0 0 2px var(--nw-navy-deep); font-weight: 700; }
/* วันที่มีกิจกรรม: วงกลมแดงทึบ ตัวเลขขาว - กดเพื่อดูเฉพาะกิจกรรมวันนั้น */
.nw-cal-day.has-event { background: var(--nw-red); color: #fff; }
.nw-cal-day.has-event.is-today { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--nw-red); }
/* ทุกวันของเดือนกดได้ (ดูกิจกรรมของวันนั้น) - วันที่เลือกอยู่เป็นวงกลมกรมท่าทึบ */
button.nw-cal-day { cursor: pointer; transition: background-color .15s, box-shadow .15s, color .15s; }
button.nw-cal-day:hover { background: var(--nw-navy-soft); }
button.nw-cal-day.has-event:hover { background: var(--nw-red-deep); }
button.nw-cal-day[aria-pressed="true"],
button.nw-cal-day[aria-pressed="true"]:hover { background: var(--nw-navy-deep); color: #fff; }
/* วันนอกเดือน (ปุ่ม disabled) - ไม่มีเคอร์เซอร์มือ/ไม่ไฮไลต์ตอนชี้ */
button.nw-cal-day:disabled,
button.nw-cal-day:disabled:hover { cursor: default; background: transparent; }

/* ── การ์ดกิจกรรมข้างปฏิทิน (ใช้ในคอลัมน์ข้างของหน้ากิจกรรมด้วย) ── */
.nw-cal-side { min-width: 0; }
.nw-cal-events {
    display: flex;
    flex-direction: column;
    gap: clamp(.75rem, 1.1vw, 1.3rem);
    margin: 0;
    padding: 0;
    list-style: none;
}
.nw-cal-event {
    position: relative;
    display: flex;
    gap: clamp(.8rem, 1.2vw, 1.4rem);
    align-items: flex-start;
    min-height: clamp(5.5rem, 6.5vw, 7.8rem);
    padding: clamp(.85rem, 1.1vw, 1.3rem) clamp(1rem, 1.6vw, 1.9rem);
    border-radius: var(--nw-radius-lg);
    background: #fff;
    box-shadow: 0 8px 30px rgba(22, 48, 107, .09);
    transition: box-shadow .18s, transform .18s;
}
.nw-cal-event:hover { box-shadow: 0 10px 34px rgba(22, 48, 107, .16); transform: translateY(-2px); }
.nw-cal-event[hidden] { display: none; }
.nw-cal-event-date {
    flex: 0 0 clamp(2.5rem, 2.8vw, 3.3rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--nw-red);
    line-height: 1.15;
}
.nw-cal-event-date .d { font-family: var(--bs-font-primary); font-weight: 700; font-size: clamp(1.4rem, 1.65vw, 2rem); }
.nw-cal-event-date .m { font-family: var(--bs-font-primary); font-weight: 500; font-size: clamp(.85rem, 1vw, 1.2rem); }
.nw-cal-event-info {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
    line-height: 1.5;
}
.nw-cal-event-info .t { color: var(--nw-navy-deep); font-size: clamp(.82rem, .9vw, 1.05rem); }
.nw-cal-event-info .n {
    color: var(--nw-navy-deep);
    font-family: var(--bs-font-primary);
    font-weight: 700;
    font-size: clamp(.9rem, .98vw, 1.15rem);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* ลิงก์ชื่อกิจกรรมขยายเต็มการ์ด */
.nw-cal-event-info .n::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.nw-cal-event:hover .n { color: var(--nw-red); }
.nw-cal-event-info .p { color: var(--nw-muted); font-size: clamp(.82rem, .9vw, 1.05rem); }

/* เดือนนี้ไม่มีกิจกรรม / วันนั้นไม่มีกิจกรรม */
.nw-cal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    min-height: clamp(11rem, 13vw, 16rem);
    padding: 1.5rem;
    border: 1.5px dashed #cfd8ea;
    border-radius: var(--nw-radius-lg);
    background: #fff;
    color: var(--nw-muted);
    font-size: clamp(.92rem, 1.05vw, 1.2rem);
    text-align: center;
}
.nw-cal-empty[hidden] { display: none; }
.nw-cal-empty i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--nw-navy-soft);
    color: var(--nw-navy-deep);
    font-size: 1.5rem;
}

/* ══════════════════════════════════════════════════════════════════════
   3. ประมวลภาพกิจกรรมย้อนหลัง (การ์ดอัลบั้ม gallery/_album_card - หน้าประมวลภาพทั้งหมดใช้ gallery-list.css)
   ══════════════════════════════════════════════════════════════════════ */
.nw-album-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--nw-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}
.nw-album-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: var(--nw-radius-lg);
    background: #fff;
    box-shadow: 0 8px 30px rgba(22, 48, 107, .09);
    transition: box-shadow .18s, transform .18s;
}
.nw-album-card:hover { box-shadow: 0 10px 34px rgba(22, 48, 107, .16); transform: translateY(-3px); }
.nw-album-media { aspect-ratio: 404 / 230; }
.nw-album-media img { transition: transform .35s ease; }
.nw-album-card:hover .nw-album-media img { transform: scale(1.04); }
.nw-album-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: clamp(.8rem, 1vw, 1.2rem) clamp(.9rem, 1.05vw, 1.25rem) clamp(1rem, 1.6vw, 1.9rem);
}
.nw-album-title {
    margin: 0 0 clamp(.6rem, .9vw, 1rem);
    padding-bottom: clamp(.6rem, .9vw, 1rem);
    border-bottom: 1px solid var(--nw-line);
    font-family: var(--bs-font-primary);
    font-weight: 700;
    font-size: clamp(.95rem, 1.15vw, 1.375rem);
    line-height: 1.8;
    min-height: calc(3.6em + clamp(.6rem, .9vw, 1rem)); /* 2 บรรทัดเสมอ เส้นคั่นจะได้ตรงแนวกันทุกใบ */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nw-album-title a { color: var(--nw-navy-deep); text-decoration: none; }
.nw-album-title a::after { content: ""; position: absolute; inset: 0; }
.nw-album-card:hover .nw-album-title a { color: var(--nw-red); }
/* วันที่ + จำนวนรูป (component news/album-meta) - ทุกหน้าที่มีการ์ดอัลบั้ม ขนาดตัวหนังสือตามคลาสของแต่ละหน้า */
.nw-album-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin: 0;
    color: var(--nw-navy-deep);
}
.nw-album-stats span { display: inline-flex; align-items: center; gap: 6px; }

/* การ์ดหน้าแรก - สเกลหน้าแรก (vw) */
.nw-album-meta {
    gap: .35rem clamp(.8rem, 1.1vw, 1.3rem);
    margin-top: auto;
    font-size: clamp(.85rem, 1.15vw, 1.375rem);
}
.nw-album-meta span { gap: .45rem; }

/* ยังไม่มีภาพ: การ์ดจาง ๆ 4 ใบ + ข้อความกลาง */
.nw-empty-ghost.is-albums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nw-empty-ghost.is-albums .g-card { min-height: clamp(12rem, 17vw, 20rem); }

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */

@media (max-width: 1199.98px) {
    .nw-album-grid,
    .nw-empty-ghost.is-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nw-empty-ghost.is-albums .g-card:nth-child(n+3) { display: none; }
}

/* จอ < 992: ข่าว / ปฏิทิน เรียงเป็นแถวเดียว */
@media (max-width: 991.98px) {
    /* ภาพประกอบของ banner เลื่อนมาอยู่หลังตัวหนังสือ - ไล่สีฟ้าอ่อนทับให้อ่านตัวหนังสือกรมท่าออก */
    .nw-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        background: linear-gradient(90deg, rgba(238, 245, 253, .94) 0%, rgba(238, 245, 253, .75) 60%, rgba(238, 245, 253, 0) 100%);
    }

    .nw-news-grid { grid-template-columns: minmax(0, 1fr); }
    .nw-featured-slider,
    .nw-slider-dots,
    .nw-news-grid > .nw-news-list,
    .nw-news-grid > .nw-section-foot { grid-column: 1; grid-row: auto; }
    .nw-featured-slider { min-height: 26rem; }
    .nw-slider-dots { margin-bottom: 1.75rem; }

    .nw-cal-layout { grid-template-columns: minmax(0, 1fr); row-gap: 1.5rem; }

    .nw-empty-ghost { grid-template-columns: minmax(0, 1fr); }
    .nw-empty-ghost .g-card { display: none; }
}

@media (max-width: 767.98px) {
    .nw-hero::after { background-position: 72% center; }
    .nw-hero-inner { padding-inline: clamp(1rem, 4.7vw, 5.75rem); padding-left: calc(clamp(1rem, 4.7vw, 5.75rem) + 23px); }

    .nw-filter { gap: .6rem; margin-bottom: 1.25rem; }
    .nw-filter-search { width: 100%; }
    .nw-select { flex: 1 1 calc(33.333% - .4rem); min-width: 0; }
    .nw-select select,
    .nw-select-sm select { width: 100%; padding-right: 2rem; background-position: right .7rem center; }
    .nw-filter-reset { margin-left: auto; }

    .nw-featured-slider { min-height: 22rem; }
    .nw-featured-media { height: 52%; }
}

@media (max-width: 575.98px) {
    .nw-album-grid { grid-template-columns: minmax(0, 1fr); }
    .nw-btn-navy { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .nw-album-media img,
    .nw-album-card,
    .nw-cal-event,
    .nw-dot { transition: none; }
    .nw-featured-slider { scroll-behavior: auto; }
}

/* ข้อความสำหรับโปรแกรมอ่านหน้าจอ (ป้ายช่องกรอง / ปุ่มค้นหา) - ย้ายออกนอกจอแทน position:absolute ทับในหน้า
   ตัวตรวจ WCAG ขึ้นข้อควรระวัง "absolutely positioned" กับข้อความที่ซ้อนอยู่ในหน้า - ตอนโฟกัสยังแสดงตามปกติ (ค่าเดียวกับ knowledge) */
.visually-hidden:not(:focus):not(:focus-within) { left: -10000px !important; }
