/* =============================================================================
   WSS Vibranding Grid Home
   ============================================================================= */

/* Contenedor raíz */
.wss-grid-home {
    position: relative;
}

/* ---------------------------------------------------------------------------
   Masonry grid
   --------------------------------------------------------------------------- */
.wss-grid-home__gridh {
    /* Masonry (JS) gestiona el posicionamiento */
}

/* Columna de referencia: 1/4 de ancho con gutters de 26px */
.wss-grid-home__gridh {
    --grid-gutter: 26px;
    /* Centraliza el valor del gutter */
}

.wss-grid-home__gridh .gridh__col-sizer {
    /* (gutter * 3 columnas de separación) / 4 columnas = 19.5px */
    width: calc(25% - (var(--grid-gutter) * 3 / 4));
}

.wss-grid-home__gridh .gridh__gutter-sizer {
    width: var(--grid-gutter);
}

/* ---------------------------------------------------------------------------
   Items — todos 1 columna (1/4)
   --------------------------------------------------------------------------- */
.gridh-item {
    width: calc(25% - 19.5px);
    margin-bottom: 26px;
}

/* ---------------------------------------------------------------------------
   gridh-wrap: contenedor interior
   Los items con imagen (cs, cs2, e, b) usan flex-column: imagen + texto abajo.
   Los items de texto puro (s, ca) son el rectángulo en sí.
   --------------------------------------------------------------------------- */
.gridh-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Enlace que envuelve la imagen */
.gridh-wrap>a {
    display: block;
    width: 100%;
    line-height: 0;
    /* elimina espacio fantasma bajo img */
    overflow: hidden;
    /* necesario para el efecto zoom */
}

.gridh-wrap img {
    display: block;
    width: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gridh-wrap:hover>a img {
    transform: scale(1.05);
}

/* Case Studies horizontales — aspecto ~3:2 */
.gridh-item--height_cs .gridh-wrap img {
    aspect-ratio: 3 / 2;
}

/* Case Studies verticales — aspecto ~2:3 */
.gridh-item--height_cs2 .gridh-wrap img {
    aspect-ratio: 2 / 3;
}

/* Equipo — aspecto retrato */
.gridh-item--height_e .gridh-wrap img {
    aspect-ratio: 3 / 4;
}

/* Blog — aspecto paisaje */
.gridh-item--height_b .gridh-wrap img {
    aspect-ratio: 4 / 3;
}

/* ---------------------------------------------------------------------------
   Texto debajo de imagen (CS, equipo, blog)
   --------------------------------------------------------------------------- */
.cs-info,
.team-name,
.blog-info {
    margin-top: 15px;
    font-family: 'Franklin Gothic URW', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: 18px;
    line-height: 20px;
    color: #222;
    transition: color 0.2s ease;
}

.cs-info {
    margin-bottom: 20px;
}

.gridh-wrap:hover .cs-info,
.gridh-wrap:hover .team-name,
.gridh-wrap:hover .blog-info {
    color: #D6001C;
}

/* ---------------------------------------------------------------------------
   Bloques de Servicios — pastilla rectangular roja
   --------------------------------------------------------------------------- */
.gridh-item--height_s .gridh-wrap--service {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    aspect-ratio: 1 / 1;
    padding: 20px 15px;
    background: #D6001C;
    color: #fff;
    text-decoration: none;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(30px, 3.5vw, 50px);
    line-height: 1.1;
    font-weight: 700;
    font-style: italic;
    border: 1px solid transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.gridh-item--height_s .gridh-wrap--service:hover {
    background: #fff;
    color: #D6001C;
    border-color: #D6001C;
}

.gridh-item--height_s .gridh-wrap--service span {
    display: block;
    font-family: 'Franklin Gothic URW', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: clamp(14px, 1.8vw, 24px);
    line-height: 1.2;
    font-weight: 400;
    font-style: normal;
    color: inherit;
}

/* ---------------------------------------------------------------------------
   Bloques CTA — pastilla rectangular blanca
   --------------------------------------------------------------------------- */
.gridh-item--height_ca .gridh-wrap--cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    aspect-ratio: 1 / 1;
    padding: 20px 15px;
    background: #fff;
    color: #D6001C;
    font-family: 'Franklin Gothic URW', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: clamp(20px, 2.8vw, 40px);
    line-height: 1.1;
    font-weight: 400;
    text-decoration: none;
    transition: background 0.2s ease;
    box-sizing: border-box;
}

.gridh-item--height_ca .gridh-wrap--cta:hover {
    background: #f8f8f8;
}

.gridh-item--height_ca .gridh-wrap--cta span {
    font-family: 'Franklin Gothic URW', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: clamp(20px, 2.8vw, 40px);
    line-height: 1.1;
    font-weight: 400;
    color: #D6001C;
    text-decoration: underline;
    text-decoration-thickness: 0.5px;
    text-underline-offset: 5px;
    display: inline;
}

/* ---------------------------------------------------------------------------
   Loader
   --------------------------------------------------------------------------- */
.wss-grid-home__loader {
    display: none;
    justify-content: center;
    gap: 8px;
    padding: 32px 0;
}

.wss-grid-home__loader.is-loading {
    display: flex;
}

.wss-grid-home__loader span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #D6001C;
    animation: wss-grid-home-bounce 1.2s ease-in-out infinite;
}

.wss-grid-home__loader span:nth-child(1) {
    animation-delay: -0.32s;
}

.wss-grid-home__loader span:nth-child(2) {
    animation-delay: -0.16s;
}

.wss-grid-home__loader span:nth-child(3) {
    animation-delay: 0s;
}

.wss-grid-home__loader span:nth-child(4) {
    animation-delay: 0.16s;
}

@keyframes wss-grid-home-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---------------------------------------------------------------------------
   Botón "Cargar más"
   --------------------------------------------------------------------------- */
.wss-grid-home__more-wrap {
    display: flex;
    justify-content: center;
    padding: 60px 0 60px;
}

.wss-grid-home__btn-more {
    display: inline-block;
    padding: 14px 40px;
    background: none;
    border: 1px solid #dadbdd;
    border-radius: 0;
    color: #000000;
    font-family: 'Franklin Gothic URW', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wss-grid-home__btn-more:hover {
    background-color: #d6001c;
    border-color: #d6001c;
    color: #ffffff;
}

.wss-grid-home__btn-more:focus {
    outline: none;
}

.wss-grid-home__btn-more:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wss-grid-home__more-wrap.is-hidden {
    display: none;
}

/* Sentinel para infinite scroll */
.wss-grid-home__sentinel {
    height: 1px;
}

/* ---------------------------------------------------------------------------
   Responsive — 2 columnas (≤1024px)
   --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .wss-grid-home__gridh .gridh__col-sizer {
        width: calc(50% - (var(--grid-gutter) / 2));
    }

    .gridh-item {
        width: calc(50% - (var(--grid-gutter) / 2));
    }

    /* Las fuentes ya son responsivas con clamp(), no se sobreescriben */
}

/* ---------------------------------------------------------------------------
   Responsive — 1 columna (≤600px)
   --------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .wss-grid-home__gridh .gridh__col-sizer {
        width: 100%;
    }

    .gridh-item {
        width: 100%;
    }

    .gridh-item--height_cs .gridh-wrap img {
        aspect-ratio: 16 / 9;
    }

    .gridh-item--height_cs2 .gridh-wrap img {
        aspect-ratio: 4 / 3;
    }

    /* Las fuentes ya son responsivas con clamp(), no se sobreescriben */
}