/* ═══════════════════════════════════════════════════════════
   NEWS MODULE — banghang.net
   Dùng chung cho cả trang danh sách và chi tiết tin tức
   public/css/frontend/news.css
═══════════════════════════════════════════════════════════ */

/* ══ SHARED SIDEBAR COMPONENTS ═══════════════════════════════ */

.ns-block {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
    padding: 20px;
    margin-bottom: 20px;
}

.ns-block-title {
    font-size: .85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #1a1a2e;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--red, #e53935);
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Category list */
.ns-cats {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ns-cats li {
    border-bottom: 1px solid #f5f5f5;
}

.ns-cats li:last-child {
    border-bottom: none;
}

.ns-cats a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    text-decoration: none;
    color: #444;
    font-size: .88rem;
    transition: color .15s;
}

.ns-cats a:hover,
.ns-cats a.ns-active {
    color: var(--red, #e53935);
    font-weight: 600;
}

.ns-cats .ns-cnt {
    background: #f5f5f5;
    color: #777;
    font-size: .73rem;
    border-radius: 10px;
    padding: 2px 9px;
    font-weight: 600;
}

.ns-cats a.ns-active .ns-cnt {
    background: var(--red, #e53935);
    color: #fff;
}

/* Dấu nối cây cho danh mục con (cấp 2-3) trong sidebar */
.ns-cats .ns-cat-tree {
    color: #bbb;
    margin-right: 2px;
    font-weight: 400;
}

/* Latest news list */
.ns-latest {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ns-latest li {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.ns-latest li:last-child {
    border-bottom: none;
}

.ns-latest-thumb {
    width: 68px;
    height: 50px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
}

.ns-latest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ns-latest-info {
    min-width: 0;
}

.ns-latest-info a {
    font-size: .82rem;
    font-weight: 600;
    color: #1a1a2e;
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ns-latest-info a:hover {
    color: var(--red, #e53935);
}

.ns-latest-date {
    font-size: .73rem;
    color: #bbb;
    margin-top: 4px;
}

/* Search bar */
.ns-search {
    display: flex;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.ns-search input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: .9rem;
    outline: none;
    background: transparent;
}

.ns-search button {
    background: var(--red, #e53935);
    border: none;
    color: #fff;
    padding: 0 16px;
    cursor: pointer;
    font-size: .95rem;
    white-space: nowrap;
    transition: opacity .18s;
}

.ns-search button:hover {
    opacity: .88;
}

/* Tags */
.ns-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.ns-tag {
    display: inline-block;
    padding: 5px 13px;
    border: 1.5px solid #e0e0e0;
    border-radius: 20px;
    font-size: .78rem;
    color: #555;
    text-decoration: none;
    transition: all .18s;
}

.ns-tag:hover {
    background: var(--red, #e53935);
    border-color: var(--red, #e53935);
    color: #fff;
}

/* Project block (dùng trong sidebar detail) */
.ns-project {
    background: linear-gradient(135deg, var(--red, #e53935) 0%, #b71c1c 100%);
    color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.ns-project-label {
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    opacity: .8;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ns-project-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 7px;
    line-height: 1.3;
}

.ns-project-addr {
    font-size: .8rem;
    opacity: .8;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.ns-project-btn {
    display: inline-block;
    background: #fff;
    color: var(--red, #e53935);
    padding: 8px 20px;
    border-radius: 4px;
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
    transition: opacity .18s;
}

.ns-project-btn:hover {
    opacity: .9;
}


/* ══ NEWS INDEX PAGE ══════════════════════════════════════════ */

.ni-wrap {
    max-width: 95%;
    margin: 0 auto;
    padding: 32px 20px 60px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 960px) {
    .ni-wrap {
        grid-template-columns: 1fr;
    }
}

/* Breadcrumb */
.ni-breadcrumb {
    font-size: .8rem;
    color: #888;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ni-breadcrumb a {
    color: #888;
    text-decoration: none;
}

.ni-breadcrumb a:hover {
    color: var(--red, #e53935);
}

.ni-breadcrumb .sep {
    color: #ccc;
}

/* Page title */
.ni-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--red, #e53935);
    display: inline-block;
}

/* Search bar (main area) */
.ni-search {
    display: flex;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 28px;
    background: #fff;
}

.ni-search input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: .9rem;
    outline: none;
}

.ni-search button {
    background: var(--red, #e53935);
    border: none;
    color: #fff;
    padding: 0 18px;
    cursor: pointer;
    font-size: .95rem;
    white-space: nowrap;
    transition: opacity .18s;
}

.ni-search button:hover {
    opacity: .88;
}

/* News grid — 3 cột */
.ni-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 700px) {
    .ni-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 701px) and (max-width: 960px) {
    .ni-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* News card */
.ni-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.ni-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
    transform: translateY(-3px);
}

.ni-card-img {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}

.ni-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}

.ni-card:hover .ni-card-img img {
    transform: scale(1.06);
}

.ni-card-cat {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--red, #e53935);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ni-card-cat i {
    font-size: .65rem;
}

.ni-card-body {
    padding: 14px 16px 16px;
}

.ni-card-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.45;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}

.ni-card:hover .ni-card-title {
    color: var(--red, #e53935);
}

.ni-card-excerpt {
    font-size: .82rem;
    color: #666;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.ni-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .78rem;
}

.ni-card-date {
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ni-card-readmore {
    color: var(--red, #e53935);
    font-weight: 700;
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Empty state */
.ni-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: #bbb;
}

.ni-empty i {
    font-size: 3rem;
    display: block;
    margin-bottom: 14px;
}

/* Pagination */
.ni-pagination {
    margin-top: 36px;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ni-pagination .pagination {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.ni-pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #555;
    font-size: .88rem;
    text-decoration: none;
    transition: all .2s;
}

.ni-pagination .page-item.active .page-link,
.ni-pagination .page-item .page-link:hover {
    background: var(--red, #e53935);
    border-color: var(--red, #e53935);
    color: #fff;
}

.ni-pagination .page-item.disabled .page-link {
    opacity: .4;
    pointer-events: none;
}

/* Sidebar sticky */
.ni-sidebar {
    position: sticky;
    top: 80px;
}


/* ══ NEWS DETAIL PAGE ═════════════════════════════════════════ */

/* Breadcrumb bar */
.nd-breadbar {
    background: #f8f8f8;
    border-bottom: 1px solid #efefef;
    padding: 10px 0;
}

.nd-breadbar-inner {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: #888;
    flex-wrap: wrap;
}

.nd-breadbar-inner a {
    color: #888;
    text-decoration: none;
}

.nd-breadbar-inner a:hover {
    color: var(--red, #e53935);
}

.nd-breadbar-inner .sep {
    color: #ccc;
}

/* Layout 2 cột */
.nd-wrap {
    max-width: 95%;
    margin: 0 auto;
    padding: 32px 20px 60px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 960px) {
    .nd-wrap {
        grid-template-columns: 1fr;
    }
}

/* 1 cột, chiếm trọn chiều ngang (max-width 95%, cùng lề với breadcrumb).
   Dùng cho: trang tin tĩnh (type=page) và bài viết không có sidebar. */
.nd-wrap.nd-wrap--full {
    grid-template-columns: 1fr;
}

/* Category badge */
.nd-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--red, #e53935);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 3px;
    margin-bottom: 12px;
    text-decoration: none;
    transition: opacity .18s;
}

.nd-cat-badge:hover {
    opacity: .85;
}

/* Article title */
body .nd-title {
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.35;
    margin: 0 0 14px;
    border-bottom: none;
    display: block;
    padding-bottom: 0;
}

/* Meta row */
.nd-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: .82rem;
    color: #888;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.nd-meta-row span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nd-meta-row a {
    color: #888;
    text-decoration: none;
}

.nd-meta-row a:hover {
    color: var(--red, #e53935);
}

/* Lead / description */
.nd-lead {
    font-size: 1rem;
    color: #555;
    line-height: 1.75;
    font-style: italic;
    margin-bottom: 22px;
    padding: 14px 18px;
    background: #f9f9f9;
    border-left: 3px solid var(--red, #e53935);
    border-radius: 0 6px 6px 0;
}

/* Article content */
.nd-content {
    font-size: .97rem;
    line-height: 1.85;
    color: #333;
}

.nd-content h2,
.nd-content h3,
.nd-content h4 {
    font-weight: 700;
    color: #1a1a2e;
    margin: 1.6em 0 .6em;
    line-height: 1.35;
}

.nd-content h2 { font-size: 1.3rem; }
.nd-content h3 { font-size: 1.1rem; }

.nd-content p {
    margin: 0 0 1.1em;
}

.nd-content ul,
.nd-content ol {
    padding-left: 22px;
    margin-bottom: 1.1em;
}

.nd-content li {
    margin-bottom: .4em;
}

.nd-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1em 0;
    display: block;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}

.nd-content figure {
    margin: 1.2em 0;
}

.nd-content figcaption {
    font-size: .8rem;
    color: #999;
    text-align: center;
    margin-top: 6px;
}

.nd-content blockquote {
    border-left: 4px solid var(--red, #e53935);
    padding: 12px 20px;
    background: #fafafa;
    margin: 1.4em 0;
    border-radius: 0 8px 8px 0;
    color: #555;
    font-style: italic;
}

.nd-content a {
    color: var(--red, #e53935);
}

.nd-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: .9rem;
}

.nd-content th,
.nd-content td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
}

.nd-content th {
    background: #f7f7f7;
    font-weight: 700;
}

/* Share bar */
.nd-share {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nd-share-label {
    font-size: .85rem;
    font-weight: 700;
    color: #555;
}

.nd-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 4px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity .18s;
}

.nd-share-btn:hover {
    opacity: .85;
}

.nd-share-fb   { background: #1877f2; color: #fff; }
.nd-share-zalo { background: #0068ff; color: #fff; }
.nd-share-copy { background: #f0f0f0; color: #444; }

/* Related news section */
.nd-related {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 3px solid var(--red, #e53935);
}

.nd-related-title {
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #1a1a2e;
    margin: 0 0 22px;
}

.nd-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

@media (max-width: 700px) {
    .nd-related-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 701px) and (max-width: 960px) {
    .nd-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Related card */
.nd-rcard {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
    transition: transform .2s, box-shadow .2s;
}

.nd-rcard:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}

.nd-rcard-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
}

.nd-rcard-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.nd-rcard:hover .nd-rcard-img img {
    transform: scale(1.06);
}

.nd-rcard-cat {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--red, #e53935);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.nd-rcard-body {
    padding: 11px 13px 13px;
}

.nd-rcard-title {
    font-size: .87rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 7px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}

.nd-rcard:hover .nd-rcard-title {
    color: var(--red, #e53935);
}

.nd-rcard-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nd-rcard-date {
    font-size: .73rem;
    color: #bbb;
}

.nd-rcard-readmore {
    font-size: .76rem;
    color: var(--red, #e53935);
    font-weight: 700;
}

/* Detail sidebar */
.nd-sidebar {
    position: sticky;
    top: 80px;
}
