/* =========================================================
   TV PAGE
========================================================= */

.tv-page {
    min-height: 100vh;
}


/* =========================================================
   HERO
========================================================= */

.tv-hero {
    position: relative;

    min-height: 650px;

    overflow: hidden;

    background: #090909;
}


.tv-backdrop {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    opacity: .55;
}


.tv-backdrop-overlay {
    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(0,0,0,.97) 0%,
            rgba(0,0,0,.88) 30%,
            rgba(0,0,0,.50) 65%,
            rgba(0,0,0,.25) 100%
        ),
        linear-gradient(
            0deg,
            #171717 0%,
            rgba(23,23,23,.35) 25%,
            transparent 55%
        );
}


.tv-hero-content {
    position: relative;

    z-index: 5;

    width: min(
        1450px,
        92%
    );

    min-height: 650px;

    margin: auto;

    padding: 60px 0;

    display: flex;

    align-items: center;

    gap: 45px;
}


/* POSTER */

.tv-poster-column {
    flex: 0 0 280px;
}


.tv-poster {
    display: block;

    width: 100%;

    aspect-ratio: 2 / 3;

    object-fit: cover;

    border-radius: 8px;

    box-shadow:
        0
        20px
        50px
        rgba(0,0,0,.60);
}


/* INFORMATION */

.tv-info {
    max-width: 820px;
}


.tv-type {
    display: inline-block;

    padding: 6px 10px;

    margin-bottom: 12px;

    background: #ff7d00;

    border-radius: 4px;

    font-size: 11px;

    font-weight: 800;
}


.tv-info h1 {
    margin: 0;

    font-size: clamp(
        40px,
        5vw,
        68px
    );

    line-height: 1.05;
}


.tv-tagline {
    margin-top: 12px;

    color: #ccc;

    font-style: italic;
}


.tv-meta {
    display: flex;

    align-items: center;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 20px;
}


.tv-meta span {
    padding-right: 10px;

    border-right:
        1px solid
        rgba(255,255,255,.25);

    color: #eee;

    font-size: 14px;
}


.tv-meta span:last-child {
    border-right: 0;
}


.tv-rating {
    color: #ffd568 !important;

    font-weight: 700;
}


/* GENRES */

.tv-genres {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 17px;
}


.tv-genres span {
    padding: 6px 10px;

    border:
        1px solid
        rgba(255,255,255,.28);

    border-radius: 20px;

    background:
        rgba(255,255,255,.07);

    font-size: 12px;
}


/* OVERVIEW */

.tv-overview {
    max-width: 760px;

    margin-top: 22px;

    color: #ddd;

    font-size: 15px;

    line-height: 1.7;
}


/* BUTTONS */

.tv-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 24px;
}


.tv-watch-button,
.tv-trailer-button {
    height: 44px;

    display: inline-flex;

    align-items: center;

    padding: 0 19px;

    border-radius: 5px;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;
}


.tv-watch-button {
    background: #fff;

    color: #111;

    text-decoration: none;
}


.tv-trailer-button {
    border:
        1px solid
        rgba(255,255,255,.35);

    background:
        rgba(255,255,255,.12);

    color: #fff;
}


/* EXTRA */

.tv-extra-info {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 10px 28px;

    margin-top: 30px;

    color: #ccc;

    font-size: 13px;
}


.tv-extra-info strong {
    color: #fff;
}


/* =========================================================
   GENERAL SECTION
========================================================= */

.tv-section {
    width: min(
        1450px,
        94%
    );

    margin: auto;

    padding: 30px 0;
}


.tv-section > h2,
.season-header h2 {
    margin: 0 0 18px;

    font-size: 23px;
}


/* =========================================================
   CAST
========================================================= */

.tv-cast-row {
    display: flex;

    gap: 16px;

    overflow-x: auto;

    padding-bottom: 8px;

    scrollbar-width: none;
}


.tv-cast-row::-webkit-scrollbar {
    display: none;
}


.tv-cast-card {
    flex: 0 0 130px;
}


.tv-cast-photo {
    width: 110px;
    height: 110px;

    overflow: hidden;

    margin-bottom: 9px;

    border-radius: 50%;

    background: #292929;
}


.tv-cast-photo img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    object-position: center top;
}


.tv-cast-placeholder {
    width: 100%;
    height: 100%;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 36px;
}


.tv-cast-card strong {
    display: block;

    font-size: 13px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.tv-cast-card span {
    display: block;

    margin-top: 4px;

    color: #999;

    font-size: 11px;

    line-height: 1.3;
}


/* =========================================================
   SEASONS
========================================================= */

.season-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}


.season-header h2 {
    margin: 0;
}


.season-selector {
    display: flex;

    gap: 8px;

    overflow-x: auto;

    scrollbar-width: none;
}


.season-selector::-webkit-scrollbar {
    display: none;
}


.season-button {
    flex: 0 0 auto;

    padding: 9px 14px;

    border:
        1px solid
        #3c3c3c;

    border-radius: 5px;

    background: #222;

    color: #ddd;

    text-decoration: none;

    font-size: 13px;
}


.season-button:hover {
    background: #333;
}


.season-button.active {
    background: #fff;

    border-color: #fff;

    color: #111;
}


/* SELECTED SEASON */

.selected-season-info {
    margin-bottom: 20px;
}


.selected-season-info h3 {
    margin: 0 0 8px;

    font-size: 18px;
}


.selected-season-info p {
    max-width: 850px;

    margin: 0;

    color: #aaa;

    font-size: 13px;

    line-height: 1.6;
}


/* =========================================================
   EPISODES
========================================================= */

.episode-list {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 14px;
}


.episode-card {
    display: grid;

    grid-template-columns:
        210px
        minmax(0, 1fr);

    overflow: hidden;

    background: #242424;

    border:
        1px solid
        #303030;

    border-radius: 6px;
}


.episode-still {
    position: relative;

    min-height: 120px;

    background: #191919;
}


.episode-still img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


.episode-no-image {
    width: 100%;
    height: 100%;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #777;
}


.episode-number-badge {
    position: absolute;

    left: 7px;
    bottom: 7px;

    padding: 4px 7px;

    background:
        rgba(0,0,0,.80);

    border-radius: 3px;

    font-size: 10px;

    font-weight: 700;
}


.episode-info {
    padding: 14px;
}


.episode-title-row {
    display: flex;

    justify-content: space-between;

    gap: 12px;
}


.episode-label {
    color: #999;

    font-size: 10px;

    text-transform: uppercase;
}


.episode-info h3 {
    margin: 4px 0 0;

    font-size: 16px;
}


.episode-watch {
    flex: 0 0 auto;

    align-self: flex-start;

    padding: 8px 11px;

    background: #fff;

    border-radius: 4px;

    color: #111;

    text-decoration: none;

    font-size: 11px;

    font-weight: 700;
}


.episode-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 9px;

    color: #999;

    font-size: 11px;
}


.episode-info p {
    margin: 9px 0 0;

    color: #aaa;

    font-size: 12px;

    line-height: 1.5;

    display: -webkit-box;

    -webkit-line-clamp: 2;

    -webkit-box-orient: vertical;

    overflow: hidden;
}


.no-episodes {
    padding: 30px;

    background: #222;

    border-radius: 5px;

    color: #aaa;

    text-align: center;
}


/* =========================================================
   RECOMMENDATIONS
========================================================= */

.tv-recommendations {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );

    gap: 15px;
}


.tv-recommendation-card {
    overflow: hidden;

    background: #292929;

    border-radius: 5px;

    color: #fff;

    text-decoration: none;

    transition:
        transform .2s ease;
}


.tv-recommendation-card:hover {
    transform: translateY(-3px);
}


.tv-recommendation-image {
    position: relative;

    aspect-ratio: 16 / 9;

    overflow: hidden;
}


.tv-recommendation-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


.tv-recommendation-image span {
    position: absolute;

    right: 6px;
    bottom: 6px;

    padding: 3px 6px;

    background:
        rgba(0,0,0,.78);

    border-radius: 3px;

    font-size: 11px;
}


.tv-recommendation-title {
    padding: 10px;

    font-size: 14px;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   TRAILER
========================================================= */

.tv-trailer-modal {
    position: fixed;

    inset: 0;

    z-index: 5000;

    display: none;

    align-items: center;

    justify-content: center;

    padding: 20px;
}


.tv-trailer-modal.open {
    display: flex;
}


.tv-trailer-background {
    position: absolute;

    inset: 0;

    background:
        rgba(0,0,0,.90);
}


.tv-trailer-window {
    position: relative;

    z-index: 5;

    width: min(
        1000px,
        95vw
    );

    background: #000;
}


.tv-trailer-frame {
    width: 100%;

    aspect-ratio: 16 / 9;
}


.tv-trailer-frame iframe {
    width: 100%;
    height: 100%;

    border: 0;
}


.tv-trailer-close {
    position: absolute;

    right: 0;
    top: -45px;

    border: 0;

    background: transparent;

    color: #fff;

    font-size: 38px;

    cursor: pointer;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    .episode-list {
        grid-template-columns: 1fr;
    }


    .tv-recommendations {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .tv-hero {
        min-height: auto;
    }


    .tv-backdrop {
        height: 330px;
    }


    .tv-backdrop-overlay {
        background:
            linear-gradient(
                0deg,
                #171717 0%,
                #171717 22%,
                rgba(23,23,23,.78) 48%,
                rgba(0,0,0,.20) 100%
            );
    }


    .tv-hero-content {
        width: 92%;

        min-height: auto;

        flex-direction: column;

        align-items: flex-start;

        gap: 20px;

        padding:
            200px
            0
            30px;
    }


    .tv-poster-column {
        flex: none;

        width: 125px;
    }


    .tv-info h1 {
        font-size: 34px;
    }


    .tv-overview {
        font-size: 14px;
    }


    .tv-extra-info {
        grid-template-columns: 1fr;
    }


    .tv-section {
        width:
            calc(
                100% - 28px
            );

        padding: 24px 0;
    }


    .season-header {
        display: block;
    }


    .season-selector {
        margin-top: 14px;
    }


    .episode-card {
        grid-template-columns:
            135px
            minmax(0, 1fr);
    }


    .episode-still {
        min-height: 105px;
    }


    .episode-info {
        padding: 10px;
    }


    .episode-title-row {
        display: block;
    }


    .episode-watch {
        display: inline-flex;

        margin-top: 9px;
    }


    .episode-info p {
        display: none;
    }


    .tv-recommendations {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 10px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 450px) {

    .tv-hero-content {
        padding-top: 180px;
    }


    .tv-poster-column {
        width: 110px;
    }


    .tv-info h1 {
        font-size: 30px;
    }


    .episode-card {
        display: block;
    }


    .episode-still {
        aspect-ratio: 16 / 9;
    }

}