/*
 * VIDEOS: Estilos para videos destacados
 * Migrado desde module-videos.css
 * Compatible con: LiteSpeed Cache, Cloudflare, Redis
 */

/* Wrapper principal con fondo negro - FULL WIDTH */
.informe-videos-section {
    background-color: #000; /* Hardcode para garantía (producción usa #000) */
    padding: 32px 0; /* Hardcode para match producción */
    /* Full-bleed: desbordar contenedor principal */
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    position: relative;
}

.informe-videos {
    max-width: var(--max-width-container);
    margin: 0 auto;
    padding: 0 var(--container-padding-desktop);
}

/* HEADER */
.informe-videos__header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0;
    margin-bottom: var(--space-6);
    background: transparent;
    padding: 0;
}

.informe-videos__header .informe-videos__title {
    grid-column: 1;
    grid-row: 1;
}

.informe-videos__header .informe-videos__more {
    grid-column: 2;
    grid-row: 1;
}

.informe-videos-section__separator {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: var(--border-width-thick);
    background-color: var(--color-white);
    margin-top: var(--space-2);
}

/**
 * Phase B: Título de videos destacados
 * 
 * ANTES: Usaba !important para forzar color blanco contra estilos globales
 * DESPUÉS: Ya no necesita !important porque los estilos globales fueron eliminados
 * 
 * Compatibilidad: Mantiene estilos específicos, pero ahora pueden ser sobrescritos
 * por utility classes si el HTML las usa
 */
.informe-videos-section .informe-videos__title {
    font-family: var(--font-serif);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    margin: 0;
    color: var(--color-white);
}

.informe-videos__more,
.informe-videos-section .informe-videos__header .informe-videos__more,
.informe-videos-global .informe-videos-section .informe-videos__header .informe-videos__more,
.informe-videos--dark .informe-videos__header .informe-videos__more {
    font-family: var(--font-sans) !important;
    text-transform: uppercase !important;
    font-size: var(--font-size-sm) !important;
    color: var(--color-primary) !important;
    text-decoration: none !important;
    letter-spacing: var(--ls-normal) !important;
    font-weight: var(--font-weight-bold) !important;
    margin-top: 0;
    padding: 24px 24px !important; /* Match producción desktop */
}

.informe-videos__more:hover {
    text-decoration: underline;
}

/* Grid general */
.informe-videos__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px; /* Match producción (no var(--space-2) = 8px) */
}

/* Grid específico para shorts (como producción) */
.informe-videos__grid--shorts {
    display: grid !important; /* Forzar grid para evitar que se rompa */
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important; /* Hardcode para match producción */
    width: 100%; /* Asegurar ancho completo */
}

.informe-videos__item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    width: 100%; /* Asegurar que items ocupen su columna */
    max-width: 100%; /* Evitar overflow */
}

/* Item específico para shorts */
.informe-videos__item--short {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important; /* Sin gap adicional para shorts */
    width: 100% !important; /* Asegurar ancho completo */
    max-width: 100% !important; /* Evitar overflow */
}

.informe-videos__embed iframe,
.informe-videos__embed video {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    display: block;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--space-1) !important;
}

/* YouTube Shorts: forzar aspect-ratio 9:16 - Sistema Nativo */
/* Usar .informe-embed-wrapper y .informe-aspect-ratio--9-16 (sistema nativo) */
.informe-videos__embed .informe-embed-wrapper.informe-aspect-ratio--9-16,
.informe-videos__embed .informe-embed-wrapper[data-ratio="9:16"] {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Shorts: iframes directos (fallback si no hay wrapper) */
.informe-videos__embed iframe.sd-embed.is-youtube-short,
.informe-videos__embed iframe.sd-embed.is-vertical.is-youtube-short,
.informe-videos__embed .sd-embed.is-youtube-short,
.informe-videos__embed .sd-embed.is-vertical.is-youtube-short {
    aspect-ratio: 9 / 16 !important;
    max-width: 400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Shorts dentro de items específicos */
.informe-videos__item--short .informe-videos__embed .informe-embed-wrapper.informe-aspect-ratio--9-16,
.informe-videos__item--short .informe-videos__embed .informe-embed-wrapper[data-ratio="9:16"] {
    margin-bottom: 8px; /* Match producción */
    border-radius: 4px;
}

/* Título del video (ahora está en .post-details, fuera del wrapper) */
.informe-videos__item--short .post-details {
    margin-top: 8px;
}

.informe-videos__item--short .post-details .video-title {
    margin: 0;
    padding: 0;
}

.informe-videos-section .informe-videos__meta {
    margin: 0 0 var(--space-1) !important;
    font-family: var(--font-sans) !important;
    font-size: var(--font-size-xs) !important;
    display: flex !important;
    gap: var(--space-2) !important;
    text-transform: uppercase !important;
    color: var(--color-gray-300) !important;
    letter-spacing: var(--ls-normal) !important;
}

.informe-videos-section .informe-videos__meta span {
    color: var(--color-gray-300) !important;
}

/**
 * Phase B: Título de item individual de video
 * Ya no necesita !important
 */
.informe-videos-section .informe-videos__title-item {
    font-family: var(--font-serif);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-normal);
    margin: 0;
    color: var(--color-white);
    text-decoration: none;
}

.informe-videos-section .informe-videos__title-item:hover {
    text-decoration: underline;
}

/* Título de video (.video-title) - Blanco con MJRT Black */
/* Match producción: múltiples selectores para alta especificidad */
.informe-videos__item .video-title,
.informe-videos__item .video-title a,
.informe-videos--dark .video-title,
.informe-videos--dark .video-title a,
.informe-videos-section .informe-videos__item .video-title,
.informe-videos-section .informe-videos__item .video-title a,
.informe-videos__embed .video-title,
.informe-videos__embed .video-title a,
.informe-videos__embed .post-details .video-title,
.informe-videos__embed .post-details .video-title a,
.informe-videos__embed .post-details h3.video-title,
.informe-videos__embed .post-details h3.video-title a,
.informe-videos--dark .informe-videos__embed .video-title,
.informe-videos--dark .informe-videos__embed .video-title a,
.informe-videos--dark .informe-videos__embed .post-details .video-title,
.informe-videos--dark .informe-videos__embed .post-details .video-title a,
.informe-videos--dark .informe-videos__embed .post-details h3.video-title,
.informe-videos--dark .informe-videos__embed .post-details h3.video-title a,
.informe-videos-section .informe-videos__embed .post-details h3.video-title,
.informe-videos-section .informe-videos__embed .post-details h3.video-title a,
.informe-videos-section .informe-videos__item--short .post-details h3.video-title,
.informe-videos-section .informe-videos__item--short .post-details h3.video-title a,
.informe-videos-section .informe-videos__item--short .post-details .video-title,
.informe-videos-section .informe-videos__item--short .post-details .video-title a {
    font-family: "MJRT", serif !important;
    font-size: 1rem !important;
    font-weight: 900 !important; /* MJRT Black */
    color: #FFFFFF !important; /* Blanco */
    text-decoration: none !important;
    display: block !important;
    line-height: 1.25 !important;
    margin-top: 6px !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    /* Reset de estilos globales que pueden interferir */
    background: transparent !important;
    border: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.informe-videos__item .video-title a:hover,
.informe-videos--dark .video-title a:hover,
.informe-videos-section .informe-videos__item .video-title a:hover,
.informe-videos__embed .video-title a:hover,
.informe-videos__embed .post-details .video-title a:hover,
.informe-videos__embed .post-details h3.video-title a:hover,
.informe-videos--dark .informe-videos__embed .video-title a:hover,
.informe-videos--dark .informe-videos__embed .post-details .video-title a:hover,
.informe-videos--dark .informe-videos__embed .post-details h3.video-title a:hover,
.informe-videos-section .informe-videos__embed .post-details h3.video-title a:hover {
    color: #F5F5F5 !important;
    text-decoration: underline !important;
}

/* Botón Ver más - ESPECIFICIDAD COMPLETA (como producción) */
.informe-videos-section .informe-videos__load-more-wrap {
    text-align: center !important;
    margin: 30px auto 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

/* MÁS SELECTORES (como producción) - Color #EE3334 (no #EE3339) */
.informe-videos__load-more button,
.informe-videos__load-more a,
.informe-videos-destacados .load-more,
.informe-videos-section .informe-videos__load-more-wrap .informe-videos__load-more,
.informe-videos-section button.informe-videos__load-more,
button.informe-videos__load-more {
    background-color: #EE3334 !important; /* ⚠️ CAMBIADO de #EE3339 a #EE3334 (producción) */
    color: #fff !important;
    border: none !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-family: "MJRT", serif !important;
    font-size: 14px !important;
    letter-spacing: .5px !important;
    transition: all .25s ease !important;
    text-align: center !important;
    margin: 0 !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Reset adicional para estados de enlace */
.informe-videos-section .informe-videos__load-more-wrap .informe-videos__load-more:link,
.informe-videos-section .informe-videos__load-more-wrap .informe-videos__load-more:visited,
.informe-videos-section .informe-videos__load-more-wrap .informe-videos__load-more:active,
.informe-videos__load-more:link,
.informe-videos__load-more:visited,
.informe-videos__load-more:active,
.informe-videos-destacados .load-more:link,
.informe-videos-destacados .load-more:visited,
.informe-videos-destacados .load-more:active {
    background-color: #EE3334 !important;
    background: #EE3334 !important;
    color: #FFFFFF !important;
    border: none !important;
    text-decoration: none !important;
}

/* Hover */
.informe-videos__load-more button:hover,
.informe-videos__load-more a:hover,
.informe-videos-destacados .load-more:hover,
.informe-videos-section .informe-videos__load-more-wrap .informe-videos__load-more:hover:not(:disabled):not(.loading),
.informe-videos-section button.informe-videos__load-more:hover:not(:disabled):not(.loading),
button.informe-videos__load-more:hover:not(:disabled):not(.loading) {
    background-color: #c62828 !important;
    color: #fff !important;
    border: none !important;
}

/* Estados disabled y loading */
.informe-videos-section .informe-videos__load-more-wrap .informe-videos__load-more:disabled,
.informe-videos-section button.informe-videos__load-more:disabled,
button.informe-videos__load-more:disabled,
.informe-videos__load-more:disabled,
.informe-videos-destacados .load-more:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background-color: #EE3334 !important;
    color: #FFFFFF !important;
}

.informe-videos-section .informe-videos__load-more-wrap .informe-videos__load-more.loading,
.informe-videos-section button.informe-videos__load-more.loading,
button.informe-videos__load-more.loading,
.informe-videos__load-more.loading,
.informe-videos-destacados .load-more.loading {
    opacity: 0.7 !important;
    pointer-events: none !important;
    background-color: #EE3334 !important;
    color: #FFFFFF !important;
}

/* Desktop: padding lateral para grid y header (min-width: 1025px) */
@media (min-width: 1025px) {
    .informe-videos-section .informe-videos__embed,
    .informe-videos-global .informe-videos-section .informe-videos__embed,
    .informe-videos--dark .informe-videos__embed {
        width: 90% !important;
    }

    .informe-videos-section .informe-videos__grid.informe-videos__grid--shorts,
    .informe-videos-global .informe-videos-section .informe-videos__grid.informe-videos__grid--shorts,
    .informe-videos--dark .informe-videos__grid.informe-videos__grid--shorts {
        padding: 0 80px !important; /* Match producción */
    }

    .informe-videos-section .informe-videos__header,
    .informe-videos-global .informe-videos-section .informe-videos__header,
    .informe-videos--dark .informe-videos__header {
        padding: 0 80px !important; /* Match producción */
    }

    .informe-videos-section .informe-videos__header .informe-videos__more,
    .informe-videos-global .informe-videos-section .informe-videos__header .informe-videos__more,
    .informe-videos--dark .informe-videos__header .informe-videos__more {
        padding: 24px 24px !important; /* Match producción */
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .informe-videos {
        max-width: 100%;
        padding: 0 16px; /* Match producción */
    }

    /* Grid general: 2 columnas en tablet */
    .informe-videos__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Grid shorts: mantener 3 columnas en tablet (como producción) */
    .informe-videos__grid--shorts {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important; /* Match producción */
        display: grid !important; /* Forzar grid */
    }

    /* Tablet: padding específico para .informe-videos__more */
    .informe-videos__header .informe-videos__more,
    .informe-videos-section .informe-videos__header .informe-videos__more,
    .informe-videos-global .informe-videos-section .informe-videos__header .informe-videos__more,
    .informe-videos--dark .informe-videos__header .informe-videos__more {
        padding: 24px !important; /* Match producción tablet */
    }
}

@media (max-width: 768px) {
    .informe-videos-section {
        padding: 24px 0; /* Match producción */
    }

    .informe-videos {
        padding: 0 12px; /* Match producción */
    }
    
    /* Grid general: 1 columna en mobile */
    .informe-videos__grid {
        grid-template-columns: 1fr;
    }
    
    /* Grid shorts: 1 columna en mobile */
    .informe-videos__grid--shorts {
        grid-template-columns: 1fr !important;
        gap: 20px !important; /* Match producción */
        display: grid !important; /* Forzar grid */
    }

    /* Items shorts: bordes en mobile */
    .informe-videos__item--short {
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    
    .informe-videos__item--short:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    
    .informe-videos-section .informe-videos__title {
        font-size: 1.38rem !important; /* Match producción */
        line-height: 1.05 !important;
    }

    .informe-videos__header {
        margin-bottom: 20px; /* Match producción */
    }

    /* Mobile: padding específico para .informe-videos__more */
    .informe-videos__more,
    .informe-videos-section .informe-videos__header .informe-videos__more,
    .informe-videos-global .informe-videos-section .informe-videos__header .informe-videos__more,
    .informe-videos--dark .informe-videos__header .informe-videos__more {
        padding: 20px 24px !important; /* Match producción mobile */
    }
}

/* ==========================================================
   VIDEOS SUGERIDOS (PR8: Movido desde modules/module-single.css)
========================================================== */

.informe-videos-sugeridos {
    max-width: 825px; /* Cambiado de 1320px a 825px para alinear con contenido del artículo */
    margin: 30px 0 0 0; /* Cambiado a margin-left: 0 (alineado a la izquierda) */
    padding: 0; /* Padding eliminado según solicitud */
    border-top: 1px solid #111;
    box-sizing: border-box;
}

.informe-videos-row {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}

.informe-video-item {
    flex: 1;
}

.informe-video-embed {
    width: 100%;
    margin-bottom: 12px;
    padding-left: 0 !important; /* Eliminar padding lateral */
    padding-right: 0 !important; /* Eliminar padding lateral */
    display: flex;
    justify-content: center; /* Centrar videos verticales */
    align-items: flex-start;
}

/* Sistema Nativo: .informe-embed-wrapper para videos sugeridos */
.informe-video-embed .informe-embed-wrapper.informe-aspect-ratio--9-16,
.informe-video-embed .informe-embed-wrapper[data-ratio="9:16"] {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 4px;
}

/* Asegurar que el contenido dentro del wrapper tenga aspect-ratio correcto */
.informe-video-embed .informe-embed-wrapper.informe-aspect-ratio--9-16 .informe-aspect-ratio__content,
.informe-video-embed .informe-embed-wrapper[data-ratio="9:16"] .informe-aspect-ratio__content {
    border-radius: 4px;
}

/* Wrapper legacy (si existe) - mantener compatibilidad */
.informe-video-embed .embed-wrap {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* Default 16:9 */
    height: 0;
    overflow: hidden;
}

/* YouTube Shorts: neutralizar wrapper legacy */
.informe-video-embed .embed-wrap:has(iframe.sd-embed.is-youtube-short),
.informe-video-embed .embed-wrap:has(iframe.sd-embed.is-vertical.is-youtube-short),
.informe-video-embed .embed-wrap:has(.sd-embed.is-youtube-short) {
    padding-bottom: 0 !important;
    height: auto !important;
    aspect-ratio: unset !important;
    position: static !important;
}

.informe-video-embed .embed-wrap iframe,
.informe-video-embed .embed-wrap video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* YouTube Shorts: forzar aspect-ratio 9:16 - REGLAS PRINCIPALES */
/* Aplicar directamente al iframe sin depender de .embed-wrap */
.informe-video-embed iframe.sd-embed.is-youtube-short,
.informe-video-embed iframe.sd-embed.is-vertical.is-youtube-short,
.informe-video-embed iframe.is-youtube-short,
.informe-video-embed iframe.is-vertical {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 9 / 16 !important;
    max-width: 400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    top: unset !important;
    left: unset !important;
    bottom: unset !important;
    right: unset !important;
}

/* Si el iframe está dentro de .embed-wrap, también neutralizar el wrapper */
.informe-video-embed .embed-wrap:has(iframe.sd-embed.is-youtube-short) iframe,
.informe-video-embed .embed-wrap:has(iframe.sd-embed.is-vertical.is-youtube-short) iframe {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 9 / 16 !important;
    max-width: 400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    top: unset !important;
    left: unset !important;
    bottom: unset !important;
    right: unset !important;
}

/* Videos horizontales (16:9) - mantener comportamiento por defecto */
.informe-video-embed iframe:not(.is-youtube-short):not(.is-vertical) {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
}

/* Sistema Nativo: videos horizontales */
.informe-video-embed .informe-embed-wrapper.informe-aspect-ratio--16-9,
.informe-video-embed .informe-embed-wrapper[data-ratio="16:9"] {
    width: 100%;
    border-radius: 4px;
}

.informe-video-title {
    margin-top: 8px;
    font-size: 1.05rem;
    line-height: 1.4;
}

.informe-video-title a {
    font-family: MajritTx, serif !important;
    font-weight: 900;
    color: #000 !important;
    text-decoration: none;
}

.informe-video-title a:hover {
    text-decoration: underline;
}

/* Responsive videos sugeridos */
@media (min-width: 769px) and (max-width: 1024px) {
    .informe-videos-row {
        flex-wrap: wrap;
    }
    
    .informe-video-item {
        flex: 0 0 calc(50% - 12px);
    }
}

@media (max-width: 768px) {
    .informe-videos-row {
        flex-direction: column;
    }
    
    .informe-video-item {
        flex: 1 1 100%;
    }
}

/* ==========================================================
   VIDEOS DESTACADOS EN SINGLE (PR8: Movido desde modules/module-single.css)
========================================================== */

.informe-videos-single-section {
    background: #ffffff;
    padding: 40px 0;
    margin-top: 40px;
    
    /* FIX 1 + BUG 5: Ancho igual al article/comentarios/relacionadas, alineado izquierda */
    max-width: var(--max-width-content); /* 825px */
    margin-left: 0; /* Alineado a la izquierda (columna del artículo) */
    margin-right: auto;
}

.informe-videos-single__header {
    margin-bottom: 24px;
}

.informe-videos-single__title {
    font-family: MajritTx, serif;
    font-weight: 900;
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #111;
    padding-bottom: 8px;
    border-bottom: 1px solid #111;
}

.informe-videos-single__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.informe-videos-single__item {
    display: block;
}

/* Títulos de videos en negro con MJRT Black */
.informe-videos-single__item .post-title a {
    font-family: MajritTx, serif !important;
    font-size: 1rem !important;
    font-weight: 900 !important;
    color: #000 !important;
    text-decoration: none;
    line-height: 1.25;
    display: block;
    margin-top: 6px;
}

.informe-videos-single__item .post-title a:hover {
    color: #333 !important;
    text-decoration: underline;
}

/* Responsive para videos single */
@media (max-width: 1024px) {
    .informe-videos-single__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .informe-videos-sugeridos {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-top: 24px; /* Reducir espacio superior en mobile */
    }
    
    .informe-videos-single-section {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .informe-videos-single__grid {
        grid-template-columns: 1fr;
    }
}

