/* test-home — ส่วนแสดงข่าวจากระบบประชาสัมพันธ์ V2 (เพิ่มจากสไตล์ของ pages/home) */

.pn2-testbar {
    background: #fff7e6;
    border-bottom: 2px solid #f59e0b;
    color: #92400e;
    text-align: center;
    padding: 6px 12px;
    font-size: 14px;
}

/* ข่าวเด่น (carousel): รูปสัดส่วน 16:9 ตรงกับรูปปกที่ระบบบังคับ */
.pn2-featured { border-radius: 14px; overflow: hidden; box-shadow: 0 8px 28px rgba(15, 23, 42, .15); background: #0f172a; }
.pn2-featured a { color: #fff; text-decoration: none; display: block; position: relative; }
.pn2-featured-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #1e293b; }
.pn2-featured-noimg { background: linear-gradient(135deg, #003c71, #0b5ca8); }
.pn2-featured-cap {
    left: 0; right: 0; bottom: 0; padding: 48px 56px 22px; text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
}
.pn2-featured-cap small { opacity: .9; }
.pn2-featured-cap h3 { color: #fff; font-size: 1.5rem; margin: 4px 0 0; line-height: 1.35; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.pn2-featured .carousel-indicators { margin-bottom: 4px; }

/* การ์ดข่าว */
.pn2-card { display: block; height: 100%; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.pn2-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .12); color: inherit; text-decoration: none; }
.pn2-card-media { position: relative; background: #e2e8f0; }
.pn2-card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.pn2-card-noimg { display: flex; align-items: center; justify-content: center; font-size: 42px; color: #94a3b8; }
.pn2-pin { position: absolute; top: 8px; left: 8px; background: #0ea5e9; color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.pn2-card-body { padding: 12px 14px 16px; }
.pn2-card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: #64748b; margin-bottom: 4px; }
.pn2-card-title { font-size: 1.05rem; font-weight: 600; line-height: 1.4; color: #003c71; margin: 0 0 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pn2-card-sum { font-size: .9rem; color: #475569; margin: 0; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 767px) {
    .pn2-featured-cap { padding: 28px 16px 14px; }
    .pn2-featured-cap h3 { font-size: 1.05rem; }
}

/* สไลด์จากระบบ V2: ไม่ให้ใหญ่เกินจอ — จำกัดความกว้าง (รูป 16:9 สูงราว 430px) และจัดกึ่งกลาง ให้เห็นหัวข้อข่าวด้านล่างโดยไม่ต้องเลื่อนมาก */
#pn2_slide_show { max-width: 820px; margin: 0 auto 8px; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 20px rgba(15, 23, 42, .15); background: #0f172a; }
#pn2_slide_show .carousel-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; max-height: 60vh; }
#pn2_slide_show .carousel-indicators { margin-bottom: 6px; }
@media (max-width: 767px) { #pn2_slide_show { border-radius: 8px; } }

/* แท็บหัวข้อข่าว: แถวเดียวเสมอ (เลื่อนแนวนอนได้ถ้าจอแคบ) รูปแบบเหมือนหน้าแรก psu.ac.th — กล่องเม็ดยาสีอ่อน ตัวที่เลือกเป็นเม็ดฟ้าอ่อน */
.pn2-tabs-wrap { display: flex; justify-content: center; margin: 26px 0 8px; }
#pn2Tab {
    display: inline-flex; flex-wrap: nowrap; gap: 4px; padding: 6px; margin: 0; border: 0; max-width: 100%;
    background: #eef2f8; border-radius: 999px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
#pn2Tab::-webkit-scrollbar { display: none; }
#pn2Tab .nav-item { flex: 0 0 auto; }
#pn2Tab .nav-link {
    padding: 8px 22px; border-radius: 999px; background: transparent; color: #4b5563; font-weight: 500; font-size: 1rem; line-height: 1.3;
    border: 0; white-space: nowrap; transition: background .15s, color .15s;
}
#pn2Tab .nav-link:hover { background: rgba(255, 255, 255, .7); color: #0b3c71; }
#pn2Tab .nav-link.active, #pn2Tab .show > .nav-link { background: #cfe3f5; color: #0b3c71; font-weight: 700; box-shadow: none; }
@media (max-width: 575px) { .pn2-tabs-wrap { justify-content: flex-start; } #pn2Tab .nav-link { padding: 7px 16px; font-size: .95rem; } }

/* ปุ่ม "ดูข่าวทั้งหมด" */
.pn2-all-btn { display: inline-block; padding: 9px 30px; border: 1px solid #0b5ca8; border-radius: 999px; color: #0b5ca8; font-weight: 600; text-decoration: none; transition: all .15s; }
.pn2-all-btn:hover { background: #0b5ca8; color: #fff; text-decoration: none; }

/* ส่วนหัวหน้าแรกจากระบบประชาสัมพันธ์ V2 (ภาพนิ่ง / GIF / สไลด์) */
.pn2-hero .pn2-hero-img { display: block; width: 100%; height: auto; }
.pn2-hero .pn2-hero-link { display: block; }
.pn2-hero-slides { position: relative; overflow: hidden; }
.pn2-hero-slides .pn2-hs { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .8s ease; }
.pn2-hero-slides .pn2-hs + .pn2-hs { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.pn2-hero-slides .pn2-hs.on { opacity: 1; }

/* ป้ายมิติความยั่งยืน (หน้า PSUPN-SDG / subsdg) */
.pn2-dims { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pn2-dim { font-size: 12px; color: #003c71; background: #e8f0f8; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pn2-dim i { margin-right: 3px; }

/* การ์ดทั้งใบคลิกได้ (stretched link) · ไอคอน SDG เป็นลิงก์ของตัวเอง */
.pn2-card { position: relative; }
.pn2-card-link { color: inherit; text-decoration: none; }
.pn2-card-link:hover { color: inherit; text-decoration: none; }
.pn2-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pn2-sdgs a.pn2-sdg-link { position: relative; z-index: 2; display: inline-block; }
.pn2-sdgs a.pn2-sdg-link:hover img { transform: scale(1.12); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.pn2-sdgs img { transition: transform .15s, box-shadow .15s; }

/* ป้ายมิติเป็นลิงก์ → หน้า subsdg (อยู่เหนือ stretched link ของการ์ด) */
a.pn2-dim { position: relative; z-index: 2; text-decoration: none; transition: background .15s, color .15s; }
a.pn2-dim:hover { background: #003c71; color: #fff; text-decoration: none; }
