/* ====== FORZAR ESTILOS COMPACTOS EN TARJETAS DE NOTICIAS Y SIDEBAR ====== */
/* Estilos específicos para la página de Noticias - Copiados de la carpeta raíz IUDS_PAGINA */
/* IMPORTANTE: Este archivo debe cargarse DESPUÉS de noticias-common.css para tener prioridad */

.noticias-grid .card-hover {
    margin-bottom: 0.75rem !important;
    border-radius: 0.65rem !important; /* Exacto como HTML original */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important; /* shadow-md de Tailwind */
    padding: 0 !important;
    background: #fff !important;
    max-width: 24rem !important; /* max-w-sm = 24rem */
    transform: translateY(0px);
    transition: all 0.3s ease;
}

.noticias-grid .h-48,
.noticias-grid .news-image {
    height: 12rem !important; /* h-48 = 12rem */
    overflow: hidden !important;
    /* Sin border-radius en el div, la imagen se ajusta al overflow-hidden del article */
}

/* Padding del contenido - p-4 = 1rem como en HTML original */
.noticias-grid .p-4 {
    padding: 1rem !important;
}

.noticias-grid .noticias-card-content {
    padding: 0.7rem 0.9rem 0.7rem 0.9rem !important;
}

.noticias-grid .noticias-card-content h3,
.noticias-grid h3.text-lg {
    margin-bottom: 0.18rem !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.noticias-grid .noticias-card-content p,
.noticias-grid p.text-gray-600 {
    margin-bottom: 0.3rem !important;
    font-size: 0.93rem !important;
    line-height: 1.4 !important;
}

.noticias-grid .noticias-fecha,
.noticias-grid .text-xs.text-gray-500:first-of-type {
    margin-right: 0.18rem !important;
    font-size: 0.85rem !important;
}

.noticias-grid .noticias-boton,
.noticias-grid .btn-primary {
    margin-left: 0.18rem !important;
    padding: 0.32rem 0.8rem !important;
    font-size: 0.93rem !important;
    border-radius: 0.4rem !important;
}

/* Sidebar compacto */
.noticias-sidebar .bg-white.rounded-xl.shadow-md {
    margin-bottom: 0.7rem !important;
    padding: 0.7rem 1rem !important;
    border-radius: 0.6rem !important;
    box-shadow: 0 2px 8px rgba(30,58,138,0.08) !important;
}

.noticias-sidebar h3 {
    margin-bottom: 0.3rem !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
}

.noticias-sidebar .flex.items-center.space-x-3 {
    gap: 0.4rem !important;
}

.noticias-sidebar .flex.items-center.space-x-3 i {
    font-size: 0.95rem !important;
    min-width: 0.95rem !important;
}

.noticias-sidebar .flex.items-center.space-x-3 > div {
    min-width: 0;
}

.noticias-sidebar .space-y-4 > * + * {
    margin-top: 0.4rem !important;
}

.noticias-sidebar .text-sm {
    font-size: 0.93rem !important;
}

.noticias-sidebar .text-xs {
    font-size: 0.8rem !important;
}

/* ===== GRID DE NOTICIAS - FORZAR 3 COLUMNAS EN ESCRITORIO ===== */
.noticias-grid {
    display: grid !important;
    width: 100% !important;
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
}

/* Grid responsive - Mobile primero (1 columna) */
.noticias-grid.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

/* Tablet - 2 columnas */
@media (min-width: 768px) {
    .noticias-grid.md\:grid-cols-2,
    .noticias-grid[class*="md:grid-cols-2"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Desktop grande - 3 columnas */
@media (min-width: 1280px) {
    .noticias-grid.xl\:grid-cols-3,
    .noticias-grid[class*="xl:grid-cols-3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Asegurar que las tarjetas tengan max-w-sm (24rem) pero se ajusten al grid */
.noticias-grid .card-hover,
.noticias-grid article,
.noticias-grid > article {
    max-width: 24rem !important; /* max-w-sm = 24rem como HTML original */
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin: 0 auto !important; /* Centrar en su columna del grid */
}

/* El grid controla el ancho, pero max-w-sm limita el tamaño máximo */
.noticias-grid article.max-w-sm,
.noticias-grid .card-hover.max-w-sm {
    max-width: 24rem !important;
}

/* ===== ESTILOS ESPECÍFICOS PARA TARJETAS DE NOTICIAS ===== */
/* Asegurar que las tarjetas tengan el tamaño y espaciado correcto - EXACTO como HTML original */
.noticias-grid article.bg-white {
    background-color: #ffffff !important;
    border-radius: 0.65rem !important; /* EXACTO como HTML original (0.65rem) */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important; /* shadow-md de Tailwind */
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    transform: translateY(0px);
}

.noticias-grid article.bg-white:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-5px) !important;
}

/* Imagen de la tarjeta - SIN MARCO, completa sin bordes - EXACTO como HTML original */
.noticias-grid article .h-48,
article .h-48 {
    height: 12rem !important; /* h-48 = 12rem */
    overflow: hidden !important;
    /* Sin border-radius aquí, el overflow-hidden del article maneja las esquinas */
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.noticias-grid article img,
article img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
    transform: scale(1);
    cursor: pointer !important;
}

.noticias-grid article:hover img,
article:hover img {
    transform: scale(1.05) !important;
}

/* Contenido de la tarjeta - padding exacto como HTML original (p-4 = 1rem) */
.noticias-grid article .p-4 {
    padding: 1rem !important; /* p-4 en Tailwind = 1rem */
}

/* Categoría tag - Colores exactos como en la imagen */
.noticias-grid article .rounded-full {
    border-radius: 9999px !important;
    padding: 0.125rem 0.625rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
}

/* Intercambio - Fondo amarillo claro, texto marrón */
.noticias-grid article .bg-yellow-100,
article .bg-yellow-100 {
    background-color: #fef9c3 !important; /* Amarillo claro */
}

.noticias-grid article .bg-yellow-100.text-yellow-800,
article .bg-yellow-100.text-yellow-800 {
    color: #92400e !important; /* Marrón/ámbar oscuro */
}

/* Evento Social - Fondo rosa claro, texto rosa oscuro/morado */
.noticias-grid article .bg-pink-100,
article .bg-pink-100 {
    background-color: #fce7f3 !important; /* Rosa claro */
}

.noticias-grid article .bg-pink-100.text-pink-800,
article .bg-pink-100.text-pink-800 {
    color: #9f1239 !important; /* Rosa oscuro/morado */
}

/* Conferencia - Fondo morado claro, texto morado oscuro */
.noticias-grid article .bg-purple-100,
article .bg-purple-100 {
    background-color: #f3e8ff !important; /* Morado claro */
}

.noticias-grid article .bg-purple-100.text-purple-800,
article .bg-purple-100.text-purple-800 {
    color: #6b21a8 !important; /* Morado oscuro */
}

/* Texto "min lectura" - gris claro como en la imagen */
.noticias-grid article .text-gray-500,
article .text-gray-500 {
    color: #6b7280 !important; /* Gris claro */
    font-size: 0.75rem !important;
}

/* Título */
.noticias-grid article h3 {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Descripción */
.noticias-grid article p.text-gray-600 {
    font-size: 0.875rem !important;
    color: #4b5563 !important;
    margin-bottom: 1rem !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Botón Leer más */
.noticias-grid article .btn-primary {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    border-radius: 0.5rem !important;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
}

.noticias-grid article .btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #2563eb) !important;
    transform: translateY(-1px) !important;
}

.hero-bg {
    background: linear-gradient(rgba(30, 58, 138, 0.8), rgba(30, 58, 138, 0.6)), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%23e5e7eb" width="1200" height="600"/><rect fill="%23d1d5db" x="0" y="400" width="1200" height="200"/><rect fill="%23374151" x="100" y="200" width="200" height="300"/><rect fill="%236b7280" x="400" y="150" width="300" height="350"/><rect fill="%234b5563" x="800" y="180" width="250" height="320"/><circle fill="%23fbbf24" cx="1000" cy="100" r="60"/></svg>');
    background-size: cover;
    background-position: center;
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    transform: translateY(-1px);
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    transition: all 0.3s ease;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    transform: translateY(-1px);
}

.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
}

.news-image {
    background: linear-gradient(45deg, #e5e7eb, #d1d5db);
}

/* Reglas añadidas: normalización de imágenes y componentes usados por las notas */
.featured-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 400px;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    display: block;
}

.gallery-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
    display: block;
}

.gallery-image:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* Modal de imagen (coincide con las funciones en js/noticias.js) */
#imageModal,
.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.9);
    z-index: 9999;
}

#imageModal.show,
.image-modal.show {
    display: flex;
}

#imageModal .modal-image,
.image-modal .modal-image,
.modal-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 0.5rem;
}

#imageModal .close-button,
.image-modal .close-button,
.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Estilos para el breadcrumb */
.breadcrumb-nav {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
}

.breadcrumb-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.breadcrumb-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.breadcrumb-links a {
    color: #4b5563;
    text-decoration: none;
}

.breadcrumb-links a:hover {
    color: #1e3a8a;
}

.breadcrumb-separator {
    font-size: 0.75rem;
    color: #9ca3af;
}

.breadcrumb-current {
    color: #111827;
    font-weight: 500;
}

/* Estilos para el contenido del artículo */
.article-container {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.article-header {
    margin-bottom: 2rem;
}

.article-category {
    margin-bottom: 1rem;
}

.category-badge {
    background-color: #dcfce7;
    color: #166534;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.article-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    align-items: center;
    color: #4b5563;
    font-size: 0.875rem;
}

.article-meta i {
    margin-right: 0.5rem;
}

.article-meta .separator {
    margin: 0 0.75rem;
    color: #9ca3af;
}

/* Estilos para la imagen destacada */
.featured-image {
    margin-bottom: 2rem;
}

.featured-image img {
    width: 100%;
    height: 24rem;
    object-fit: cover;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Estilos para el texto del artículo */
.article-content {
    margin-bottom: 3rem;
}

.article-content p {
    font-size: 1.125rem;
    color: #374151;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Estilos para la galería de imágenes */
.image-gallery {
    margin-bottom: 3rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.gallery-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-image {
    width: 100%;
    height: 16rem;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-image:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Estilos para artículos relacionados */
.related-section {
    margin-top: 4rem;
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.related-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.related-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.related-card-content {
    padding: 1.5rem;
}

.related-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.related-card-description {
    color: #4b5563;
    font-size: 0.875rem;
}

/* Responsive design */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .article-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .breadcrumb-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ===== CORRECCIONES PARA MÓVIL - LAYOUT CENTRADO ===== */
@media (max-width: 768px) {
    /* Prevenir desbordamiento del contenido principal */
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Contenedores principales centrados */
    .article-container,
    .breadcrumb-container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
    
    /* Título del artículo responsive */
    .article-title {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        text-align: left !important;
        word-wrap: break-word !important;
        margin-bottom: 1rem !important;
    }
    
    /* Metadatos del artículo */
    .article-meta {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Imagen destacada responsive */
    .featured-image,
    .featured-image img {
        width: 100% !important;
        height: auto !important;
        max-height: 250px !important;
        object-fit: cover !important;
        margin: 1rem 0 !important;
    }
    
    /* Contenido del artículo */
    .article-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .article-content p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        text-align: left !important;
        word-wrap: break-word !important;
    }
    
    /* Galería responsive */
    .gallery-grid,
    .related-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .gallery-image {
        height: 200px !important;
        width: 100% !important;
        object-fit: cover !important;
    }
    
    /* Breadcrumb responsive */
    .breadcrumb-links {
        font-size: 0.8rem !important;
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }
    
    /* Modal de imagen en móvil */
    .image-modal .modal-image {
        max-width: 95% !important;
        max-height: 80% !important;
    }
    
    .close-modal {
        top: 10px !important;
        right: 15px !important;
        font-size: 30px !important;
    }
}

/* ===== ESTILOS FINALES CON MÁXIMA PRIORIDAD ===== */
/* Estos estilos se aplican al final para asegurar que tengan prioridad sobre cualquier otro CSS */

/* Forzar max-w-sm en todas las tarjetas del grid */
div.noticias-grid article.card-hover.max-w-sm,
div.noticias-grid > article.card-hover.max-w-sm,
.noticias-grid article.card-hover.max-w-sm,
.noticias-grid > article.card-hover.max-w-sm {
    max-width: 24rem !important;
    width: 100% !important;
    margin: 0 auto !important;
    border-radius: 0.65rem !important;
    margin-bottom: 0.75rem !important;
}

/* Forzar border-radius exacto */
div.noticias-grid article.bg-white.rounded-xl,
.noticias-grid article.bg-white.rounded-xl {
    border-radius: 0.65rem !important;
}

/* Forzar que la imagen no tenga bordes */
div.noticias-grid article .h-48.overflow-hidden,
.noticias-grid article .h-48.overflow-hidden {
    border-radius: 0 !important;
    overflow: hidden !important;
}

div.noticias-grid article .h-48.overflow-hidden img,
.noticias-grid article .h-48.overflow-hidden img {
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}







