/* ==========================================================================
   จดหมายข่าว (ทุกฉบับและหน้าคลัง) — v3 18 พ.ย. 2569
   ========================================================================== */
:root { --em-950:#011a14; --em-900:#022c22; --em-800:#04382b; --em:#007f3d; --em-400:#10b26a; --gold:#d4af37; --gold-2:#f3d774; --ivory:#fbf8ef; --ink:#10231d; --ink-2:#33433d; --mut:#5d6d67; --line:rgba(2,44,34,.09); --ease:cubic-bezier(.2,.8,.2,1); --sh-1:0 1px 2px rgba(2,44,34,.06),0 8px 24px -12px rgba(2,44,34,.18); --sh-2:0 2px 6px rgba(2,44,34,.06),0 24px 48px -20px rgba(2,44,34,.32); }
body.nl { margin: 0; font-family: 'Sarabun', system-ui, sans-serif; line-height: 1.7; color: var(--ink-2); background: var(--ivory); }
body.nl :where(h1, h2, h3) { font-family: 'Kanit', sans-serif; color: var(--ink); margin: 0; line-height: 1.25; }
.nl-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.nl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 14px; font: 600 1rem 'Kanit', sans-serif; text-decoration: none; border: 0; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s, background .25s; }
.nl-btn:hover { transform: translateY(-2px); }
.nl-btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--em-900); box-shadow: 0 16px 30px -14px rgba(184,134,11,.9); }
.nl-btn-glass { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nl-btn-glass:hover { background: rgba(255,255,255,.22); color: #fff; }
.nl-btn-line { background: #fff; color: var(--em-900); border: 1.5px solid var(--line); box-shadow: var(--sh-1); }
.nl-btn-line:hover { border-color: var(--gold); color: var(--em-900); }

/* ---------- hero ---------- */
.nl-hero { position: relative; overflow: hidden; isolation: isolate; color: #fff; background: var(--em-950); padding: clamp(40px, 7vw, 80px) 0; }
.nl-hero-bg { position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center top; filter: blur(30px) saturate(1.2); opacity: .55; transform: scale(1.1); }
.nl-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 80% at 85% 10%, rgba(212,175,55,.3), transparent 60%), linear-gradient(110deg, rgba(1,26,20,.97) 0%, rgba(2,44,34,.85) 50%, rgba(2,44,34,.55) 100%); }
.nl-hero-in { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.nl-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); font: 500 .9rem 'Kanit', sans-serif; color: #eafff4; margin: 0 0 18px; }
.nl-hero h1 { color: #fff; font-size: clamp(2.2rem, 1.3rem + 4vw, 4.2rem); font-weight: 700; letter-spacing: -.01em; }
.nl-hero h1 span { display: block; background: linear-gradient(100deg, #f9e7a1, var(--gold) 40%, #fff3c4 60%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nl-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 18px 0 0; color: rgba(236,253,245,.82); font-size: 1rem; }
.nl-meta span { display: inline-flex; align-items: center; gap: 8px; }
.nl-meta i { color: var(--gold-2); }
.nl-acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.nl-cover { position: relative; display: block; border: 0; padding: 12px; border-radius: 24px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 40px 80px -30px rgba(0,0,0,.7); cursor: zoom-in; transform: rotate(2deg); transition: transform .5s var(--ease); width: 100%; max-width: 380px; justify-self: end; }
.nl-cover:hover { transform: rotate(0) scale(1.02); }
.nl-cover img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 14px; }
.nl-cover em { position: absolute; top: -12px; left: 20px; font: 600 .8rem 'Kanit', sans-serif; font-style: normal; color: var(--em-900); background: linear-gradient(135deg, var(--gold-2), var(--gold)); padding: 5px 12px; border-radius: 999px; }

/* ---------- toolbar + grid ---------- */
.nl-bar { position: sticky; top: calc(var(--mn-nav-h, 72px) - 1px); z-index: 20; background: rgba(251,248,239,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); transition: top .45s var(--ease); }
.mn-header.is-hidden ~ * .nl-bar, body:has(.mn-header.is-hidden) .nl-bar { top: 0; }
.nl-bar .nl-wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.nl-bar h2 { font-size: 1.05rem; font-weight: 600; margin-right: auto; }
.nl-bar h2 small { font: 400 .88rem 'Sarabun', sans-serif; color: var(--mut); margin-left: 6px; }
.nl-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.nl-seg button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 500 .9rem 'Kanit', sans-serif; cursor: pointer; }
.nl-seg button[aria-pressed=true] { background: var(--em-900); color: var(--gold-2); }
.nl-main { padding: clamp(28px, 4vw, 48px) 0; }
.nl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.nl-page { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: #e7ece9; aspect-ratio: 3 / 4; cursor: zoom-in; box-shadow: var(--sh-1); transition: transform .4s var(--ease), box-shadow .4s; opacity: 0; transform: translateY(16px); }
.nl-page.is-in { opacity: 1; transform: none; }
.nl-page img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .7s var(--ease); }
.nl-page:hover { transform: translateY(-6px); box-shadow: var(--sh-2); }
.nl-page:hover img { transform: scale(1.05); }
.nl-page b { position: absolute; left: 10px; bottom: 10px; min-width: 34px; height: 30px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center; font: 600 .82rem 'Kanit', sans-serif; color: #fff; background: rgba(1,26,20,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.nl-page::after { content: "\f00e"; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; color: #fff; background: rgba(2,44,34,.45); opacity: 0; transition: opacity .3s; }
.nl-page:hover::after, .nl-page:focus-visible::after { opacity: 1; }
.nl-read { display: none; max-width: 900px; margin: 0 auto; }
.nl-read figure { margin: 0 0 22px; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--sh-1); }
.nl-read img { display: block; width: 100%; height: auto; }
.nl-read figcaption { padding: 8px 14px; font: 500 .85rem 'Kanit', sans-serif; color: var(--mut); text-align: right; }
.nl-main.is-read .nl-grid { display: none; } .nl-main.is-read .nl-read { display: block; }

/* ---------- prev / next ---------- */
.nl-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(32px, 4vw, 52px); }
.nl-pn a { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-1); text-decoration: none; color: var(--ink); transition: transform .3s var(--ease), border-color .3s; }
.nl-pn a:hover { transform: translateY(-4px); border-color: var(--gold); }
.nl-pn a.nx { justify-content: flex-end; text-align: right; grid-column: 2; }
.nl-pn small { display: block; color: var(--mut); font-size: .82rem; }
.nl-pn b { font: 600 1.05rem 'Kanit', sans-serif; }
.nl-pn i { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--em-900); color: var(--gold-2); }

/* ---------- viewer ---------- */
.nl-view { position: fixed; inset: 0; z-index: 1080; display: flex; flex-direction: column; background: rgba(1,14,10,.96); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.nl-view.is-open { opacity: 1; visibility: visible; }
.nl-vtop { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #fff; font: 500 .95rem 'Kanit', sans-serif; }
.nl-vtop span { margin-right: auto; }
.nl-vbtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; cursor: pointer; text-decoration: none; font-size: 1rem; }
.nl-vbtn:hover { background: var(--gold); color: var(--em-900); }
.nl-vstage { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.nl-vstage img { max-width: min(100%, 1100px); max-height: 100%; object-fit: contain; transition: opacity .2s; user-select: none; -webkit-user-drag: none; }
.nl-vstage img.is-zoom { max-width: none; max-height: none; width: min(1600px, 200%); cursor: zoom-out; }
.nl-vstage.is-zoom { overflow: auto; display: block; touch-action: auto; }
.nl-vnav { position: absolute; top: 50%; transform: translateY(-50%); width: 54px; height: 54px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 1.2rem; cursor: pointer; z-index: 2; }
.nl-vnav:hover { background: var(--gold); color: var(--em-900); }
.nl-vnav.pv { left: 16px; } .nl-vnav.nx { right: 16px; }
.nl-vthumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); scrollbar-width: thin; }
.nl-vthumbs button { flex: 0 0 auto; width: 52px; height: 68px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #0a2a20; cursor: pointer; opacity: .55; }
.nl-vthumbs button[aria-current=true] { border-color: var(--gold); opacity: 1; }
.nl-vthumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- archive (หน้าคลัง) ---------- */
.nl-years { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 28px; }
.nl-years a { padding: 9px 20px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font: 600 .95rem 'Kanit', sans-serif; text-decoration: none; }
.nl-years a:hover { border-color: var(--gold); }
.nl-years a[aria-current=page] { background: var(--em-900); color: var(--gold-2); border-color: var(--em-900); }
.nl-year { margin-top: 44px; }
.nl-year h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); margin-bottom: 18px; }
.nl-year h2 small { font: 400 .95rem 'Sarabun', sans-serif; color: var(--mut); }
.nl-year h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212,175,55,.6), transparent); }
.nl-issues { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.nl-issue { position: relative; display: block; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; text-decoration: none; background: #e7ece9; box-shadow: var(--sh-1); transition: transform .4s var(--ease), box-shadow .4s; }
.nl-issue img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.nl-issue::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(1,26,20,.92), rgba(1,26,20,.05) 55%, transparent); }
.nl-issue span { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 12px; color: #fff; }
.nl-issue b { display: block; font: 600 1.15rem 'Kanit', sans-serif; }
.nl-issue small { color: rgba(255,255,255,.75); }
.nl-issue em { position: absolute; z-index: 1; top: 12px; right: 12px; font: 600 .75rem 'Kanit', sans-serif; font-style: normal; color: var(--em-900); background: linear-gradient(135deg, var(--gold-2), var(--gold)); padding: 3px 10px; border-radius: 999px; }
.nl-issue:hover { transform: translateY(-6px); box-shadow: var(--sh-2); }
.nl-issue:hover img { transform: scale(1.06); }

@media (max-width: 991px) { .nl-hero-in { grid-template-columns: 1fr; } .nl-cover { justify-self: start; max-width: 300px; transform: none; } }
@media (max-width: 575px) {
  .nl-wrap { padding: 0 16px; }
  .nl-cover { display: none; }
  .nl-acts .nl-btn { flex: 1 1 100%; }
  .nl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .nl-issues { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .nl-bar h2 small { display: none; }
  .nl-seg button span { display: none; }
  .nl-pn { grid-template-columns: 1fr; } .nl-pn a.nx { grid-column: 1; }
  .nl-vnav { width: 44px; height: 44px; } .nl-vnav.pv { left: 6px; } .nl-vnav.nx { right: 6px; }
}
@media (prefers-reduced-motion: reduce) { .nl-page { opacity: 1; transform: none; } *, *::before, *::after { transition-duration: .01ms !important; } }

.nl-empty { text-align: center; padding: 40px 16px; color: var(--mut); }

/* ---------- v3.2: ข่าวรายวัน + PDF ---------- */
.nl-pdf { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: #b91c1c; font: 500 .9rem 'Kanit', sans-serif; cursor: pointer; transition: border-color .2s, background .2s; }
.nl-pdf:hover { border-color: #fca5a5; background: #fef2f2; }
.nl-pdf:disabled { cursor: progress; opacity: .75; }
.nl-pdf.is-busy i { animation: nl-spin 1s linear infinite; }
@keyframes nl-spin { to { transform: rotate(360deg); } }
.nl-day { grid-column: 1 / -1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 18px 0 2px; padding: 0 0 8px; border-bottom: 2px solid rgba(212,175,55,.45); font: 600 1.12rem 'Kanit', sans-serif; color: var(--ink, #10231d); scroll-margin-top: calc(var(--mn-nav-h, 72px) + 70px); }
.nl-day:first-child { margin-top: 0; }
.nl-day time { font: 500 .85rem 'Kanit', sans-serif; color: #fff; background: var(--em-900, #022c22); padding: 3px 12px; border-radius: 999px; }
.nl-day span { flex: 1 1 200px; min-width: 0; }
.nl-day-link { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--mut, #5d6d67); text-decoration: none; }
.nl-day-link:hover { background: rgba(212,175,55,.18); color: var(--em-900, #022c22); }
.nl-day-link.is-copied { background: #dcfce7; color: #15803d; }
.nl-day-link.is-copied::after { content: "คัดลอกลิงก์แล้ว"; position: absolute; transform: translate(-40%, -120%); font: 500 .75rem 'Kanit', sans-serif; background: #15803d; color: #fff; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.nl-read .nl-day { margin: 26px 0 12px; }
@media (max-width: 640px) {
  .nl-pdf span { display: none; }
  .nl-pdf { width: 42px; padding: 0; justify-content: center; }
  .nl-day { font-size: 1rem; }
}
/* ---------- v3.3: ข้อความข่าว (ค้นหาได้ / อ่านออกเสียงได้) ---------- */
.nl-articles { padding: 10px 0 60px; }
.nl-art-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 10px 0 16px; padding-top: 22px; border-top: 1px solid var(--line, rgba(2,44,34,.12)); }
.nl-art-bar h2 { font-size: 1.2rem; margin: 0 auto 0 0; } .nl-art-bar h2 small { font: 400 .85rem 'Sarabun', sans-serif; color: var(--mut, #5d6d67); margin-left: 8px; }
.nl-art { background: #fff; border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(2,44,34,.06), 0 10px 30px -18px rgba(2,44,34,.3); scroll-margin-top: calc(var(--mn-nav-h, 72px) + 20px); }
.nl-art header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.nl-art time { font: 500 .8rem 'Kanit', sans-serif; color: #fff; background: var(--em-900, #022c22); padding: 2px 10px; border-radius: 999px; }
.nl-art h3 { margin: 0; font-size: 1.1rem; } .nl-art h3 a { color: inherit; text-decoration: none; } .nl-art h3 a:hover { color: var(--em, #007f3d); }
.nl-art h4 { margin: 10px 0 4px; font-size: 1rem; color: var(--em, #007f3d); }
.nl-art p { margin: 0 0 6px; line-height: 1.7; } .nl-art ul { margin: 4px 0 8px; padding-left: 20px; }
.nl-art .nl-art-en { color: #42564e; border-left: 3px solid #d4af37; padding-left: 12px; margin-top: 6px; }
.nl-articles[data-show=th] .nl-art-en, .nl-articles[data-show=en] .nl-art-th { display: none; }
.nl-articles[data-show=en] .nl-art-en { border-left: 0; padding-left: 0; color: inherit; }
/* ---------- ค้นหาข้ามทุกฉบับ ---------- */
.nl-search { position: relative; display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 0 18px; padding: 4px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line, rgba(2,44,34,.12)); box-shadow: 0 10px 30px -20px rgba(2,44,34,.4); }
.nl-search i { color: var(--em, #007f3d); }
.nl-search input { flex: 1; min-width: 0; height: 46px; border: 0; outline: none; background: none; font: 400 1rem 'Sarabun', sans-serif; }
.nl-search:focus-within { border-color: #d4af37; box-shadow: 0 0 0 3px rgba(212,175,55,.25); }
.nl-search-n { font: 500 .8rem 'Kanit', sans-serif; color: var(--mut, #5d6d67); white-space: nowrap; }
.nl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nl-res { display: grid; gap: 10px; margin-bottom: 30px; }
.nl-hit { display: flex; gap: 14px; align-items: flex-start; padding: 10px; border-radius: 14px; background: #fff; text-decoration: none; color: inherit; border: 1px solid var(--line, rgba(2,44,34,.12)); }
.nl-hit:hover { border-color: #d4af37; }
.nl-hit img { width: 76px; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 8px; flex: 0 0 auto; background: #eef2f0; }
.nl-hit small { display: block; font: 500 .78rem 'Kanit', sans-serif; color: var(--em, #007f3d); }
.nl-hit b { display: block; font: 600 1rem 'Kanit', sans-serif; color: var(--ink, #10231d); }
.nl-hit em { display: block; font-style: normal; font-size: .88rem; color: var(--mut, #5d6d67); margin-top: 2px; }
.nl-hit mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 2px; }