/* =========================================================
 * MemoTV - Lightbox
 * ========================================================= */


/* =========================================================
 * OVERLAY
 * ========================================================= */

#memotv-lightbox-overlay {
    position: fixed;
    inset: 0;

    z-index: 99998;

    display: none;

    background: rgba(0, 0, 0, 0.78);

    opacity: 0;

    transition: opacity 0.2s ease;
}

#memotv-lightbox-overlay.active {
    display: block;
    opacity: 1;
}


/* =========================================================
 * LIGHTBOX
 * ========================================================= */

#memotv-lightbox {
    position: fixed;
    inset: 50% auto auto 50%;

    z-index: 99999;

    display: none;

    width: min(700px, 95vw);
    max-height: 80vh;

    overflow: hidden;

    transform: translate(-50%, -50%) scale(0.97);

    border-radius: 16px;

    box-shadow:
        0 20px 70px rgba(0, 0, 0, 0.45);

    opacity: 0;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

#memotv-lightbox.active {
    display: block;

    opacity: 1;

    transform: translate(-50%, -50%) scale(1);
}


/* =========================================================
 * BODY LOCK
 * ========================================================= */

body.memotv-lightbox-open {
    overflow: hidden;
}


/* =========================================================
 * CONTENT
 * ========================================================= */

.memotv-lightbox-content {
    display: flex;
    flex-direction: column;

    width: 100%;
    max-height: 80vh;

    overflow: hidden;
}


/* =========================================================
 * HEADER
 * ========================================================= */

.memotv-lightbox-header {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 62px;

    padding: 10px 58px 10px 18px;

    border-bottom: 1px solid rgba(127, 127, 127, 0.15);
}


/* Canale */

.memotv-lightbox-channel {
    display: flex;
    align-items: center;

    min-width: 0;

    gap: 10px;
}

.memotv-lightbox-channel-logo {
    display: block;

    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    object-fit: contain;

    border-radius: 8px;
}

.memotv-lightbox-channel-info {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.memotv-lightbox-channel-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
}

.memotv-lightbox-channel-number {
    margin-top: 2px;

    font-size: 12px;
    line-height: 1.2;

    opacity: 0.65;
}


/* Orario */

.memotv-lightbox-time {
    margin-left: auto;
    padding-right: 12px;

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
}


/* =========================================================
 * CLOSE BUTTON
 * ========================================================= */

.memotv-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    cursor: pointer;

    transition: transform 0.18s ease;
}

.memotv-lightbox-close:hover {
    transform: scale(1.08);
}

.memotv-lightbox-close .dashicons {
    width: 22px;
    height: 22px;

    font-size: 22px;
}


/* =========================================================
 * MAIN
 * ========================================================= */

.memotv-lightbox-main {
    display: flex;

    min-height: 0;

    overflow-y: auto;

    padding: 20px;
    gap: 22px;
}


/* =========================================================
 * POSTER
 * ========================================================= */

.memotv-lightbox-poster {
    flex: 0 0 260px;

    width: 260px;

    align-self: flex-start;

    overflow: hidden;

    border-radius: 12px;
}

.memotv-lightbox-poster img {
    display: block;

    width: 100%;
    height: auto;

    object-fit: cover;
}


/* =========================================================
 * INFO
 * ========================================================= */

.memotv-lightbox-info {
    flex: 1 1 auto;

    min-width: 0;
}

.memotv-lightbox-title {
    margin: 0;

    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
}

.memotv-lightbox-secondary-category {
    margin-top: 7px;

    font-size: 14px;
    line-height: 1.35;

    opacity: 0.7;
}


/* =========================================================
 * RATING
 * ========================================================= */

.memotv-lightbox-rating {
    margin-top: 13px;
}

.memotv-lightbox-rating .memotv-rating-stars {
    gap: 2px;
}

.memotv-lightbox-rating .dashicons {
    width: 18px;
    height: 18px;

    font-size: 18px;
}


/* =========================================================
 * LIGHTBOX FIELDS
 * ========================================================= */

.memotv-lightbox-fields {
    display: flex;
    flex-direction: column;

    margin-top: 18px;

    gap: 12px;
}


/*
 * Ogni campo è una coppia:
 *
 * LABEL
 * valore
 */
.memotv-lightbox-field {
    display: block;

    min-width: 0;
}

.memotv-lightbox-field-label {
    margin-bottom: 3px;

    font-size: 12px;
    font-weight: 600;

    line-height: 1.25;

    text-transform: uppercase;
    letter-spacing: 0.03em;

    opacity: 0.55;
}

.memotv-lightbox-field-value {
    font-size: 14px;
    line-height: 1.5;

    word-break: break-word;
}


/* =========================================================
 * ACTIONS
 * ========================================================= */

.memotv-lightbox-actions {
    display: flex;
    align-items: center;

    margin-top: 20px;
}

.memotv-lightbox-reminder {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 38px;

    padding: 7px 14px;

    border: 0;
    border-radius: 999px;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        opacity 0.18s ease;
}

.memotv-lightbox-reminder:hover {
    transform: translateY(-1px);
}

.memotv-lightbox-reminder .dashicons {
    width: 17px;
    height: 17px;

    font-size: 17px;
}


/* =========================================================
 * LINK / TESTO NEI CAMPI
 * ========================================================= */

.memotv-lightbox-field-value a {
    text-decoration: underline;
}


/* =========================================================
 * SCROLLBAR
 * ========================================================= */

.memotv-lightbox-main {
    scrollbar-width: thin;
}


/* =========================================================
 * RESPONSIVE - TABLET
 * ========================================================= */

@media (max-width: 760px) {

    #memotv-lightbox {
        width: min(95vw, 680px);
        max-height: 88vh;
    }

    .memotv-lightbox-content {
        max-height: 88vh;
    }

    .memotv-lightbox-main {
        padding: 16px;
        gap: 18px;
    }

    .memotv-lightbox-poster {
        flex-basis: 210px;
        width: 210px;
    }

    .memotv-lightbox-title {
        font-size: 22px;
    }

}


/* =========================================================
 * RESPONSIVE - MOBILE
 * ========================================================= */

@media (max-width: 600px) {

    #memotv-lightbox {
        width: 94vw;
        max-height: 90vh;

        border-radius: 14px;
    }

    .memotv-lightbox-content {
        max-height: 90vh;
    }

    .memotv-lightbox-header {
        min-height: 56px;

        padding:
            8px
            52px
            8px
            12px;
    }

    .memotv-lightbox-channel-logo {
        width: 36px;
        height: 36px;

        flex-basis: 36px;
    }

    .memotv-lightbox-channel-name {
        font-size: 13px;
    }

    .memotv-lightbox-channel-number {
        font-size: 11px;
    }

    .memotv-lightbox-time {
        display: none;
    }

    .memotv-lightbox-close {
        top: 9px;
        right: 9px;

        width: 36px;
        height: 36px;
    }

    .memotv-lightbox-main {
        flex-direction: column;

        padding: 14px;

        gap: 16px;
    }

    .memotv-lightbox-poster {
        flex: 0 0 auto;

        width: 180px;
        max-width: 55%;

        margin: 0 auto;
    }

    .memotv-lightbox-title {
        font-size: 20px;
    }

    .memotv-lightbox-secondary-category {
        font-size: 13px;
    }

    .memotv-lightbox-fields {
        margin-top: 15px;

        gap: 10px;
    }

    .memotv-lightbox-field-label {
        font-size: 11px;
    }

    .memotv-lightbox-field-value {
        font-size: 13px;
    }

    .memotv-lightbox-actions {
        margin-top: 17px;
    }

}


/* =========================================================
 * REDUCED MOTION
 * ========================================================= */

@media (prefers-reduced-motion: reduce) {

    #memotv-lightbox-overlay,
    #memotv-lightbox,
    .memotv-lightbox-close,
    .memotv-lightbox-reminder {
        transition: none;
    }

}