/*
 * feed.css — หน้าแรกแบบมินิมอล เน้นรูป (body.feed-grid) 2026-10-13 · โหลดหลัง toon.css
 *   - live/hello.php: ข่าวเด่นรูปใหญ่ + น้องบอททักทาย (แทนที่กระทู้น่าสนใจเดิม)
 *   - ฟีดรูป index_core.js renderPhotoGrid: การ์ดรูปทั้งหน้า ซ่อนคอลัมน์ซ้าย/ขวา
 *   - สีแหล่งที่มา (--src): ข่าว = มิ้นต์ · Facebook = ฟ้า FB · กระทู้ = ส้ม · มาแรง = ม่วง · สกู๊ป = ทอง
 * ปิด: ลบ <link feed.css> + class feed-grid ใน index.php · แก้แล้วเพิ่ม ?v= (Cloudflare cache)
 */
:root {
    --src-news:  #8fdcc6;
    --src-fb:    #6ea0f0;
    --src-forum: #ffa86b;
    --src-trend: #bdb5f5;
    --src-scoop: #e8c766;
    --pg-ink: #0c0f1c;
}
[data-src="news"]  { --src: var(--src-news); }
[data-src="fb"]    { --src: var(--src-fb); }
[data-src="forum"] { --src: var(--src-forum); }
[data-src="trend"] { --src: var(--src-trend); }
[data-src="scoop"] { --src: var(--src-scoop); }

/* ───────── ซ่อนของรก: คอลัมน์ข้าง (สถิติ/แฮชแท็ก/การ์ด VIP ซ้ำ) ───────── */
.feed-grid .left-sidebar, .feed-grid .right-sidebar { display: none !important; }
.feed-grid .main-content { display: block !important; }
.feed-grid .center-main { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; min-height: 0 !important; }
.feed-grid .content-wrapper { padding-top: 4px !important; }

/* ═════════ ส่วนบนสุด: ข่าวเด่น + ทักทาย ═════════ */
.hl-hello { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 18px; margin: 10px 0 26px; font-family: 'Sarabun', 'Noto Sans Thai', sans-serif; }
.hl-hero {
    position: relative; display: block; min-height: 380px; border-radius: 22px; overflow: hidden; text-decoration: none !important;
    border: 2px solid var(--pg-ink); box-shadow: 0 6px 0 var(--pg-ink); background: #11152a; isolation: isolate;
    transition: transform .2s cubic-bezier(.3, 1.5, .5, 1), box-shadow .2s;
}
.hl-hero:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--pg-ink); }
.hl-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .6s ease; }
.hl-hero:hover > img { transform: scale(1.04); }
.hl-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 13, 26, 0) 35%, rgba(10, 13, 26, .78) 70%, rgba(10, 13, 26, .96)); }
.hl-hero.hl-noimg { display: none; }
.hl-hero-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; }
.hl-kicker { font-size: .82rem; font-weight: 800; color: var(--src); letter-spacing: .02em; }
.hl-hero-t { font-size: clamp(1.35rem, 2.1vw, 2rem); font-weight: 800; line-height: 1.3; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hl-hero-x { font-size: .98rem; color: rgba(236, 234, 244, .82); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ป้ายแหล่งที่มา (ใช้ทั้ง hero และการ์ดฟีด) */
.hl-chip, .pg-chip {
    position: absolute; top: 12px; left: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 24px);
    padding: 4px 11px 4px 5px; border-radius: 999px; background: var(--src); color: #141829; font-weight: 800; font-size: .8rem; line-height: 1.2;
    border: 2px solid var(--pg-ink); box-shadow: 2px 3px 0 var(--pg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hl-chip { padding-left: 11px; font-size: .86rem; }
.pg-chip i { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #141829; color: var(--src);
    font-style: normal; font-size: .72rem; font-weight: 900; flex-shrink: 0; }
[data-src="fb"] .pg-chip i { font-family: Arial, sans-serif; font-size: .85rem; }

/* กล่องทักทาย */
.hl-greet { display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 16px; border-radius: 22px; background: var(--sf-card, #232a3e);
    border: 2px solid var(--pg-ink); box-shadow: 0 6px 0 var(--pg-ink); border-top: 7px solid var(--sf-butter, #f6d98e); min-width: 0; }
.hl-greet-top { display: flex; align-items: center; gap: 12px; }
.hl-bot { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(2px 4px 0 var(--pg-ink)); animation: hlWave 3s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes hlWave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg) translateY(-3px); } }
.hl-hi { font-size: 1.45rem; font-weight: 800; color: var(--sf-butter, #f6d98e); line-height: 1.25; text-shadow: 0 3px 0 var(--pg-ink); }
.hl-sub { font-size: .92rem; color: var(--sf-mute, #9196ad); }
/* 👑 VIP วันนี้มีอะไรใหม่ (live/hello.php) — แถบทอง */
.hl-vipnew { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 12px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(253, 230, 138, .16), rgba(245, 158, 11, .06)); border: 1px solid rgba(245, 190, 70, .45); }
.hl-vipnew::after { content: ''; position: absolute; top: 0; bottom: 0; width: 30%; left: -40%; transform: skewX(-20deg); pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .14), transparent); animation: hlGoldShine 4.5s ease-in-out infinite; }
@keyframes hlGoldShine { 0%, 55% { left: -40%; } 85%, 100% { left: 120%; } }
.hl-vipnew-h { font-size: .8rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; color: #3b2600; background: linear-gradient(135deg, #fde68a, #f59e0b); }
.hl-vipnew a { font-size: .84rem; color: #fde9b0 !important; text-decoration: none !important; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .18); transition: background .2s; }
.hl-vipnew a:hover { background: rgba(245, 158, 11, .25); }
.hl-vipnew a b { color: #fff; }
.hl-vipnew a i { color: #f5c542; }
@media (prefers-reduced-motion: reduce) { .hl-vipnew::after { animation: none; } }
/* ตัวเลขสดวันนี้ (live/hello.php + live/now.php) */
.hl-now { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hl-n { display: flex; flex-direction: column; justify-content: center; padding: 9px 10px; border-radius: 14px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .07); min-width: 0; }
.hl-n small { font-size: .74rem; color: var(--sf-mute, #9196ad); white-space: nowrap; }
.hl-n b { font-size: 1.35rem; line-height: 1.15; color: var(--sf-ink, #eceaf4); font-variant-numeric: tabular-nums; display: inline-block; }
.hl-n em { font-style: normal; font-size: .76rem; font-weight: 800; }
.hl-n em.up { color: #4ade80; } .hl-n em.down { color: #f87171; }
.hl-on { flex-direction: row; align-items: center; gap: 6px; font-size: .8rem; color: #86efac; flex-wrap: wrap; }
.hl-on b { color: #86efac; }
.hl-on i { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; animation: hlPulse 2s infinite; flex-shrink: 0; }
@keyframes hlPulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } }
.hl-bump { animation: hlBump .6s ease; }
@keyframes hlBump { 40% { transform: scale(1.18); color: var(--sf-butter, #f6d98e); } }
.hl-note { grid-column: 1 / -1; font-size: .72rem; color: var(--sf-mute, #9196ad); opacity: .8; }
@media (max-width: 520px) { .hl-now { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .hl-on i, .hl-bump { animation: none; } }
.hl-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .95rem; color: var(--sf-ink-2, #c9cbdb); }
.hl-lines li { padding: 7px 11px; border-radius: 12px; background: rgba(255, 255, 255, .035); }
.hl-lines b { color: var(--sf-ink, #eceaf4); }
.hl-lines a { color: var(--sf-lav, #bdb5f5); font-weight: 700; }
.hl-tops-h { font-size: .88rem; font-weight: 800; color: var(--sf-sakura, #f5b5c8); margin-top: 2px; }
.hl-tops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.hl-top-img.hl-ph img { object-fit: contain !important; padding: 8px; background: linear-gradient(135deg, #2a3249, #1b2033); }
.hl-top { display: flex; flex-direction: column; gap: 4px; text-decoration: none !important; min-width: 0; }
.hl-top-img { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; border: 2px solid var(--pg-ink); }
.hl-top-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.hl-top:hover .hl-top-img img { transform: scale(1.08); }
.hl-top-img b { position: absolute; top: 5px; left: 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--sf-sakura, #f5b5c8); color: #141829;
    font-size: .78rem; display: flex; align-items: center; justify-content: center; border: 2px solid var(--pg-ink); }
.hl-fbdot { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; background: var(--src-fb); color: #fff; font: 900 .8rem Arial, sans-serif;
    display: flex; align-items: center; justify-content: center; border: 2px solid var(--pg-ink); }
.hl-top-t { font-size: .8rem; line-height: 1.35; color: var(--sf-ink, #eceaf4); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hl-top-v { font-size: .72rem; color: var(--sf-mute, #9196ad); }

/* ═════════ แถบสี / ตัวกรอง ═════════ */
.pg-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.pg-legend button {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; cursor: pointer; font: 700 .9rem 'Sarabun', sans-serif;
    background: var(--sf-card, #232a3e); color: var(--sf-ink-2, #c9cbdb); border: 2px solid var(--pg-ink); box-shadow: 0 3px 0 var(--pg-ink); transition: transform .12s;
}
.pg-legend button:hover { transform: translateY(-2px); }
.pg-legend button i { width: 12px; height: 12px; border-radius: 50%; background: var(--src); border: 2px solid var(--pg-ink); }
.pg-legend button b { font-size: .78rem; color: var(--sf-mute, #9196ad); }
.pg-legend button.on { background: var(--src, var(--sf-ink, #eceaf4)); color: #141829; }
.pg-legend button.on b { color: #141829; opacity: .7; }

/* ═════════ ฟีดรูป ═════════ */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); grid-auto-flow: dense; gap: 18px; }
.pg-feed[data-filter] .pg-big, .pg-feed[data-filter] .pg-wide { grid-column: auto; grid-row: auto; }
.pg-feed[data-filter] .pg-vip { display: none; }
.pg-grid[data-filter="news"]  .pg-card:not([data-src="news"]),
.pg-grid[data-filter="fb"]    .pg-card:not([data-src="fb"]),
.pg-feed[data-filter="forum"] .pg-card:not([data-src="forum"]),
.pg-feed[data-filter="trend"] .pg-card:not([data-src="trend"]),
.pg-feed[data-filter="scoop"] .pg-card:not([data-src="scoop"]) { display: none; }

.pg-card {
    position: relative; display: flex; flex-direction: column; min-width: 0; cursor: pointer; overflow: hidden;
    background: var(--sf-card, #232a3e); border-radius: 18px; border: 2px solid var(--pg-ink); border-top: 6px solid var(--src, var(--sf-mint));
    box-shadow: 0 5px 0 var(--pg-ink); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .18s;
    animation: pgIn .45s ease both;
}
@keyframes pgIn { from { opacity: 0; transform: translateY(10px); } }
.pg-card:hover { transform: translateY(-4px); box-shadow: 0 9px 0 var(--pg-ink); }
.pg-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #141829; }
.pg-img > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.pg-card:hover .pg-img > img { transform: scale(1.06); }
.pg-new { position: absolute; bottom: 10px; right: 10px; z-index: 3; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: .74rem;
    background: var(--sf-sakura, #f5b5c8); color: #141829; border: 2px solid var(--pg-ink); }
.pg-new-hot { background: #ff6b6b; color: #fff; animation: pgBlink 1.2s ease-in-out infinite; }
@keyframes pgBlink { 50% { transform: scale(1.08); } }
.pg-img .fbg-sticker { top: auto !important; bottom: 10px; left: 10px; right: auto !important; }

.pg-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; flex: 1; }
.pg-t { margin: 0; font-size: 1.04rem; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pg-t a { color: var(--sf-ink, #eceaf4) !important; text-decoration: none !important; }
.pg-card:hover .pg-t a { color: var(--src) !important; }
.pg-x { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--sf-ink-2, #c9cbdb); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pg-meta { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .78rem; color: var(--sf-mute, #9196ad); }
.pg-tag { color: var(--cat, var(--sf-mint)); font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-src="forum"] .pg-tag { color: var(--src-forum); }

/* การ์ดใหญ่ใบแรก + การ์ดกว้างคั่นจังหวะ */
.pg-big { grid-column: span 2; grid-row: span 2; }
.pg-big .pg-img { aspect-ratio: auto; flex: 1; min-height: 300px; }
.pg-big .pg-t { font-size: clamp(1.3rem, 1.7vw, 1.65rem); line-height: 1.35; }
.pg-big .pg-chip { font-size: .9rem; }
.pg-wide { grid-column: span 2; flex-direction: row; }
.pg-wide .pg-img { aspect-ratio: auto; flex: 0 0 55%; min-height: 220px; }
.pg-wide .pg-t { font-size: 1.2rem; }

/* VIP ไทล์ */
.pg-vip { --src: var(--src-scoop); text-decoration: none !important; background: linear-gradient(180deg, #3a2c4a, #2a2238); }
.pg-vip .pg-img { display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(232, 199, 102, .35), transparent 70%); }
.pg-vip .pg-img > img { width: 62%; height: 80%; object-fit: contain; filter: drop-shadow(3px 5px 0 var(--pg-ink)); }
.pg-vip .pg-t { color: var(--src-scoop); font-size: 1.2rem; }
.pg-vip-btn { margin-top: auto; align-self: flex-start; padding: 6px 16px; border-radius: 999px; background: var(--src-scoop); color: #141829; font-weight: 800; border: 2px solid var(--pg-ink); }

#paginationBar { flex-wrap: wrap; }

/* ═════════ จอเล็ก ═════════ */
@media (max-width: 1100px) {
    .hl-hello { grid-template-columns: 1fr; }
    .hl-hero { min-height: 320px; }
}
@media (max-width: 768px) {
    .hl-hello { gap: 14px; margin-top: 6px; }
    .hl-hero { min-height: 360px; border-radius: 18px; }
    .hl-hero-body { padding: 16px; }
    .hl-greet { padding: 14px; }
    .hl-bot { width: 56px; height: 56px; }
    .hl-hi { font-size: 1.2rem; }
    .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .pg-big, .pg-wide { grid-column: span 2; grid-row: auto; }
    .pg-wide { flex-direction: column; }
    .pg-wide .pg-img, .pg-big .pg-img { aspect-ratio: 16 / 10; min-height: 0; flex: none; }
    .pg-body { padding: 10px 11px 12px; gap: 6px; }
    .pg-t { font-size: .95rem; }
    .pg-chip { font-size: .72rem; top: 8px; left: 8px; }
    .pg-legend { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
    .pg-legend button { flex-shrink: 0; font-size: .85rem; }
}
@media (max-width: 420px) {
    .pg-grid { grid-template-columns: 1fr; }
    .pg-big, .pg-wide { grid-column: auto; }
    .pg-t { font-size: 1.02rem; }
}

/* ═════════ มุมมองผสม (2026-10-13): กริด / นิตยสาร / แถบเลื่อน / รายการรูปเล็ก ═════════ */
.pg-views { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 0 2px 10px; font: 700 .8rem 'Sarabun', sans-serif; color: var(--sf-mute, #9196ad); }
.pg-views button { padding: 4px 12px; border-radius: 999px; cursor: pointer; font: 700 .8rem 'Sarabun', sans-serif; color: var(--sf-ink-2, #c9cbdb);
    background: var(--sf-card, #232a3e); border: 2px solid var(--pg-ink); box-shadow: 0 2px 0 var(--pg-ink); transition: transform .12s; }
.pg-views button:hover { transform: translateY(-2px); }
.pg-views button.on { background: var(--sf-butter, #f6d98e); color: #141829; }
.pg-block { margin-bottom: 26px; }
.pg-srcname { display: none; font-weight: 800; color: var(--src); }
.pg-sec-h { font-size: 1.1rem; font-weight: 800; color: var(--sf-ink, #eceaf4); margin: 0 2px 10px; }
.pg-sec-h small { font-size: .78rem; font-weight: 600; color: var(--sf-mute, #9196ad); margin-left: 6px; }

/* นิตยสาร: ใหญ่ 1 + รายการ 4 */
.pg-mag { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
.pg-mag-flip .pg-mag-main { order: 2; }
.pg-mag-main .pg-img { aspect-ratio: 16 / 9; }
.pg-mag-main .pg-t { font-size: clamp(1.25rem, 1.6vw, 1.55rem); line-height: 1.35; }

/* แถวรูปเล็ก (หน้าตาแบบคอลัมน์ข้างเดิม) */
.pg-list { display: flex; flex-direction: column; gap: 12px; }
.pg-list-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.pg-row { flex-direction: row; border-top-width: 2px; border-left: 6px solid var(--src); box-shadow: 0 3px 0 var(--pg-ink); border-radius: 14px; }
.pg-row:hover { box-shadow: 0 6px 0 var(--pg-ink); }
.pg-row .pg-img { flex: 0 0 140px; aspect-ratio: 4 / 3; }
.pg-row .pg-chip, .pg-row .pg-new, .pg-row .fbg-sticker { display: none; }
.pg-row .pg-srcname { display: inline; }
.pg-row .pg-body { padding: 9px 12px; gap: 5px; }
.pg-row .pg-t { font-size: .95rem; -webkit-line-clamp: 2; }
.pg-row .pg-tag { display: none; }
.pg-mag .pg-list .pg-row { flex: 1; }

/* แถบเลื่อนข้าง: การ์ดแนวตั้งรูปสูง */
.pg-strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 12px; scrollbar-width: thin; }
.pg-tall { flex: 0 0 230px; scroll-snap-align: start; }
.pg-tall .pg-img { aspect-ratio: 3 / 4; }
.pg-tall .pg-body { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, transparent, rgba(12, 15, 28, .92) 35%); padding-top: 34px; }
.pg-tall .pg-t a { color: #fff !important; }
.pg-tall .pg-meta .pg-tag { display: none; }
.pg-tall .pg-new { bottom: auto; top: 12px; right: 10px; }

@media (max-width: 900px) {
    .pg-mag { grid-template-columns: 1fr; }
    .pg-mag-flip .pg-mag-main { order: 0; }
}
@media (max-width: 768px) {
    .pg-views { justify-content: flex-start; overflow-x: auto; }
    .pg-list-cols { grid-template-columns: 1fr; }
    .pg-row .pg-img { flex-basis: 112px; }
    .pg-tall { flex-basis: 62%; }
}.pg-block[hidden] { display: none !important; }

/* ═════════ โทนเบา (2026-10-13 ผู้ใช้: "เหลือสีอีกนิดหน่อยเท่านั้น") — สีแหล่งที่มาเหลือแค่จุด + เส้นบาง ═════════ */
.pg-card { border-top: 3px solid color-mix(in srgb, var(--src, #8fdcc6) 70%, transparent); box-shadow: 0 3px 0 var(--pg-ink); }
.pg-card:hover { box-shadow: 0 6px 0 var(--pg-ink); }
.pg-chip, .hl-chip { background: rgba(14, 17, 32, .78); color: #eceaf4; border: 1px solid rgba(255, 255, 255, .14); box-shadow: none;
    backdrop-filter: blur(6px); font-weight: 700; padding: 3px 10px 3px 4px; }
.hl-chip { padding-left: 10px; }
.hl-chip::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--src); }
.pg-chip i { width: 16px; height: 16px; background: var(--src); color: #141829; font-size: .6rem; }
.pg-card:hover .pg-t a { color: #fff !important; }
.pg-tag, [data-src="forum"] .pg-tag { color: var(--sf-mute, #9196ad); font-weight: 600; }
.pg-new { background: rgba(14, 17, 32, .78); color: #f5b5c8; border: 1px solid rgba(245, 181, 200, .5); }
.pg-new-hot { background: #e85d6c; color: #fff; border-color: transparent; }
.pg-row { border-top-width: 2px; border-top-color: var(--pg-ink); border-left: 3px solid color-mix(in srgb, var(--src) 70%, transparent); }
.pg-srcname { color: color-mix(in srgb, var(--src) 80%, #eceaf4); font-weight: 700; }
.pg-legend button { box-shadow: none; border-width: 1px; border-color: rgba(255, 255, 255, .1); font-weight: 600; }
.pg-legend button.on { background: #eceaf4; color: #141829; }
.pg-legend button.on i { border-color: #141829; }
.hl-kicker { color: var(--sf-ink-2, #c9cbdb); }
.hl-greet { border-top: 3px solid var(--sf-butter, #f6d98e); box-shadow: 0 3px 0 var(--pg-ink); }
.hl-hero { box-shadow: 0 3px 0 var(--pg-ink); }
.hl-hi { text-shadow: none; }
.hl-lines a { color: var(--sf-ink, #eceaf4); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .3); }
.hl-tops-h { color: var(--sf-ink-2, #c9cbdb); }
.pg-vip { background: var(--sf-card, #232a3e); }
.pg-views button { box-shadow: none; border-width: 1px; border-color: rgba(255, 255, 255, .1); }
.pg-views button.on { background: #eceaf4; }
/* ข่าวเด่นรูปเสีย → ซ่อน ให้กล่องทักทายเต็มแถว (รูปคนอ่านเยอะ 3 รูปเรียงยาว) */
.hl-solo { grid-template-columns: 1fr; }
.hl-solo .hl-hero { display: none; }
.hl-solo .hl-greet { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); column-gap: 22px; align-items: start; }
.hl-solo .hl-greet-top, .hl-solo .hl-lines { grid-column: 1; }
.hl-solo .hl-tops-h { grid-column: 2; grid-row: 1; }
.hl-solo .hl-tops { grid-column: 2; grid-row: 2 / span 2; }
@media (max-width: 900px) { .hl-solo .hl-greet { display: flex; } }

/* ═════════ เต็มจอคอม (2026-10-14 ผู้ใช้: "พื้นที่ว่าง ... เอาให้เต็มพอดีคอม") ═════════ */
.pg-row .pg-x { display: none; }
/* แถบ "มาแรงตอนนี้" เดิมกว้างสุด 1200px ลอยกลาง → เต็มแถว */
.pg-home .trending-ribbon { max-width: none; }
/* แถบเลื่อน: การ์ดยืดเต็มแถว (เดิมกว้างตายตัว 230px เหลือที่ว่างขวา) สูงคงที่แทนอัตราส่วน */
.pg-tall { flex: 1 0 230px; }
@media (min-width: 769px) {
    .pg-tall .pg-img { aspect-ratio: auto; height: 320px; }
}
@media (min-width: 901px) {
    /* นิตยสาร: แถวข้างถูกยืดสูงเท่าข่าวใหญ่ → รูปเต็มความสูง + คำโปรย แทนช่องว่าง */
    .pg-mag .pg-list .pg-row .pg-img { flex: 0 0 40%; aspect-ratio: auto; min-height: 120px; }
    .pg-mag .pg-list .pg-row .pg-t { font-size: 1.02rem; -webkit-line-clamp: 3; }
    .pg-mag .pg-list .pg-row .pg-x { display: -webkit-box; -webkit-line-clamp: 3; font-size: .88rem; }
    .pg-mag .pg-list .pg-row .pg-body { padding: 12px 14px; gap: 6px; }
}
/* การ์ดใหญ่: รูปกินพื้นที่ที่เหลือ ไม่ให้ใต้ข้อความว่าง */
.pg-big .pg-body { flex: 0 0 auto; }
/* การ์ดที่ถูกขยายเติมท้ายแถว (pgFillRows ใน index_core.js) */
.pg-fill.pg-wide .pg-img { min-height: 200px; }
@media (min-width: 769px) {
    /* การ์ดกว้าง: รูปไม่กำหนดความสูงเอง (เดิมรูปทรงสูงดันการ์ดสูง 300–700px) → สูงตามข้อความ อย่างน้อย 200–220px */
    .pg-wide .pg-img > img { position: absolute; inset: 0; }
    .pg-fill.pg-wide .pg-img { flex-basis: 45%; }
}
@media (min-width: 901px) {
    /* นิตยสาร: ข่าวใหญ่ถูกยืดสูงเท่าคอลัมน์ข้าง → รูปยืดกินที่ว่าง ข้อความชิดล่าง */
    .pg-mag-main .pg-img { aspect-ratio: auto; flex: 1 1 auto; min-height: 280px; }
    .pg-mag-main .pg-img > img { position: absolute; inset: 0; }
    .pg-mag-main .pg-body { flex: 0 0 auto; }
}
/* ส่วนชุมชนท้ายหน้า (part2.php / app.php) เดิมกว้างสุด 1100–1200px */
.pg-home .forum-communities-grid, .pg-home .apps-container { max-width: none; }
@media (min-width: 1101px) {
    .pg-home .apps-container { grid-template-columns: repeat(9, 1fr); }
    .pg-home .forum-regular-communities { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1700px) {
    .pg-home .apps-container { grid-template-columns: repeat(18, 1fr); }
    .pg-home .forum-regular-communities { grid-template-columns: repeat(6, 1fr); }
}

/* ── 2026-10-14 บนสุดหน้าแรก: เทรนด์วันนี้ (ซ้าย) + กล่องทักทาย/เมื่อวาน (ขวา) — index.php .top-split · live/hello.php $hlPart ── */
.top-split { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; align-items: stretch; margin: 4px 0 18px; }
.top-split > .th-wrap { max-width: none; margin: 0; }
.top-split > .hl-side { display: flex; margin: 0; }
.top-split > .hl-side .hl-greet { flex: 1; }
.hl-heroonly { grid-template-columns: 1fr; }
.hl-heroonly .hl-hero { min-height: 340px; }
/* 2026-10-15 ผู้ใช้: "ข่าวเด่นยาวใหญ่ไป แบ่ง 2–3 ตอน" → ข่าวใหญ่ 1 (ซ้าย) + ข่าวเล็ก 2 (ขวา ซ้อนกัน) · มือถือเลื่อนซ้ายขวา */
.hl-heros { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-rows: 1fr 1fr; gap: 14px; }
.hl-heros.n1 { grid-template-columns: 1fr; grid-template-rows: auto; }
.hl-heros.n2 { grid-template-rows: auto; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.hl-heros > .hl-hero:first-child { grid-row: span 2; }
.hl-heros.n2 > .hl-hero:first-child { grid-row: auto; }
.hl-heroonly .hl-heros .hl-hero { min-height: 0; }
.hl-heroonly .hl-heros > .hl-hero:first-child { min-height: 360px; }
.hl-heros .hl-sub { min-height: 173px; border-radius: 18px; }
.hl-heros .hl-sub .hl-hero-body { padding: 14px 16px; gap: 4px; }
.hl-heros .hl-sub .hl-hero-t { font-size: clamp(1rem, 1.3vw, 1.18rem); -webkit-line-clamp: 2; }
.hl-heros .hl-sub .hl-hero-x { font-size: .82rem; -webkit-line-clamp: 1; }
.hl-heros .hl-sub .hl-chip { font-size: .7rem; }
@media (max-width: 760px) {
    .hl-heros { grid-template-columns: none; grid-template-rows: none; grid-auto-flow: column; grid-auto-columns: 86%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .hl-heros::-webkit-scrollbar { display: none; }
    .hl-heros > .hl-hero { grid-row: auto !important; scroll-snap-align: start; min-height: 300px !important; }
    .hl-heros .hl-sub .hl-hero-t { font-size: 1.15rem; -webkit-line-clamp: 3; }
}
@media (max-width: 1250px) { .top-split { grid-template-columns: 1fr; } }
/* การ์ดเทรนด์แคบลงเมื่ออยู่ข้างกล่องทักทาย: แถว "จาก/ใช้กับ" ขึ้นบรรทัดได้ ไม่ทับกัน · ย่อโลโก้/ช่องไฟ */
.top-split .th-src { flex-wrap: wrap; row-gap: 3px; }
.top-split .th-app { width: 17px; height: 17px; font-size: .6rem; }
.top-split .th-col { padding: 9px; }
.top-split .th-ch h3 { font-size: .9rem; }
.top-split .th-row img.th-clip { width: 26px; height: 40px; }
.top-split .th-row img, .top-split .th-ph, .top-split .th-ico { width: 32px; height: 32px; }
.top-split .th-vipk { padding: 3px 9px; font-size: .72rem; }
