/* Homepage News Section Custom Styles */

.news-tabs-wrapper {
    margin-bottom: 3rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.news-tabs-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.news-tabs {
    display: inline-flex;
    gap: 0.75rem;
    padding: 5px 2px;
}

.news-tab-item {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    background: rgba(201, 168, 76, 0.05);
    border: 1px solid rgba(201, 168, 76, 0.15);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    font-family: var(--font-title), serif;
}

.news-tab-item:hover {
    border-color: rgba(201, 168, 76, 0.4);
    color: var(--gold);
}

.news-tab-item.active {
    background: var(--gold);
    color: var(--deep);
    border-color: var(--gold);
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.25);
}

/* Horizontal Scroll Container */
.news-scroll-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    transition: opacity 0.3s ease;
}

@media (max-width: 1024px) {
    .news-scroll-container {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1.25rem;
        margin: 0 -1.5rem;
        padding: 0 1.5rem 1.5rem;
        scrollbar-width: none;
    }
    
    .news-scroll-container::-webkit-scrollbar {
        display: none;
    }

    .news-scroll-container > article {
        flex: 0 0 40%; /* Tablet: ~2.5 items */
        scroll-snap-align: start;
        height: auto;
    }
}

@media (max-width: 768px) {
    .news-scroll-container > article {
        flex: 0 0 80%; /* Mobile: ~1.2 items (100/80 = 1.25, close enough) */
    }
}

/* Load More / Loading Box */
.news-load-more-box {
    flex: 0 0 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(201, 168, 76, 0.03);
    border: 1px dashed rgba(201, 168, 76, 0.2);
    border-radius: 1rem;
    scroll-snap-align: start;
    transition: all 0.3s ease;
    margin-right: 1.5rem;
}

.news-load-more-box.hidden {
    display: none !important;
}

.news-load-more-box .loading-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.news-load-more-box .loading-text {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gold);
    opacity: 0.6;
}

.news-load-more-box.is-loading .loading-logo {
    animation: huyenhoc-spin 2s linear infinite;
    opacity: 1;
}

@keyframes huyenhoc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.news-container-wrapper {
    position: relative;
    min-height: 200px;
}

.news-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 15, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-radius: 1rem;
}

.news-loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Desktop spacing adjustment */
@media (min-width: 1025px) {
    .news-load-more-box {
        display: none !important; /* Only for mobile/tablet scroll */
    }
}
