/* ============================================
   VARIABLES GLOBALES
   ============================================ */
:root {
    --color-bg-dark: #0a0a0a;
    --color-bg-light: #ffffff;
    --color-text-light: #f0f0f0;
    --color-text-dark: #1e1f22;
    --color-primary: #0064ff;
    --color-primary-hover: #0050cc;
    --color-border: #e5e7eb;
    --color-miniatura-border: #595353;
    --color-miniatura-active: #0485f7;
    --transition-speed: 0.2s;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================
   NOTICIA COMPLETA (página pública)
   ============================================ */

/* ---------- TÍTULOS Y ENCABEZADOS ---------- */
.new-noticia-completa .new-titulo-principal {
  margin-bottom: 4px;
  text-align: center;
  padding: 4px;
  text-transform: uppercase;
  color: #05f;
  font-size: 1.15rem;
}

.new-noticia-completa h3 {
  font-size: 1.2rem;
  text-align: center;
}
.new-subtitulo {
    font-size: 1rem;
    color: #6b7280;
    font-weight: normal;
    text-align: center;
    margin-bottom: 7px;
}

/* ---------- CONTENIDO PRINCIPAL CON IMAGEN FLOTANTE ---------- */
.new-contenido-principal {
    margin: 1rem;
    display: flex;
    flex-direction: column;
}

.new-imagen-flotante {
    position: relative;
    width: 100%;
    float: none;
    margin: 0 0 1rem;
    cursor: pointer;
}

.new-img-flotante {
    display: block;
    width: 100%;
    height: clamp(240px, 30vw, 420px);
    object-fit: cover;
    transition: transform var(--transition-speed);
    border: 1px inset #fff;
    border-radius: 4px;
}

.new-imagen-flotante:hover .new-img-flotante {
    transform: scale(1.02);
}

.new-badge-galeria {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgb(255, 255, 255);
    color: red;
    padding: 5px;
    border-radius: 50%;
    pointer-events: none;
    border: 1px inset white;
    font-weight: bold;
    font-size: 14px;
}

.new-texto-noticia {
    text-align: justify;
    width: auto;
    float: none;
    order: 3;
    line-height: 1.5rem;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.new-texto-noticia p {
    width: auto;
    max-width: none;
}

.new-clean {
    clear: both;
}

/* En escritorio, el texto fluye alrededor del medio principal. */
@media (min-width: 769px) {
    .new-contenido-principal {
        display: flow-root;
    }

    .new-imagen-flotante,
    .new-video-principal {
        width: min(42%, 560px);
        float: left;
        margin: 0 1.25rem 0.75rem 0;
    }

    .new-texto-noticia,
    .new-video-principal + .new-texto-noticia {
        display: block;
        width: auto;
        float: none;
    }

    .new-contenido-principal--sin-texto :is(.new-imagen-flotante, .new-video-principal) {
        width: 100%;
        max-width: none;
        float: none;
        margin: 0 0 1rem;
    }
}

/* ---------- GALERÍA DE MINIATURAS (thumbnails) - RESPONSIVE ---------- */
.new-galeria-completa {
    border-radius: 4px;
    width: 100%;
    float: none;
    clear: none;
    order: 2;
    margin: 0 0 1.5rem;
    padding: 0;
}

.new-galeria-titulo {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Grid responsive - se adapta automáticamente */
.new-grid-galeria {
    --galeria-altura-imagen: 11rem;
    --galeria-altura-texto: 8rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 9px;
    margin-top: 1rem;
}

.new-item-galeria {
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    box-shadow: var(--shadow-sm);
    width: 100%;
    min-width: 0;
    height: calc(var(--galeria-altura-imagen) + var(--galeria-altura-texto));
}

.new-item-galeria:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.new-miniatura {
    flex: 0 0 var(--galeria-altura-imagen);
    width: 100%;
    height: var(--galeria-altura-imagen);
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--transition-speed);
    background: #e1e1e1;
}

.new-miniatura:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.new-miniatura img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.new-miniatura video,
.new-miniatura iframe {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: cover;
    border: 0;
}

.new-miniatura--abrir { position: relative; cursor: pointer; }
.new-miniatura-play {
    position: absolute;
    inset: 50% auto auto 50%;
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    place-items: center;
    padding-left: .18rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font-size: 1.4rem;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.new-miniatura-video-icon { display: grid; width: 100%; height: 100%; place-items: center; background: #111827; font-size: 3rem; }

.new-miniatura--pdf {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem;
    cursor: default;
    color: #334155;
    background: #f8fafc;
}

.new-miniatura--pdf span {
    font-size: clamp(2.25rem, 4vw, 3.5rem);
    line-height: 1;
}

.new-miniatura--pdf strong {
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: center;
}

.new-miniatura--pdf a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    color: #fff;
    background: #2563eb;
    font-size: 0.85rem;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.new-miniatura:hover img {
    transform: scale(1.02);
}

.sin-imagen {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #9ca3af;
}

.new-texto-imagen {
    flex: 0 0 var(--galeria-altura-texto);
    width: 100%;
    height: var(--galeria-altura-texto);
    box-sizing: border-box;
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    color: #374151;
    border-top: 1px solid var(--color-border);
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
    text-align: justify;
    line-height: 1.15rem;
}

/* Eliminamos el pseudo-elemento que cortaba el texto */
.new-texto-imagen::after {
    display: none;
}

/* ---------- VIDEO ---------- */

.video-local {
  width: 99%;
}

.imgs-videos-relacionados {
    padding: 10px;
}

.new-video-container {
    text-align: center;
}

.imgs-videos-relacionados .new-video-container .video-container {
    width: 50%;
    max-width: 100%;
    margin: 0 auto;
}

.imgs-videos-relacionados .new-video-container .video-container iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 4px;
    background: #000;
}

.new-video-titulo {
    padding: 7px;
}

.new-video-noticia {
    width: 97%;
    border-radius: 8px;
    border: 4px inset #464646;
}

/* ---------- ACCIONES NOTICIA ---------- */
.new-acciones-noticia {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 9px;
    align-items: center;
    margin-bottom: 1rem;
}

/* ---------- COMPARTIR EN REDES SOCIALES ---------- */
.new-compartir {
    padding: 9px;
    border-top: 1px inset #e8e8e8;
    background: #e1e1e1;
    margin-bottom: 1rem;
}

.new-compartir-titulo {
    margin-bottom: 0.5rem;
}

.new-redes-sociales {
    justify-content: center;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ---------- BOTONES GENERALES ---------- */
.btn-new {
    padding: 6px 12px;
    transition: all var(--transition-speed);
    border: 1px solid white;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    margin-right: 4px;
    background: #ffcece;
}

.btn-new:hover {
    transform: translateY(-4px);
    background: none;
    color: #00b00b;
    font-weight: bold;
    border: none;
}

.btn-new-small {
    background: #a2a0a0;
    font-size: 0.9rem;
    color: #fff;
}

.btn-new-large {
    padding: 9px 12px;
    font-size: 1rem;
}

.btn-new-secondary:hover {
    background: #4b5563;
    color: white;
}

.btn-new-comentarios {
    background: #e9e9ed;
    text-decoration: none;
    display: inline-block;
}

.btn-new-comentarios:hover {
    background: #2563eb;
    color: white;
}

/* ---------- ALERTAS ---------- */
.new-alerta {
    padding: 9px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.new-alerta-info {
    background: #ffe8e8;
    color: #0369a1;
    border-left: 2px solid #ff5050;
    border-bottom: 1px solid #ff8080;
}

.new-alerta-info {
    color: #f00;
}

.new-alerta-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* ============================================
   MODAL DE GALERÍA CON NAVEGACIÓN - RESPONSIVE
   ============================================ */
.modal-galeria {
  position: fixed;
  z-index: 13000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.98);
  align-items: center;
  justify-content: center;
}
.modal-galeria-contenido {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(90vw, 1200px);
  text-align: center;
  background: transparent;
  max-width: 1200px;
  max-height: 90vh;
  margin: 0 auto;
  box-sizing: border-box;
}


.modal-galeria-contenido img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.modal-galeria-medio {
    display: flex;
    width: 100%;
    min-height: 12rem;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}
.modal-galeria-medio :is(img, video) {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(70vh, 675px);
    margin: 0 auto;
    border: 0;
    border-radius: 8px;
    background: #000;
    object-fit: contain;
}
.modal-galeria-medio iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    border: 0;
    border-radius: 8px;
    background: #000;
}
.modal-galeria-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: #fff;
    color: #1d4ed8;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.modal-galeria-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.8rem 1.2rem;
    z-index: 10;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-galeria-prev {
    left: 10px;
}

.modal-galeria-next {
    right: 10px;
}

.modal-galeria-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.05);
}

.modal-galeria-cerrar {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-galeria-cerrar:hover {
    color: #ccc;
    background: rgba(0, 0, 0, 0.8);
}

.modal-galeria-texto {
    width: min(100%, 960px);
    box-sizing: border-box;
    margin-top: 1rem;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.modal-galeria-contador {
    width: 100%;
    margin-top: 0.5rem;
    color: white;
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================
   MODAL DE REPORTE DE COMENTARIOS
   ============================================ */
.modal-reporte {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-reporte-contenido {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.modal-reporte-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #dc3545;
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-reporte-header h3 {
    margin: 0;
}

.modal-reporte-cierre {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* ---------- CAMPOS DE FORMULARIO ---------- */
.campo-form {
    margin-bottom: 15px;
    padding: 0 20px;
}

.campo-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.campo-form select,
.campo-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* ---------- PIE DEL MODAL ---------- */
.modal-reporte-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-reporte-footer button {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal-reporte-footer button[type="button"] {
    background: #6c757d;
    color: white;
}

.modal-reporte-footer .btn-enviar {
    background: #dc3545;
    color: white;
}

/* ---------- ANIMACIONES ---------- */
@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   ESTILOS PARA NOTICIAS IMPORTADAS DE RSS
   ============================================ */
.noticia-rss-importada {
    font-family: inherit;
    line-height: 1.6;
}

.rss-extracto {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn-rss-externo {
  display: inline-block;
  background: linear-gradient(135deg, #99c4ff, #06a2ff);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 1rem;
}
.btn-rss-externo:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.rss-fuente {
    font-size: 11px;
    color: #9ca3af;
    text-align: right;
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
    margin-top: 8px;
}

/* ============================================
   BOTÓN FAVORITO
   ============================================ */
.btn-new-favorito {
    background: #f3f4f6;
    color: #374151;
    transition: all 0.2s;
}

.btn-new-favorito:hover {
    background: #fef3c7;
    color: #92400e;
    transform: translateY(-2px);
}

.btn-new-favorito[data-favorito="1"] {
    background: #fee2e2;
    color: #dc2626;
}

        /* Estilos adicionales por si acaso */
        .galeria-container {
            display: flex;
            flex-direction: column;
            height: 100vh;
            background: #0a0a0a;
            color: #f0f0f0;
        }
        .galeria-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            background: rgba(0,0,0,0.5);
            flex-shrink: 0;
        }
        .galeria-header a {
            color: #0064ff;
            text-decoration: none;
        }
        .galeria-img-container {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            padding: 1rem;
        }
        .galeria-img-container img,
        .galeria-img-container video,
        .galeria-img-container iframe {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        .galeria-img-container video,
        .galeria-img-container iframe {
            width: min(960px, 100%);
            aspect-ratio: 16 / 9;
            border: 0;
            background: #000;
        }
        .galeria-documento a {
            color: #93c5fd;
        }
        .galeria-texto {
            text-align: center;
            padding: 0.5rem 1rem;
            background: rgba(0,0,0,0.3);
            margin: 0.5rem;
            border-radius: 8px;
        }
        .galeria-controles {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 1rem;
            padding: 0.5rem;
        }
        .galeria-btn {
            background: rgba(255,255,255,0.2);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 30px;
            text-decoration: none;
        }
        .galeria-btn:hover {
            background: #0064ff;
        }
        .galeria-contador {
            font-size: 0.9rem;
        }
        .galeria-miniaturas {
            display: flex;
            gap: 0.5rem;
            padding: 0.75rem;
            background: #1a1a1a;
            overflow-x: auto;
            flex-shrink: 0;
        }
        .galeria-miniaturas a {
            flex-shrink: 0;
            opacity: 0.6;
            transition: opacity 0.2s;
            border: 2px solid transparent;
            border-radius: 4px;
            overflow: hidden;
        }
        .galeria-miniaturas a.active {
            opacity: 1;
            border-color: #0064ff;
        }
        .galeria-miniaturas img {
            height: 60px;
            width: auto;
            display: block;
            object-fit: cover;
        }
        .galeria-miniaturas span {
            display: grid;
            width: 72px;
            height: 60px;
            place-items: center;
            background: #111827;
            font-size: 1.5rem;
        }

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablets y móviles grandes (≤768px) */
@media (max-width: 768px) {
    /* Noticia completa */
    .new-imagen-flotante {
        width: 100%;
        float: none;
        margin: 0 0 1rem;
    }

    .new-img-flotante {
        width: 100%;
        height: clamp(220px, 58vw, 360px);
        float: none;
    }
    .new-texto-noticia {
        width: 100%;
        float: none;
    }
    .new-galeria-completa {
        width: 100%;
        float: none;
        padding: 0 0.5rem;
    }
    .new-video-container {
        width: 100%;
        float: none;
        margin-left: 0;
    }

    .imgs-videos-relacionados .new-video-container .video-container {
        width: 100%;
    }

    /* Galería a ancho completo con alturas adaptadas */
    .new-grid-galeria {
        gap: 0.5rem;
    }

    .new-item-galeria {
        height: auto;
    }

    .new-miniatura {
        flex: 0 0 auto;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .new-miniatura--video img,
    .new-miniatura video,
    .new-miniatura iframe {
        object-fit: contain;
        background: #000;
    }

    .new-acciones-noticia {
    gap: 4px;
    flex-wrap: wrap;
    padding: 10px;
  }
    
    /* Modal galería responsive */
    .modal-galeria-nav {
        font-size: 1.2rem;
        padding: 0.5rem 1rem;
    }
    .modal-galeria-cerrar {
        top: -35px;
        right: 0;
        width: 35px;
        height: 35px;
        font-size: 25px;
    }
    .modal-galeria-contenido img {
        max-height: 60vh;
    }
    .modal-galeria-texto {
        font-size: 0.8rem;
        max-width: 95%;
    }
            .galeria-miniaturas img {
                height: 40px;
            }
}

/* Móviles pequeños (≤480px) */
@media (max-width: 480px) {
    /* Galería - 1 columna en móviles */
    .new-grid-galeria {
        --galeria-altura-texto: 7rem;
        gap: 1rem;
    }

    .new-grid-galeria {
        grid-template-columns: 1fr;
    }
    
    .new-noticia-completa .new-titulo-principal {
        font-size: 1rem;
    }
    
    .btn-new {
        padding: 7px 10px;
    }
    
    /* Modal galería móvil */
    .modal-galeria-nav {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
    .modal-galeria-prev {
        left: 5px;
    }
    .modal-galeria-next {
        right: 5px;
    }
    .modal-galeria-contenido img {
        max-height: 50vh;
    }
    .modal-galeria-texto {
        font-size: 0.7rem;
        padding: 0.5rem;
    }
}

.new-video-principal {
    width: 40%;
    float: left;
    cursor: default;
}

.new-video-principal + .new-texto-noticia {
    width: auto;
    float: none;
}

.new-video-principal video,
.new-video-principal iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 4px;
    background: #000;
}

.new-video-principal .video-container {
    width: 100%;
}

.new-video-principal .video-fuente {
    margin: 0.45rem 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
}

.new-video-portada {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background: #000;
    cursor: pointer;
}

.new-video-portada .new-img-flotante {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
}

.new-video-portada-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 4rem;
    height: 4rem;
    place-items: center;
    padding-left: 0.2rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    transform: translate(-50%, -50%);
    transition: background 0.2s ease, transform 0.2s ease;
}

.new-video-portada:hover .new-video-portada-play,
.new-video-portada:focus-visible .new-video-portada-play {
    background: #dc2626;
    transform: translate(-50%, -50%) scale(1.08);
}

/* Vídeos insertados desde TinyMCE dentro del contenido editorial. */
.new-contenido-html iframe {
    display: block;
    width: 50% !important;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto !important;
    margin: 1rem auto;
    border: 0;
    border-radius: 4px;
    background: #000;
}

@media (max-width: 768px) {
    .new-video-principal,
    .new-video-principal + .new-texto-noticia {
        width: 100%;
        float: none;
    }

    .new-video-principal {
        margin-bottom: 1rem;
    }

    .new-contenido-html iframe {
        width: 100% !important;
    }
}
