/* ==========================================================================
   NEW MODERN NEWS DESIGN - VIET THAI (FULL WHITE THEME)
   ========================================================================== */



/* --- News Headers (Flat Full White Background) --- */
.news-header-section {
    padding: 8.5rem 0 2rem;
    /* Clean padding below navigation */
    background: #ffffff;
}

.news-header-content {
    width: 100%;
}

.news-subtitle {
    display: inline-block;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.news-main-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    color: var(--fg);
    line-height: 1.15;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.news-desc {
    font-size: 1.05rem;
    color: var(--muted-fg);
    line-height: 1.5;
}

/* --- Sort Bar --- */
.filter-container {
    padding: 0.75rem 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
    position: sticky;
    top: 4rem;
    /* Below fixed nav */
    z-index: 10;
}

.filter-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.sort-select-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--fg);
    font-weight: 600;
}

.sort-select-wrapper label {
    margin: 0;
    white-space: nowrap;
}

.sort-select-wrapper select {
    padding: 0.35rem 1.5rem 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: #fff;
    font-size: 0.85rem;
    color: var(--fg);
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
}

.sort-select-wrapper select:focus {
    border-color: var(--primary);
}

/* --- News Grid --- */
.news-section {
    padding: 2.5rem 0 5rem;
    background: var(--muted);
}

/* --- UNIFIED HOME PAGE NEWS CARD STYLES --- */
.news-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 1.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.news-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--muted);
}

.news-card-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.35) 100%);
    opacity: 0.8;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.news-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.news-card:hover .news-card-img-wrap::after {
    opacity: 1;
}

.news-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--muted-fg);
    font-size: 2.5rem;
}

.news-card-date-chip {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    z-index: 2;
}

.news-card-date-chip i {
    font-size: 0.7rem;
    opacity: 0.85;
}

.news-card:hover .news-card-date-chip {
    background: var(--primary);
    color: var(--primary-fg);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 115, 212, 0.2);
}

.news-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    background: rgba(17, 115, 212, 0.06);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    width: fit-content;
    transition: all 0.3s ease;
}

.news-card:hover .news-card-category {
    background: var(--primary);
    color: var(--primary-fg);
}

.news-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--fg);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
    height: 3.1rem;
}

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

.news-card-desc {
    font-size: 0.875rem;
    color: var(--muted-fg);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.news-card-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    transition: all 0.3s ease;
}

.news-card-link i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

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

.news-card:hover .news-card-link i {
    transform: translateX(5px);
}

/* --- Pagination --- */
.news-pagination-wrapper {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
}

.news-pagination-wrapper nav {
    position: static;
    margin-top: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.news-pagination-wrapper nav span,
.news-pagination-wrapper nav a {
    border-radius: 8px;
    margin: 0 4px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.news-pagination-wrapper nav a:hover {
    background-color: var(--muted);
    color: var(--primary);
}

/* --- Empty state --- */
.news-empty-state {
    text-align: center;
    padding: 5rem 1.5rem;
    background: #fff;
    border-radius: 1.25rem;
    margin: 0 auto;
}

.empty-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.news-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--fg);
}

.news-empty-state p {
    color: var(--muted-fg);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* ==========================================================================
   ARTICLE DETAIL PAGE (Show Page - Wide Layout)
   ========================================================================== */

.article-detail-section {
    padding: 8.5rem 0 4rem;
    /* Safe spacing under navigation */
    background: #ffffff;
}

.article-header {
    margin: 0 auto 2rem;
    width: 100%;
}

.article-category {
    display: inline-block;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    text-decoration: none;
}

.article-detail-title {
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    color: var(--fg);
    line-height: 1.25;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.article-detail-meta-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.article-author-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: var(--muted-fg);
}

.article-author-info span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.article-author-info .author-name {
    color: var(--fg);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.author-logo-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid var(--border);
    padding: 2px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.45rem;
}

/* --- Framed Cover Image below Title (Wide) --- */
.article-detail-cover {
    width: 100%;
    max-width: 640px;
    margin: 0 auto 2.5rem;
}

.article-detail-cover-img {
    width: 100%;
    max-height: 540px;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.08);
    display: block;
}

/* --- Article Body Content (Wide) --- */
.article-content-wrapper {
    width: 100%;
    margin: 0 auto;
}

.article-detail-body {
    color: #334155;
    line-height: 1.85;
    font-size: 1.05rem;
}

.article-detail-body h2,
.article-detail-body h3,
.article-detail-body h4 {
    color: var(--fg);
    font-weight: 600;
    margin: 2.25rem 0 1rem;
    line-height: 1.3;
}

.article-detail-body h2 {
    font-size: 1.45rem;
    border-left: 4px solid var(--primary);
    padding-left: 0.75rem;
}

.article-detail-body h3 {
    font-size: 1.25rem;
}

.article-detail-body h4 {
    font-size: 1.1rem;
}

.article-detail-body p {
    margin-bottom: 1.5rem;
}

.article-detail-body p strong {
    color: var(--fg);
}

.article-detail-body ul,
.article-detail-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-detail-body ul {
    list-style-type: disc;
}

.article-detail-body ol {
    list-style-type: decimal;
}

.article-detail-body li {
    margin-bottom: 0.5rem;
}

.article-detail-body blockquote {
    border-left: 4px solid var(--primary);
    background: #f8fafc;
    padding: 1.25rem 1.75rem;
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
    font-style: italic;
    color: #475569;
}

.article-detail-body blockquote p {
    margin-bottom: 0;
}

.article-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2.5rem auto;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.article-detail-body a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.article-detail-body a:hover {
    color: var(--primary-hover);
}

.article-detail-body figure {
    margin: 2rem 0;
    text-align: center;
}

.article-detail-body figcaption {
    font-size: 0.875rem;
    color: var(--muted-fg);
    margin-top: 0.5rem;
}

.article-detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.article-detail-body th,
.article-detail-body td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.article-detail-body th {
    background-color: var(--muted);
    color: var(--fg);
    font-weight: 600;
}

.article-detail-body tr:nth-child(even) {
    background-color: #f8fafc;
}

/* --- Signature Block --- */
.article-signature {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 3.5rem 0 2rem;
}

.article-signature h4 {
    color: var(--primary) !important;
    font-size: 1.15rem !important;
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    font-weight: 600;
}

.article-signature p {
    margin-bottom: 0.5rem !important;
    font-size: 0.95rem;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-signature p i {
    color: var(--primary);
    width: 16px;
}

.signature-note {
    margin-top: 1rem !important;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
    font-style: italic;
    color: var(--muted-fg) !important;
    font-size: 0.9rem !important;
}

/* --- Footer Sharing Section --- */
.article-footer-share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-bottom: 3rem;
}

.share-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--fg);
}

.share-buttons-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-buttons-group .article-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--fg);
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.share-buttons-group .article-share-btn.fb:hover {
    border-color: #1877f2;
    background: rgba(24, 119, 242, 0.04);
    color: #1877f2;
}

.share-buttons-group .article-share-btn.tw:hover {
    border-color: #1da1f2;
    background: rgba(29, 161, 242, 0.04);
    color: #1da1f2;
}

.share-buttons-group .article-share-btn.tg:hover {
    border-color: #0088cc;
    background: rgba(0, 136, 204, 0.04);
    color: #0088cc;
}

.share-buttons-group .article-share-btn.copy-link:hover {
    border-color: var(--primary);
    background: rgba(17, 115, 212, 0.04);
    color: var(--primary);
}

/* --- Related Categories Grid (Products) --- */
.related-section {
    padding: 4rem 0;
    background-color: #f8fafc;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-top: 4rem;
}

.section-header-custom {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title-custom {
    font-size: 1.75rem;
    color: var(--fg);
    margin-bottom: 0.5rem;
}

.section-desc-custom {
    font-size: 0.95rem;
    color: var(--muted-fg);
}

/* Child categories grid copied from category.css but scoped */
.category-children-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .category-children-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .category-children-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .category-children-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.category-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--muted);
    color: var(--muted-fg);
    font-size: 2.5rem;
}

/* --- Other News Grid --- */
.other-news-section {
    padding: 4rem 0 5rem;
    background: #ffffff;
}