/* ═══════════════════════════════════════════════════════════════
   list.css — หน้ารายการ (news.php · documents.php) ใช้ร่วมกับ site.css + detail.css
   ═══════════════════════════════════════════════════════════════ */
.ls-wrap { padding-block: 26px 44px; }
.ls-card { padding: clamp(18px, 2.6vw, 30px); }
.ls-title { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--navy); line-height: 1.3; }
.ls-title .ic { color: var(--blue); }
.ls-sub { margin: 0 0 18px; color: var(--muted); font-size: .95rem; }

/* ── แถบค้นหา/ตัวกรอง ──────────────────────────────────── */
.ls-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; margin-bottom: 14px; background: var(--sky); border-radius: 12px; }
.ls-bar .f-q { position: relative; flex: 1 1 260px; min-width: 0; }
.ls-bar .f-q .ic { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.ls-bar input[type="search"] { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--line); border-radius: 10px; font: 400 .95rem var(--font); background: #fff; color: var(--ink); }
.ls-bar select, .per select { padding: 9px 32px 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: 400 .92rem var(--font); background: #fff; color: var(--ink); cursor: pointer; }
.ls-bar select { max-width: 100%; }
.ls-bar input:focus-visible, .ls-bar select:focus-visible, .per select:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.ls-bar .btn { padding: 9px 22px; }
.ls-bar .clear { color: var(--muted); font-size: .88rem; white-space: nowrap; }

/* ── สรุป + จำนวน/หน้า ─────────────────────────────────── */
.ls-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; color: var(--muted); font-size: .9rem; }
.ls-head b { color: var(--navy); }
.per { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .9rem; color: var(--muted); }
.per select { padding: 6px 28px 6px 10px; }

/* ── รายการข่าว ─────────────────────────────────────────── */
.ls-news { list-style: none; margin: 0; padding: 0; }
.ls-news > li { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.ls-news > li:last-child { border-bottom: 0; }
.ls-news .ph { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--sky); display: grid; place-items: center; color: var(--blue-2); }
.ls-news .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.ls-news .ph:hover img { transform: scale(1.05); }
.ls-news .bd { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ls-news .mt { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; color: var(--muted); font-size: .85rem; }
.ls-news .mt span { display: inline-flex; align-items: center; gap: 6px; }
.ls-news h2 { margin: 0; font-size: 1.2rem; line-height: 1.5; font-weight: 600; }
.ls-news h2 a { color: var(--navy); }
.ls-news h2 a:hover { color: var(--blue); text-decoration: none; }
.ls-news p { margin: 0; color: #3d4a66; font-size: .95rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ls-news .more-link { margin-top: auto; color: var(--blue); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.ls-news .badge-new { margin-left: 0; }

/* ── เอกสาร: แถว (แบบฟอร์ม/รายงาน) ──────────────────────── */
.ls-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ls-docs > li { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.ls-docs > li:hover { border-color: var(--blue-2); box-shadow: var(--shadow); }
.ls-docs .th { width: 56px; aspect-ratio: 1; border-radius: 10px; }
.ls-docs .th.ft { display: flex; }
.ls-docs .bd { min-width: 0; }
.ls-docs h2 { margin: 0 0 2px; font-size: 1.02rem; line-height: 1.5; font-weight: 600; }
.ls-docs h2 a { color: var(--navy); overflow-wrap: anywhere; }
.ls-docs h2 a:hover { color: var(--blue); text-decoration: none; }
.ls-docs .mt { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--muted); font-size: .82rem; align-items: center; }
.ls-docs .mt span { display: inline-flex; align-items: center; gap: 5px; }
.ls-docs .yr { background: var(--navy); color: #fff; font-weight: 600; font-size: .74rem; padding: 1px 9px; border-radius: 99px; }
/* คลิกได้ทั้งแถว (ไม่มีปุ่ม) — ลิงก์ที่ชื่อเอกสารยืดให้คลุมทั้งแถว */
.ls-docs h2 a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.ls-docs h2 a:focus-visible { outline: none; }
.ls-docs h2 a:focus-visible::after { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ── เอกสาร: ชั้นหนังสือ (จดหมายข่าว/วารสาร/E-Book) ───────── */
.ls-books { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 20px; }
.ls-books a { display: grid; gap: 8px; color: var(--navy); }
.ls-books a:hover { text-decoration: none; }
.ls-books .bk { display: block; aspect-ratio: 3 / 4; border-radius: 6px 10px 10px 6px; overflow: hidden; background: var(--sky); box-shadow: 0 6px 16px rgba(18, 48, 107, .2); display: grid; place-items: center; color: var(--blue-2); transition: transform .25s, box-shadow .25s; border-left: 4px solid rgba(18, 48, 107, .35); }
.ls-books a:hover .bk { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(18, 48, 107, .26); }
.ls-books .bk img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ls-books .bt { font-weight: 600; font-size: .92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ls-books .by { color: var(--muted); font-size: .8rem; }
.ls-books a:hover .bt { color: var(--blue); }

/* ── ภาพรวมหมวดเอกสาร (documents.php ไม่มี ?p=) ───────────── */
.ls-cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ls-cats a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); font-weight: 600; transition: border-color .2s, box-shadow .2s; }
.ls-cats a:hover { text-decoration: none; border-color: var(--blue-2); box-shadow: var(--shadow); }
.ls-cats .ic { color: var(--blue); }
.ls-cats small { margin-left: auto; color: var(--muted); font-weight: 400; white-space: nowrap; }
.ls-cat-group { margin: 22px 0 10px; font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.ls-cat-group:first-of-type { margin-top: 4px; }

/* ── แบ่งหน้า ───────────────────────────────────────────── */
.ls-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.pager ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pager .pg, .pager .pg-nav { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); font: 500 .92rem var(--font); }
.pager a.pg:hover, .pager a.pg-nav:hover { background: var(--sky); border-color: var(--blue-2); text-decoration: none; }
.pager .pg.is-cur { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.pager .pg-nav.is-off { opacity: .4; }
.pager .gap { color: var(--muted); padding: 0 4px; }

@media (max-width: 760px) {
  .ls-news > li { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; }
  .ls-news h2 { font-size: 1.02rem; }
  .ls-news p { -webkit-line-clamp: 2; font-size: .88rem; }
  .ls-docs > li { grid-template-columns: 48px minmax(0, 1fr); }
  .ls-docs .th { width: 48px; }
  .ls-books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .ls-foot { justify-content: center; }
  .pager .pg-nav span { display: none; }
  .pager .pg { min-width: 36px; height: 36px; padding: 0 8px; }
}
@media print { .ls-bar, .ls-foot, .per { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .ls-news .ph img, .ls-books .bk { transition: none; } }
.ls-news, .ls-docs, .ls-books { margin-top: 14px; }

/* ── ข่าวประชาสัมพันธ์: แท็บหมวด + รายการแถว (ไม่มีภาพปก) ─────── */
.nws-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.nws-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 2px solid var(--line); border-radius: 99px; background: #fff; color: var(--muted); font-weight: 600; font-size: .9rem; transition: border-color .2s, color .2s, background .2s; }
.nws-tab:hover { text-decoration: none; border-color: var(--blue-2); color: var(--blue); }
.nws-tab.is-on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(18, 48, 107, .2); }
.nws-cnt { min-width: 22px; padding: 1px 8px; border-radius: 99px; background: var(--sky); color: var(--muted); font-size: .72rem; font-weight: 700; text-align: center; }
.nws-tab.is-on .nws-cnt { background: rgba(255, 255, 255, .28); color: #fff; }
.nws-bar { background: transparent; padding: 0; }
.nws-bar input[type="search"] { border-radius: 99px; padding-block: 11px; }

.nws-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.nws-item { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 0; border-left: 4px solid var(--blue); border-radius: 10px; background: #fff; color: inherit; box-shadow: 0 2px 8px rgba(0, 0, 0, .05); transition: background .2s, box-shadow .2s, transform .2s; }
.nws-item:hover { text-decoration: none; background: var(--sky); box-shadow: 0 6px 20px rgba(18, 48, 107, .12); transform: translateX(3px); }
.nws-ico { flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--sky); color: var(--blue); }
.nws-ico-pdf { background: #fee2e2; color: #dc2626; }
.nws-ico-doc { background: #dbeafe; color: #1d4ed8; }
.nws-ico-file { background: #dcfce7; color: #15803d; }
.nws-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nws-name { font-weight: 600; font-size: .98rem; line-height: 1.5; color: var(--navy); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; padding-right: 44px; }
.nws-item:hover .nws-name { color: var(--blue); }
.nws-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .78rem; color: var(--muted); }
.nws-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.nws-date { color: var(--blue); font-weight: 500; }
.nws-chip { padding: 1px 9px; border-radius: 99px; background: var(--sky); color: var(--navy); font-weight: 600; font-size: .72rem; }
.nws-chip-pin { background: #fef3c7; color: #92400e; }
.nws-chip-file { background: #e0f2fe; color: #075985; }
.nws-new { position: absolute; top: 12px; right: 12px; padding: 2px 10px; border-radius: 99px; background: #e53e3e; color: #fff; font-size: .68rem; font-weight: 700; }
.nws-arrow { flex: none; color: #cbd5e1; transition: transform .18s, color .18s; }
.nws-item:hover .nws-arrow { color: var(--blue); transform: translateX(3px); }
@media (max-width: 760px) {
  .nws-tab { padding: 8px 13px; font-size: .84rem; }
  .nws-item { padding: 10px 12px; gap: 10px; }
  .nws-ico { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) { .nws-item, .nws-arrow { transition: none; } .nws-item:hover { transform: none; } }
