/* ========================================
   Child Pages Grid - v2.2
   CSS complementario (estilos base en inline)
   ======================================== */

/* Font */
.cpg-grid,
.cpg-grid * {
    font-family: 'Nunito', sans-serif !important;
    box-sizing: border-box !important;
}

/* ----------------------------------------
   IMÁGENES DECORATIVAS - Forzar tamaño
   ---------------------------------------- */
.cpg-grid > .cpg-item.cpg-decorative-image {
    position: relative !important;
    overflow: hidden !important;
}

.cpg-grid > .cpg-item.cpg-decorative-image > img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* ----------------------------------------
   HOVER - Mostrar imagen destacada
   ---------------------------------------- */
.cpg-child-page:hover .cpg-ellipse-image img {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
}

/* Hover en enlace */
.cpg-read-more:hover {
    color: #004AAD !important;
}

/* ----------------------------------------
   RESPONSIVE - 3 columnas (tablet)
   ---------------------------------------- */
@media screen and (max-width: 1200px) {
    .cpg-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        grid-auto-rows: 350px !important;
    }
    
    .cpg-grid > .cpg-item {
        height: 350px !important;
        min-height: 350px !important;
        max-height: 350px !important;
    }
    
    .cpg-grid > .cpg-item[style*="grid-row:span 2"],
    .cpg-grid > .cpg-item[style*="grid-row: span 2"] {
        height: 700px !important;
        min-height: 700px !important;
        max-height: 700px !important;
    }
    
    .cpg-title {
        font-size: 0.9rem !important;
    }
    
    .cpg-ellipse-image img {
        width: 130px !important;
        height: 70px !important;
    }
}

/* ----------------------------------------
   RESPONSIVE - 2 columnas (tablet pequeña)
   ---------------------------------------- */
@media screen and (max-width: 900px) {
    .cpg-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-rows: 320px !important;
    }
    
    .cpg-grid > .cpg-item {
        height: 320px !important;
        min-height: 320px !important;
        max-height: 320px !important;
        padding: 1.25rem !important;
    }
    
    /* Imágenes decorativas sin padding */
    .cpg-grid > .cpg-item.cpg-decorative-image {
        padding: 0 !important;
    }
    
    .cpg-grid > .cpg-item[style*="grid-row:span 2"],
    .cpg-grid > .cpg-item[style*="grid-row: span 2"] {
        height: 640px !important;
        min-height: 640px !important;
        max-height: 640px !important;
    }
    
    .cpg-title {
        font-size: 0.85rem !important;
    }
    
    .cpg-excerpt {
        font-size: 0.75rem !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .cpg-ellipse-image {
        height: 70px !important;
        min-height: 70px !important;
    }
    
    .cpg-ellipse-image img {
        width: 110px !important;
        height: 60px !important;
    }
}

/* ----------------------------------------
   RESPONSIVE - 1 columna (móvil)
   ---------------------------------------- */
@media screen and (max-width: 600px) {
    .cpg-grid {
        grid-template-columns: 1fr !important;
        grid-auto-rows: 280px !important;
    }
    
    .cpg-grid > .cpg-item {
        height: 280px !important;
        min-height: 280px !important;
        max-height: 280px !important;
        padding: 1rem !important;
    }
    
    /* Imágenes decorativas sin padding */
    .cpg-grid > .cpg-item.cpg-decorative-image {
        padding: 0 !important;
    }
    
    /* Reset span en móvil */
    .cpg-grid > .cpg-item[style*="grid-row:span 2"],
    .cpg-grid > .cpg-item[style*="grid-row: span 2"] {
        height: 280px !important;
        min-height: 280px !important;
        max-height: 280px !important;
        grid-row: span 1 !important;
    }
    
    .cpg-title {
        font-size: 0.8rem !important;
    }
    
    .cpg-excerpt {
        font-size: 0.7rem !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .cpg-ellipse-image {
        height: 60px !important;
        min-height: 60px !important;
    }
    
    .cpg-ellipse-image img {
        width: 100px !important;
        height: 50px !important;
    }
}

/* ----------------------------------------
   Animación sutil
   ---------------------------------------- */
@keyframes cpgFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.cpg-grid > .cpg-item {
    animation: cpgFadeIn 0.3s ease forwards;
}
