/**
 * TMDb Backdrop — Estilos para .info_movie
 *
 * Archivo: css/tmdb-backdrop.css
 * Ruta completa: wp-content/themes/wovie/css/tmdb-backdrop.css
 *
 * El overlay y los colores de texto SOLO se aplican cuando el div
 * tiene la clase "has-backdrop" (agregada por pelicula.php cuando
 * tmdb_get_backdrop_url() devuelve una URL válida).
 *
 * Sin imagen guardada → sin clase → sin overlay → diseño original intacto.
 */

/* ─────────────────────────────────────────────────────────────────────────────
   1. BASE — propiedades que aplican siempre (no afectan el diseño original)
   ───────────────────────────────────────────────────────────────────────────── */

.info_movie {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    isolation: isolate;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: -5px;
}

/* El contenido siempre por encima de cualquier overlay */
.info_movie > * {
    position: relative;
    z-index: 1;
    top: 10px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   2. OVERLAY — solo cuando hay imagen de fondo (.has-backdrop)
   ───────────────────────────────────────────────────────────────────────────── */

.info_movie.has-backdrop::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to right,
            rgba(10, 14, 26, 0.75) 0%,
            rgba(10, 14, 26, 0.45) 40%,
            rgba(10, 14, 26, 0.45) 60%,
            rgba(10, 14, 26, 0.75) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(10, 14, 26, 0.40) 0%,
            rgba(10, 14, 26, 0.30) 50%,
            rgba(10, 14, 26, 0.70) 100%
        );
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   3. COLORES DE TEXTO — solo cuando hay imagen de fondo (.has-backdrop)
      Sin backdrop, los colores originales de style.css se mantienen intactos
   ───────────────────────────────────────────────────────────────────────────── */

/* Labels (Calificación, Año, País, etc.) */
.info_movie.has-backdrop p i {
    color: #a8c4e0 !important;
}

/* Valores de cada fila */
.info_movie.has-backdrop p,
.info_movie.has-backdrop p span {
    color: #e8edf2 !important;
}

/* Links (ej: el año enlazado) */
.info_movie.has-backdrop a {
    color: #7eb8e8 !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   4. RESPONSIVE
   ───────────────────────────────────────────────────────────────────────────── */

/* Tablet (≤ 930px) — sin poster, igual que antes */
@media only screen and (max-width: 930px) {

    .info_movie {
        grid-template-columns: 1fr;
    }

    .info_movie .info-left {
        display: none;
    }

    /* Overlay vertical en tablet — solo con backdrop */
    .info_movie.has-backdrop::before {
        background:
            linear-gradient(
                to bottom,
                rgba(10, 14, 26, 0.55) 0%,
                rgba(10, 14, 26, 0.40) 40%,
                rgba(10, 14, 26, 0.75) 100%
            );
    }
}

/* Móvil (≤ 780px) — MOSTRAR poster junto a la info */
@media only screen and (max-width: 780px) {

    .info_movie .info-right p {
        line-height: 1.4;
        padding: 1px 0;
    }

    /* Cancelar el top:10px del base — causa espaciado exagerado en móvil */
    .info_movie > * {
        top: 0;
    }

    .info_movie {
        grid-template-columns: 110px 1fr;
        padding: 12px;
        gap: 12px;
        border-radius: 8px;
        align-items: start;
    }

    /* MOSTRAR el poster en móvil */
    .info_movie .info-left {
        display: block;
        width: 110px;
    }

    .info_movie .info-left img {
        width: 100%;
        height: auto;
        border-radius: 6px;
        display: block;
        box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    }

    /* Ocultar badge de idioma en móvil */
    .info_movie .info-left .language-badge-poster {
        display: none;
    }

    /* Más contraste en móvil — solo con backdrop */
    .info_movie.has-backdrop::before {
        background:
            linear-gradient(
                to bottom,
                rgba(10, 14, 26, 0.55) 0%,
                rgba(10, 14, 26, 0.40) 40%,
                rgba(10, 14, 26, 0.80) 100%
            );
    }

    /* Filas de info */
    .info_movie p {
        grid-template-columns: 85px 1fr;
        gap: 6px;
        font-size: 11px;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* El texto del valor no se corta con ... */
    .info_movie p span {
        overflow: visible;
        white-space: normal;
        text-overflow: unset;
    }

    /* Las estrellitas vuelven a flujo normal */
    .info_movie p span .abc-c {
        position: relative;
        top: auto;
        right: auto;
    }
}

/* Móvil pequeño (≤ 500px) */
@media only screen and (max-width: 500px) {

    .info_movie {
        grid-template-columns: 85px 1fr;
        padding: 10px;
        gap: 10px;
        border-radius: 6px;
    }

    .info_movie .info-left {
        width: 85px;
    }

    /* Reducir columna del label para que no parta el texto */
    .info_movie p {
        grid-template-columns: 70px 1fr;
        font-size: 10px;
        gap: 4px;
    }

    /* Labels más cortos */
    .info_movie p i {
        font-size: 9px;
    }
}

/* Móvil muy pequeño (≤ 380px) */
@media only screen and (max-width: 380px) {

    .info_movie {
        grid-template-columns: 70px 1fr;
        padding: 8px;
        gap: 8px;
    }

    .info_movie .info-left {
        width: 70px;
    }

    .info_movie p {
        grid-template-columns: 65px 1fr;
        font-size: 10px;
        gap: 3px;
    }

    /* Labels más pequeños para evitar el salto de línea */
    .info_movie p i {
        font-size: 9px;
        word-break: break-word;
    }
}