/* =========================================================
   5TV Content Single
========================================================= */

.ftv-container {
    width: min(100% - 2rem, 92rem);
    margin-inline: auto;
}

.ftv-content-hero {
    position: relative;
    overflow: hidden;

    margin: 1.5rem auto 0;
    width: min(calc(100% - 2rem), 92rem);

    min-height: 26rem;

    border: 1px solid var(--border);
    border-radius: 1.35rem;

    background:
        linear-gradient(
            90deg,
            rgb(8 10 13 / 96%),
            rgb(8 10 13 / 82%),
            rgb(8 10 13 / 60%)
        ),
        var(--ftv-backdrop);

    background-size: cover;
    background-position: center;
}

.ftv-content-hero__overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to top,
            rgb(8 10 13 / 96%) 0%,
            transparent 60%
        );
}

.ftv-content-hero__inner {
    position: relative;
    z-index: 2;

    min-height: 26rem;

    display: grid;
    grid-template-columns: 12.5rem minmax(0, 1fr);
    align-items: center;
    gap: 2rem;

    padding-block: 2rem;
}

.ftv-content-hero__poster {
    overflow: hidden;

    aspect-ratio: 2 / 3;

    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 1rem;

    background: var(--surface);
}

.ftv-content-hero__poster img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.ftv-content-hero__content {
    max-width: 55rem;
}

.ftv-content-hero__title {
    margin: 0 0 .65rem;

    font-size: clamp(
        1.8rem,
        3.2vw,
        2.75rem
    );

    line-height: 1.15;
}

.ftv-content-hero__meta,
.ftv-content-hero__genres {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;

    margin-block-end: .65rem;
}

.ftv-content-hero__meta span,
.ftv-content-hero__genres span {
    padding: .35rem .65rem;

    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 999px;

    background: rgb(20 22 27 / 80%);

    color: var(--text-muted);

    font-size: .76rem;
    line-height: 1;
}

.ftv-content-hero__description {
    max-width: 50rem;

    color: var(--text-muted);

    font-size: .92rem;
    line-height: 1.9;
}

.ftv-content-hero__description p {
    margin: 0;
}

.ftv-content-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;

    margin-block-start: 1.1rem;
}

.ftv-content-action {
    min-height: 2.75rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding-inline: 1rem;

    border-radius: .75rem;

    font-size: .82rem;
    font-weight: 700;
}

.ftv-content-action--primary {
    background: var(--accent);
    color: #111;
}


/* Sections
--------------------------------------------------------- */

.ftv-content-section {
    padding-block-start: 1.25rem;
}

.ftv-content-panel {
    padding: 1.4rem;

    border: 1px solid var(--border);
    border-radius: 1.2rem;

    background: var(--surface);
}

.ftv-content-panel h2 {
    margin: 0 0 1rem;

    font-size: 1.25rem;
}

.ftv-content-placeholder {
    margin: 0;
    padding-block: 0.5rem;
    color: var(--text-muted);
    text-align: center;
}


/* Credits
--------------------------------------------------------- */

.ftv-credits-group + .ftv-credits-group {
    margin-block-start: 1.1rem;
}

.ftv-credits-label {
    display: block;

    margin-block-end: .55rem;

    color: var(--text-muted);

    font-size: .78rem;
}

.ftv-credits-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.ftv-credits-list a {
    display: inline-flex;
    align-items: baseline;
    gap: .3rem;

    padding: .45rem .7rem;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface-2);

    color: var(--text);

    font-size: .76rem;
}

.ftv-credits-list small {
    color: var(--text-muted);
    font-size: .68rem;
}

.ftv-credits-list em {
    color: var(--accent);
    font-size: .68rem;
    font-style: normal;
}


/* Episode
--------------------------------------------------------- */

.ftv-episode-head {
    padding-block-start: 1.5rem;
}

.ftv-episode-head h1 {
    margin: .7rem 0 0;

    font-size: clamp(
        1.55rem,
        3vw,
        2.4rem
    );
}

.ftv-episode-back {
    display: inline-flex;

    padding: .5rem .7rem;

    border: 1px solid var(--border);
    border-radius: .65rem;

    background: var(--surface);

    color: var(--text-muted);

    font-size: .75rem;
}


/* Mobile
--------------------------------------------------------- */

@media (max-width: 700px) {

    .ftv-container {
        width: min(100% - 1rem, 100%);
    }

    .ftv-content-hero {
        width: calc(100% - 1rem);
        margin-block-start: .75rem;

        min-height: auto;

        border-radius: 1rem;
    }

    .ftv-content-hero__inner {
        min-height: auto;

        grid-template-columns: 6.8rem minmax(0, 1fr);
        align-items: start;

        gap: .9rem;

        padding-block: 1rem;
    }

    .ftv-content-hero__poster {
        border-radius: .75rem;
    }

    .ftv-content-hero__title {
        margin-block-start: .1rem;

        font-size: 1.35rem;
        line-height: 1.25;
    }

    .ftv-content-hero__meta,
    .ftv-content-hero__genres {
        gap: .3rem;

        margin-block-end: .45rem;
    }

    .ftv-content-hero__meta span,
    .ftv-content-hero__genres span {
        padding: .3rem .5rem;

        font-size: .65rem;
    }

    .ftv-content-hero__description {
        grid-column: 1 / -1;

        font-size: .78rem;
        line-height: 1.75;
    }

    .ftv-content-hero__actions {
        grid-column: 1 / -1;

        margin-block-start: .65rem;
    }

    .ftv-content-action,
    .ftv-mylist-button__toggle {
        min-height: 2.45rem;

        font-size: .74rem;
    }

    .ftv-content-section {
        padding-block-start: .75rem;
    }

    .ftv-content-panel {
        padding: .95rem;

        border-radius: .9rem;
    }

    .ftv-content-panel h2 {
        margin-block-end: .75rem;

        font-size: 1.05rem;
    }

    .ftv-credits-list {
        gap: .4rem;
    }

    .ftv-credits-list a {
        padding: .4rem .6rem;

        font-size: .7rem;
    }

    .ftv-credits-list small,
    .ftv-credits-list em {
        font-size: .62rem;
    }

    .ftv-episode-head {
        padding-block-start: .9rem;
    }

    .ftv-episode-head h1 {
        font-size: 1.4rem;
    }
}


/* =========================================================
   FIX: Hero dropdown + clickable taxonomy chips
========================================================= */

/*
 * Allow My List dropdown to leave the Hero box.
 * Border radius still clips the element background itself.
 */
.ftv-content-hero {
    overflow: visible;
    position: relative;
    z-index: 20;
}

.ftv-content-hero__overlay {
    border-radius: inherit;
    pointer-events: none;
}


/* Make sure My List dropdown stays above following sections */
.ftv-content-hero .ftv-mylist-button {
    position: relative;
    z-index: 500;
}

.ftv-content-hero .ftv-mylist-button__menu {
    z-index: 9999;
}


/* Taxonomy chips
--------------------------------------------------------- */

.ftv-content-hero__meta .ftv-content-chip,
.ftv-content-hero__genres .ftv-content-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: .35rem .65rem;

    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 999px;

    background: rgb(20 22 27 / 80%);

    color: var(--text-muted);

    font-size: .76rem;
    line-height: 1;

    text-decoration: none;

    transition:
        color 140ms ease,
        border-color 140ms ease,
        background 140ms ease;
}

.ftv-content-hero__meta a.ftv-content-chip:hover,
.ftv-content-hero__genres a.ftv-content-chip:hover {
    color: var(--text);

    border-color: rgb(255 255 255 / 20%);

    background: rgb(35 38 45 / 92%);
}


/* Primary category gets a tiny visual distinction */
.ftv-content-chip--category {
    color: var(--accent) !important;

    border-color:
        color-mix(
            in srgb,
            var(--accent) 35%,
            transparent
        ) !important;
}


/* Year is information only, not a link */
.ftv-content-chip--plain {
    cursor: default;
}


/* Prevent old span rules from fighting new links */
.ftv-content-hero__meta span,
.ftv-content-hero__genres span {
    font: inherit;
}


/* Following content stays below Hero dropdown */
.ftv-content-section {
    position: relative;
    z-index: 1;
}


/* Mobile */
@media (max-width: 700px) {

    .ftv-content-hero__meta .ftv-content-chip,
    .ftv-content-hero__genres .ftv-content-chip {
        padding: .3rem .5rem;
        font-size: .65rem;
    }

    .ftv-content-hero .ftv-mylist-button__menu {
        max-width: calc(100vw - 1.5rem);
    }
}


/* =========================================================
   5TV HERO META LAYOUT V2
========================================================= */

/* Year above title
--------------------------------------------------------- */

.ftv-content-hero__year {
    margin-block-end: .4rem;
}

.ftv-content-hero__year a,
.ftv-content-hero__year span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 3rem;

    padding: .3rem .6rem;

    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 999px;

    background: rgb(12 14 18 / 74%);

    color: #d5d7dc;

    font-size: .68rem;
    font-weight: 700;

    line-height: 1;

    text-decoration: none;

    backdrop-filter: blur(8px);
}

.ftv-content-hero__year a:hover {
    color: #fff;
    border-color: rgb(255 255 255 / 24%);
}


/* Main row:
   category + quality + status
--------------------------------------------------------- */

.ftv-content-hero__main-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: .4rem;

    margin-block:
        .1rem
        .55rem;
}


/* Genres
--------------------------------------------------------- */

.ftv-content-hero__genres {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: .35rem;

    margin-block-end: .45rem;
}


/* Country + language
--------------------------------------------------------- */

.ftv-content-hero__secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: .3rem;

    margin-block-end: .6rem;
}


/* Shared chips
--------------------------------------------------------- */

.ftv-content-hero__main-meta .ftv-content-chip,
.ftv-content-hero__genres .ftv-content-chip,
.ftv-content-hero__secondary .ftv-content-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 1.7rem;

    padding-inline: .62rem;

    border: 1px solid rgb(255 255 255 / 11%);
    border-radius: 999px;

    background: rgb(21 23 28 / 76%);

    color: #b9bdc5;

    font-size: .68rem;
    font-weight: 600;

    line-height: 1;

    text-decoration: none;

    transition:
        background 140ms ease,
        color 140ms ease,
        border-color 140ms ease;
}

.ftv-content-hero__main-meta .ftv-content-chip:hover,
.ftv-content-hero__genres .ftv-content-chip:hover,
.ftv-content-hero__secondary .ftv-content-chip:hover {
    background: rgb(38 41 48 / 90%);
    border-color: rgb(255 255 255 / 20%);

    color: #fff;
}


/* Primary category */
.ftv-content-chip--category {
    color: var(--accent) !important;

    border-color:
        color-mix(
            in srgb,
            var(--accent) 32%,
            transparent
        ) !important;
}


/* Quality */
.ftv-content-chip--quality {
    color: #e3e5e8 !important;
}


/* Status */
.ftv-content-chip--status {
    color: #bfc5ce !important;
}


/* Genre */
.ftv-content-chip--genre {
    background: rgb(16 18 22 / 66%) !important;
}


/* Country/language quieter */
.ftv-content-chip--secondary {
    min-height: auto !important;

    padding:
        .18rem
        .1rem !important;

    border: 0 !important;

    background: transparent !important;

    color: #9298a2 !important;

    font-size: .65rem !important;
}

.ftv-content-chip--secondary + .ftv-content-chip--secondary::before {
    content: "•";

    margin-inline-end: .35rem;

    color: #646a74;
}


/* Title spacing
--------------------------------------------------------- */

.ftv-content-hero__title {
    margin-block-end: .65rem;
}


/* Mobile
--------------------------------------------------------- */

@media (max-width: 700px) {

    .ftv-content-hero__year {
        margin-block-end: .3rem;
    }

    .ftv-content-hero__year a,
    .ftv-content-hero__year span {
        min-width: 2.6rem;

        padding: .25rem .48rem;

        font-size: .6rem;
    }

    .ftv-content-hero__main-meta {
        gap: .3rem;

        margin-block-end: .4rem;
    }

    .ftv-content-hero__genres {
        gap: .28rem;

        margin-block-end: .35rem;
    }

    .ftv-content-hero__main-meta .ftv-content-chip,
    .ftv-content-hero__genres .ftv-content-chip {
        min-height: 1.55rem;

        padding-inline: .5rem;

        font-size: .61rem;
    }

    .ftv-content-chip--secondary {
        font-size: .58rem !important;
    }
}


/* =========================================================
   Unified Movie / Series / Episode additions
========================================================= */

.ftv-content-body {
    position: relative;
    z-index: 1;
}


/* Episode section heading
--------------------------------------------------------- */

.ftv-episode-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    margin-block-end: 1rem;
}

.ftv-episode-section-head h2 {
    margin: 0;
}

.ftv-episode-series-link {
    min-height: 2.35rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding-inline: .75rem;

    border: 1px solid var(--border);
    border-radius: .65rem;

    background: var(--surface-2);

    color: var(--text-muted);

    font-size: .7rem;
    font-weight: 600;

    text-decoration: none;

    transition:
        color 140ms ease,
        background 140ms ease,
        border-color 140ms ease;
}

.ftv-episode-series-link:hover {
    color: var(--text);
    background: var(--surface);
}


/* Player placeholder
--------------------------------------------------------- */

.ftv-player-placeholder {
    min-height: 22rem;

    display: grid;
    place-items: center;

    border-radius: .85rem;

    background: #08090b;
}


/* Previous / Next
--------------------------------------------------------- */

.ftv-episode-navigation {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: .65rem;

    margin-block-start: .8rem;
}

.ftv-episode-navigation__item {
    min-height: 3.7rem;

    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: .15rem;

    padding: .65rem .8rem;

    border: 1px solid var(--border);
    border-radius: .75rem;

    background: var(--surface-2);

    color: var(--text);

    text-decoration: none;
}

.ftv-episode-navigation__item small {
    color: var(--text-muted);

    font-size: .63rem;
}

.ftv-episode-navigation__item strong {
    font-size: .78rem;
}


/* Remaining episodes
--------------------------------------------------------- */

.ftv-episodes-grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: .5rem;
}

.ftv-episode-card {
    min-height: 4.3rem;

    display: flex;
    align-items: center;

    gap: .55rem;

    padding: .65rem;

    border: 1px solid var(--border);
    border-radius: .72rem;

    background: var(--surface-2);

    color: var(--text);

    text-decoration: none;

    transition:
        border-color 140ms ease,
        background 140ms ease;
}

.ftv-episode-card:hover {
    background: var(--surface);
}

.ftv-episode-card.is-current {
    border-color:
        color-mix(
            in srgb,
            var(--accent) 70%,
            var(--border)
        );
}

.ftv-episode-card__play {
    width: 1.85rem;
    height: 1.85rem;

    flex: 0 0 1.85rem;

    display: grid;
    place-items: center;

    border-radius: 999px;

    background: rgb(255 255 255 / 5%);

    color: var(--accent);
}

.ftv-episode-card__play svg {
    width: .85rem;
    height: .85rem;

    fill: currentColor;
}

.ftv-episode-card__text {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: .1rem;
}

.ftv-episode-card__text strong {
    font-size: .72rem;
}

.ftv-episode-card__text small {
    color: var(--accent);

    font-size: .56rem;
}


/* Responsive
--------------------------------------------------------- */

@media (max-width: 1100px) {

    .ftv-episodes-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }
}


@media (max-width: 700px) {

    .ftv-episode-section-head {
        align-items: flex-start;

        gap: .6rem;
    }

    .ftv-episode-series-link {
        min-height: 2rem;

        padding-inline: .6rem;

        font-size: .62rem;
    }

    .ftv-player-placeholder {
        min-height: 13rem;
    }

    .ftv-episode-navigation {
        gap: .45rem;
    }

    .ftv-episode-navigation__item {
        min-height: 3.2rem;

        padding: .55rem .65rem;
    }

    .ftv-episodes-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: .4rem;
    }

    .ftv-episode-card {
        min-height: 3.7rem;

        padding: .55rem;
    }
}


/* =========================================================
   SERIES EPISODES V2
========================================================= */

html {
    scroll-behavior: smooth;
}


/* Hero action icons
--------------------------------------------------------- */

.ftv-content-action {
    gap: .4rem;
}

.ftv-content-action svg {
    width: 1rem;
    height: 1rem;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ftv-content-action--primary svg {
    fill: currentColor;
    stroke: none;
}

.ftv-content-action--secondary {
    border: 1px solid var(--border);

    background: rgb(18 20 25 / 88%);

    color: var(--text);

    text-decoration: none;
}

.ftv-content-action--secondary:hover {
    background: var(--surface-2);
}


/* Episodes header
--------------------------------------------------------- */

.ftv-series-episodes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    margin-block-end: 1rem;
}

.ftv-series-episodes-head > div {
    display: flex;
    align-items: baseline;
    gap: .6rem;
}

.ftv-series-episodes-head h2 {
    margin: 0;
}

.ftv-series-episodes-head small {
    color: var(--text-muted);

    font-size: .68rem;
}


/* Season anchors - only > 1 season
--------------------------------------------------------- */

.ftv-season-links {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.ftv-season-links a {
    min-height: 2rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding-inline: .65rem;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface-2);

    color: var(--text-muted);

    font-size: .65rem;
    font-weight: 600;

    text-decoration: none;
}

.ftv-season-links a:hover {
    color: var(--text);
}


/* Season
--------------------------------------------------------- */

.ftv-season-group {
    scroll-margin-top: 6rem;
}

.ftv-season-group + .ftv-season-group {
    margin-block-start: 1.4rem;
}

.ftv-season-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    margin-block-end: .65rem;
}

.ftv-season-group__head h3 {
    margin: 0;

    font-size: .9rem;
}

.ftv-season-group__head span {
    color: var(--text-muted);

    font-size: .64rem;
}


/* Episodes Grid
--------------------------------------------------------- */

.ftv-series-episodes-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: .5rem;
}

.ftv-series-episode-card {
    min-width: 0;
    min-height: 4.25rem;

    display: flex;
    align-items: center;

    gap: .6rem;

    padding: .65rem .7rem;

    border: 1px solid var(--border);
    border-radius: .75rem;

    background: var(--surface-2);

    color: var(--text);

    text-decoration: none;

    transition:
        background 140ms ease,
        border-color 140ms ease,
        transform 140ms ease;
}

.ftv-series-episode-card:hover {
    background: var(--surface);

    border-color:
        rgb(255 255 255 / 14%);

    transform: translateY(-1px);
}

.ftv-series-episode-card__play {
    width: 2rem;
    height: 2rem;

    flex: 0 0 2rem;

    display: grid;
    place-items: center;

    border-radius: 999px;

    background: rgb(255 255 255 / 5%);

    color: var(--accent);
}

.ftv-series-episode-card__play svg {
    width: .9rem;
    height: .9rem;

    fill: currentColor;
}

.ftv-series-episode-card__body {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;

    gap: .12rem;
}

.ftv-series-episode-card__body strong {
    font-size: .74rem;
}

.ftv-series-episode-card__body small {
    overflow: hidden;

    color: var(--text-muted);

    font-size: .61rem;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.ftv-series-episode-card__arrow {
    color: var(--text-muted);

    font-size: 1.1rem;
}

.ftv-series-episodes-empty {
    padding: 2rem 1rem;

    border: 1px dashed var(--border);
    border-radius: .8rem;

    color: var(--text-muted);

    text-align: center;

    font-size: .78rem;
}


/* Target highlight after clicking حلقات
--------------------------------------------------------- */

#episodes {
    scroll-margin-top: 5rem;
}


/* Tablet
--------------------------------------------------------- */

@media (max-width: 1050px) {

    .ftv-series-episodes-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}


/* Mobile
--------------------------------------------------------- */

@media (max-width: 700px) {

    .ftv-series-episodes-head {
        align-items: flex-start;
        flex-direction: column;

        gap: .55rem;
    }

    .ftv-season-links {
        width: 100%;

        overflow-x: auto;

        flex-wrap: nowrap;

        padding-block-end: .15rem;

        scrollbar-width: none;
    }

    .ftv-season-links::-webkit-scrollbar {
        display: none;
    }

    .ftv-season-links a {
        flex: 0 0 auto;
    }

    .ftv-series-episodes-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: .4rem;
    }

    .ftv-series-episode-card {
        min-height: 3.7rem;

        gap: .45rem;

        padding: .55rem;
    }

    .ftv-series-episode-card__play {
        width: 1.7rem;
        height: 1.7rem;

        flex-basis: 1.7rem;
    }

    .ftv-series-episode-card__body strong {
        font-size: .66rem;
    }

    .ftv-series-episode-card__body small {
        font-size: .55rem;
    }

    .ftv-content-hero__actions {
        gap: .45rem;
    }
}


/* =========================================================
   Episode - Back to series in Hero
========================================================= */

.ftv-episode-hero-back {
    width: fit-content;

    min-height: 2.25rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: .4rem;

    margin-block-end: .65rem;

    padding-inline: .65rem;

    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: .65rem;

    background: rgb(12 14 18 / 68%);

    color: #aeb4bd;

    font-size: .68rem;
    font-weight: 600;

    line-height: 1;

    text-decoration: none;

    backdrop-filter: blur(8px);

    transition:
        color 140ms ease,
        background 140ms ease,
        border-color 140ms ease;
}

.ftv-episode-hero-back svg {
    width: 1rem;
    height: 1rem;

    flex: 0 0 1rem;
}

.ftv-episode-hero-back:hover {
    color: #fff;

    background: rgb(25 28 34 / 86%);

    border-color: rgb(255 255 255 / 20%);
}


@media (max-width: 700px) {

    .ftv-episode-hero-back {
        min-height: 2rem;

        margin-block-end: .45rem;

        padding-inline: .55rem;

        font-size: .6rem;
    }

    .ftv-episode-hero-back svg {
        width: .9rem;
        height: .9rem;

        flex-basis: .9rem;
    }
}


/* =========================================================
   SEASON TABS V3
========================================================= */

.ftv-season-tabs__nav {
    display: flex;
    align-items: center;

    gap: .4rem;

    margin-block-end: .9rem;

    overflow-x: auto;

    scrollbar-width: none;
}

.ftv-season-tabs__nav::-webkit-scrollbar {
    display: none;
}


.ftv-season-tab {
    flex: 0 0 auto;

    min-height: 2.4rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: .4rem;

    padding-inline: .8rem;

    border: 1px solid var(--border);
    border-radius: .72rem;

    background: var(--surface-2);

    color: var(--text-muted);

    font-size: .7rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        color 140ms ease,
        border-color 140ms ease,
        background 140ms ease;
}

.ftv-season-tab span {
    min-width: 1.35rem;
    height: 1.35rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    background: rgb(255 255 255 / 5%);

    color: var(--text-muted);

    font-size: .58rem;
}


.ftv-season-tab:hover {
    color: var(--text);
}


.ftv-season-tab.is-active {
    border-color:
        color-mix(
            in srgb,
            var(--accent) 65%,
            var(--border)
        );

    background:
        color-mix(
            in srgb,
            var(--accent) 8%,
            var(--surface-2)
        );

    color: var(--accent);
}


.ftv-season-tab.is-active span {
    background: var(--accent);

    color: #111;
}


.ftv-season-panel[hidden] {
    display: none !important;
}


.ftv-season-panel.is-active {
    display: block;
}


/* remove old visual season grouping */
.ftv-season-group,
.ftv-season-group + .ftv-season-group {
    margin: 0;
}


/* Mobile */
@media (max-width: 700px) {

    .ftv-season-tabs__nav {
        gap: .3rem;

        margin-inline:
            -.1rem;

        padding-inline:
            .1rem;
    }

    .ftv-season-tab {
        min-height: 2.2rem;

        padding-inline: .7rem;

        font-size: .64rem;
    }

    .ftv-season-tab span {
        min-width: 1.2rem;
        height: 1.2rem;

        font-size: .54rem;
    }
}


/* =========================================================
   HERO LIGHT MODE + EPISODE POSTER BACK BUTTON
========================================================= */

/*
 * The Hero is always dark due to the backdrop/overlay,
 * so its important foreground text should NOT inherit
 * the global light-mode text color.
 */
.ftv-content-hero,
.ftv-content-hero__content {
    color: #fff;
}

.ftv-content-hero__title {
    color: #fff !important;
}

.ftv-content-hero__description {
    color: rgb(255 255 255 / 72%) !important;
}

.ftv-content-hero__description p {
    color: inherit !important;
}


/* Year stays readable in both themes */
.ftv-content-hero__year a,
.ftv-content-hero__year span {
    color: #e7e9ed !important;
}


/* Main chips */
.ftv-content-hero__main-meta .ftv-content-chip,
.ftv-content-hero__genres .ftv-content-chip {
    color: #d3d6dc;
}

.ftv-content-chip--status,
.ftv-content-chip--quality {
    color: #e5e7eb !important;
}


/* Country / language */
.ftv-content-chip--secondary {
    color: #b4bac3 !important;
}


/* =========================================================
   Episode back button above poster
========================================================= */

.ftv-content-hero__poster {
    position: relative;
    overflow: visible;
}

.ftv-content-hero__poster img {
    overflow: hidden;
    border-radius: inherit;
}

.ftv-episode-poster-back {
    position: absolute;

    inset-inline: 0;
    inset-block-start: -2.9rem;

    z-index: 20;

    width: max-content;
    max-width: 100%;

    min-height: 2.2rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: .4rem;

    padding-inline: .65rem;

    border: 1px solid rgb(255 255 255 / 14%);
    border-radius: .65rem;

    background: rgb(12 14 18 / 82%);

    color: #d6d9df;

    font-size: .67rem;
    font-weight: 600;

    line-height: 1;

    text-decoration: none;

    backdrop-filter: blur(10px);

    transition:
        color 140ms ease,
        background 140ms ease,
        border-color 140ms ease;
}

.ftv-episode-poster-back:hover {
    color: #fff;

    background: rgb(24 27 33 / 94%);

    border-color: rgb(255 255 255 / 24%);
}

.ftv-episode-poster-back svg {
    width: 1rem;
    height: 1rem;

    flex: 0 0 1rem;
}


/* =========================================================
   Episodes button - readable in light + dark mode
========================================================= */

.ftv-content-action--secondary {
    border: 1px solid rgb(255 255 255 / 15%) !important;

    background: rgb(15 17 21 / 86%) !important;

    color: #f2f3f5 !important;

    box-shadow:
        0 1px 0 rgb(255 255 255 / 3%) inset;
}

.ftv-content-action--secondary:hover {
    border-color: rgb(255 255 255 / 26%) !important;

    background: rgb(28 31 37 / 94%) !important;

    color: #fff !important;
}


/* Keep My List legible over Hero in light mode */
.ftv-content-hero .ftv-mylist-button__toggle {
    border-color: rgb(255 255 255 / 15%) !important;

    background: rgb(15 17 21 / 82%) !important;

    color: #f0f1f3 !important;
}


/* =========================================================
   Mobile
========================================================= */

@media (max-width: 700px) {

    .ftv-episode-poster-back {
        inset-block-start: -2.45rem;

        min-height: 1.95rem;

        padding-inline: .5rem;

        font-size: .58rem;
    }

    .ftv-episode-poster-back svg {
        width: .85rem;
        height: .85rem;

        flex-basis: .85rem;
    }
}


/* =========================================================
   5TV MOBILE SAFE FIX
   Keep original design + fix episode back button only
========================================================= */

@media (max-width: 700px) {

    /*
     * Give the episode Hero a little room above the poster
     * for the Back to Series button.
     */
    .ftv-episode-single ~ *,
    body.single-episode {
        --ftv-mobile-episode-back-space: 2.4rem;
    }


    /*
     * Keep the original Hero proportions.
     * Only create safe top space on episode pages.
     */
    body.single-episode .ftv-content-hero__inner {
        padding-block-start: 3.35rem;
    }


    /*
     * Back to Series:
     * directly above poster, INSIDE the Hero,
     * not touching the site header.
     */
    body.single-episode .ftv-episode-poster-back {
        position: absolute;

        inset-block-start: -2.55rem;
        inset-inline-start: 0;
        inset-inline-end: auto;

        width: max-content;
        max-width: calc(100vw - 2rem);

        min-height: 2rem;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        gap: .35rem;

        padding-inline: .55rem;

        border: 1px solid rgb(255 255 255 / 14%);
        border-radius: .55rem;

        background: rgb(12 14 18 / 88%);

        color: #e0e2e6;

        font-size: .59rem;
        font-weight: 600;

        line-height: 1;

        white-space: nowrap;

        z-index: 30;
    }

    body.single-episode .ftv-episode-poster-back svg {
        width: .9rem;
        height: .9rem;

        flex: 0 0 .9rem;
    }


    /*
     * Don't let Hero title become oversized on phones.
     * Everything else keeps the original layout.
     */
    .ftv-content-hero__title {
        font-size: 1.3rem;
        line-height: 1.3;
    }


    /*
     * Keep description readable without altering its layout.
     */
    .ftv-content-hero__description {
        font-size: .76rem;
        line-height: 1.75;
    }


    /*
     * Video/player area should not become absurdly tall.
     */
    .ftv-player-placeholder {
        min-height: 12.5rem;
    }


    /*
     * Bottom navigation is fixed, so protect page content.
     */
    .ftv-content-body {
        padding-block-end: 6rem;
    }
}

@media (max-width: 767px) {

    [style*="backdrop-filter"],
    .ftv-content-hero *,
    .ftv-server-area * {
        -webkit-backdrop-filter:
            none !important;

        backdrop-filter:
            none !important;
    }

}


/* Season rail: created only when the navigation script runs. */
.ftv-season-rail {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 2rem;
    align-items: center;
    gap: .25rem;
    margin-block-end: .9rem;
    direction: rtl;
}
.ftv-season-rail:not(.is-scrollable) { grid-template-columns: 0 minmax(0, 1fr) 0; gap: 0; }
.ftv-season-rail .ftv-season-tabs__nav {
    min-width: 0;
    width: 100%;
    margin: 0;
    margin-inline: 0;
    overscroll-behavior-inline: contain;
    touch-action: pan-x pan-y;
}
.ftv-season-rail__arrow {
    display: inline-flex;
    visibility: hidden;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: .65rem;
    background: var(--surface-2);
    color: var(--accent);
    font: 700 1.45rem/1 Arial, sans-serif;
    cursor: pointer;
}
.ftv-season-rail.is-scrollable .ftv-season-rail__arrow { visibility: visible; }
.ftv-season-rail__arrow:disabled { opacity: .35; cursor: default; }
.ftv-season-rail.is-scrollable .ftv-season-tabs__nav { cursor: grab; user-select: none; -webkit-user-select: none; }
.ftv-season-rail.is-dragging .ftv-season-tabs__nav { cursor: grabbing; scroll-behavior: auto; user-select: none; }
.ftv-season-rail__arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 700px) {
    .ftv-season-rail { grid-template-columns: 1.6rem minmax(0, 1fr) 1.6rem; gap: .15rem; }
    .ftv-season-rail__arrow { width: 1.6rem; height: 1.8rem; font-size: 1.25rem; }
}
