/* ============================================================
   Tin tức — danh sách bài viết (themesieuviet / Win Ora)
   CSS thật (tailwind.css build sẵn thiếu nhiều utility). Namespace nw-*.
   Accent DUY NHẤT: var(--site-primary…). Badge danh mục dùng
   var(--site-primary-soft) — MỘT hệ màu, không mỗi danh mục một màu.
   Glass đồng bộ header/footer: alpha .55–.74, blur 16–20px, saturate 155–160%.

   GIỮ NGUYÊN tên class mà nơi khác bám vào:
     .news-hero  (header.css cấp padding-top 120px)
     .news-container  (alias .site-container trong app.css)
     .pagination__*  (components/pagination.blade.php)
   ============================================================ */

.nw-page { color: #0f172b; background: #fff; overflow-x: clip; }
.nw-page section { position: relative; }
.nw-page svg[fill="none"] { stroke: currentColor; }

/* ---- Reveal (gate .nw-anim; no-JS / reduced-motion → hiện đủ) ---- */
.nw-anim [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .55s cubic-bezier(.16, 1, .3, 1), transform .55s cubic-bezier(.16, 1, .3, 1);
}
.nw-anim [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .nw-anim [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
    .nw-page * { animation: none !important; }
}

/* ---- Nhịp section + giao thoa nền fade về trắng (liquid-glass §4b) ---- */
/* Khối toolbar: padding-top nhỏ vì hero đã có padding-bottom riêng —
   cộng dồn 56 + 56 tạo khoảng trắng ~112px giữa hero và thanh lọc. */
.nw-sect { padding: 30px 0 40px; }
.nw-soft {
    background:
        linear-gradient(180deg,
            rgba(var(--site-primary-rgb, 220, 38, 38), 0) 0,
            rgba(var(--site-primary-rgb, 220, 38, 38), .045) 120px,
            rgba(var(--site-primary-rgb, 220, 38, 38), .045) calc(100% - 120px),
            rgba(var(--site-primary-rgb, 220, 38, 38), 0) 100%),
        #ffffff;
}

/* ---- Pill · heading ---- */
.news-pill {
    display: inline-flex; align-items: center; gap: 8px;
    height: 30px; padding: 0 14px; border-radius: 999px;
    background: rgba(var(--site-primary-rgb, 220, 38, 38), .09);
    border: 1px solid rgba(var(--site-primary-rgb, 220, 38, 38), .18);
    color: var(--site-primary, #dc2626);
    font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.nw-h2 {
    margin: 0; color: #0f172b; font-weight: 900; letter-spacing: -.01em;
    font-size: clamp(22px, 2.2vw, 28px); line-height: 1.2;
}
.nw-section-head { margin: 0 0 22px; }

/* Badge danh mục — MỘT hệ màu duy nhất.
   align-self + width: fit-content là BẮT BUỘC: badge nằm trong flex column
   (.news-featured-body / .news-card-body) nên mặc định bị kéo giãn full width. */
.news-tag {
    align-self: flex-start; width: fit-content;
    display: inline-flex; align-items: center; height: 24px; padding: 0 11px; border-radius: 999px;
    background: rgba(var(--site-primary-rgb, 220, 38, 38), .1);
    color: var(--site-primary, #dc2626);
    font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}

/* ---- Button · focus ---- */
.news-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 22px; border-radius: 11px; border: 0; cursor: pointer;
    font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
    background: linear-gradient(135deg, var(--site-primary-light, #ef4444), var(--site-primary, #dc2626));
    color: #fff; box-shadow: 0 10px 24px rgba(var(--site-primary-rgb, 220, 38, 38), .3);
    transition: transform .2s ease, box-shadow .2s ease;
}
.news-btn:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 16px 32px rgba(var(--site-primary-rgb, 220, 38, 38), .4); }

.nw-page a:focus-visible,
.nw-page button:focus-visible,
.nw-page input:focus-visible {
    outline: 3px solid rgba(var(--site-primary-rgb, 220, 38, 38), .45);
    outline-offset: 2px;
}

/* ---- Fallback khi trình duyệt không hỗ trợ backdrop-filter ---- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .nw-toolbar, .news-featured, .news-card, .news-side-card, .nw-bottom-card, .nw-filter-note {
        background: rgba(255, 255, 255, .93) !important;
    }
}

/* =========================================================================
   1) HERO — gọn, ảnh minh hoạ làm lớp nền mờ phía sau
   ========================================================================= */
.news-hero {
    /* padding-top do header.css (.news-hero → 120px) quản lý — nguồn duy nhất */
    padding-bottom: 26px;
    overflow: hidden;
    background:
        radial-gradient(900px 400px at 88% -10%, rgba(var(--site-primary-rgb, 220, 38, 38), .15), transparent 60%),
        radial-gradient(700px 340px at 4% 8%, rgba(var(--site-primary-rgb, 220, 38, 38), .07), transparent 58%),
        linear-gradient(180deg, #fbf7f7 0%, #f8f1f1 62%, #fdf8f8 100%);
}
.news-hero::after {
    content: ''; position: absolute; inset: auto 0 0 0; height: 40%;
    background: linear-gradient(180deg, transparent, #ffffff); pointer-events: none; z-index: 0;
}
.nw-hero__inner { position: relative; z-index: 1; max-width: 640px; }
.nw-hero__inner h1 {
    margin: 16px 0 0; color: #11213d; font-weight: 900; letter-spacing: -.015em;
    font-size: clamp(30px, 3.3vw, 42px); line-height: 1.1; text-wrap: balance;
}
.nw-hero__inner > p { margin: 14px 0 0; color: #475569; font-size: 15.8px; line-height: 1.7; max-width: 56ch; }

/* Ảnh minh hoạ: lớp trang trí mờ phía sau, không phải khối nội dung riêng */
/* Lớp trang trí: mờ và fade hai phía để không giành sự chú ý với thanh nav
   (header overlay nằm đè lên hero) và không cạnh tranh với H1. */
.news-hero-art {
    position: absolute; right: -30px; top: 62%; transform: translateY(-50%);
    z-index: 0; width: min(42%, 480px); opacity: .34; pointer-events: none;
    -webkit-mask-image: linear-gradient(105deg, transparent 0, #000 46%), linear-gradient(180deg, transparent 0, #000 26%);
    mask-image: linear-gradient(105deg, transparent 0, #000 46%), linear-gradient(180deg, transparent 0, #000 26%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}
.news-hero-art img { display: block; width: 100%; height: auto; }

@media (max-width: 1023px) {
    .news-hero-art { display: none; }
    .nw-hero__inner { max-width: none; }
}

/* =========================================================================
   2) TOOLBAR — ô tìm kiếm + pill lọc danh mục (kèm số bài)
   ========================================================================= */
.nw-toolbar {
    display: grid; grid-template-columns: 1fr; gap: 16px;
    border-radius: 20px; padding: 16px;
    background: rgba(255, 255, 255, .66); border: 1px solid rgba(255, 255, 255, .74);
    box-shadow: 0 14px 38px rgba(15, 23, 43, .08), inset 0 1px 0 rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(18px) saturate(158%); backdrop-filter: blur(18px) saturate(158%);
}
.news-search { position: relative; display: flex; }
.news-search input {
    width: 100%; height: 46px; padding: 0 46px 0 16px; border-radius: 12px;
    border: 1.5px solid rgba(15, 23, 43, .1); background: #fff; color: #0f172b;
    font-size: 14.5px; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.news-search input::placeholder { color: #94a3b8; }
.news-search input:focus {
    border-color: var(--site-primary, #dc2626);
    box-shadow: 0 0 0 4px rgba(var(--site-primary-rgb, 220, 38, 38), .14);
}
.news-search button {
    position: absolute; right: 4px; top: 4px; width: 38px; height: 38px;
    display: grid; place-items: center; border: 0; border-radius: 10px; cursor: pointer;
    background: transparent; color: var(--site-primary, #dc2626);
}
.news-search button:hover { background: rgba(var(--site-primary-rgb, 220, 38, 38), .1); }
.news-search button svg { width: 19px; height: 19px; }

.nw-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.nw-tab {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px;
    border-radius: 999px; border: 1px solid #e6eaf0; background: #fff; text-decoration: none;
    color: #475569; font-size: 13.5px; font-weight: 700; white-space: nowrap;
    transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.nw-tab:hover { transform: translateY(-1px); border-color: rgba(var(--site-primary-rgb, 220, 38, 38), .4); color: var(--site-primary, #dc2626); }
.nw-tab__count {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 999px; background: rgba(15, 23, 43, .06); color: #64748b;
    font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.nw-tab.is-active {
    border-color: var(--site-primary, #dc2626); background: var(--site-primary, #dc2626); color: #fff;
    box-shadow: 0 10px 22px rgba(var(--site-primary-rgb, 220, 38, 38), .24);
}
.nw-tab.is-active .nw-tab__count { background: rgba(255, 255, 255, .24); color: #fff; }

@media (min-width: 900px) {
    .nw-toolbar { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: center; }
    .nw-tabs { justify-content: flex-end; }
}

/* Dải thông báo đang lọc */
.nw-filter-note {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin-bottom: 22px; border-radius: 14px; padding: 12px 16px;
    background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .74);
    box-shadow: 0 8px 22px rgba(15, 23, 43, .06);
    -webkit-backdrop-filter: blur(16px) saturate(158%); backdrop-filter: blur(16px) saturate(158%);
    color: #475569; font-size: 13.5px; font-weight: 700;
}
/* Ở đây badge nằm trong flex ROW → trả lại canh giữa dọc. */
.nw-filter-note .news-tag { align-self: center; }
.nw-filter-note__clear { margin-left: auto; color: var(--site-primary, #dc2626); font-weight: 800; text-decoration: none; }
.nw-filter-note__clear:hover { text-decoration: underline; }

/* =========================================================================
   3) LAYOUT — nội dung chính + sidebar
   ========================================================================= */
.news-layout { display: grid; grid-template-columns: 1fr; gap: 34px; align-items: start; }

@media (min-width: 1100px) {
    .news-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 40px; }
    .news-sidebar { position: sticky; top: 112px; }
}

/* =========================================================================
   4) BÀI NỔI BẬT — feature split (ảnh trái, nội dung phải)
   ========================================================================= */
.news-featured {
    display: grid; grid-template-columns: 1fr; gap: 0; overflow: hidden;
    border-radius: 22px; margin-bottom: 44px;
    background:
        radial-gradient(520px 340px at 100% 0, rgba(var(--site-primary-rgb, 220, 38, 38), .1), transparent 62%),
        rgba(255, 255, 255, .66);
    border: 1px solid rgba(var(--site-primary-rgb, 220, 38, 38), .18);
    box-shadow: 0 20px 50px rgba(var(--site-primary-rgb, 220, 38, 38), .1), inset 0 1px 0 rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
    transition: box-shadow .25s ease;
}
.news-featured:hover { box-shadow: 0 28px 62px rgba(var(--site-primary-rgb, 220, 38, 38), .16); }
.news-featured-img { display: block; overflow: hidden; }
.news-featured-img img {
    display: block; width: 100%; height: 100%; min-height: 240px; object-fit: cover;
    transition: transform .5s cubic-bezier(.16, 1, .3, 1);
}
.news-featured-img:hover img { transform: scale(1.04); }
.news-featured-body { display: flex; flex-direction: column; padding: 26px; }
.news-featured-body h2 { margin: 14px 0 0; font-size: clamp(20px, 1.9vw, 26px); line-height: 1.28; font-weight: 900; letter-spacing: -.01em; }
.news-featured-body h2 a { color: #0f172b; text-decoration: none; }
.news-featured-body h2 a:hover { color: var(--site-primary, #dc2626); }
.news-excerpt { margin: 12px 0 0; color: #64748b; font-size: 14.2px; line-height: 1.7; }

@media (min-width: 800px) {
    .news-featured { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
    .news-featured-body { padding: 30px 32px; justify-content: center; }
}

/* ---- Meta (ngày · thời gian đọc · đọc thêm) ---- */
.news-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: auto; padding-top: 20px;
    color: #94a3b8; font-size: 12.6px; font-weight: 600;
}
.news-meta > span { display: inline-flex; align-items: center; gap: 7px; }
.news-meta svg { width: 15px; height: 15px; }
.news-more {
    display: inline-flex; align-items: center; gap: 7px; margin-left: auto;
    color: var(--site-primary, #dc2626); font-size: 13.5px; font-weight: 800; text-decoration: none;
}
.news-more svg { width: 16px; height: 16px; transition: transform .2s ease; }
.news-more:hover svg { transform: translateX(3px); }

/* =========================================================================
   5) LƯỚI BÀI VIẾT — card (bố cục lưới là đúng cho blog listing)
   ========================================================================= */
.news-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.news-card {
    display: flex; flex-direction: column; overflow: hidden; border-radius: 18px;
    background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .74);
    box-shadow: 0 10px 26px rgba(15, 23, 43, .07), inset 0 1px 0 rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: blur(16px) saturate(158%); backdrop-filter: blur(16px) saturate(158%);
    transition: transform .25s ease, box-shadow .25s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: 0 20px 42px rgba(15, 23, 43, .12); }
.news-card-img { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: #f1f5f9; }
.news-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.news-card-img:hover img { transform: scale(1.05); }
.news-card-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.news-card-body h3 { margin: 12px 0 0; font-size: 15.8px; line-height: 1.45; font-weight: 800; }
.news-card-body h3 a { color: #0f172b; text-decoration: none; }
.news-card-body h3 a:hover { color: var(--site-primary, #dc2626); }
.news-card-body .news-meta { padding-top: 16px; }

@media (min-width: 560px) { .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.news-empty {
    border-radius: 18px; padding: 40px 24px; text-align: center;
    border: 1px dashed #dbe1ea; background: rgba(255, 255, 255, .6); color: #64748b; font-size: 14.5px;
}

/* ---- Phân trang (class do components/pagination.blade.php sinh) ---- */
.news-pagination { margin-top: 34px; }
.news-pagination .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination__link {
    display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 13px;
    border-radius: 11px; border: 1px solid #e6eaf0; background: #fff; text-decoration: none;
    color: #475569; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums;
    transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
a.pagination__link:hover { transform: translateY(-1px); border-color: rgba(var(--site-primary-rgb, 220, 38, 38), .4); color: var(--site-primary, #dc2626); }
.pagination__link--active {
    border-color: var(--site-primary, #dc2626); background: var(--site-primary, #dc2626); color: #fff;
    box-shadow: 0 10px 22px rgba(var(--site-primary-rgb, 220, 38, 38), .24);
}
.pagination__link--disabled { opacity: .45; cursor: not-allowed; }
.pagination__link--dots { border: 0; background: transparent; }

/* =========================================================================
   6) SIDEBAR — panel kính
   ========================================================================= */
.news-sidebar { display: grid; gap: 20px; }
.news-side-card {
    border-radius: 20px; padding: 22px;
    background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .74);
    box-shadow: 0 12px 32px rgba(15, 23, 43, .07), inset 0 1px 0 rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
}
.news-side-title {
    margin: 0 0 16px; color: #0f172b; font-size: 16px; font-weight: 900; letter-spacing: -.01em;
    padding-bottom: 12px; border-bottom: 1px solid rgba(15, 23, 43, .07);
}

/* Danh mục */
.news-category-list { display: grid; gap: 4px; }
.news-category-list a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border-radius: 11px; padding: 11px 13px; text-decoration: none;
    color: #475569; font-size: 14px; font-weight: 600;
    transition: background .2s ease, color .2s ease;
}
.news-category-list a:hover { background: rgba(var(--site-primary-rgb, 220, 38, 38), .06); color: var(--site-primary, #dc2626); }
.news-category-list a.active { background: rgba(var(--site-primary-rgb, 220, 38, 38), .1); color: var(--site-primary, #dc2626); font-weight: 800; }
.news-category-count {
    display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px;
    border-radius: 999px; background: rgba(15, 23, 43, .06); color: #64748b;
    font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.news-category-list a.active .news-category-count { background: var(--site-primary, #dc2626); color: #fff; }

/* Bài phổ biến — số thứ tự "ghost" 1–5 */
.news-popular-list { display: grid; gap: 6px; }
.news-popular-item {
    position: relative; display: grid; grid-template-columns: 34px 62px minmax(0, 1fr); gap: 12px;
    align-items: center; border-radius: 13px; padding: 10px 8px; text-decoration: none;
    transition: background .2s ease;
}
.news-popular-item:hover { background: rgba(var(--site-primary-rgb, 220, 38, 38), .06); }
.news-popular-rank {
    font-size: 26px; font-weight: 900; line-height: 1; letter-spacing: -.03em; text-align: center;
    color: rgba(var(--site-primary-rgb, 220, 38, 38), .28); font-variant-numeric: tabular-nums;
    transition: color .2s ease;
}
.news-popular-item:hover .news-popular-rank { color: rgba(var(--site-primary-rgb, 220, 38, 38), .6); }
.news-popular-img { display: block; overflow: hidden; border-radius: 10px; aspect-ratio: 1 / 1; background: #f1f5f9; }
.news-popular-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-popular-title {
    display: block; color: #0f172b; font-size: 13.4px; font-weight: 700; line-height: 1.45;
}
.news-popular-item:hover .news-popular-title { color: var(--site-primary, #dc2626); }
.news-popular-date { display: block; margin-top: 4px; color: #94a3b8; font-size: 11.8px; font-variant-numeric: tabular-nums; }

/* Newsletter sidebar */
.news-newsletter { text-align: center; }
.news-newsletter img { display: block; width: 100%; max-width: 150px; height: auto; margin: 0 auto 14px; }
.news-newsletter .news-side-title { border-bottom: 0; padding-bottom: 0; margin-bottom: 8px; }
.news-input {
    width: 100%; height: 46px; padding: 0 15px; border-radius: 11px; background: #fff; color: #0f172b;
    border: 1.5px solid rgba(15, 23, 43, .1); font-size: 14.5px; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.news-input::placeholder { color: #94a3b8; }
.news-input:focus { border-color: var(--site-primary, #dc2626); box-shadow: 0 0 0 4px rgba(var(--site-primary-rgb, 220, 38, 38), .14); }
.news-newsletter .news-btn { width: 100%; }

/* =========================================================================
   7) CTA cuối — băng ngang newsletter
   ========================================================================= */
.news-bottom-cta { padding: 0 0 78px; background: #fff; }
.nw-bottom-card {
    display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; text-align: center;
    border-radius: 24px; padding: 30px 26px;
    background:
        radial-gradient(620px 340px at 0 0, rgba(var(--site-primary-rgb, 220, 38, 38), .12), transparent 62%),
        rgba(255, 255, 255, .66);
    border: 1px solid rgba(255, 255, 255, .74);
    box-shadow: 0 20px 50px rgba(15, 23, 43, .08), inset 0 1px 0 rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
}
.nw-bottom-card img { display: block; width: 100%; max-width: 150px; height: auto; margin: 0 auto; }
.nw-bottom-card h2 { margin: 0; color: #0f172b; font-size: clamp(21px, 2.2vw, 28px); font-weight: 900; letter-spacing: -.01em; line-height: 1.24; text-wrap: balance; }
.nw-bottom-card p { margin: 10px 0 0; color: #64748b; font-size: 14.5px; line-height: 1.7; }
.nw-bottom-card form { display: grid; grid-template-columns: 1fr; gap: 10px; }

@media (min-width: 940px) {
    .nw-bottom-card { grid-template-columns: 160px minmax(0, 1fr) minmax(0, 340px); gap: 34px; padding: 32px 38px; text-align: left; }
    .nw-bottom-card p { max-width: 52ch; }
}
@media (max-width: 767px) {
    .nw-sect { padding: 44px 0; }
    .news-bottom-cta { padding-bottom: 56px; }
    .news-featured-body { padding: 22px 20px; }
}
