/**
 * Bloque Rejilla de Noticias - ALINEADO CON HERO BLOCK
 */
.rescop-news-grid-block {
    width: 100%;
    background: white;
    padding: 4rem 0;
    /* Resetear padding que pueda aplicar refinement-global.css */
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.rescop-news-grid-container {
    /* Estructura idéntica a los contenedores de bloques */
    max-width: var(--rescop-container-max-width, 1280px);
    margin: 0 auto;
    
    box-sizing: border-box;
}

.rescop-news-grid-title {
    color: black !important;
    font-size: 32px !important;
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    font-weight: 400 !important;
    line-height: 48px !important;
    text-align: center;
    margin: 0 0 3rem 0 !important;
    text-transform: capitalize !important;
}

/* === BUSCADOR A LA DERECHA === */
.rescop-news-search-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

.rescop-news-search-wrapper {
    display: flex;
    max-width: 450px; /* 🆕 Aumentado para botón limpiar */
    width: auto;
    min-width: 300px;
    overflow: hidden;
    background: white;
}

.rescop-news-search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-size: 16px !important;
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
    background: transparent;
    color: #404040 !important;
    border: none !important;
}

.rescop-news-search-input::placeholder {
    color: rgba(64, 64, 64, 0.6) !important;
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
}

.rescop-news-search-button {
    background: #404040;
    border: none;
    border-right: none;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    max-height: 40px;
}

.rescop-news-search-button:hover {
    background: #BE252D;
}

/* 🆕 BOTÓN LIMPIAR */
.rescop-news-clear-button {
    background: #6c757d;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    color: white;
    font-size: 16px;
    opacity: 0.7;
}

.rescop-news-clear-button:hover {
    background: #5a6268;
    opacity: 1;
}

.rescop-news-clear-button.active {
    opacity: 1;
    background: #dc3545;
}

.rescop-news-clear-button.active:hover {
    background: #c82333;
}

.rescop-search-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Convertir a blanco */
    transition: all 0.3s ease;
}

.rescop-news-search-button:hover .rescop-search-icon {
    transform: scale(1.1);
}

/* Ajustar espaciado cuando no hay filtros de categorías */
.rescop-news-grid-block .rescop-news-search-container:last-child {
    margin-bottom: 3rem; /* Más espacio si es el último elemento antes del grid */
}

/* Si hay tanto buscador como filtros */
.rescop-news-search-container + .rescop-category-filters-container {
    margin-top: 1rem; /* Espacio entre buscador y filtros */
}

/* 🆕 === FILTROS DE CATEGORÍAS === */
.rescop-category-filters-container {
    width: 100%;
    margin-bottom: 3rem;
}

.rescop-category-filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem 0;
}

.rescop-category-filter-btn {
    background: #F2F2F2;
    border: 2px solid #404040;
    color: #404040 !important;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px !important;
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    font-weight: 400 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    }
    
.rescop-category-filter-btn:hover {
    background: #404040;
    color: white !important;
    transform: translateY(-2px);
}

.rescop-category-filter-btn.active {
    background: #BE252D !important;
    border-color: #BE252D !important;
    color: white !important;
    transform: translateY(-2px);
}

.rescop-category-filter-btn.active:hover {
    background: #9E1E25 !important;
    border-color: #9E1E25 !important;
}

/* === INDICADORES DE FILTROS ACTIVOS === */
.rescop-news-active-filters {
    margin-bottom: 2rem;
    text-align: left;
}

.rescop-filter-indicator {
    color: #BE252D !important;
    font-size: 16px !important;
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
    font-weight: 400 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.rescop-filter-indicator strong {
    font-weight: 600 !important;
    color: #BE252D !important;
}

/* === GRID === */
.rescop-news-grid {
    display: grid;
    gap: 4rem !important;
    align-items: start;
    }
    
.rescop-news-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
    }
    
.rescop-news-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
    }
    
.rescop-news-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* === CARD DE NOTICIA === */
.rescop-news-grid-card {
    background: #F2F2F2;
    border: 1px rgba(0, 0, 0, 0.50) solid;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    height: 100%;
}

.rescop-news-grid-card:hover {
    transform: translateY(-5px);
}

/* === IMAGEN === */
.rescop-news-grid-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 6px 6px 0 0;
}

.rescop-news-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rescop-news-grid-placeholder {
    width: 100%;
    height: 100%;
    background: #E5E5E5;
    border: 1px rgba(0, 0, 0, 0.30) solid;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.5);
    font-size: 14px;
}

/* === CONTENIDO === */
.rescop-news-grid-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rescop-news-grid-date {
    color: rgba(217, 208, 195, 0.80) !important;
    font-size: 16px !important;
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
    font-weight: 400 !important;
    line-height: 26px !important;
    margin: 0 !important;
    order: 1;
}

.rescop-news-grid-title {
    color: black !important;
    font-size: 20px !important;
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    font-weight: 400 !important;
    line-height: 30px !important;
    text-transform: capitalize !important;
    margin: 0 !important;
    padding: 0 !important;
    word-wrap: break-word;
    order: 2;
    
    /* Máximo 3 líneas */
    max-height: 90px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.rescop-news-grid-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.rescop-news-grid-title a:hover {
    color: #BE252D !important;
}

.rescop-news-grid-excerpt {
    color: rgba(0, 0, 0, 0.80) !important;
    font-size: 16px !important;
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
    font-weight: 400 !important;
    line-height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    word-wrap: break-word;
    order: 3;
    flex: 1;
    
    /* Máximo 4 líneas */
    max-height: 104px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* === PAGINACIÓN === */
.rescop-news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
        gap: 2rem;
    margin-top: 3rem;
    padding: 2rem 0;
    }
    
.rescop-news-prev,
.rescop-news-next {
    background: #BE252D;
    color: white !important;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px !important;
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    }
    
.rescop-news-prev:hover,
.rescop-news-next:hover {
    background: #9E1E25;
    transform: translateY(-2px);
    }
    
.rescop-news-prev.disabled,
.rescop-news-next.disabled {
    background: #CCCCCC !important;
    color: #666666 !important;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
    }

.rescop-news-page-info {
    font-size: 18px !important;
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
    color: #404040 !important;
    font-weight: 400 !important;
}

.rescop-current-page {
    font-weight: 700 !important;
    color: #BE252D !important;
    font-size: 20px !important;
}

/* === MENSAJE SIN RESULTADOS === */
.rescop-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: #F8F8F8;
    border-radius: 8px;
    margin: 2rem 0;
}

.rescop-no-results p {
    color: rgba(0, 0, 0, 0.60) !important;
    font-size: 18px !important;
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
    margin: 0 !important;
    font-style: italic;
}

/* 🆕 === LOADING === */
.rescop-news-loading {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 2rem 0;
}

/* === RESPONSIVE ALINEADO CON HERO BLOCK === */

/* Pantallas grandes (1281px+) - Usar variables globales */
@media (min-width: 1281px) {
    .rescop-news-grid-container {
        padding-right: 2rem;
    }
}

/* Pantallas medianas-grandes (1024px - 1280px) */
@media (min-width: 1024px) and (max-width: 1280px) {
    .rescop-news-grid-container {
        max-width: var(--rescop-container-max-width, 1280px);
        padding-left: var(--rescop-container-padding, 1.5rem);
    }
}

@media (max-width: 1200px) {
    .rescop-news-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet landscape (769px - 1023px) - Usar variables globales */
@media (min-width: 769px) and (max-width: 1023px) {
    .rescop-news-grid-container {
        max-width: 95vw;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

@media (max-width: 900px) {
    .rescop-news-grid.columns-3,
    .rescop-news-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 🆕 Filtros responsive */
    .rescop-category-filter-buttons {
        gap: 0.5rem;
        padding: 1.5rem 0;
    }
    
    .rescop-category-filter-btn {
        padding: 10px 16px;
        font-size: 14px !important;
        min-width: 100px;
    }
}

/* Móvil (hasta 768px) - Seguir variables globales */
@media (max-width: 768px) {
    .rescop-news-grid-block {
        padding: 2rem 0;
    }
    
    .rescop-news-grid-container {
        padding-left: var(--rescop-space-sm, 1rem);
        padding-right: var(--rescop-space-sm, 1rem);
    }
    
    .rescop-news-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
    
    .rescop-news-grid-image {
        height: 200px;
    }
    
    .rescop-news-grid-content {
        padding: 1.5rem;
    }

    .rescop-news-pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .rescop-news-prev,
    .rescop-news-next {
        width: 200px;
        padding: 16px 24px;
    }

    .rescop-news-page-info {
        order: -1;
        font-size: 16px !important;
    }

    .rescop-news-search-container {
        justify-content: center;
    }

    .rescop-news-search-wrapper {
        max-width: 100%;
        width: 100%;
        min-width: auto;
    }

    .rescop-news-search-input {
        font-size: 14px !important;
        padding: 10px 12px;
    }

    .rescop-news-search-button,
    .rescop-news-clear-button {
        padding: 10px 12px;
        min-width: 44px;
    }
    
    .rescop-search-icon {
        width: 18px;
        height: 18px;
    }
    
    /* 🆕 Filtros móvil */
    .rescop-category-filter-buttons {
        justify-content: center;
        gap: 0.75rem;
    }
    
    .rescop-category-filter-btn {
        padding: 8px 12px;
        font-size: 12px !important;
        min-width: 80px;
        flex: 1;
        max-width: 120px;
    }
    
    /* Indicadores de filtros activos - móvil */
    .rescop-filter-indicator {
        font-size: 14px !important;
    }
}

/* Móviles pequeños (hasta 480px) - Usar variables globales */
@media (max-width: 480px) {
    .rescop-news-grid-container {
        padding-left: var(--rescop-space-xs, 0.5rem);
        padding-right: var(--rescop-space-xs, 0.5rem);
    }

    .rescop-news-search-wrapper {
        border-radius: 4px;
        min-width: auto;
    }

    .rescop-search-icon {
        width: 16px;
        height: 16px;
    }
    
    /* 🆕 Filtros móvil pequeño */
    .rescop-category-filter-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .rescop-category-filter-btn {
        width: 100%;
        max-width: 200px;
        min-width: auto;
    }
    
    /* Indicadores de filtros activos - móvil pequeño */
    .rescop-filter-indicator {
        font-size: 12px !important;
    }
}

/* Móviles muy pequeños (hasta 360px) */
@media (max-width: 360px) {
    .rescop-news-grid-container {
        padding-left: var(--rescop-space-xs, 0.5rem);
        padding-right: var(--rescop-space-xs, 0.5rem);
    }
}



