/**
 * Noticias Home - Grid Layout
 * Diseño jerárquico con Hero, Secundarias y Automáticas
 */

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */
.noticias-home-container {
    padding: 3rem 0;
    background: #f8f9fa;
}

.noticias-home-container .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================================
   NOTICIA HERO (PRINCIPAL)
   ============================================ */
.noticia-hero {
    width: 100%;
    height: 500px;
    position: relative;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.noticia-hero:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.noticia-hero__link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.noticia-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.noticia-hero:hover .noticia-hero__image {
    transform: scale(1.05);
}

.noticia-hero__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
    padding: 3rem 2rem 2rem;
    color: white;
}

.noticia-hero__badge {
    display: inline-block;
    background: #00857a;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.noticia-hero__title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: white;
}

.noticia-hero__excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.noticia-hero__cta {
    display: inline-block;
    background: #00857a;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.noticia-hero__cta:hover {
    background: #006b62;
}

/* ============================================
   GRID DE NOTICIAS
   ============================================ */
.noticias-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ============================================
   NOTICIA MEDIANA (SECUNDARIA)
   ============================================ */
.noticia-mediana {
    grid-column: span 2;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 350px; /* Altura uniforme aumentada */
    display: flex;
    flex-direction: column;
}

.noticia-mediana:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.noticia-mediana__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.noticia-mediana__image-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
}

.noticia-mediana__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.noticia-mediana:hover .noticia-mediana__image {
    transform: scale(1.1);
}

.noticia-mediana__badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #00857a;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 2;
}

.noticia-mediana__content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.noticia-mediana__title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.noticia-mediana__excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #6c757d;
    margin-bottom: 0.75rem;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.noticia-mediana__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #00857a;
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap 0.3s ease;
}

.noticia-mediana:hover .noticia-mediana__cta {
    gap: 0.75rem;
}

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

.noticia-mediana:hover .noticia-mediana__cta i {
    transform: translateX(3px);
}

/* Layout Horizontal para la Primera Secundaria */
.noticia-mediana--horizontal .noticia-mediana__link {
    flex-direction: row;
}

.noticia-mediana--horizontal .noticia-mediana__image-wrapper {
    width: 40%;
    height: 100%;
    position: relative;
}

/* Efecto difuminado entre imagen y texto */
.noticia-mediana--horizontal .noticia-mediana__image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px; /* Ancho del difuminado */
    background: linear-gradient(to right, transparent 0%, white 100%);
    pointer-events: none;
    z-index: 1;
}

.noticia-mediana--horizontal .noticia-mediana__content {
    width: 60%;
    padding: 1.5rem;
}

.noticia-mediana--horizontal .noticia-mediana__title {
    font-size: 1.25rem;
}

.noticia-mediana--horizontal .noticia-mediana__excerpt {
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* ============================================
   WRAPPER PARA NOTICIAS AUTOMÁTICAS (SLICK)
   ============================================ */
.noticias-automaticas-wrapper {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}


/* ============================================
   NOTICIA PEQUEÑA (AUTOMÁTICA)
   ============================================ */
.noticia-pequena {
    grid-column: span 1;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.noticia-pequena:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.noticia-pequena__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.noticia-pequena__image-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.noticia-pequena__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.noticia-pequena:hover .noticia-pequena__image {
    transform: scale(1.1);
}

.noticia-pequena__content {
    padding: 1rem;
}

.noticia-pequena__title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    display: -webkit-box;
    /* -webkit-line-clamp: 3; */
    /* line-clamp: 3; */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.noticia-pequena__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #00857a;
    font-weight: 600;
    font-size: 0.85rem;
    transition: gap 0.3s ease;
}

.noticia-pequena:hover .noticia-pequena__cta {
    gap: 0.75rem;
}

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

.noticia-pequena:hover .noticia-pequena__cta i {
    transform: translateX(3px);
}

/* ============================================
   FOOTER (BOTÓN VER TODAS)
   ============================================ */
.noticias-footer {
    text-align: center;
    margin-top: 2rem;
}

.noticias-footer .btn {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   ESTADO VACÍO
   ============================================ */
.noticias-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

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

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .noticia-hero {
        height: 400px;
    }

    .noticia-hero__title {
        font-size: 1.75rem;
    }

    .noticia-hero__excerpt {
        font-size: 1rem;
    }

    .noticias-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .noticia-mediana {
        grid-column: span 1;
    }

    .noticia-pequena {
        grid-column: span 1;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .noticias-home-container {
        padding: 1.5rem 0;
        overflow-x: hidden;
    }

    .noticias-home-container .container {
        padding: 0 15px;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }

    /* Reset del Grid */
    .noticias-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        margin: 0;
        width: 100%;
    }

    /* --- HERO --- */
    .noticia-hero {
        height: 350px;
        border-radius: 8px;
        width: 100%;
        margin-bottom: 1.5rem; /* Ajustado para igualar el gap */
    }

    .noticia-hero__overlay {
        padding: 1.5rem;
    }

    .noticia-hero__title {
        font-size: 1.4rem;
    }

    /* --- TARJETAS SECUNDARIAS (MEDIANAS) --- */
    .noticia-mediana {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 380px; /* Altura mínima para asegurar visibilidad */
        margin: 0;
        display: flex;
        flex-direction: column;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Sombra suave */
        overflow: hidden; /* Importante para bordes */
    }

    /* Reset para la primera noticia horizontal */
    .noticia-mediana--horizontal .noticia-mediana__link {
        flex-direction: column;
    }

    /* Wrapper de Imagen - FORZAR ALTURA */
    .noticia-mediana__image-wrapper,
    .noticia-mediana--horizontal .noticia-mediana__image-wrapper {
        width: 100%;
        height: 200px !important; /* Altura fija forzada */
        flex-shrink: 0; /* Evitar que se encoja */
        position: relative;
        display: block;
    }

    .noticia-mediana__image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Contenido */
    .noticia-mediana__content,
    .noticia-mediana--horizontal .noticia-mediana__content {
        width: 100%;
        padding: 1.25rem;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    .noticia-mediana__excerpt {
        margin-bottom: 1rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* --- SLIDER AUTOMÁTICAS --- */
    .noticias-automaticas-wrapper {
        display: block;
        width: 100%;
        margin-top: 0; /* Eliminado margen extra, usa gap del contenedor */
        padding-bottom: 1rem;
    }

    /* Las tarjetas dentro del slider */
    .noticias-automaticas-wrapper .noticia-pequena {
        margin: 0 0px; /* Pequeño margen entre slides */
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .noticia-pequena__image-wrapper {
        width: 100%;
        height: 180px !important; /* Forzar altura imagen */
        display: block;
    }

    .noticia-pequena__image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .noticia-pequena__content {
        padding: 1rem;
    }

    /* Ajustes Slider Slick */
    .noticias-automaticas-wrapper .slick-list {
        padding: 0 !important; /* Sin padding interno raro */
        overflow: hidden;
    }

    .noticias-automaticas-wrapper .slick-track {
        display: flex;
        align-items: stretch;
    }

    .noticias-automaticas-wrapper .slick-slide {
        height: auto;
        display: flex;
        align-items: stretch;
        justify-content: center;
    }

    .noticias-automaticas-wrapper .slick-slide > div {
        width: 100%;
    }

    .noticias-automaticas-wrapper .slick-next:before,
    .noticias-automaticas-wrapper .slick-prev:before {
        color:#3c4544
    }
    
    .noticias-automaticas-wrapper .slick-prev {
        left: -15px; /* Pegada al borde izquierdo */
    }
    
    .noticias-automaticas-wrapper .slick-next {
        right: -15px; /* Pegada al borde derecho */
    }

    /* Botón Footer */
    .noticias-footer .btn {
        width: 100%;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    .noticia-hero {
        height: 300px;
    }

    .noticia-hero__title {
        font-size: 1.25rem;
    }

    .noticia-hero__excerpt {
        display: none; /* Ocultar extracto en móviles muy pequeños */
    }

    .noticia-mediana__title {
        font-size: 1.1rem;
    }

    .noticia-pequena__title {
        font-size: 0.95rem;
    }
}
