/* Estilos para el listado de noticias */

/* Wrapper principal con hero */
.noticias-archive-wrapper {
    background: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero del listado */
.noticias-hero {
    position: relative;
    min-height: 100vh;
    background-color: #2c3e50;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    z-index: 0;
}

.noticias-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.85) 0%, rgba(52, 152, 219, 0.75) 100%);
    z-index: 1;
}

.noticias-hero .container {
    position: relative;
    z-index: 2;
}

.noticias-hero-content {
    color: #fff;
    position: relative;
    z-index: 1;
}

.noticias-hero-titulo {
    font-size: 52px;
    font-weight: 900;
    margin: 0 0 20px 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.noticias-hero-titulo i {
    margin-right: 12px;
    color: #fff;
}

.noticias-hero-descripcion {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Contenedor del listado */
.noticias-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    z-index: 0;
    isolation: isolate;
}

/* ========== BÚSQUEDA ========== */
.noticias-buscador-section {
    background: #fff;
    padding: 25px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Buscador */
.noticias-buscador {
    max-width: 700px;
    margin: 0 auto;
}

.buscador-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.buscador-container i.fa-search {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #27ae60;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
}

.buscador-container input {
    width: 100%;
    padding: 16px 55px 16px 55px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
    color: #2c3e50;
}

.buscador-container input:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

.buscador-container input::placeholder {
    color: #adb5bd;
}

.clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(46, 204, 113, 0.1);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #27ae60;
    z-index: 1;
}

.clear-search:hover {
    background: #27ae60;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

/* Filtros de Categoría */
.noticias-filtros-section {
    background: #fff;
    padding: 12px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    isolation: isolate;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .noticias-filtros-section {
        position: relative;
        top: auto;
        bottom: auto;
        z-index: 1 !important;
        padding: 5px 0;
        box-shadow: none;
        border-top: 1px solid #eee;
        transition: transform 0.3s ease-in-out;
    }

    .noticias-filtros-section.sticky-bottom-mobile {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 100000 !important;
        background: #fff;
        padding: 5px 0;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #eee;
        animation: slideUpMobile 0.3s ease-out forwards;
    }



    .noticias-filtros-section .container {
        padding: 0 10px;
    }

    .noticias-filtros-container {
        display: flex;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .filtro-todas {
        order: 2;
    }

    .filtros-slider-wrapper {
        order: 1;
    }
}

@keyframes slideUpMobile {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.noticias-filtros-section .container {
    padding: 0 10px;
    overflow: hidden;
}

.noticias-filtros-container {
    display: flex;
    gap: 20px;
    align-items: center;
    min-width: 0;
}

/* ===== FILTROS ESPECIALES (Urgente / Destacado) ===== */
.noticias-filtros-left {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 15px;
    border-right: 2px solid #e0e0e0;
}

.filtro-especial-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filtro-especial-btn i {
    font-size: 18px;
}

.filtro-especial-btn:hover {
    transform: scale(1.05);
}

.filtro-especial-btn.btn-destacado:hover {
    border-color: #f39c12;
    color: #f39c12;
}

.filtro-especial-btn.btn-destacado.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-color: #e67e22;
    color: #fff;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.filtro-especial-btn.btn-urgente:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.filtro-especial-btn.btn-urgente.active {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-color: #c0392b;
    color: #fff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.filtro-todas {
    flex-shrink: 0;
}

/* ===== BADGE CONTADOR + BOTONES RÁPIDOS ===== */
.noticias-resultados {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: -10px 0 20px 0;
    padding: 0;
}

.noticias-filtros-especiales {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.noticias-resultados #resultados-count {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.filtro-especial-btn.btn-urgente.active i {
    animation: bellShakeFilter 2s infinite;
}

@keyframes bellShakeFilter {

    0%,
    100% {
        transform: rotate(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: rotate(-12deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: rotate(12deg);
    }
}

.filtros-slider-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    overflow: hidden;
}

/* Botones de navegación de filtros */
.filtro-nav-btn {
    background: #2ecc71;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
    color: #ffffff;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.filtro-nav-btn i {
    transition: transform 0.25s ease;
}

.filtro-nav-btn:hover {
    background: #27ae60;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.filtro-nav-btn:hover i {
    transform: scale(1.08);
}

.filtro-nav-btn:active {
    background: #229954;
}

.filtro-nav-btn:active i {
    transform: scale(0.92);
}

/* Wrapper con scroll */
.categorias-chips-wrapper {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.categorias-chips-wrapper::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.categorias-chips {
    display: flex;
    gap: 10px;
    padding: 5px 0;
}

.chip-filtro {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.chip-filtro i {
    font-size: 1rem;
}

.chip-filtro:hover {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.3);
    color: #27ae60;
    transform: translateY(-2px);
}

.chip-filtro.active {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #ffffff;
    border-color: #27ae60;
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.3);
}

.chip-filtro.active i {
    color: #fff;
}

.chip-filtro.active:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    border-color: #229954;
    color: #ffffff;
}

/* Contador de resultados */

.noticias-resultados span {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid rgba(46, 204, 113, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

/* Mensaje sin resultados */
.noticias-no-resultados {
    display: none;
    text-align: center;
    padding: 60px 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.noticias-no-resultados i {
    font-size: 4rem;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.noticias-no-resultados p {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 25px;
}

.btn-limpiar-filtros {
    background: #2ecc71;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-limpiar-filtros:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

/* Grid de noticias */
.noticias-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -17.5px;
    position: relative;
}

.noticias-grid article {
    width: calc(33.333% - 35px);
    margin: 17.5px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-direction: column;
    position: relative;
    z-index: 0;
}

/* Tarjeta de noticia */
.noticia-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.3s ease;
    background-color: white;
    position: relative;
    z-index: 0;
    min-height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    opacity: 1;
}

.noticia-card.noticia-visible {
    animation: fadeInCard 0.4s ease-out;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.noticia-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Badges urgente y destacada */
.badge-urgente {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 3;
    background: #e74c3c;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.badge-destacada {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 3;
    background: #f39c12;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* HEADER: Imagen de la noticia */
.noticia-card-imagen {
    height: 220px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.noticia-card-imagen:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    z-index: 1;
    pointer-events: none;
}

.noticia-card-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.noticia-card:hover .noticia-card-imagen img {
    transform: scale(1.08);
}

/* Badge de categoría en imagen */
.categoria-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 30px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.categoria-badge i {
    font-size: 0.9rem;
}

/* Colores por categoría */
.categoria-eventos {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: #fff;
}

.categoria-talleres {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
}

.categoria-exposiciones {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    color: #fff;
}

.categoria-actividades {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: #fff;
}

.categoria-comunicados {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

.categoria-convocatorias {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
}

.categoria-galeria {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: #fff;
}

.categoria-premios {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    color: #2c3e50;
}

.categoria-general {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: #fff;
}

/* BODY: Contenido de la noticia */
.noticia-card-content {
    padding: 25px;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 240px;
    max-height: 240px;
}

/* Meta información (fecha y tiempo lectura) */
.noticia-card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.noticia-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.noticia-card-meta i {
    font-size: 0.9rem;
}

/* Título de la noticia */
.noticia-card-titulo {
    font-size: 1.25rem;
    margin-bottom: 12px;
    line-height: 1.3;
    min-height: 2.7em;
    max-height: 2.7em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    white-space: normal;
}

.noticia-card-titulo a {
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.noticia-card-titulo a:hover {
    color: #27ae60;
}

/* Resumen de la noticia */
.noticia-card-resumen {
    margin-bottom: 0;
    color: #2c3e50;
    line-height: 1.6;
    font-size: 0.95rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    max-height: 4.6em;
}

/* FOOTER: Contenedor del botón */
.noticia-card-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* FOOTER: Botón de acción */
.noticia-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 12px 15px;
    background: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    font-size: 0.9rem;
}

.noticia-card-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #27ae60;
    transition: all 0.3s ease;
    z-index: -1;
}

.noticia-card-btn:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.noticia-card-btn:hover:before {
    left: 0;
}

.noticia-card-btn i {
    transition: transform 0.3s ease;
}

.noticia-card-btn:hover i {
    transform: translateX(3px);
}

/* Mensaje de no noticias */
.noticias-empty {
    text-align: center;
    padding: 60px 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.noticias-empty p {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0;
}

/* Responsive */
@media (max-width: 992px) {
    .noticias-grid article {
        width: calc(50% - 35px);
    }

    .noticias-hero-titulo {
        font-size: 42px;
    }

    .noticias-hero-descripcion {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .noticias-grid {
        margin: -12.5px;
    }

    .noticias-grid article {
        width: calc(100% - 25px);
        margin: 12.5px;
    }

    .noticia-card,
    .noticia-card-imagen,
    .noticia-card-titulo {
        position: relative;
    }

    .noticia-card-titulo {
        font-size: 1.1rem;
        line-height: 1.3;
        min-height: 2.6em;
        max-height: 2.6em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .noticias-hero {
        min-height: 100vh;
        background-attachment: scroll;
    }

    .noticias-hero-titulo {
        font-size: 38px;
    }

    .noticias-hero-descripcion {
        font-size: 15px;
    }

    /* Filtros responsive */
    .noticias-buscador-section {
        padding: 20px 0;
    }

    .noticias-filtros-section {
        padding: 20px 0;
    }

    .noticias-filtros-section .container {
        padding: 0 10px;
    }

    .noticias-filtros-container {
        flex-wrap: nowrap;
        gap: 10px;
        align-items: center;
        display: flex;
        justify-content: flex-start;
    }

    .buscador-container input {
        padding: 12px 45px 12px 45px;
        font-size: 0.95rem;
    }

    .filtro-todas {
        width: 45px;
        height: 45px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        margin: 0;
    }

    .filtro-todas span:not(.filtro-icono) {
        display: none;
        /* Hide text */
    }

    .filtro-todas i {
        margin: 0;
        font-size: 1.2rem;
    }

    .filtros-slider-wrapper {
        flex: 1;
        width: auto;
        min-width: 0;
    }

    .filtro-nav-btn {
        display: none;
    }

    .categorias-chips-wrapper {
        overflow-x: auto;
    }

    .chip-filtro {
        padding: 8px 16px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .noticias-no-resultados {
        padding: 40px 20px;
    }

    .noticias-no-resultados i {
        font-size: 3rem;
    }

    .noticias-no-resultados p {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .noticias-hero-titulo {
        font-size: 32px;
    }

    .noticias-hero-descripcion {
        font-size: 14px;
    }

    .noticia-card-imagen {
        height: 200px;
    }
}
