/* Contenedor principal con CSS Grid */
.cbg-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: sans-serif;
    grid-auto-flow: row dense;
}

/* Estilos generales de las tarjetas */
.cbg-card {
    background: #fff;
    border: 1px solid #6b98c5; /* Color azul de los bordes según la imagen */
    display: flex;
    flex-direction: column;
}

/* El Post Destacado abarca 1 columna y 2 filas */
.cbg-featured {
    grid-column: span 1;
    grid-row: span 2;
}

/* Imagen del post destacado */
.cbg-image img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid #eee;
}

/* Contenedor de texto */
.cbg-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.cbg-category {
    font-size: 0.8rem;
    color: #333;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.cbg-card h3 {
    font-size: 1.2rem;
    margin: 0 0 15px 0;
    line-height: 1.3;
    color: #1a1a1a;
}

.cbg-card p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 20px;
    flex-grow: 1; /* Empuja el botón hacia abajo */
}

/* Estilo del botón */
.cbg-button {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid #1a569d; /* Azul más oscuro */
    color: #1a1a1a;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    align-self: flex-start; /* Evita que el botón ocupe todo el ancho */
    transition: all 0.3s ease;
}

.cbg-button:hover {
    background-color: #f4f8fc;
}

/* Responsive: Para móviles, poner todo en 1 columna */
@media (max-width: 768px) {
    .cbg-container {
        grid-template-columns: 1fr;
    }
    .cbg-featured {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* V. 1.0.5 */
/* ==========================================================
   Modificador para poner el destacado a la derecha 
   ========================================================== */
.cbg-layout-right .cbg-featured {
    grid-column: 3 / 4; /* Fuerza estrictamente a ocupar la columna 3 */
    grid-row: 1 / span 2; /* Obliga a comenzar en la fila 1 y abarcar 2 filas */
}

/* ==========================================================
   ACTUALIZACIÓN RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
    .cbg-container {
        grid-template-columns: 1fr;
    }
    
    .cbg-featured,
    .cbg-layout-right .cbg-featured {
        grid-column: 1 / -1; /* Resetea para ocupar todo el ancho en móviles */
        grid-row: auto;
    }
}
/* V. 1.1.0 */
/* ==========================================================
   ESTILOS DE LA PAGINACIÓN
   ========================================================== */
.cbg-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    width: 100%;
}

.cbg-pagination a,
.cbg-pagination span.current {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #6b98c5;
    color: #1a569d;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cbg-pagination span.current {
    background-color: #1a569d;
    color: #fff;
    border-color: #1a569d;
}

.cbg-pagination a:hover {
    background-color: #f4f8fc;
}