/* ==========================================================================
   File: /wp-content/themes/pandora-custom/assets/css/14-video-post.css
   Versione: 8.5 STABLE CLEAN LAYOUT & MEDIA-TEXT INTEGRATION
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GESTIONE IFRAME / YOUTUBE NATIVO & BLOCCHI GUTENBERG
   -------------------------------------------------------------------------- */

/* Rende gli iframe YouTube fluida a 16:9 senza creare vuoti */
.entry-content iframe[src*="youtube.com"],
.entry-content iframe[data-src*="youtube.com"],
.entry-content iframe[src*="youtu.be"],
.wp-block-embed-youtube .wp-block-embed__wrapper {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
    border: 0;
    border-radius: var(--pandora-top-box-radius, 16px);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(131, 0, 254, 0.2);
    display: block;
    margin: 20px 0;
}

/* --------------------------------------------------------------------------
   2. INTEGRAZIONE BLOCCO NATIVO "MEDIA E TESTO" (Media + Text Block)
   -------------------------------------------------------------------------- */

/* Ottimizza il blocco nativo Gutenberg "Media e Testo" quando contiene un video */
.wp-block-media-text {
    gap: 25px !important;
    margin-top: 25px !important;
    margin-bottom: 25px !important;
    align-items: center !important;
}

.wp-block-media-text .wp-block-media-text__media {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(131, 0, 254, 0.35);
    box-shadow: 0 8px 24px rgba(131, 0, 254, 0.2);
    transition: all 0.3s ease;
}

.wp-block-media-text .wp-block-media-text__media:hover {
    border-color: #f100ff;
    box-shadow: 0 10px 30px rgba(241, 0, 255, 0.35);
}

.wp-block-media-text .wp-block-media-text__media video,
.wp-block-media-text .wp-block-media-text__media iframe {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.wp-block-media-text .wp-block-media-text__content {
    padding: 0 !important;
    color: #e0d8f0;
    font-size: 15px;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   3. WRAPPER CUSTOM PANDORA (Se usato direttamente nel template)
   -------------------------------------------------------------------------- */
.pandora-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0f081d;
    margin: 20px 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(131, 0, 254, 0.35);
    box-shadow: 0 8px 24px rgba(131, 0, 254, 0.2);
}

.pandora-youtube-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #120a28;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.pandora-youtube-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10, 5, 20, 0.35);
    transition: background 0.3s ease;
}

.pandora-youtube-placeholder:hover::before {
    background: rgba(10, 5, 20, 0.1);
}

.pandora-play-button {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #8300fe, #f100ff);
    border-radius: 50%;
    position: relative;
    z-index: 3;
    box-shadow: 0 0 20px #f100ff, 0 0 35px #8300fe;
    transition: transform 0.3s ease;
}

.pandora-youtube-placeholder:hover .pandora-play-button {
    transform: scale(1.1);
}

.pandora-play-button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #ffffff;
}

/* --------------------------------------------------------------------------
   4. MODULO THEATER OVERLAY
   -------------------------------------------------------------------------- */
#pandora-post-video-theater {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    background: rgba(10, 5, 20, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    display: none;
    overflow-y: auto !important;
}

#pandora-post-video-theater.is-open {
    display: block !important;
}

#pandora-post-video-theater .ppvt-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(15, 10, 25, 0.95);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(131, 0, 254, 0.3);
}

#pandora-post-video-theater .ppvt-close {
    background: rgba(131, 0, 254, 0.2);
    color: #fff;
    border: 1px solid rgba(241, 0, 255, 0.4);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

#pandora-post-video-theater .ppvt-close:hover {
    background: #f100ff;
    box-shadow: 0 0 15px #f100ff;
}

#pandora-post-video-theater .ppvt-layout {
    max-width: 1650px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    padding: 28px;
}

#pandora-post-video-theater .ppvt-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(131, 0, 254, 0.3);
}

#pandora-post-video-theater .ppvt-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    margin: 20px 0 8px;
}

#pandora-post-video-theater .ppvt-meta {
    color: #a49bb7;
    font-size: 14px;
    margin-bottom: 18px;
}

#pandora-post-video-theater .ppvt-desc {
    background: rgba(22, 11, 46, 0.8);
    border: 1px solid rgba(131, 0, 254, 0.2);
    border-radius: 12px;
    padding: 20px;
    color: #e0d8f0;
    font-size: 15px;
    line-height: 1.6;
}

#pandora-post-video-theater .ppvt-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#pandora-post-video-theater .ppvt-side h4 {
    color: #ffffff;
    font-size: 16px;
    margin: 0 0 6px;
    text-transform: uppercase;
}

#pandora-post-video-theater .ppvt-rel {
    display: flex;
    gap: 12px;
    background: rgba(22, 11, 46, 0.6);
    border: 1px solid rgba(131, 0, 254, 0.15);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    padding: 10px;
}

#pandora-post-video-theater .ppvt-rel img {
    width: 110px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
}

#pandora-post-video-theater .ppvt-rel .ppvt-rel-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 1024px) {
    #pandora-post-video-theater .ppvt-layout {
        grid-template-columns: 1fr;
    }
}