/* ==========================================================
   MÓDULO BLOG ESTILO GARI CRUZE / SQUARESPACE
   Clase del módulo requerida: ss-blog-squares
   ========================================================== */

/* 1. ROMPER EL CONTENEDOR DE DIVI (100% Viewport) */
.ss-blog-squares {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    padding: 0 !important;
}

/* 2. CONTENEDOR FLEXBOX (Sin espacios entre imágenes) */
.ss-blog-squares .et_pb_ajax_pagination_container,
.ss-blog-squares .et_pb_salvattore_content {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    height: auto !important;
    position: static !important;
}

/* 3. TARJETAS DEL BLOG (Cuadrícula, máscara y limpieza) */
.ss-blog-squares article.et_pb_post {
    width: 33.33%!important; /* 4 columnas en escritorio */
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    float: none !important;
    position: relative !important;
    display: block !important;
    overflow: hidden !important; /* Evita que el zoom/título se salga del cuadrado */
}

/* 4. TRUCO PARA EL CUADRADO PERFECTO (1:1) */
.ss-blog-squares .entry-featured-image-url,
.ss-blog-squares .et_pb_image_container {
    display: block !important;
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Mantiene la proporción 1:1 */
    height: 0;
    overflow: hidden;
    margin: 0 !important;
}

/* 5. AJUSTE Y RECORTE DE LA IMAGEN */
.ss-blog-squares .entry-featured-image-url img,
.ss-blog-squares .et_pb_image_container img {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover; /* Recorta sin deformar */
    max-width: none !important;
    transition: transform 0.5s ease !important; /* Transición para el zoom */
}

/* 6. ZOOM DEL 25% EN LA IMAGEN AL HACER HOVER */
.ss-blog-squares article.et_pb_post:hover img {
    transform: scale(1.25) !important;
    -webkit-transform: scale(1.25) !important;
}

/* 7. CAPA OSCURA (OVERLAY) AL 65% AL HACER HOVER */
.ss-blog-squares .entry-featured-image-url::before,
.ss-blog-squares .et_pb_image_container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); /* Transparente por defecto */
    z-index: 1;
    transition: background-color 0.4s ease;
    pointer-events: none;
}

.ss-blog-squares article.et_pb_post:hover .entry-featured-image-url::before,
.ss-blog-squares article.et_pb_post:hover .et_pb_image_container::before {
    background-color: rgba(0, 0, 0, 0.65) !important; /* 65% oscuro */
}

/* 8. CONTENEDOR DEL TÍTULO (Centrado matemático vertical y horizontal) */
.ss-blog-squares .entry-title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 20px !important;
    background: none !important;
    z-index: 2 !important; /* Encima de la capa oscura */
    text-align: center !important;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 9. TÍTULO Y TEXTO "VER MÁS" (Animación Zoom Out con Rebote) */
.ss-blog-squares .entry-title a {
    display: block;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: normal !important; /* Fuente regular */
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    
    /* Estado inicial: 20% más grande e invisible */
    transform: scale(1.2); 
    opacity: 0; 
    
    /* Animación rápida (0.4s) con rebote al final (1.275) */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.ss-blog-squares .entry-title a::after {
    content: "- Ver más -";
    display: block;
    margin-top: 12px;
    font-size: 14px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.4s ease;
    transition-delay: 0.5s; /* Aparece después del título */
}

/* 10. EFECTO HOVER FINAL: Aparece el texto */
.ss-blog-squares article.et_pb_post:hover .entry-title a {
    transform: scale(1); /* Vuelve al tamaño normal */
    opacity: 1; /* Aparece */
}

.ss-blog-squares article.et_pb_post:hover .entry-title a::after {
    opacity: 1; /* Aparece el "- Ver más -" */
}

/* 11. RESPONSIVE: 3 COLUMNAS EN TABLET */
@media (max-width: 980px) {
    .ss-blog-squares article.et_pb_post {
        width: 33.33% !important;
    }
}

/* 12. RESPONSIVE: 2 COLUMNAS EN MÓVIL */
@media (max-width: 479px) {
    .ss-blog-squares article.et_pb_post {
        width: 50% !important;
    }
}