/* 
 * NEWS SERIES SECTION STYLES
 * DHANATERAS REVAMPED V2
 * Dual Layout: Custom Desktop + Mobile Single-Scroller
 */

.series-section {
    width: 100%;
    margin: 40px 0;
    padding: 0 15px;
}

.series-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

body.dark .series-container {
    background: #1a202c;
    border-color: #2d3748;
}

/* Header */
.series-header {
    width: 100%;
    padding: 20px 30px;
    background: linear-gradient(90deg, #E67E22, #D35400);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.series-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.series-header h2 {
    margin: 0;
    font-weight: 600;
    font-size: 1.8rem;
    letter-spacing: 0.5px;
}

.series-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    backdrop-filter: blur(5px);
}

.view-all-series-link {
    background: #fff;
    color: #E67E22;
    padding: 6px 15px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.view-all-series-link:hover {
    transform: translateX(3px);
}

/* Hero Section (Desktop View) */
.series-main {
    width: 100%;
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
}

body.dark .series-main {
    border-color: #2d3748;
}

.series-main-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    gap: 30px;
    align-items: center;
}

.series-main-image {
    flex: 0 0 50%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
}

.series-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.series-main-card:hover .series-main-image img {
    transform: scale(1.05);
}

.series-main-content {
    flex: 1;
}

.series-main-content h3 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 15px;
    color: #1a202c;
    font-weight: 600;
}

body.dark .series-main-content h3 {
    color: #edf2f7;
}

.series-main-content .summary {
    color: #4a5568;
    font-size: 1.1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark .series-main-content .summary {
    color: #a0aec0;
}

/* Episodes Section */
.series-episodes {
    width: 100%;
    background: #fafafa;
    padding: 20px 0;
}

body.dark .series-episodes {
    background: #171923;
}

.episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px 15px;
}

.episodes-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.episodes-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark .nav-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #edf2f7;
}

.nav-btn:hover {
    background: #E67E22;
    color: #fff;
    border-color: #E67E22;
}

.episodes-wrapper {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 30px 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

/* Mobile Hero Injection Logic */
.hero-mobile-card {
    display: none !important;
}

.episode-card {
    flex: 0 0 280px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

body.dark .episode-card {
    background: #2d3748;
    border-color: #1a202c;
}

.episode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #E67E22;
}

.episode-img {
    width: 100%;
    height: 150px;
    overflow: hidden;
    position: relative;
}

.episode-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.episode-tag {
    font-size: 0.75rem;
    color: #E67E22;
    font-weight: 700;
    text-transform: uppercase;
}

.episode-info h4 {
    font-size: 1rem;
    line-height: 1.4;
    margin: 5px 0;
    color: #2d3748;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

body.dark .episode-info h4 {
    color: #edf2f7;
}

.episode-meta {
    font-size: 0.8rem;
    color: #a0aec0;
    display: flex;
    align-items: center;
}

/* =========================================
   MOBILE RESPONSIVE -> Single Scroller Mode
   ========================================= */
@media (max-width: 768px) {
    .series-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 15px 20px;
    }

    .view-all-series-link {
        width: 100%;
        justify-content: center;
    }

    /* Hide Desktop Hero on Mobile */
    .series-main {
        display: none !important;
    }

    /* Show Hero Card in Scroller on Mobile */
    .hero-mobile-card {
        display: flex !important;
    }

    .episodes-header {
        padding: 0 20px 5px;
    }

    .episodes-title {
        display: none;
        /* Hero card effectively acts as title/start */
    }

    .episodes-nav {
        display: none;
    }

    .episodes-wrapper {
        padding: 10px 20px 20px;
        gap: 15px;
    }

    /* Gallery Style Transformation for Mobile Cards */
    .episode-card {
        flex: 0 0 230px;
        background: #f8fafc;
        border-radius: 15px;
        border-color: #edf2f7;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    }

    body.dark .episode-card {
        background: #2d3748;
        border-color: #4a5568;
    }

    .episode-img {
        height: auto;
        aspect-ratio: 16/9;
    }

    .episode-info {
        padding: 12px;
    }

    .episode-tag {
        font-size: 0.75rem;
        margin-bottom: 5px;
    }

    .episode-meta {
        display: none;
    }

    .episode-info h4 {
        font-size: 0.95rem;
        min-height: auto;
        margin: 0;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
}

/* Custom Scrollbar Styles */
.episodes-wrapper::-webkit-scrollbar {
    height: 5px;
}

.episodes-wrapper::-webkit-scrollbar-track {
    background: transparent;
    margin: 0 30px;
}

.episodes-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

body.dark .episodes-wrapper::-webkit-scrollbar-thumb {
    background: #4a5568;
}