/* News Page Styles */
/* CAROUSEL / TOP CARDS SECTION */
.top-cards-section {
    padding-top: 5.5rem;
    margin-bottom: 37px;
    overflow: hidden;
    position: relative;
}

/* Ensure space for pagination dots inside the splide wrapper */
.top-cards-splide {
    padding-bottom: 2.7rem !important;
    /* Increased space */
}

/* Custom Splide Pagination */
.top-cards-section .splide__pagination {
    bottom: 0 !important;
    padding: 0 !important;
    transform: translateY(-17px);
    /* Move up slightly */
    z-index: 10;
}

.top-cards-section .splide__pagination__page {
    width: 10px;
    height: 10px;
    background: #cbd5e1;
    /* Light gray */
    border-radius: 50%;
    margin: 0 6px;
    transition: all 0.3s ease;
    opacity: 1;
}

.top-cards-section .splide__pagination__page.is-active {
    background: #ff7e67;
    /* Active color */
    transform: scale(1.2);
}

/* Horizontal Card for Carousel */
.top-card-horizontal {
    display: flex;
    flex-direction: row;
    background: white;
    border-radius: 20px;
    /* Increased rounded corners */
    overflow: hidden;
    /* Softer, larger shadow */
    height: 100%;
    min-height: 120px;
    /* Compact height */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f9fafb;
    /* Lighter border */
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    /* For absolute positioning of share */
}

.top-card-horizontal.visible {
    opacity: 1;
    transform: translateY(0);
}

.top-card-horizontal:hover {
    transform: translateX(3px);
    /* box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12); */
}

.top-card-img-wrapper {
    flex: 0 0 auto;
    width: 110px;
    /* Fixed width for consistency */
    position: relative;
    background: #f3f4f6;
    overflow: hidden;
}

/* Badge for Top Card */
.top-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #0066CC;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    /* Compact padding */
    border-radius: 8px;
    text-transform: uppercase;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    width: max-content;
    /* Fit content */
    max-width: calc(100% - 20px);
    /* Prevent overflow */
    white-space: normal;
    /* Allow text wrapping if really long */
    line-height: 1.2;
    text-align: center;
}

.top-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.top-card-horizontal:hover .top-card-img-wrapper img {
    transform: scale(1.05);
}

.top-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    background: #f9fafb;
}

.top-card-content-wrapper {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    min-width: 0;
}

/* Date Row (Top) */
.top-card-date-row {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    line-height: 1.2;
}

.date-item {
    white-space: nowrap;
}

.date-sep {
    margin: 0 6px;
    color: #e5e7eb;
}

.author-item {
    color: #6b7280;
}

/* Views Row (Bottom of content) */
.top-card-views-row {
    margin-top: auto;
    /* Push to bottom if needed, or just flow naturally */
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #9ca3af;
    width: 100%;
    position: relative;
    /* Context for absolute share menu */
    overflow: visible !important;
}

/* Specific override for Top Card Share Menu positioning */
.top-card-views-row .radial-share-menu {
    bottom: 5% !important;
    right: 5% !important;
}

.meta-item {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
}

.meta-item svg {
    color: #9ca3af;
}

/* Title */
.top-card-title-h {
    text-align: left;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit to 2 lines */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: inherit;
}

.top-card-title-h a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.top-card-title-h a:hover {
    color: #3B82F6;
}

/* Share Button */
.item-share-wrapper {
    position: relative;
    /* Removed absolute positioning */
}

.slide-share-button {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
    font-size: 16px;
    padding: 0;
    position: relative;
    z-index: 30;
}

/* .slide-share-button:hover {
    color: #6b7280;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 50%;
} */

.slide-share-button:hover {
    color: #e09f7d;
}

/* Radial Menu tweaks */
.item-share-wrapper .radial-share-menu {
    position: absolute;
    bottom: 20px;
    right: 0px;
    width: 260px;
    height: 260px;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}

.item-share-wrapper .radial-share-menu.active {
    opacity: 1;
    pointer-events: auto;
}


/* Featured Article - Immersive Overlay Style (Gọn gàng) */
.featured-article-section {
    margin-bottom: 40px;
}

.featured-article-container {
    display: block;
    /* Stacked, not grid */
    position: relative;
    height: 340px;
    /* Fixed compact height */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: none;
}

/* Image Background */
.featured-image-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.featured-article-container:hover .featured-img {
    transform: scale(1.05);
}

/* Gradient Overlay for Text Readability */
.featured-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 40%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Badge (Top Left) */
.featured-category-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #dc2626;
    /* Strong red Accent */
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Date Badge (Top Right) */
.featured-date-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent black */
    color: white;
    font-size: 12px;
    /* Slightly larger as per reference */
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    z-index: 10;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Content Overlay (Bottom) */
.featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: transparent;
}

/* Text Colors -> White theme */
/* Text Colors -> White theme */
.featured-meta-row {
    color: #e5e7eb;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Slight gap between groups */
    flex-wrap: wrap;
    /* Allow wrapping */
}

.meta-sep {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 4px;
}

.featured-date,
.featured-views,
.featured-rating {
    display: flex;
    align-items: center;
}

.featured-views svg {
    margin-right: 8px;
}

.featured-rating .star-rating-container {
    display: flex;
    align-items: center;
    gap: 7px;
}

.featured-rating .icon-sm {
    width: 14px;
    height: 14px;
}

.featured-rating .rating-count {
    margin-left: 6px;
    font-size: 13px;
}

.featured-title {
    font-size: 24px;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 90%;
}

.featured-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 800px;
}

/* Actions */
.featured-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.btn-read-more {
    background: white;
    color: #111827;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-read-more:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    /* Glassy */
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: white;
    color: #111827;
    transform: scale(1.1);
}

.btn-save:hover {
    background: #dc2626;
    color: white;
}

.btn-save.saved {
    background: #dc2626;
    color: white;
}

/* Search Filter Section */
.search-filter-section {
    margin-bottom: 30px;
}

/* Search Filter Sidebar */
.search-filter-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.filter-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.widget-decorator {
    display: block;
    width: 3rem;
    height: 2px;
    background-color: rgb(239, 68, 68);
    margin-bottom: 1rem;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #dc2626;
}

.btn-apply-filter {
    width: 100%;
    background: #dc2626;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-apply-filter:hover {
    background: #b91c1c;
}

/* Main Content Wrapper */
.main-content-wrapper {
    display: block;
    width: 100%;
}

/* Article Grid Section */
.article-grid-section {
    min-height: 400px;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.article-category {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.article-category.lifestyle {
    background: #ec4899;
    color: white;
}

.article-category.food {
    background: #10b981;
    color: white;
}

.article-category.travel {
    background: #3b82f6;
    color: white;
}

.article-date {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
}

.article-image-placeholder {
    height: 180px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
}

.article-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 16px 16px 8px 16px;
    line-height: 1.4;
}

.article-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 16px 16px 16px;
    flex-grow: 1;
}

.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}

.article-views {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    line-height: 1;
}

.article-views svg {
    margin-right: 6px;
    vertical-align: middle;
}

.stars {
    color: #fbbf24;
    font-size: 12px;
}

/* .rating-count {
    font-size: 12px;
    color: #6b7280;
} */

.article-share {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-share:hover {
    background: #f3f4f6;
    color: #dc2626;
}

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 32px;
}

.btn-load-more {
    background: #7986cb;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover {
    transform: translateY(-2px);
}

.btn-load-more:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: #10b981;
}

.toast-error {
    background: #dc2626;
}

.toast-info {
    background: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {

    .top-post-carousel {
        /* If specific adjustments needed */
    }

    .featured-article-container {
        grid-template-columns: 1fr;
    }

    .featured-image-container {
        min-height: 250px;
    }

    .featured-content {
        padding: 24px;
    }

    .featured-title {
        font-size: 22px;
    }

    .main-content-wrapper {
        display: block;
    }

    .search-filter-sidebar {
        display: none;
    }

    .article-grid-section {
        width: 100%;
    }

    .article-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* .btn-read-more,
    .btn-save {
        width: 100%;
        text-align: center;
    } */

    .top-card-img-wrapper {
        flex: 0 0 30%;
    }
}

@media (max-width: 480px) {
    .featured-title {
        font-size: 18px;
    }

    .featured-description {
        font-size: 14px;
    }

    .top-card-horizontal {
        min-height: 120px;
    }

    .top-card-title-h {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
}

/* Loading States */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Print Styles */
@media print {

    .search-filter-sidebar,
    .article-share,
    .btn-load-more,
    .featured-actions {
        display: none;
    }

    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* --- New News Card Styles (Matching Series Card) --- */
.news-card-styled.series-card {
    background-color: rgb(255 255 255);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    /* Ensure full height */
}

.news-card-styled.series-card:hover {
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    transform: translateY(-4px);
}

.news-card-styled .card-image-container {
    position: relative;
}

.news-card-styled .card-image-container>a {
    display: block;
}

.news-card-styled .card-image {
    width: 100%;
    height: 13rem;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card-styled:hover .card-image {
    transform: scale(1.05);
}

.news-card-styled .card-category-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    color: rgb(255 255 255);
    background-color: #D66D75;
    /* Default fallback */
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
}

.news-card-styled .slide-date-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: rgb(0 0 0 / 0.5);
    color: rgb(255 255 255);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.news-card-styled .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-styled .card-content {
    padding: 1.25rem;
    flex-grow: 1;
}

.news-card-styled .card-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: rgb(17 24 39);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.news-card-styled .card-title a {
    text-align: left;
    color: inherit;
    text-decoration: none;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.news-card-styled .card-title a:hover {
    color: #3B82F6;
}

.news-card-styled .card-description {
    color: rgb(75 85 99);
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 5;
    line-clamp: 5;
}

.news-card-styled .card-footer {
    padding: 1.25rem;
    padding-top: 0;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-card-styled .card-stats {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(107 114 128);
}

.news-card-styled .stat-item {
    display: flex;
    align-items: center;
}

.news-card-styled .stat-item svg {
    margin-right: 4px;
}

/* Star Rating Styles */
.news-card-styled .star-rating-container {
    display: flex;
    align-items: center;
    gap: 2px;
}

.news-card-styled .icon-sm {
    width: 14px;
    height: 14px;
}

.news-card-styled .card-share-button {
    color: rgb(156 163 175);
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 30;
}

.news-card-styled .card-share-button:hover {
    color: #e09f7d;
}

/* Category colors with higher specificity */
.news-card-styled .card-category-badge.bg-podcast {
    background-color: #8b5cf6;
}

.news-card-styled .card-category-badge.bg-truyen-thong {
    background-color: #95A5A6;
}

.news-card-styled .card-category-badge.bg-doi-tac {
    background-color: #758CA3;
}

.news-card-styled .card-category-badge.bg-gender-insights {
    background-color: #D66D75;
}

/* Dark Mode Overrides for News Cards (matching Series) */
[data-theme="dark"] .news-card-styled.series-card {
    background-color: #252E36;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .news-card-styled .card-title {
    color: #f3f4f6;
}

[data-theme="dark"] .news-card-styled .card-description {
    color: #9ca3af;
}

[data-theme="dark"] .news-card-styled .card-stats {
    color: #9ca3af;
}

[data-theme="dark"] .news-card-styled .card-share-button {
    color: #9ca3af;
}

[data-theme="dark"] .news-card-styled .card-share-button:hover {
    color: #e09f7d;
}

/* Dark Mode Overrides for Top Cards (Carousel) */
[data-theme="dark"] .top-card-horizontal {
    background-color: #252E36;
    border-color: #34404B;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .top-card-title-h {
    color: #f3f4f6;
}

[data-theme="dark"] .top-card-img-wrapper {
    background-color: #1e293b;
}

[data-theme="dark"] .top-card-placeholder {
    background-color: #1e293b;
    color: #4b5563;
}

[data-theme="dark"] .top-card-date-row {
    color: #9ca3af;
}

[data-theme="dark"] .top-card-views-row {
    color: #9ca3af;
}

[data-theme="dark"] .date-sep {
    color: #4b5563;
}

[data-theme="dark"] .slide-share-button {
    color: #9ca3af;
}

[data-theme="dark"] .slide-share-button:hover {
    color: #e09f7d;
}