/* site.css - ธีมหน้าเว็บ (ฟ้า / น้ำเงิน / ส้ม / ขาว)
   สีหลัก 3 สีมาจาก หลังบ้าน > ตั้งค่าระบบ > ธีมสี (header.php ใส่ค่า --brand / --sky / --accent ให้) */

:root {
    --brand: #0b3b8c;
    --brand-rgb: 11, 59, 140;
    --sky: #0ea5e9;
    --sky-rgb: 14, 165, 233;
    --accent: #f97316;
    --accent-rgb: 249, 115, 22;

    --brand-dark: color-mix(in srgb, var(--brand) 78%, #000);
    --brand-deep: color-mix(in srgb, var(--brand) 55%, #020617);
    --accent-dark: color-mix(in srgb, var(--accent) 86%, #000);
    --sky-soft: color-mix(in srgb, var(--sky) 12%, #fff);
    --brand-soft: color-mix(in srgb, var(--brand) 8%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 12%, #fff);

    --bg: #f3f7fc;
    --surface: #ffffff;
    --surface-2: #f6f9fd;
    --text: #1b2a41;
    --heading: #0c2a5e;
    --muted: #64748b;
    --line: #e1e9f3;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 40, 80, .05), 0 2px 10px rgba(15, 40, 80, .05);
    --shadow-md: 0 10px 30px rgba(15, 40, 80, .12);

    /* เก่า: ให้หน้าบริการเดิมที่อ้างตัวแปรชุดนี้ใช้สีธีมใหม่ */
    --accent-old: var(--accent);
    --navy: var(--brand);
    --navy-mid: var(--brand-dark);

    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: var(--brand-rgb);
    --bs-link-hover-color: var(--accent-dark);
    --bs-body-font-family: 'Prompt', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

[data-bs-theme="dark"] {
    --bg: #0a1424;
    --surface: #111e33;
    --surface-2: #17263f;
    --text: #d8e2f0;
    --heading: #f1f5fb;
    --muted: #93a4bd;
    --line: #22344f;
    --sky-soft: color-mix(in srgb, var(--sky) 16%, #111e33);
    --brand-soft: color-mix(in srgb, var(--sky) 10%, #111e33);
    --accent-soft: color-mix(in srgb, var(--accent) 16%, #111e33);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .45);
    --bs-link-color: #7cc4f5;
    --bs-link-color-rgb: 124, 196, 245;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--line);
}

/* ---------- พื้นฐาน ---------- */
html { scroll-behavior: smooth; }
body {
    font-family: var(--bs-body-font-family);
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
main { flex-grow: 1; }
h1, h2, h3, h4, h5, h6 { color: var(--heading); }
a { text-decoration: none; }
img { max-width: 100%; }
::selection { background: rgba(var(--sky-rgb), .3); }
:focus-visible { outline: 3px solid rgba(var(--sky-rgb), .55); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 3000; background: var(--accent); color: #fff; padding: 8px 16px; border-radius: 8px; }
.skip-link:focus { left: 8px; color: #fff; }

/* ---------- ปุ่ม ---------- */
.btn { font-weight: 500; }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #7cc4f5; --bs-btn-border-color: #7cc4f5; }
.btn-accent { background: var(--accent); color: #fff; border: none; border-radius: 10px; }
.btn-accent:hover, .btn-accent:focus { background: var(--accent-dark); color: #fff; }
.btn-sky { background: var(--sky); color: #fff; border: none; }
.btn-sky:hover { background: color-mix(in srgb, var(--sky) 85%, #000); color: #fff; }
.text-accent { color: var(--accent) !important; }
.text-brand { color: var(--brand) !important; }
.text-sky { color: var(--sky) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }
.bg-accent { background: var(--accent) !important; color: #fff; }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.border-primary { border-color: var(--brand) !important; }
[data-bs-theme="dark"] .text-primary, [data-bs-theme="dark"] .text-brand { color: #7cc4f5 !important; }
.form-control:focus, .form-select:focus { border-color: var(--sky); box-shadow: 0 0 0 .2rem rgba(var(--sky-rgb), .2); }
.page-link { color: var(--brand); }
.active > .page-link, .page-link.active { background: var(--brand); border-color: var(--brand); }
.dropdown-item:active { background: var(--brand); }

/* ---------- แถบบนสุด ---------- */
.pn-topbar { background: var(--brand-deep); color: rgba(255, 255, 255, .7); font-size: 12.5px; padding: 6px 0; }
.pn-topbar a { color: rgba(255, 255, 255, .7); transition: color .15s; }
.pn-topbar a:hover { color: #fff; }
.pn-topbar .sep { opacity: .25; }
.pn-topbar .pn-social a { font-size: 14px; margin-left: 10px; }

/* ---------- ส่วนหัว: โลโก้ + ค้นหา ---------- */
.pn-masthead { background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 0; }
.pn-logo { display: inline-flex; align-items: center; gap: 12px; color: var(--heading); }
.pn-logo:hover { color: var(--heading); }
.pn-logo-mark {
    width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--brand) 0%, var(--sky) 100%);
    color: #fff; font-weight: 700; font-size: 1.5rem; line-height: 1;
    display: flex; align-items: center; justify-content: center; position: relative;
    box-shadow: 0 6px 16px rgba(var(--brand-rgb), .28);
}
.pn-logo-mark::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); }
.pn-logo-name { font-weight: 700; font-size: 1.45rem; line-height: 1.15; letter-spacing: -.01em; color: var(--brand); }
[data-bs-theme="dark"] .pn-logo-name { color: #fff; }
.pn-logo-tag { font-size: 12px; color: var(--muted); font-weight: 400; }
.pn-logo img { max-height: 52px; width: auto; }
.pn-search { position: relative; width: 100%; max-width: 380px; }
.pn-search input {
    width: 100%; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--text);
    border-radius: 999px; padding: 9px 46px 9px 18px; font-size: .92rem; transition: border-color .15s, box-shadow .15s, background .15s;
}
.pn-search input:focus { outline: none; border-color: var(--sky); background: var(--surface); box-shadow: 0 0 0 4px rgba(var(--sky-rgb), .15); }
.pn-search button { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 38px; border: none; border-radius: 50%; background: var(--accent); color: #fff; }
.pn-search button:hover { background: var(--accent-dark); }
.pn-icon-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--heading);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; transition: all .15s; flex-shrink: 0;
}
.pn-icon-btn:hover { border-color: var(--sky); color: var(--sky); }
[data-bs-theme="dark"] .pn-theme-toggle .bi-moon-stars-fill, :root:not([data-bs-theme="dark"]) .pn-theme-toggle .bi-sun-fill { display: none; }

/* ---------- เมนูหลัก ---------- */
.pn-nav {
    background: linear-gradient(90deg, var(--brand-dark) 0%, var(--brand) 55%, color-mix(in srgb, var(--brand) 55%, var(--sky)) 100%);
    border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 1030; box-shadow: 0 4px 16px rgba(var(--brand-rgb), .18);
}
.pn-nav .container { display: flex; align-items: center; gap: 4px; min-height: 48px; }
.pn-nav-brand { display: none; color: #fff; font-weight: 700; margin-right: 12px; white-space: nowrap; }
.pn-nav.is-stuck .pn-nav-brand { display: inline-flex; align-items: center; gap: 8px; }
.pn-nav-brand:hover { color: #fff; }
.pn-nav-links { display: flex; align-items: stretch; list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; white-space: nowrap; }
.pn-nav-link {
    display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 14px; color: rgba(255, 255, 255, .86); font-weight: 500; font-size: .95rem;
    position: relative; transition: color .15s, background .15s; border: 0; background: none;
}
.pn-nav-link::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); transform: scaleX(0); transition: transform .2s; }
.pn-nav-link:hover, .pn-nav-link.active, .pn-nav-link.show { color: #fff; background: rgba(255, 255, 255, .08); }
.pn-nav-link:hover::after, .pn-nav-link.active::after { transform: scaleX(1); }
.pn-nav-link.dropdown-toggle::after { display: none; }
.pn-nav-service { background: var(--accent); color: #fff !important; border-radius: 999px; height: 34px; align-self: center; margin: 0 6px; padding: 0 16px; }
.pn-nav-service:hover, .pn-nav-service.show { background: var(--accent-dark); }
.pn-nav .dropdown-menu { border: 0; border-radius: 14px; box-shadow: var(--shadow-md); padding: 8px; margin-top: 6px !important; background: var(--surface); }
.pn-nav .dropdown-item { border-radius: 8px; padding: 8px 14px; color: var(--text); }
.pn-nav .dropdown-item:hover { background: var(--sky-soft); color: var(--heading); }
.pn-nav .dropdown-item i { color: var(--accent); width: 22px; display: inline-block; }
.pn-nav-user { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pn-nav-user a.pn-nav-plain { color: rgba(255, 255, 255, .8); font-size: .88rem; }
.pn-nav-user a.pn-nav-plain:hover { color: #fff; }

/* ---------- มือถือ: แถบบน + เมนูล่าง ---------- */
.pn-mobile-top {
    background: linear-gradient(90deg, var(--brand-dark), var(--brand) 60%, color-mix(in srgb, var(--brand) 55%, var(--sky)));
    border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 1030; padding: 8px 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.pn-mobile-top .pn-logo-mark { width: 34px; height: 34px; font-size: 1.1rem; border-radius: 10px; box-shadow: none; background: #fff; color: var(--brand); }
.pn-mobile-top .pn-logo-mark::after { border-color: var(--brand); width: 11px; height: 11px; }
.pn-mobile-top .pn-logo-name { color: #fff; font-size: 1.15rem; }
.pn-mobile-top .pn-logo img { max-height: 36px; }
.pn-mobile-top .pn-icon-btn { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; width: 36px; height: 36px; }
.pn-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(15, 40, 80, .1); display: flex; justify-content: space-around; align-items: flex-end;
    padding: 4px 4px calc(6px + env(safe-area-inset-bottom));
}
.pn-bottom-nav a { flex: 1; text-align: center; color: var(--muted); font-size: 11px; font-weight: 600; transition: color .15s; }
.pn-bottom-nav a i { display: block; font-size: 1.35rem; line-height: 1.3; }
.pn-bottom-nav a.active, .pn-bottom-nav a:hover { color: var(--brand); }
[data-bs-theme="dark"] .pn-bottom-nav a.active, [data-bs-theme="dark"] .pn-bottom-nav a:hover { color: #7cc4f5; }
.pn-bottom-nav .pn-fab { flex: 0 0 auto; margin: 0 6px; }
.pn-bottom-nav .pn-fab span {
    width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; border: 4px solid var(--surface);
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #facc15)); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: 0 8px 20px rgba(var(--accent-rgb), .4);
}
.pn-bottom-space { height: 74px; }
.offcanvas { background: var(--surface); color: var(--text); }
.pn-offcanvas-head { background: linear-gradient(120deg, var(--brand-dark), var(--brand) 60%, var(--sky)); color: #fff; }
.pn-offcanvas-head .pn-logo-name { color: #fff; }
.pn-menu-tile { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; text-align: center; color: var(--text); font-size: 12px; font-weight: 500; height: 100%; }
.pn-menu-tile i { display: block; font-size: 1.4rem; color: var(--accent); }
.pn-menu-link { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; color: var(--text); font-weight: 500; }
.pn-menu-link:hover { background: var(--sky-soft); color: var(--heading); }

/* ---------- ข่าวด่วน ---------- */
.pn-ticker { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); overflow: hidden; }
.pn-ticker-label { background: var(--accent); color: #fff; font-weight: 600; font-size: .85rem; border-radius: 999px; padding: 7px 16px; white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.pn-ticker-label i { animation: pnPulse 1.4s ease-in-out infinite; }
@keyframes pnPulse { 50% { opacity: .35; } }
.ticker-outer, .pn-ticker-track { overflow: hidden; flex: 1; min-width: 0; margin-left: 12px; }
.ticker-inner, .pn-ticker-inner { display: inline-flex; white-space: nowrap; animation: tickerScroll 45s linear infinite; }
.ticker-inner:hover, .pn-ticker-inner:hover { animation-play-state: paused; }
@keyframes tickerScroll { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }
.pn-ticker-inner a { color: var(--text); font-weight: 500; margin-right: 48px; }
.pn-ticker-inner a:hover { color: var(--accent-dark); }
.pn-ticker-inner a i { color: var(--accent); }

/* ---------- หัวข้อส่วน ---------- */
.pn-section-head, .section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 1.1rem; padding-bottom: .7rem; border-bottom: 2px solid var(--line); }
.pn-section-bar, .section-head-bar { width: 5px; height: 24px; border-radius: 3px; flex-shrink: 0; background: linear-gradient(180deg, var(--sky), var(--brand)); }
.pn-section-title { font-size: 1.3rem; font-weight: 700; margin: 0; color: var(--heading); }
h3.pn-section-title { font-size: 1.08rem; }
.pn-section-more { margin-left: auto; font-size: .86rem; font-weight: 500; color: var(--accent-dark); white-space: nowrap; }
.pn-section-more:hover { color: var(--accent); }
.pn-section-more i { transition: transform .15s; }
.pn-section-more:hover i { transform: translateX(3px); }

/* ---------- การ์ดข่าว ---------- */
.pn-card, .card-modern { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; transition: transform .22s ease, box-shadow .22s ease, border-color .22s; }
.card-modern { border: none; }
.pn-card:hover, .card-modern:hover { transform: translateY(-4px); box-shadow: var(--shadow-md) !important; border-color: rgba(var(--sky-rgb), .45); }
.pn-thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.pn-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.pn-card:hover .pn-thumb img { transform: scale(1.06); }
.pn-badge { display: inline-block; color: #fff; font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; line-height: 1.5; background: var(--brand); }
.pn-thumb .pn-badge { position: absolute; left: 10px; bottom: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.pn-play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.pn-card-body { padding: 14px 16px 12px; display: flex; flex-direction: column; flex: 1; }
.pn-title { font-size: 1rem; font-weight: 600; line-height: 1.5; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pn-title a { color: var(--heading); transition: color .15s; }
.pn-title a:hover { color: var(--accent-dark); }
[data-bs-theme="dark"] .pn-title a:hover { color: var(--accent); }
.pn-hot { background: var(--accent); color: #fff; font-size: .68rem; padding: 1px 7px; border-radius: 5px; vertical-align: 2px; font-weight: 600; }
.pn-excerpt { color: var(--muted); font-size: .88rem; line-height: 1.6; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pn-meta { margin-top: auto; display: flex; justify-content: space-between; gap: 10px; font-size: .76rem; color: var(--muted); }
.pn-card .pn-meta { padding-top: 10px; border-top: 1px solid var(--line); }
.pn-meta i { color: var(--sky); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hover-primary { transition: color .2s; }
.hover-primary:hover { color: var(--accent-dark) !important; }
.text-shadow { text-shadow: 1px 2px 6px rgba(0, 0, 0, .7); }
.hero-gradient { background: linear-gradient(to top, rgba(4, 20, 50, .92) 0%, rgba(4, 20, 50, .35) 55%, transparent 100%); }

/* ข่าวเด่น (ตัวหนังสือทับภาพ) */
.pn-hero { position: relative; display: block; border-radius: 20px; overflow: hidden; background: var(--brand-deep); color: #fff; box-shadow: var(--shadow-md); height: 100%; }
.pn-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.pn-hero:hover img { transform: scale(1.05); }
.pn-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4, 20, 50, .95) 0%, rgba(4, 20, 50, .45) 45%, rgba(4, 20, 50, 0) 75%); }
.pn-hero-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pn-hero-title { font-weight: 700; line-height: 1.35; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pn-hero-lg { min-height: 440px; }
.pn-hero-lg .pn-hero-title { font-size: 1.85rem; }
.pn-hero-lg .pn-hero-body { padding: 30px; }
.pn-hero-sm { min-height: 212px; }
.pn-hero-sm .pn-hero-title { font-size: 1.08rem; }
.pn-hero-excerpt { color: rgba(255, 255, 255, .82); font-size: .95rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pn-hero-meta { font-size: .78rem; color: rgba(255, 255, 255, .75); }
.pn-hero:hover .pn-hero-title { color: #ffe4cc; }

/* รายการย่อ */
.pn-mini-list { display: flex; flex-direction: column; }
.pn-mini { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); color: var(--text); }
.pn-mini:last-child { border-bottom: 0; padding-bottom: 0; }
.pn-mini-thumb { width: 92px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--surface-2); }
.pn-mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pn-mini-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pn-mini-title { font-size: .9rem; font-weight: 500; line-height: 1.45; color: var(--heading); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color .15s; }
.pn-mini:hover .pn-mini-title { color: var(--accent-dark); }
[data-bs-theme="dark"] .pn-mini:hover .pn-mini-title { color: var(--accent); }
.pn-rank { font-size: 1.5rem; font-weight: 700; line-height: 1; width: 26px; text-align: center; flex-shrink: 0; color: transparent; -webkit-text-stroke: 1.5px var(--sky); }
.pn-mini:nth-child(-n+3) .pn-rank { -webkit-text-stroke: 0; color: var(--accent); }

/* ---------- กล่องแถบข้าง ---------- */
.pn-widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.pn-sticky { position: sticky; top: 68px; }
.pn-cat-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pn-cat-pill, .cat-badge-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 5px 13px; border-radius: 999px; font-size: .84rem; font-weight: 500; transition: all .15s; }
.cat-badge-pill { border-left: 3px solid; border-radius: 8px; }
.pn-cat-pill:hover, .cat-badge-pill:hover { background: var(--sky-soft); border-color: var(--sky); color: var(--heading); }
.pn-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.pn-follow { background: linear-gradient(140deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 45%, var(--sky)) 100%); border: 0; color: #fff; }
.pn-follow-title { font-weight: 700; font-size: 1.05rem; }
.pn-follow-title i { color: #ffd9b8; }
.pn-follow-text { font-size: .84rem; color: rgba(255, 255, 255, .8); margin: 4px 0 12px; }
.pn-follow-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pn-follow-btn { background: #fff; color: var(--c); font-weight: 600; font-size: .82rem; padding: 6px 13px; border-radius: 999px; transition: transform .15s; }
.pn-follow-btn:hover { transform: translateY(-2px); color: var(--c); }

/* ---------- โฆษณา ---------- */
.pn-ad { text-align: center; margin-bottom: 20px; }
.pn-ad-label { display: block; font-size: 10px; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.pn-ad img { max-width: 100%; height: auto; border-radius: 12px; }
.pn-ad.mb-0 img { max-height: 220px; width: auto; }
.pn-ad-side { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.pn-ad-html { overflow: hidden; display: flex; justify-content: center; }
.pn-ad-popup img { width: 100%; object-fit: contain; border-radius: 18px; box-shadow: var(--shadow-md); }
.pn-ad-popup .pn-ad-html { background: #fff; border-radius: 18px; padding: 16px; }
.pn-sponsor-label { text-align: center; color: var(--muted); font-size: 10px; letter-spacing: .06em; margin-bottom: 6px; }
.pn-card-ad { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); }
.pn-card-ad .pn-thumb { background: #fff; }
.pn-card-ad .pn-thumb img { object-fit: contain; padding: 6px; }
.pn-card-ad .pn-badge { background: var(--accent); }
.modal-backdrop.show { opacity: .75; }

/* ---------- หน้าอ่านข่าว ---------- */
.pn-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; background: linear-gradient(90deg, var(--sky), var(--accent)); transition: width .1s linear; }
.pn-breadcrumb .breadcrumb { font-size: .84rem; }
.pn-breadcrumb a { color: var(--muted); }
.pn-breadcrumb a:hover { color: var(--accent-dark); }
.pn-article { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 32px; box-shadow: var(--shadow-sm); }
.pn-article-title { font-size: 2.15rem; font-weight: 700; line-height: 1.35; color: var(--heading); margin: 12px 0 14px; }
.pn-lead { font-size: 1.1rem; color: var(--muted); line-height: 1.75; border-left: 4px solid var(--sky); padding-left: 16px; margin-bottom: 20px; }
.pn-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; font-size: .86rem; color: var(--muted); }
.pn-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--sky)); color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.pn-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pn-byline strong { color: var(--heading); font-weight: 600; }
.pn-byline i { color: var(--sky); }
.pn-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pn-tool-btn { height: 34px; min-width: 34px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--heading); font-size: .82rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.pn-tool-btn:hover { border-color: var(--sky); color: var(--sky); }
.pn-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pn-share-btn { height: 38px; padding: 0 16px; border-radius: 999px; border: 0; color: #fff; font-size: .86rem; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; transition: transform .15s, filter .15s; }
.pn-share-btn:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.08); }
.pn-share-fb { background: #1877f2; } .pn-share-x { background: #111; } .pn-share-line { background: #06c755; }
.pn-share-copy { background: var(--surface-2); color: var(--heading); border: 1px solid var(--line); }
.pn-share-copy:hover { color: var(--heading); }
.pn-share-more { background: var(--accent); }
.pn-cover { border-radius: 16px; overflow: hidden; margin-bottom: 24px; background: var(--surface-2); }
.pn-cover img { width: 100%; max-height: 560px; object-fit: cover; display: block; }
.article-content { font-size: var(--article-font, 1.12rem); line-height: 1.95; color: var(--text); overflow-wrap: break-word; }
.article-content p { margin-bottom: 1.4rem; }
.article-content h2, .article-content h3, .article-content h4 { margin: 2rem 0 1rem; font-weight: 700; line-height: 1.45; }
.article-content h2 { font-size: 1.5em; } .article-content h3 { font-size: 1.25em; }
.article-content a { color: var(--brand); text-decoration: underline; text-decoration-color: rgba(var(--sky-rgb), .6); text-underline-offset: 3px; }
[data-bs-theme="dark"] .article-content a { color: #7cc4f5; }
.article-content img { max-width: 100% !important; height: auto !important; border-radius: 14px; margin: 22px auto; display: block; box-shadow: var(--shadow-sm); cursor: zoom-in; }
.article-content iframe, .article-content video { max-width: 100% !important; width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 14px; border: 0; }
.article-content blockquote { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 14px 20px; border-radius: 0 12px 12px 0; margin: 1.6rem 0; color: var(--heading); }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95em; display: block; overflow-x: auto; }
.article-content th, .article-content td { border: 1px solid var(--line); padding: 8px 12px; }
.article-content th { background: var(--surface-2); }
[data-bs-theme="dark"] .article-content [style*="color"] { color: inherit !important; }
[data-bs-theme="dark"] .article-content [style*="background"] { background: transparent !important; }
.pn-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pn-tag { background: var(--sky-soft); color: var(--brand); border-radius: 999px; padding: 5px 14px; font-size: .86rem; font-weight: 500; transition: all .15s; }
[data-bs-theme="dark"] .pn-tag { color: #9fd4f8; }
.pn-tag:hover { background: var(--brand); color: #fff; }
.pn-author-box { display: flex; gap: 16px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.pn-author-box .pn-avatar { width: 58px; height: 58px; font-size: 1.4rem; }
.pn-lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(2, 8, 20, .92); display: none; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.pn-lightbox.show { display: flex; }
.pn-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* ความคิดเห็น */
.pn-comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pn-comment:last-child { border-bottom: 0; }
.pn-comment-name { font-weight: 600; color: var(--heading); }
.pn-comment-time { font-size: .76rem; color: var(--muted); }
.pn-comment-text { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.pn-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- หน้ารายการ (หมวด / ค้นหา / แท็ก) ---------- */
.pn-page-head { background: linear-gradient(120deg, var(--brand-dark) 0%, var(--brand) 50%, color-mix(in srgb, var(--brand) 40%, var(--sky)) 100%); color: #fff; border-radius: 20px; padding: 26px 30px; margin-bottom: 24px; position: relative; overflow: hidden; }
.pn-page-head::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.pn-page-head::before { content: ''; position: absolute; right: 90px; bottom: -110px; width: 200px; height: 200px; border-radius: 50%; background: rgba(var(--accent-rgb), .22); }
.pn-page-head h1 { color: #fff; font-weight: 700; font-size: 1.8rem; margin: 6px 0 4px; position: relative; z-index: 1; }
.pn-page-head p { color: rgba(255, 255, 255, .82); margin: 0; position: relative; z-index: 1; }
.pn-page-head .pn-breadcrumb { position: relative; z-index: 1; }
.pn-page-head .pn-breadcrumb a, .pn-page-head .breadcrumb-item.active, .pn-page-head .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .7); }
.pn-page-head .pn-breadcrumb a:hover { color: #fff; }
.pn-search-lg { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 20px; max-width: 620px; box-shadow: var(--shadow-sm); }
.pn-search-lg:focus-within { border-color: var(--sky); }
.pn-search-lg i { color: var(--muted); font-size: 1.1rem; }
.pn-search-lg input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); font-size: 1rem; min-width: 0; }
.pn-pager .page-link { border: 1px solid var(--line); background: var(--surface); margin: 3px; border-radius: 12px !important; min-width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--heading); }
.pn-pager .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.pn-pager .page-link:hover { border-color: var(--sky); color: var(--sky); }
.pn-pager .page-item.disabled .page-link { opacity: .45; }
.pn-empty { padding: 30px 0; }
.pn-empty-code { font-size: 6rem; font-weight: 700; line-height: 1; background: linear-gradient(135deg, var(--brand), var(--sky) 60%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pn-empty i.display-1 { color: var(--sky); opacity: .4; }
mark { background: rgba(var(--accent-rgb), .22); color: inherit; padding: 0 2px; border-radius: 3px; }

/* ---------- ส่วนท้าย ---------- */
.pn-footer { background: var(--brand-deep); color: rgba(255, 255, 255, .72); margin-top: 48px; position: relative; }
.pn-footer::before { content: ''; display: block; height: 4px; background: linear-gradient(90deg, var(--sky), var(--brand) 40%, var(--accent)); }
.pn-footer h5, .pn-footer h6 { color: #fff; font-weight: 600; }
.pn-footer h6 { font-size: .95rem; margin-bottom: 16px; position: relative; padding-bottom: 10px; }
.pn-footer h6::after { content: ''; position: absolute; left: 0; bottom: 0; width: 32px; height: 3px; border-radius: 3px; background: var(--accent); }
.pn-footer a, .footer-link { color: rgba(255, 255, 255, .72); transition: color .15s, padding-left .15s; }
.pn-footer a:hover, .footer-link:hover { color: #fff !important; }
.pn-footer ul a:hover { padding-left: 4px; }
.pn-footer .pn-logo-name { color: #fff; }
.pn-footer .pn-logo-mark::after { border-color: var(--brand-deep); }
.pn-footer-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .09); display: inline-flex; align-items: center; justify-content: center; color: #fff; margin-right: 6px; }
.pn-footer-social a:hover { background: var(--accent); padding-left: 0; }
.pn-footer-contact i { color: var(--sky); width: 22px; flex-shrink: 0; margin-top: 3px; }
.pn-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; }
.pn-totop { position: fixed; right: 16px; bottom: 88px; z-index: 1035; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 1.2rem; box-shadow: 0 8px 20px rgba(var(--accent-rgb), .4); opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s; }
.pn-totop.show { opacity: 1; visibility: visible; transform: none; }
.pn-totop:hover { background: var(--accent-dark); }
.pn-cookie { position: fixed; left: 16px; right: 16px; bottom: 84px; z-index: 1045; max-width: 720px; margin: 0 auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); padding: 16px 18px; display: none; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .88rem; }
.pn-cookie.show { display: flex; }
.pn-cookie p { margin: 0; flex: 1; min-width: 220px; }
.pn-toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); z-index: 3100; background: var(--brand-deep); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: .9rem; opacity: 0; pointer-events: none; transition: all .25s; box-shadow: var(--shadow-md); }
.pn-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- หน้าเก่าที่ยังใช้ class/สีเดิม: ปรับให้เข้ากับธีมและโหมดมืด ---------- */
.topbar { background: var(--brand-deep); }
[data-bs-theme="dark"] .bg-white, [data-bs-theme="dark"] .card, [data-bs-theme="dark"] .list-group-item, [data-bs-theme="dark"] .modal-content:not(.bg-transparent),
[data-bs-theme="dark"] [style*="background:#fff"], [data-bs-theme="dark"] [style*="background: #fff"], [data-bs-theme="dark"] [style*="background-color: #fff"] { background-color: var(--surface) !important; color: var(--text); }
[data-bs-theme="dark"] .bg-light, [data-bs-theme="dark"] .btn-light, [data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] [style*="background:#f8fafc"], [data-bs-theme="dark"] [style*="background:#f1f5f9"], [data-bs-theme="dark"] [style*="background: #f8fafc"] { background-color: var(--surface-2) !important; color: var(--text) !important; border-color: var(--line) !important; }
[data-bs-theme="dark"] .text-dark, [data-bs-theme="dark"] [style*="color:#0b3b8c"], [data-bs-theme="dark"] [style*="color: #0b3b8c"],
[data-bs-theme="dark"] [style*="color:#1e293b"], [data-bs-theme="dark"] [style*="color: #1a1a1a"], [data-bs-theme="dark"] [style*="color: #333"] { color: var(--heading) !important; }
[data-bs-theme="dark"] .text-muted { color: var(--muted) !important; }
[data-bs-theme="dark"] .border, [data-bs-theme="dark"] .border-top, [data-bs-theme="dark"] .border-bottom, [data-bs-theme="dark"] [style*="solid #e2e8f0"] { border-color: var(--line) !important; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: var(--surface-2); border-color: var(--line); color: var(--text); }

/* ---------- จอเล็ก ---------- */
@media (max-width: 991.98px) {
    .pn-hero-lg { min-height: 300px; }
    .pn-hero-lg .pn-hero-title { font-size: 1.3rem; }
    .pn-hero-lg .pn-hero-body { padding: 18px; }
    .pn-hero-sm { min-height: 170px; }
    .pn-hero-sm .pn-hero-title { font-size: .95rem; }
    .pn-hero-sm .pn-hero-body { padding: 14px; }
    .pn-article { padding: 18px 16px; border-radius: 16px; }
    .pn-article-title { font-size: 1.5rem; }
    .pn-lead { font-size: 1rem; }
    .pn-page-head { padding: 20px; border-radius: 16px; }
    .pn-page-head h1 { font-size: 1.4rem; }
    .pn-sticky { position: static; }
    .pn-footer { margin-top: 32px; }
}
@media (max-width: 575.98px) {
    .pn-card-body { padding: 10px 12px; }
    .pn-title { font-size: .9rem; }
    .pn-meta { font-size: .7rem; }
    .pn-section-title { font-size: 1.12rem; }
    .pn-tools { margin-left: 0; width: 100%; }
    .pn-share-btn span { display: none; }
    .pn-share-btn { padding: 0 13px; }
}
@media (min-width: 992px) {
    .pn-totop { bottom: 24px; right: 24px; }
    .pn-cookie { bottom: 24px; }
    .pn-toast { bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .ticker-inner, .pn-ticker-inner { animation: none; white-space: normal; }
}
@media print {
    .pn-topbar, .pn-masthead, .pn-nav, .pn-mobile-top, .pn-bottom-nav, .pn-footer, .pn-ad, .pn-share, .pn-tools, .pn-totop, .pn-cookie, aside, .pn-comments, .pn-related { display: none !important; }
    body { background: #fff; }
    .pn-article { border: 0; box-shadow: none; padding: 0; }
}
