/* --- ESCRITORIO (Grid Layout) --- */
@media (min-width: 768px) {
    /* Contenedor principal */
    .cdb-swiper-noticias .swiper-wrapper {
        display: grid !important;
        grid-template-columns: 1.2fr 1fr; /* Proporción del diseño original */
        grid-template-rows: repeat(3, auto);
        gap: 20px;
        transform: none !important; /* Desactiva el desplazamiento de Swiper */
        width: 100% !important;
    }

    /* ITEM PRINCIPAL (El primero) */
    .cdb-swiper-noticias .swiper-slide:first-child {
        grid-row: 1 / 4; /* Ocupa las 3 filas de la columna izquierda */
        display: flex;
        flex-direction: column;
        margin: 0 !important;
    }
    .cdb-swiper-noticias .swiper-slide{
        width:auto!important;
    }

    .cdb-swiper-noticias .swiper-slide:first-child .cdb-noticias-image img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }

    /* ITEMS SECUNDARIOS (Los de la derecha) */
    .cdb-swiper-noticias .swiper-slide:not(:first-child) {
        display: grid;
        grid-template-columns: 240px 1fr; /* Imagen pequeña + Texto */
        gap: 20px;
        align-items: start;
        margin: 0 !important;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    .cdb-swiper-noticias .swiper-slide:not(:first-child) .cdb-noticias-image img {
        width: 240px;
        height: 100%;
        aspect-ratio:8/5;
        object-fit: cover;
    }
}

@media (min-width: 1024px) {
    /* Contenedor de texto del primer post */
    .cdb-swiper-noticias .swiper-slide:first-child .cdb-noticias-content {
        display: grid;
        /* Columna 1 (izquierda) fija para los datos | Columna 2 (derecha) para el excerpt */
        grid-template-columns: 280px 1fr; 
        column-gap: 50px;
        align-items: start;
    }

    /* --- COLUMNA IZQUIERDA (Categoría, Título, Fecha, Leer más) --- */
    .cdb-swiper-noticias .swiper-slide:first-child .cdb-noticias-terms,
    .cdb-swiper-noticias .swiper-slide:first-child .cdb-noticias-fecha,
    .cdb-swiper-noticias .swiper-slide:first-child .cdb-noticias-link {
        grid-column: 1; /* Todos a la izquierda */
    }

    /* Reordenamos verticalmente a la izquierda (por si GenerateBlocks cambia el orden) */
    .cdb-swiper-noticias .swiper-slide:first-child .cdb-noticias-terms {
        grid-row: 1; /* Primera fila */
    }

    .cdb-swiper-noticias .swiper-slide:first-child .cdb-noticias-fecha {
        grid-row: 2; /* Tercera fila */
    }

    .cdb-swiper-noticias .swiper-slide:first-child .cdb-noticias-link {
        display: inline-block;
        width: fit-content;
        grid-row: 3; /* Cuarta fila */
    }

    /* --- COLUMNA DERECHA (Solo Excerpt) --- */
    .cdb-swiper-noticias .swiper-slide:first-child .cdb-noticias-title {
        grid-column: 2; /* El único a la derecha */
        grid-row: 1 / 4; /* Ocupa todo el alto de las otras 4 filas para alinearse arriba */
        max-width: 90%; /* Evita que el texto sea demasiado largo */
    }
    .cdb-noticias-pagination{
        display:none!important;
    }
}
/* --- MÓVIL (Swiper Activo) --- */
@media (max-width: 767px) {
    .cdb-swiper-noticias .swiper-wrapper{
        display:Flex!important;
        column-gap: 0px!important;
        column-gap: 0px!important;
    }
    .cdb-swiper-noticias .swiper-slide {
        display: flex !important;
        flex-direction: column;
        height: auto;
    }

    /* Aseguramos que las imágenes ocupen todo el ancho del slide */
    .cdb-swiper-noticias .swiper-slide .cdb-noticias-image img {
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }

    /* Limitamos el extracto a 2 líneas para que no rompa el diseño */
    .cdb-noticias-excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Color de los bullets inactivos */
.cdb-noticias-pagination .swiper-pagination-bullet {
    background: #838383 !important;
    width:16px;
    height:16px;
    opacity: 1; /* Swiper por defecto les baja la opacidad, así aseguramos el color exacto */
}

/* Color del bullet activo */
.cdb-noticias-pagination .swiper-pagination-bullet-active {
    background: #5E8A57 !important;
}










/* Bloquear clics en los enlaces solo dentro del editor de Gutenberg */
.is-positioned-editor .cdb-actividad-card,
.is-positioned-editor .cdb-actividades-more,
.wp-block-cdb-swiper-actividades a {
    pointer-events: none;
    cursor: default;
}

.cdb-swiper-actividades-wrapper {
    position:relative;
    width: 100%;
    overflow:hidden;
    box-sizing:border-box;
}

.cdb-actividad-card {
    text-decoration: none;
    display: block;
    transition: transform 0.3s ease;
    max-height:500px;
}

.cdb-actividad-card:hover {
    transform: translateY(-5px);
}

.cdb-actividad-image img {
    width: 100%;
    height: 100%;
    max-height:500px;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

.cdb-actividad-info {
    position:absolute;
    width:100%;
    bottom:0;
    background: #6d8e64; /* El verde de tu imagen */
    padding: 15px;
    color: #fff;
    min-height: 90px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.cdb-actividad-info h3 {
    margin: 0;
    line-height: 1.2;
    text-transform: uppercase;
    font-weight: 500;
}

.cdb-swiper-actividades-footer {
    margin-top: 10px;
}

.cdb-actividades-more {
    display:inline-flex;
    justify-content: center;
    width:100%;
    background: #6d8e64;
    padding: 12px;
    text-align: center;
    color: #fff;
    text-decoration: none;
    text-transform:uppercase;
    font-weight: 500;
    font-size: inherit;
}

.cdbSwiperActividades{
    overflow:hidden;
}

/* Swiper Arrows */
/*
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-next img,
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-prev img{
    width: 24px;
    height: 28px;
}
*/


/* 1. Eliminamos la flecha por defecto de Swiper */
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-next svg,
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-prev svg,
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-next::after,
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-prev::after {
    display: none !important;
}

/* 2. Ajustamos los contenedores para que tus SVGs se vean bien */
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-next,
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-prev {
    background-image: none; /* Por si acaso */
    margin-top: 0;          /* Reset de posición vertical de Swiper */
    transform: translateY(-50%); /* Centrado manual preciso */
    top:50%;
}
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-next{
    right:0!important;
}
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-prev{
    left:0!important;
}
/* 3. Estilo opcional para que los SVGs tengan feedback al pasar el ratón */
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-next img,
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-prev img {
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-next:hover img,
.cdb-swiper-actividades-wrapper .cdb-act-swiper-button-prev:hover img {
    opacity: 0.8;
    transform: scale(1.1);
}

/* 4. Asegúrate de que los botones no se salgan del contenedor principal si este tiene overflow hidden */
.cdb-swiper-actividades-wrapper {
    position: relative;
}

.cdb-home-pagination{
    bottom:24px!important;
}
/* Color de los bullets inactivos */
.cdb-home-pagination .swiper-pagination-bullet {
    background: #fff !important;
    width:16px;
    height:16px;
    opacity: 1; /* Swiper por defecto les baja la opacidad, así aseguramos el color exacto */
}

@media (min-width:1024px){
    .cdb-home-pagination .swiper-pagination-bullet {
        width:20px;
        height:20px;
    }
}

/* Color del bullet activo */
.cdb-home-pagination .swiper-pagination-bullet-active {
    background: #5E8A57 !important;
}

