/* ================================================
   news.css - Trang tin tức WebIn
   ================================================ */

/* ---- Compact Page Header ---- */
.news-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.news-compact-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Breadcrumb */
.news-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.news-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.18s;
}

.news-breadcrumb a:hover {
    opacity: 0.75;
}

.news-bc-sep {
    font-size: 9px;
    opacity: 0.45;
}

.news-compact-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
}

.news-compact-title i {
    color: var(--primary);
    font-size: 1.1rem;
}

/* Inline Search */
.news-inline-search {
    flex-shrink: 0;
}

.news-search-wrap {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 0 6px 0 14px;
    gap: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 280px;
}

.news-search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(82,130,255,0.12);
}

.news-search-icon {
    color: var(--text-secondary);
    font-size: 13px;
    flex-shrink: 0;
}

.news-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13.5px;
    color: var(--text-primary);
    padding: 9px 0;
    flex: 1;
    min-width: 0;
}

.news-search-input::placeholder {
    color: var(--text-secondary);
}

.news-search-clear {
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.18s, color 0.18s;
}

.news-search-clear:hover {
    background: #fee2e2;
    color: #ef4444;
}

.news-search-btn {
    padding: 7px 16px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.18s;
    flex-shrink: 0;
}

.news-search-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* Category tabs */
.news-category-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.news-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.22s ease;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    background: var(--surface);
}

.news-cat-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb, 82,130,255), 0.06);
    transform: translateY(-1px);
}

.news-cat-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(82,130,255,0.32);
}

.news-cat-count {
    background: rgba(255,255,255,0.24);
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 11px;
}

.news-cat-tab:not(.active) .news-cat-count {
    background: var(--border);
    color: var(--text-secondary);
}

/* Main layout */
.news-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}

/* News card - HORIZONTAL 30/70 layout */
.news-card-h {
    display: grid;
    grid-template-columns: 30% 70%;
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    color: inherit;
    margin-bottom: 16px;
}

.news-card-h:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.13);
    border-color: var(--primary);
}

.news-card-h-img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.news-card-h:hover .news-card-h-img {
    transform: scale(1.04);
}

.news-card-h-img-wrap {
    overflow: hidden;
    position: relative;
    min-height: 190px;
}

.news-card-h-img-wrap .no-img {
    width: 100%;
    height: 190px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #94a3b8;
}

.news-card-h-body {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 190px;
}

.news-card-cat-badge {
    display: inline-block;
    padding: 3px 12px;
    background: rgba(var(--primary-rgb, 82,130,255), 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.news-card-title-h {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.news-card-h:hover .news-card-title-h {
    color: var(--primary);
}

.news-card-summary-h {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
    flex: 1;
}

.news-card-meta-h {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-secondary);
}

.news-card-meta-h i {
    margin-right: 4px;
    color: var(--primary);
    opacity: 0.7;
}

.news-card-read-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    transition: gap 0.2s;
}

.news-card-h:hover .news-card-read-more {
    gap: 8px;
}

/* Empty state */
.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.news-empty i {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 16px;
}

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

/* Sidebar */
.news-sidebar {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.sidebar-card-header {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-card-header i {
    color: var(--primary);
}

/* Sidebar small news item */
.sidebar-news-item {
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.sidebar-news-item:last-child {
    border-bottom: none;
}

.sidebar-news-item:hover {
    background: rgba(var(--primary-rgb, 82,130,255), 0.04);
}

.sidebar-news-img {
    width: 60px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.sidebar-news-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.sidebar-news-item:hover .sidebar-news-title {
    color: var(--primary);
}

.sidebar-news-date {
    font-size: 11px;
    color: var(--text-secondary);
}

/* News detail page */
.news-detail-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

.news-detail-main {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.news-detail-hero {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.news-detail-body {
    padding: 36px 40px;
}

.news-detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.news-detail-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.news-detail-breadcrumb a:hover {
    text-decoration: underline;
}

.news-detail-cat {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(var(--primary-rgb, 82,130,255), 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 14px;
    text-decoration: none;
}

.news-detail-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 16px;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.news-detail-meta i {
    margin-right: 5px;
    color: var(--primary);
    opacity: 0.75;
}

.news-detail-content {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-primary);
}

.news-detail-content h2 { font-size: 1.3rem; font-weight: 700; margin: 28px 0 12px; }
.news-detail-content h3 { font-size: 1.1rem; font-weight: 700; margin: 22px 0 10px; }
.news-detail-content p  { margin-bottom: 16px; }
.news-detail-content ul,
.news-detail-content ol { margin: 0 0 16px 24px; }
.news-detail-content li { margin-bottom: 6px; }
.news-detail-content img { max-width: 100%; border-radius: 10px; margin: 12px 0; }
.news-detail-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    background: rgba(var(--primary-rgb,82,130,255),0.06);
    border-radius: 0 10px 10px 0;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-secondary);
}
.news-detail-content a {
    color: var(--primary);
    text-decoration: underline;
}
.news-detail-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 13px;
    margin: 16px 0;
}

/* Related news */
.related-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 32px;
}

.related-news-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s, box-shadow 0.22s;
}

.related-news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.related-news-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.related-news-body {
    padding: 14px;
}

.related-news-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: color 0.2s;
}

.related-news-card:hover .related-news-title {
    color: var(--primary);
}

.related-news-date {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Homepage featured news block */
.home-news-section {
    margin-bottom: 50px;
}

.home-news-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.home-news-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-news-header h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 4px;
}

.home-news-all-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1.5px solid var(--primary);
    border-radius: 50px;
    transition: all 0.2s;
}

.home-news-all-link:hover {
    background: var(--primary);
    color: #fff;
}

.home-news-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Home news card horizontal */
.home-news-card {
    display: grid;
    grid-template-columns: 28% 72%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}

.home-news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.home-news-img-wrap {
    overflow: hidden;
}

.home-news-img {
    width: 100%;
    height: 100%;
    min-height: 140px;
    max-height: 160px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.home-news-card:hover .home-news-img {
    transform: scale(1.05);
}

.home-news-no-img {
    width: 100%;
    min-height: 140px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #94a3b8;
}

.home-news-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.home-news-badge {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(var(--primary-rgb,82,130,255), 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    align-self: flex-start;
}

.home-news-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.42;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.home-news-card:hover .home-news-title {
    color: var(--primary);
}

.home-news-summary {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-news-meta {
    font-size: 11.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-news-meta i {
    color: var(--primary);
    opacity: 0.65;
    margin-right: 3px;
}

/* Responsive */
@media (max-width: 900px) {
    .news-layout {
        grid-template-columns: 1fr;
    }
    .news-sidebar {
        position: static;
    }
    .news-detail-wrap {
        grid-template-columns: 1fr;
    }
    .related-news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .news-compact-header {
        gap: 14px;
    }
    .news-search-wrap {
        min-width: 220px;
    }
}

@media (max-width: 600px) {
    .news-card-h {
        grid-template-columns: 1fr;
    }
    .news-card-h-img-wrap {
        min-height: 180px;
    }
    .news-card-h-img {
        height: 180px;
    }
    .news-detail-body {
        padding: 22px 18px;
    }
    .news-detail-title {
        font-size: 1.35rem;
    }
    .related-news-grid {
        grid-template-columns: 1fr;
    }
    .home-news-card {
        grid-template-columns: 1fr;
    }
    .news-compact-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .news-inline-search {
        width: 100%;
    }
    .news-search-wrap {
        min-width: unset;
        width: 100%;
    }
    .news-compact-title {
        font-size: 1.15rem;
    }
}
