/* =========================================
   PAGINA SINGOLO PROGRAMMA
   ANS TV PLAY
========================================= */

.single-programma-page {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top left,
            rgba(212, 175, 55, .08),
            transparent 34%
        ),
        #06070a;
    color: #fff;
}

.programma-container {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
}

/* =========================================
   HERO DEL PROGRAMMA
========================================= */

.programma-hero {
    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: flex-end;
    background-position: center;
    background-size: cover;
    overflow: hidden;
}

.programma-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(4, 5, 8, .97) 0%,
            rgba(4, 5, 8, .82) 34%,
            rgba(4, 5, 8, .28) 68%,
            rgba(4, 5, 8, .55) 100%
        ),
        linear-gradient(
            180deg,
            rgba(4, 5, 8, .18) 0%,
            rgba(4, 5, 8, .25) 50%,
            #06070a 100%
        );
}

.programma-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(
            circle at 70% 35%,
            rgba(212, 175, 55, .08),
            transparent 36%
        );
}

.programma-hero-content {
    position: relative;
    z-index: 2;
    padding-top: 150px;
    padding-bottom: 80px;
}

.programma-back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 42px;
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
    transition:
        color .25s ease,
        transform .25s ease;
}

.programma-back-link:hover {
    color: #d4af37;
    transform: translateX(-3px);
}

.programma-category,
.programma-season {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border: 1px solid rgba(212, 175, 55, .48);
    border-radius: 999px;
    background: rgba(6, 7, 10, .52);
    color: #d4af37;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.programma-title {
    max-width: 850px;
    margin: 20px 0 12px;
    font-size: clamp(3rem, 7vw, 6.7rem);
    line-height: .95;
    letter-spacing: -.055em;
    text-wrap: balance;
}

.programma-slogan {
    max-width: 760px;
    margin: 0 0 20px;
    color: #d4af37;
    font-size: clamp(1.15rem, 2vw, 1.65rem);
    font-weight: 700;
}

.programma-description {
    max-width: 660px;
    margin: 0 0 30px;
    color: rgba(255, 255, 255, .78);
    font-size: 1.02rem;
    line-height: 1.75;
}

.programma-description p {
    margin: 0;
}

.programma-watch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 23px;
    border-radius: 999px;
    background: #d4af37;
    color: #08090c;
    text-decoration: none;
    font-weight: 850;
    box-shadow:
        0 12px 35px rgba(212, 175, 55, .24);
    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.programma-watch-button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 18px 42px rgba(212, 175, 55, .34);
}

/* =========================================
   SEZIONE PLAYER E PLAYLIST
========================================= */

.programma-player-section {
    padding: 70px 0 110px;
}

.programma-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
}

.programma-section-heading h2 {
    margin: 13px 0 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: -.035em;
}

.programma-update-label {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
    color: rgba(255, 255, 255, .6);
    font-size: .82rem;
}

/* =========================================
   LAYOUT VIDEO PRINCIPALE + PLAYLIST
========================================= */

.programma-video-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(320px, .75fr);
    gap: 22px;
    align-items: start;
}

.programma-main-video {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 24px;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .035),
            rgba(255, 255, 255, .015)
        );
    box-shadow:
        0 30px 80px rgba(0, 0, 0, .48);
}

.programma-player-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.programma-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.programma-current-episode {
    padding: 24px 26px 27px;
}

.programma-now-playing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #d4af37;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.programma-now-playing::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4af37;
    box-shadow: 0 0 14px rgba(212, 175, 55, .8);
}

.programma-current-episode h3 {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    line-height: 1.2;
    letter-spacing: -.025em;
}

.programma-current-date {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .48);
    font-size: .85rem;
}

.programma-current-description {
    margin: 15px 0 0;
    color: rgba(255, 255, 255, .68);
    font-size: .96rem;
    line-height: 1.65;
}

/* =========================================
   SIDEBAR PLAYLIST
========================================= */

.programma-episodes-sidebar {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 24px;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .045),
            rgba(255, 255, 255, .018)
        );
    box-shadow:
        0 24px 70px rgba(0, 0, 0, .34);
}

.programma-episodes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 20px 17px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.programma-episodes-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.programma-episodes-header span {
    max-width: 135px;
    color: rgba(255, 255, 255, .42);
    font-size: .72rem;
    line-height: 1.35;
    text-align: right;
}

.programma-episodes-list {
    max-height: 680px;
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color:
        rgba(212, 175, 55, .55)
        rgba(255, 255, 255, .04);
}

.programma-episodes-list::-webkit-scrollbar {
    width: 8px;
}

.programma-episodes-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .03);
}

.programma-episodes-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(212, 175, 55, .48);
}

.programma-episode-card {
    position: relative;
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 13px;
    width: 100%;
    margin: 0;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition:
        background .22s ease,
        border-color .22s ease,
        transform .22s ease;
}

.programma-episode-card + .programma-episode-card {
    margin-top: 5px;
}

.programma-episode-card:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .045);
}

.programma-episode-card.is-active {
    border-color: rgba(212, 175, 55, .48);
    background:
        linear-gradient(
            90deg,
            rgba(212, 175, 55, .14),
            rgba(212, 175, 55, .035)
        );
}

.programma-episode-thumbnail {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: #111318;
}

.programma-episode-thumbnail::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            transparent 45%,
            rgba(0, 0, 0, .48) 100%
        );
}

.programma-episode-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform .3s ease,
        opacity .3s ease;
}

.programma-episode-card:hover
.programma-episode-thumbnail img {
    transform: scale(1.045);
}

.programma-episode-play {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .52);
    border-radius: 50%;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: .72rem;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(8px);
    transition:
        background .22s ease,
        color .22s ease,
        border-color .22s ease;
}

.programma-episode-card:hover
.programma-episode-play,
.programma-episode-card.is-active
.programma-episode-play {
    border-color: #d4af37;
    background: #d4af37;
    color: #08090c;
}

.programma-playing-label {
    position: absolute;
    z-index: 3;
    left: 7px;
    bottom: 7px;
    display: none;
    padding: 4px 7px;
    border-radius: 999px;
    background: #d4af37;
    color: #08090c;
    font-size: .58rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.programma-episode-card.is-active
.programma-playing-label {
    display: inline-flex;
}

.programma-episode-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.programma-episode-info strong {
    display: -webkit-box;
    overflow: hidden;
    color: rgba(255, 255, 255, .9);
    font-size: .86rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.programma-episode-info small {
    color: rgba(255, 255, 255, .42);
    font-size: .73rem;
}

.programma-episode-card.is-active
.programma-episode-info strong {
    color: #fff;
}

/* =========================================
   MESSAGGI VUOTI
========================================= */

.programma-empty-message {
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 20px;
    background: rgba(255, 255, 255, .035);
}

.programma-empty-message h3 {
    margin: 0 0 7px;
    font-size: 1.1rem;
}

.programma-empty-message p {
    margin: 0;
    color: rgba(255, 255, 255, .62);
    line-height: 1.55;
}

/* =========================================
   TABLET
========================================= */

@media (max-width: 1050px) {

    .programma-video-layout {
        grid-template-columns: 1fr;
    }

    .programma-episodes-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        max-height: none;
        overflow: visible;
    }

    .programma-episode-card + .programma-episode-card {
        margin-top: 0;
    }

}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 760px) {

    .programma-container {
        width: min(100% - 24px, 1280px);
    }

    .programma-hero {
        min-height: 620px;
        background-position: center;
    }

    .programma-hero::after {
        background:
            linear-gradient(
                180deg,
                rgba(4, 5, 8, .3) 0%,
                rgba(4, 5, 8, .72) 47%,
                #06070a 100%
            );
    }

    .programma-hero-content {
        padding-top: 120px;
        padding-bottom: 50px;
    }

    .programma-back-link {
        margin-bottom: 140px;
    }

    .programma-player-section {
        padding: 45px 0 75px;
    }

    .programma-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .programma-main-video,
    .programma-episodes-sidebar {
        border-radius: 17px;
    }

    .programma-current-episode {
        padding: 20px;
    }

    .programma-episodes-list {
        grid-template-columns: 1fr;
        padding: 8px;
    }

    .programma-episode-card {
        grid-template-columns: 118px minmax(0, 1fr);
        padding: 8px;
    }

}

/* =========================================
   MOBILE PICCOLO
========================================= */

@media (max-width: 480px) {

    .programma-title {
        font-size: 2.75rem;
    }

    .programma-episode-card {
        grid-template-columns: 102px minmax(0, 1fr);
        gap: 10px;
    }

    .programma-episode-info strong {
        font-size: .78rem;
        -webkit-line-clamp: 2;
    }

    .programma-episodes-header {
        padding: 17px;
    }

}