/* =====================================================
   News Page Styles — INFINITY X
   ธีมสว่าง-น้ำเงิน ชุดเดียวกับ landing-page.css
   ใช้ token --ix-* ที่ประกาศไว้ใน :root ของ css/landing-page.css
   (news.php / news_detail.php โหลด landing-page.css ก่อนไฟล์นี้เสมอ)
   ===================================================== */

/* ===== Page Layout ===== */
.news-page {
    position: relative;
    min-height: 100vh;
    /* navbar เป็น sticky อยู่ใน flow แล้ว — เว้นแค่พอให้หัวข้ออยู่ห่างแถบเมนูราว 120px */
    padding-top: 72px;
    padding-bottom: 72px;
    background: linear-gradient(180deg, var(--ix-white) 0%, var(--ix-sky) 45%, var(--ix-sky) 100%);
    overflow: hidden;
}

/* องค์ประกอบที่ JS สลับด้วย attribute hidden — กัน display ของคลาสไปทับ */
.news-page [hidden] {
    display: none !important;
}

.news-bg-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* ถอด radial-gradient แสงนวลออก ให้เหมือนที่ทำกับ .screenshots-bg-glow — เหลือเฉพาะเส้นตารางใน ::after */
    z-index: 0;
}
.news-bg-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(29, 78, 216, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(29, 78, 216, .04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 85%);
    opacity: 0.75;
}

/* ===== Page Header — โครงเดียวกับ .section-title ในหน้าแรก ===== */
.news-page-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 20px 40px;
}
/* แสงนวลหลังหัวข้อ — ให้ส่วนบนไม่แบนเรียบ (โทนเดียวกับ --ix-blue) */
.news-page-header::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -48px;
    width: min(960px, 100%);
    height: 340px;
    transform: translateX(-50%);
    background: radial-gradient(60% 50% at 50% 0%, rgba(29, 78, 216, .08) 0%, rgba(29, 78, 216, 0) 70%);
    pointer-events: none;
    z-index: -1;
}

.news-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 14px;
}

.news-title-icon {
    width: 34px;
    height: 34px;
    color: var(--ix-blue);
    filter: none;
    flex-shrink: 0;
}

.news-page-title {
    font-family: 'Cinzel', 'Prompt', serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--ix-ink);
    margin: 0;
    /* ธีมเดิมไล่สีตัวอักษรด้วย background-clip — ล้างทิ้งให้เป็นสีทึบ */
    text-shadow: none;
    background: none;
    -webkit-text-fill-color: currentColor;
}

.news-bar {
    position: relative;
    flex: 0 0 120px;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, #B7CCEC 50%, transparent 100%);
}
.news-bar.right {
    background: linear-gradient(to left, transparent 0%, #B7CCEC 50%, transparent 100%);
}
.news-bar::before,
.news-bar::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 6px;
    height: 6px;
    background: #2563EB;
    transform: translateY(-50%) rotate(45deg);
    box-shadow: none;
}
.news-bar.left::before  { right: 0; }
.news-bar.left::after   { left: 0; opacity: 0.4; width: 3px; height: 3px; }
.news-bar.right::before { left: 0; }
.news-bar.right::after  { right: 0; opacity: 0.4; width: 3px; height: 3px; }

.news-page-subtitle {
    font-size: 14px;
    color: var(--ix-ink-2);
    letter-spacing: 0;
    font-weight: 400;
    margin: 0;
}

/* ===== Content Container ===== */
.news-content {
    position: relative;
    z-index: 1;
    padding: 0 20px;
    max-width: 900px;
    margin: 0 auto;
}

/* ===== Filter Tabs — การ์ดขาวแบบ .ranking-tabs ในหน้าแรก
   ป้ายเป็นภาษาไทย + เม็ดตัวเลขบอกจำนวนข่าวในหมวด (JS เติมจาก allNews) ===== */
.news-tabs-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0 auto 30px;
}

.news-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    background: var(--ix-white);
    border: 1px solid var(--ix-line);
    border-radius: 12px;
    box-shadow: var(--ix-shadow-card);
    max-width: fit-content;
    flex-wrap: wrap;
}

.news-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px 9px 18px;
    font-family: 'Prompt', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ix-ink-2);
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    border: none;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.news-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-family: 'Cinzel', 'Prompt', sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--ix-ink-2);
    background: var(--ix-sky);
    border: 1px solid var(--ix-line);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.news-tab:hover {
    color: var(--ix-blue);
    background: var(--ix-tint);
}
.news-tab:hover .news-tab-count {
    color: var(--ix-blue);
    background: var(--ix-white);
    border-color: #B7CCEC;
}

.news-tab.active {
    color: #fff;
    background: linear-gradient(180deg, var(--ix-blue-soft) 0%, var(--ix-blue) 100%);
    box-shadow: 0 6px 18px -6px rgba(29, 78, 216, .5);
    text-shadow: none;
}
.news-tab.active .news-tab-count {
    color: #fff;
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .38);
}
.news-tab.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--ix-blue);
    filter: none;
}

/* ===== News List ===== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px 14px 20px;
    background: var(--ix-white);
    border: 1px solid var(--ix-line);
    border-radius: 12px;
    box-shadow: var(--ix-shadow-card);
    text-decoration: none;
    /* ไม่แอนิเมต padding แล้ว — ตัวหนังสือขยับตอน hover ดูกระตุก */
    transition: background 0.22s ease, border-color 0.22s ease,
                transform 0.22s cubic-bezier(.22, .61, .36, 1), box-shadow 0.22s ease;
    overflow: hidden;
}

/* แถบสีด้านซ้าย — ธีมเดิมเป็นแดง เปลี่ยนเป็นน้ำเงิน ยืดออกตอน hover เหมือนเดิม */
.news-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--ix-blue-soft) 0%, var(--ix-blue) 100%);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.3s ease;
    box-shadow: none;
}

.news-item:hover {
    background: var(--ix-tint);
    border-color: #B7CCEC;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px -16px rgba(15, 30, 61, .3);
}
.news-item:hover::before {
    transform: scaleY(1);
}

/* ตัวเนื้อหา: หัวข้อ + บรรทัดข้อมูล (วันที่ / ป้ายใหม่) */
.news-item-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--ix-ink-2);
}

.news-meta-ic {
    width: 13px;
    height: 13px;
    flex: none;
    color: #8FA6CC;
}

/* ป้าย "ใหม่" — เฉพาะข่าวที่ลงภายใน 7 วัน */
.news-new {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px 2px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
    background: linear-gradient(180deg, var(--ix-blue-soft) 0%, var(--ix-blue) 100%);
    box-shadow: 0 4px 10px -5px rgba(29, 78, 216, .6);
}
.news-new::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    opacity: .9;
}

/* วงกลมลูกศรด้านขวา — บอกว่ากดเข้าไปอ่านต่อได้ */
.news-go {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--ix-blue);
    background: var(--ix-tint);
    border: 1px solid var(--ix-line);
    transition: transform 0.22s cubic-bezier(.22, .61, .36, 1), background 0.2s ease,
                color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.news-go svg {
    width: 14px;
    height: 14px;
}
.news-item:hover .news-go {
    transform: translateX(4px);
    color: #fff;
    background: linear-gradient(180deg, var(--ix-blue-soft) 0%, var(--ix-blue) 100%);
    border-color: var(--ix-blue);
    box-shadow: 0 6px 14px -6px rgba(29, 78, 216, .55);
}

/* ===== ป้ายหมวด — คงสีประจำหมวดไว้ แต่สลับเป็นชิปพื้นอ่อนบนพื้นขาว ===== */
.news-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 5px 10px;
    border-radius: 999px;
    font-family: 'Cinzel', 'Prompt', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    flex-shrink: 0;
    border: 1px solid transparent;
    box-shadow: none;
    text-shadow: none;
}

.cat-all,
.cat-event {
    background: #F1F5F9;
    color: #475569;
    border-color: #CBD5E1;
}

.cat-promotion {
    background: var(--t-amber, #FEF6E0);
    color: var(--i-amber, #B45309);
    border-color: #F0D089;
}

.cat-news {
    background: var(--ix-tint);
    color: var(--ix-blue-deep);
    border-color: #B7CCEC;
}

.cat-game {
    background: var(--t-green, #E9F8EE);
    color: var(--i-green, #15803D);
    border-color: #A6DEBB;
}

/* หน้าผู้ใช้ห้ามใช้สีม่วง — หมวด RULE จึงเป็นโทนคราม (indigo) แทนของเดิม */
.cat-rule {
    background: #EEF0FE;
    color: #3730A3;
    border-color: #BFC5F5;
}

.cat-ban {
    background: var(--t-red, #FDECEC);
    color: var(--i-red, #B91C1C);
    border-color: #F3B7B7;
}

/* Title — ตัดได้สูงสุด 2 บรรทัดทุกขนาดจอ (เดิมตัดบรรทัดเดียว หัวข้อบนมือถือหายไปครึ่ง) */
.news-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ix-ink);
    line-height: 1.45;
    letter-spacing: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.news-item:hover .news-title {
    color: var(--ix-blue-deep);
}

/* Date — "1 ก.ย. 2569" เป็นตัวไทย ใช้ Prompt (Cinzel ไม่มีอักษรไทย) */
.news-date {
    font-family: 'Prompt', sans-serif;
    font-size: 12px;
    color: var(--ix-ink-2);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0;
    font-weight: 500;
}
.news-item:hover .news-date {
    color: var(--ix-blue);
}

/* ===== Empty State ===== */
.news-empty {
    position: relative;
    text-align: center;
    padding: 56px 20px 60px;
    color: var(--ix-ink-2);
    background: var(--ix-white);
    border: 1px solid var(--ix-line);
    border-radius: 14px;
    box-shadow: var(--ix-shadow-card);
}
/* ขีดมุมทั้ง 4 มุมของธีมเดิม — เอาออกตามที่ผู้ใช้ขอ ให้เหลือแค่การ์ดขอบมนเรียบ ๆ */
.news-empty::before {
    display: none;
}

.news-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 50%;
    color: var(--ix-blue-soft);
    background: var(--ix-tint);
}
.news-empty-icon svg {
    width: 30px;
    height: 30px;
}

.news-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ix-ink);
    margin: 0 0 4px;
}
.news-empty-sub {
    font-size: 13px;
    color: var(--ix-ink-2);
    margin: 0;
}

/* ===== Pagination ===== */
.news-pagination-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-bottom: 20px;
}

.news-pag-info {
    margin: 0;
    font-size: 12.5px;
    color: var(--ix-ink-2);
}

.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-family: 'Cinzel', 'Prompt', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--ix-ink-2);
    background: var(--ix-white);
    border: 1px solid var(--ix-line);
    text-decoration: none;
    transition: color 0.2s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    text-transform: uppercase;
}

.page-link:hover:not(.active):not(.disabled):not(.dots) {
    color: var(--ix-blue);
    background: var(--ix-tint);
    border-color: #B7CCEC;
    box-shadow: none;
}

.page-link.active {
    color: #fff;
    background: linear-gradient(180deg, var(--ix-blue-soft) 0%, var(--ix-blue) 100%);
    border-color: var(--ix-blue);
    font-weight: 700;
    box-shadow: 0 6px 18px -6px rgba(29, 78, 216, .5);
    text-shadow: none;
}

.page-link.disabled {
    color: #A9B7D0;
    cursor: not-allowed;
    pointer-events: none;
    border-color: var(--ix-line);
    background: var(--ix-sky);
}

.page-link.dots {
    border: none;
    background: none;
    cursor: default;
    pointer-events: none;
    color: #A9B7D0;
}

/* ก่อนหน้า / ถัดไป — ข้อความไทย + ลูกศร */
.page-link.page-prev,
.page-link.page-next {
    gap: 6px;
    padding: 0 14px;
    font-family: 'Prompt', sans-serif;
    font-size: 12.5px;
    letter-spacing: 0;
    text-transform: none;
}
.page-link svg {
    width: 14px;
    height: 14px;
    flex: none;
}

/* ===== Focus & motion ===== */
.news-tab:focus-visible,
.news-item:focus-visible,
.page-link:focus-visible {
    outline: 2px solid var(--ix-blue);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .news-item,
    .news-item::before,
    .news-go,
    .news-tab,
    .news-tab-count,
    .page-link {
        transition: none;
    }
    .news-item:hover,
    .news-item:hover .news-go {
        transform: none;
    }
}

/* =====================================================
   News Detail Page — INFINITY X
   ⚠️ เนื้อหาข่าวเก่าบางชิ้นมีสีตัวอักษรฝังมาจาก editor (Quill) ซึ่งเลือกไว้ตอนพื้นหลังยังมืด
      สีพวกนั้นเป็นข้อมูลในฐานข้อมูล ไม่ใช่ CSS — ถ้าอ่านยากบนพื้นขาวต้องแก้ที่หลังบ้าน
   ===================================================== */

/* Detail Container */
.news-detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px 40px;
    position: relative;
    z-index: 1;
}

/* Back Button */
.news-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ix-ink-2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
    margin-bottom: 24px;
}

.news-back-btn:hover {
    color: var(--ix-blue);
}

.news-back-btn svg {
    flex-shrink: 0;
}

.news-back-bottom {
    margin-top: 30px;
    margin-bottom: 0;
}

/* Article — การ์ดขาวแบบเดียวกับ .news-item */
.news-article {
    background: var(--ix-white);
    border: 1px solid var(--ix-line);
    border-radius: 14px;
    box-shadow: var(--ix-shadow-card);
    overflow: hidden;
}

.news-article-header {
    padding: 28px 28px 20px;
}

.news-article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.news-article-date {
    font-size: 12px;
    color: var(--ix-ink-2);
}

.news-article-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ix-ink);
    line-height: 1.5;
    margin: 0;
}

.news-article-divider {
    height: 1px;
    background: var(--ix-line);
    margin: 0 28px;
}

.news-article-body {
    padding: 24px 28px 32px;
    color: var(--ix-ink);
    font-size: 14px;
    line-height: 1.42;
}

.news-article-body p {
    margin: 0;
}

.news-article-body p:last-child {
    margin-bottom: 0;
}

.news-article-body p > br:only-child {
    display: block;
    content: "";
    margin-top: 0.5em;
}

.news-article-body h1 {
    font-size: 2em;
    font-weight: 700;
    color: var(--ix-ink);
    margin: 0;
}

.news-article-body h2 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--ix-ink);
    margin: 0;
}

.news-article-body h3 {
    font-size: 1.17em;
    font-weight: 600;
    color: var(--ix-ink);
    margin: 0;
}

.news-article-body ul,
.news-article-body ol {
    margin: 0 0 14px;
    padding-left: 20px;
}

.news-article-body li {
    margin-bottom: 6px;
    color: var(--ix-ink);
}

.news-article-body strong {
    color: var(--ix-ink);
    font-weight: 700;
}

.news-article-body img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    display: block;
}

.news-article-body img:first-child {
    margin-top: 0;
}

.news-article-body a {
    color: var(--ix-blue);
    text-decoration: none;
}

.news-article-body a:has(> img) {
    display: contents;
}

.news-article-body a:hover {
    text-decoration: underline;
}

/* Quill Editor Content Classes */
.news-article-body .ql-align-center {
    text-align: center;
}

.news-article-body .ql-align-center img {
    margin-left: auto;
    margin-right: auto;
}

.news-article-body .ql-align-right {
    text-align: right;
}

.news-article-body .ql-align-right img {
    margin-left: auto;
    margin-right: 0;
}

.news-article-body .ql-align-justify {
    text-align: justify;
}

.news-article-body .ql-indent-1 {
    padding-left: 3em;
}

.news-article-body .ql-indent-2 {
    padding-left: 6em;
}

.news-article-body .ql-indent-3 {
    padding-left: 9em;
}

.news-article-body .ql-size-small {
    font-size: 0.75em;
}

.news-article-body .ql-size-large {
    font-size: 1.5em;
}

.news-article-body .ql-size-huge {
    font-size: 2.5em;
}

/* ===== Table Styles — โทนเดียวกับตารางอันดับในหน้าแรก ===== */
.news-article-body table.news-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ix-line);
}

.news-article-body table.news-table th,
.news-article-body table.news-table td {
    padding: 12px 16px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--ix-line);
}

.news-article-body table.news-table thead th {
    background: var(--ix-sky);
    color: var(--ix-blue-deep);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #B7CCEC;
}

.news-article-body table.news-table tbody td {
    background: var(--ix-white);
    color: var(--ix-ink);
}

.news-article-body table.news-table tbody tr:nth-child(even) td {
    background: #F8FBFF;
}

.news-article-body table.news-table tbody tr:hover td {
    background: var(--ix-tint);
}

.news-article-body table.news-table img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
    width: auto;
}

/* ===== Horizontal Rule ===== */
.news-article-body hr {
    border: none;
    border-top: 2px solid var(--ix-line);
    margin: 24px 0;
}

/* ===== Blockquote ===== */
.news-article-body blockquote {
    border-left: 4px solid var(--ix-blue-soft);
    margin: 16px 0;
    padding: 12px 20px;
    background: var(--ix-tint);
    color: var(--ix-ink-2);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

/* ===== Video Embed ===== */
.news-article-body iframe,
.news-article-body .ql-video {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 10px;
    margin: 20px auto;
    background: #000;
}

/* ===== Blacklist Search Box ===== */
.blacklist-search-box {
    background: var(--ix-white);
    border: 1px solid var(--ix-line);
    border-radius: 12px;
    box-shadow: var(--ix-shadow-card);
    padding: 16px;
    margin-bottom: 20px;
}

.blacklist-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blacklist-search-icon {
    flex-shrink: 0;
    color: var(--ix-ink-2);
}

.blacklist-search-input {
    flex: 1;
    background: #F8FBFF;
    border: 1px solid var(--ix-line);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--ix-ink);
    font-family: 'Prompt', sans-serif;
    outline: none;
    transition: border-color 0.2s ease;
}

.blacklist-search-input::placeholder {
    color: #A9B7D0;
}

.blacklist-search-input:focus {
    border-color: var(--ix-blue-soft);
}

.blacklist-search-btn {
    flex-shrink: 0;
    padding: 9px 20px;
    background: linear-gradient(180deg, var(--ix-blue-soft) 0%, var(--ix-blue) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Prompt', sans-serif;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.blacklist-search-btn:hover {
    filter: brightness(1.08);
}

.blacklist-clear-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    background: var(--ix-sky);
    color: var(--ix-ink-2);
    border: 1px solid var(--ix-line);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Prompt', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blacklist-clear-btn:hover {
    background: var(--ix-tint);
    color: var(--ix-blue);
    border-color: #B7CCEC;
}

.blacklist-search-result {
    font-size: 12px;
    margin-top: 10px;
    min-height: 0;
}

.blacklist-search-result:empty {
    margin-top: 0;
}

.blacklist-search-result.found {
    color: var(--i-green, #15803D);
}

.blacklist-search-result.not-found {
    color: var(--i-red, #B91C1C);
}

/* Highlight — พื้นเหลืองแบบปากกาเน้นข้อความ อ่านง่ายกว่าบนพื้นขาว */
.blacklist-highlight {
    background: #FDE68A;
    color: var(--ix-ink);
    padding: 1px 3px;
    border-radius: 3px;
    font-style: inherit;
}

/* Not Found State */
.news-not-found {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 80px 20px;
    color: var(--ix-ink-2);
}

.news-not-found svg {
    margin-bottom: 16px;
    opacity: 1;
    color: var(--ix-blue-soft);
}

.news-not-found h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ix-ink);
    margin: 0 0 8px;
}

.news-not-found p {
    font-size: 13px;
    margin: 0 0 24px;
}

.news-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    background: linear-gradient(180deg, var(--ix-blue-soft) 0%, var(--ix-blue) 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 18px -6px rgba(29, 78, 216, .5);
    transition: filter 0.2s ease;
}

.news-back-link:hover {
    filter: brightness(1.08);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .news-page {
        padding-top: 48px;
        padding-bottom: 100px;
    }

    .news-page-header {
        padding: 28px 16px 30px;
    }

    .news-title-row {
        gap: 12px;
        margin-bottom: 12px;
    }
    .news-page-title {
        font-size: 22px;
        letter-spacing: 4px;
    }
    .news-title-icon { width: 26px; height: 26px; }
    .news-bar { flex: 0 0 40px; }
    .news-page-subtitle {
        font-size: 12px;
        letter-spacing: 0.5px;
    }

    .news-content {
        padding: 0 12px;
    }

    /* แถบหมวด: แถวเดียวเลื่อนแนวนอน + เงาจางขอบขวาบอกว่ายังมีต่อ (JS ถอดเมื่อเลื่อนสุด) */
    .news-tabs-wrap {
        justify-content: flex-start;
        margin-bottom: 22px;
    }
    .news-tabs-wrap::after {
        content: '';
        position: absolute;
        top: 1px;
        bottom: 1px;
        right: 1px;
        width: 48px;
        border-radius: 0 11px 11px 0;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, var(--ix-white) 72%);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    .news-tabs-wrap.can-scroll:not(.at-end)::after {
        opacity: 1;
    }
    .news-tabs {
        width: 100%;
        max-width: 100%;
        padding: 4px;
        gap: 2px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        flex-wrap: nowrap;
        scroll-padding: 0 12px;
    }
    .news-tabs::-webkit-scrollbar { display: none; }
    .news-tab {
        padding: 8px 10px 8px 13px;
        font-size: 12.5px;
        gap: 6px;
        flex-shrink: 0;
    }
    .news-tab-count {
        min-width: 20px;
        height: 18px;
        font-size: 10px;
    }
    /* สามเหลี่ยมใต้แท็บที่เลือกจะโดนกล่องเลื่อนตัดทิ้ง — ซ่อนไปเลย */
    .news-tab.active::after {
        display: none;
    }

    .news-item {
        padding: 12px 12px 12px 16px;
        gap: 12px;
    }

    .news-category {
        min-width: 64px;
        padding: 4px 8px;
        font-size: 9px;
        letter-spacing: 0.8px;
    }

    .news-title {
        font-size: 13px;
    }

    .news-date {
        font-size: 11.5px;
    }

    .news-go {
        width: 28px;
        height: 28px;
    }
    .news-go svg {
        width: 12px;
        height: 12px;
    }

    .blacklist-search-box {
        padding: 12px;
    }

    .blacklist-search-inner {
        flex-wrap: wrap;
    }

    .blacklist-search-icon {
        display: none;
    }

    .blacklist-search-input {
        flex: 1;
        min-width: 0;
    }

    .news-detail-container {
        padding: 20px 12px 30px;
    }

    .news-article-header {
        padding: 20px 18px 16px;
    }

    .news-article-title {
        font-size: 17px;
    }

    .news-article-divider {
        margin: 0 18px;
    }

    .news-article-body {
        padding: 18px 18px 24px;
        font-size: 13px;
    }

    .news-article-body table.news-table {
        font-size: 12px;
    }

    .news-article-body table.news-table th,
    .news-article-body table.news-table td {
        padding: 8px 10px;
    }

    .news-article-body table.news-table img {
        max-width: 60px;
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    .news-page-header {
        padding: 22px 12px 22px;
    }

    .news-page-title {
        font-size: 20px;
        letter-spacing: 3px;
    }
    .news-title-icon { width: 22px; height: 22px; }
    .news-bar { flex: 0 0 28px; }

    .news-tab {
        padding: 7px 9px 7px 12px;
        font-size: 12px;
    }

    /* จอแคบ: ป้ายหมวดขึ้นบรรทัดของตัวเอง หัวข้อได้ความกว้างเต็ม ลูกศรคร่อมสองแถวทางขวา */
    .news-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "cat  go"
            "body go";
        align-items: center;
        row-gap: 8px;
        column-gap: 10px;
        padding: 12px 12px 12px 16px;
    }
    .news-category {
        grid-area: cat;
        justify-self: start;
        min-width: 58px;
        padding: 3px 8px;
        font-size: 9px;
    }
    .news-item-body {
        grid-area: body;
    }
    .news-go {
        grid-area: go;
        align-self: center;
    }

    .news-date {
        font-size: 11px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 11px;
    }
    .page-link.page-prev,
    .page-link.page-next {
        padding: 0 10px;
        font-size: 11.5px;
    }

    .news-page {
        padding-bottom: 100px;
    }

    .news-detail-container {
        padding: 15px 8px 25px;
    }

    .news-article-header {
        padding: 18px 14px 14px;
    }

    .news-article-title {
        font-size: 16px;
    }

    .news-article-divider {
        margin: 0 14px;
    }

    .news-article-body {
        padding: 16px 14px 20px;
    }

    .news-article-body h3 {
        font-size: 14px;
    }

    .news-article-body table.news-table {
        font-size: 11px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .news-article-body table.news-table th,
    .news-article-body table.news-table td {
        padding: 6px 8px;
        white-space: nowrap;
    }

    .news-article-body table.news-table img {
        max-width: 50px;
        max-height: 50px;
    }
}
