/**
 * Series Grid Styles (Level 1 - Series Catalog)
 *
 * Grid of series cards with thumbnail, season badge,
 * title, and genre pills. Each card links to the Series Detail page.
 *
 * Uses CSS custom properties for easy theming via shortcode
 * attributes, Elementor controls, and Gutenberg block settings.
 *
 * @package Tvstartup_OTT_Platform
 * @since   1.13.0
 */

/* ==========================================================================
   CSS Custom Properties (Defaults)
   ========================================================================== */

.ts-ott-series {
    --ts-ott-font-family: inherit;
    --ts-ott-title-color: #1a1a2e;
    --ts-ott-desc-color: #6b7280;
    --ts-ott-bg-color: #ffffff;
    --ts-ott-accent-color: #6366f1;
    --ts-ott-border-radius: 12px;
    --ts-ott-card-padding: 1rem;
    --ts-ott-card-spacing: 1.25rem;
    --ts-ott-columns: 4;
    --ts-ott-transition: 0.25s ease;

    font-family: var(--ts-ott-font-family);
    box-sizing: border-box;
    width: 100%;
}

.ts-ott-series *,
.ts-ott-series *::before,
.ts-ott-series *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.ts-ott-series--empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ts-ott-desc-color);
    font-size: 1rem;
}

/* ==========================================================================
   Series Card Link Wrapper
   ========================================================================== */

.ts-ott-series-card-link,
.ts-ott-series-card-link:link,
.ts-ott-series-card-link:visited {
    text-decoration: none !important;
    color: inherit;
    display: flex;
    height: 100%;
}

.ts-ott-series-card-link:hover,
.ts-ott-series-card-link:focus,
.ts-ott-series-card-link:active {
    text-decoration: none !important;
    color: inherit;
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.ts-ott-series--grid {
    display: grid;
    grid-template-columns: repeat(var(--ts-ott-columns), 1fr);
    gap: var(--ts-ott-card-spacing);
}

/* ==========================================================================
   Series Card (Base Styles)
   ========================================================================== */

.ts-ott-series-card {
    background-color: var(--ts-ott-bg-color);
    border-radius: var(--ts-ott-border-radius);
    overflow: hidden;
    transition: transform var(--ts-ott-transition),
                box-shadow var(--ts-ott-transition);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    width: 100%;
}

.ts-ott-series-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* --- Thumbnail --- */

.ts-ott-series-card__thumbnail {
    position: relative;
    overflow: hidden;
    background-color: #f3f4f6;
    aspect-ratio: 16 / 9;
}

.ts-ott-series-card__thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ts-ott-transition);
}

.ts-ott-series-card:hover .ts-ott-series-card__thumbnail img {
    transform: scale(1.05);
}

.ts-ott-series-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background-color: #f3f4f6;
    color: #d1d5db;
}

/* --- Season Count Badge --- */

.ts-ott-series-card__seasons-badge {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background-color: var(--ts-ott-accent-color);
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    line-height: 1.4;
    z-index: 5;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

/* --- Content --- */

.ts-ott-series-card__content {
    padding: var(--ts-ott-card-padding);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ts-ott-series-card__genres {
    margin-top: auto;
}

.ts-ott-series-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ts-ott-title-color);
    margin: 0 0 0.375rem 0;
    line-height: 1.3;
    font-family: var(--ts-ott-font-family);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ts-ott-series-card__desc {
    font-size: 0.8125rem;
    color: var(--ts-ott-desc-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Genre Tags --- */

.ts-ott-series-card__genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ts-ott-series-genre-tag {
    display: inline-block;
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--ts-ott-accent-color);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.1875rem 0.5rem;
    border-radius: 9999px;
    line-height: 1.4;
}

/* ==========================================================================
   Responsive: Large Tablet (max-width: 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .ts-ott-series--grid {
        --ts-ott-columns: 3;
    }
}

/* ==========================================================================
   Responsive: Tablet (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .ts-ott-series--grid {
        --ts-ott-columns: 2;
    }
}

/* ==========================================================================
   Responsive: Mobile (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {
    .ts-ott-series--grid {
        --ts-ott-columns: 1;
    }

    .ts-ott-series {
        --ts-ott-card-spacing: 0.75rem;
    }

    .ts-ott-series-card__title {
        font-size: 0.9375rem;
    }
}

/* ==========================================================================
   Gutenberg Editor Preview Wrapper
   ========================================================================== */

.ts-ott-block-preview {
    padding: 0;
}
