/* ─── Metzina OTT Card ─────────────────────────────────────────────────────
   Targeta estil OTT (Prime): pòster + overlay de títol + hover preview +
   botons rodons superposats (play inline + enllaç a la fitxa). */

.mzv-ott-card {
    position: relative;
    display: block;
    width: 100%;
}

.mzv-ott-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    will-change: transform;
}

/* Ampliació estil Prime en hover */
.mzv-ott--scale:hover .mzv-ott-media {
    transform: scale(1.06);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    z-index: 5;
}

.mzv-ott-poster {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.mzv-ott-poster--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: rgba(255, 255, 255, 0.5);
    background: #111;
}

/* Contenidor de l'iframe (preview en hover o reproducció inline) */
.mzv-ott-preview {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.mzv-ott-preview iframe,
.mzv-ott-preview video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
}

.mzv-ott-card.is-previewing .mzv-ott-preview {
    opacity: 1;
}

.mzv-ott-card.is-previewing .mzv-ott-poster {
    opacity: 0;
}

/* Enllaç que cobreix tota la card (clic al pòster → fitxa) */
.mzv-ott-cover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    text-decoration: none;
}

/* Overlay de títol amb degradat */
.mzv-ott-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 28px 14px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.mzv-ott-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Lightbox de reproducció (shorts) ─────────────────────────────────────── */
.mzv-lb {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.mzv-lb.is-open {
    display: flex;
}

.mzv-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.mzv-lb-stage {
    position: relative;
    z-index: 1;
    height: 90vh;
    width: auto;
    aspect-ratio: 9 / 16;
    max-width: 94vw;
}

.mzv-lb-content {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.mzv-lb-content video,
.mzv-lb-content iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: contain;
    background: #000;
}

.mzv-lb-close {
    position: fixed;
    top: 16px;
    right: 22px;
    z-index: 2;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.mzv-lb-close:hover {
    color: #1aa3ff;
}


/* Badge de durada: només l'usa la fila de destacats (Metzina_Featured_Row_Widget),
   que llegeix la durada de l'API. La targeta lligada al CPT no en té. */
.mzv-ott-duration {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 2;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

/* Graella de la fila de destacats.
   Els valors surten de variables perquè els controls d'Elementor només hagin de
   redefinir-les: així, si el CSS generat per Elementor encara no hi és (el WP
   Rocket té «Remove Unused CSS» i triga a regenerar-lo), la fila ja es veu bé
   amb aquests valors per defecte en comptes de caure a una sola columna. */
.mzv-ott-row {
    display: grid;
    grid-template-columns: repeat(var(--mzv-cols, 4), minmax(0, 1fr));
    gap: var(--mzv-gap, 20px);
}

@media (max-width: 1024px) {
    .mzv-ott-row { grid-template-columns: repeat(var(--mzv-cols-t, 2), minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .mzv-ott-row { grid-template-columns: repeat(var(--mzv-cols-m, 1), minmax(0, 1fr)); }
}

/* El títol de la targeta de destacats, amb la display de Metzina com la resta
   del web. Doble classe per guanyar al tema. */
.mzv-ott-card .mzv-ott-title {
    font-family: "Eksell display", "Eksell Display", Georgia, "Times New Roman", serif;
    font-weight: 500;
}

/* Carrusel horitzontal de destacats.
   Mateixa idea que les files del catàleg OTT: desplaçament natiu amb scroll-snap
   (o sigui que el dit al mòbil ja funciona sense JS) i les fletxes només com a
   afegit per a ratolí. Les targetes van amb amplada fixa calculada a partir de
   --mzv-cols, així en caben exactament les que toquen per pantalla. */
.mzv-ott-carousel {
    position: relative;
}

.mzv-ott-row--slider {
    display: flex;
    gap: var(--mzv-gap, 20px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.mzv-ott-row--slider::-webkit-scrollbar {
    display: none;
}

.mzv-ott-row--slider > .mzv-ott-card {
    flex: 0 0 calc((100% - (var(--mzv-cols, 4) - 1) * var(--mzv-gap, 20px)) / var(--mzv-cols, 4));
    scroll-snap-align: start;
}

@media (max-width: 1024px) {
    .mzv-ott-row--slider > .mzv-ott-card {
        flex-basis: calc((100% - (var(--mzv-cols-t, 2) - 1) * var(--mzv-gap, 20px)) / var(--mzv-cols-t, 2));
    }
}

@media (max-width: 767px) {
    .mzv-ott-row--slider > .mzv-ott-card {
        flex-basis: calc((100% - (var(--mzv-cols-m, 1) - 1) * var(--mzv-gap, 20px)) / var(--mzv-cols-m, 1));
    }
}

.mzv-ott-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    cursor: pointer;
    line-height: 0;
    opacity: 0;
    transition: opacity .18s ease, background-color .18s ease;
}

/* Doble classe: el tema pinta qualsevol button:hover de #cc3366. */
.mzv-ott-carousel .mzv-ott-nav:hover,
.mzv-ott-carousel .mzv-ott-nav:focus {
    background: rgba(0, 0, 0, .78);
    color: #fff;
    outline: none;
}

.mzv-ott-nav--prev { left: -8px; }
.mzv-ott-nav--next { right: -8px; }

/* Només amb ratolí: al mòbil s'arrossega amb el dit i les fletxes molesten. */
@media (hover: hover) and (min-width: 768px) {
    .mzv-ott-nav { display: flex; }
    .mzv-ott-carousel:hover .mzv-ott-nav { opacity: 1; }
    .mzv-ott-nav[disabled] { opacity: 0 !important; pointer-events: none; }
}

.mzv-ott-nav svg { width: 22px; height: 22px; }
