/* =============================================================================
   WSS Vibra Trabajos – Filter + Grid
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. Filter nav
   ----------------------------------------------------------------------------- */

.wss-vibra-trabajos {
    width: 100%;
}

.wss-trabajos-filter {
    margin-bottom: 40px;
}

.wss-trabajos-filter__list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wss-trabajos-filter__item {
    font-family: "Franklin Gothic URW", "Franklin Gothic Medium", "ITC Franklin Gothic", Franklin, sans-serif;
    font-size: 18px;
    line-height: 22px;
    color: #999999;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.wss-trabajos-filter__item:hover {
    color: #222222;
}

.wss-trabajos-filter__item.is-active {
    color: #d6001c;
}

/* -----------------------------------------------------------------------------
   2. Grid container
   ----------------------------------------------------------------------------- */

.wss-trabajos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
    width: 100%;
    transition: opacity 0.3s ease;
}

.wss-trabajos-grid.is-fading {
    opacity: 0;
}

/* -----------------------------------------------------------------------------
   3. Grid items — column positions (12-cycle)
   ----------------------------------------------------------------------------- */

.wss-item-pos-1  { grid-column: 1 / span 2; }
.wss-item-pos-2  { grid-column: 3 / span 2; }
.wss-item-pos-3  { grid-column: 1 / span 2; }
.wss-item-pos-4  { grid-column: 3 / span 2; }
.wss-item-pos-5  { grid-column: 1 / span 2; }
.wss-item-pos-6  { grid-column: 3; }
.wss-item-pos-7  { grid-column: 4; }
.wss-item-pos-8  { grid-column: 1; }
.wss-item-pos-9  { grid-column: 2 / span 2; }
.wss-item-pos-10 { grid-column: 4; }
.wss-item-pos-11 { grid-column: 1 / span 2; }
.wss-item-pos-12 { grid-column: 3 / span 2; }

.wss-trabajos-item {
    display: block;
    overflow: hidden;
    position: relative;
    background-color: #ffffff;
}

/* Horizontal items: landscape aspect ratio */
.wss-trabajos-item--h {
    aspect-ratio: 3 / 2;
}

/* Vertical items: portrait aspect ratio */
.wss-trabajos-item--v {
    aspect-ratio: 2 / 3;
}

/* Positions 5 and 9 are horizontal items inside mixed rows:
   height is determined by V siblings, override aspect-ratio */
.wss-item-pos-5,
.wss-item-pos-9 {
    aspect-ratio: unset;
    align-self: stretch;
}

/* Links fill the full cell */
.wss-trabajos-item__link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

/* -----------------------------------------------------------------------------
   4. Image: fades out on hover
   ----------------------------------------------------------------------------- */

.wss-trabajos-item__img-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.wss-trabajos-item__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.35s ease;
}

.wss-trabajos-item__link:hover .wss-trabajos-item__img-wrap img {
    opacity: 0;
}

/* -----------------------------------------------------------------------------
   5. Text info: fades in on hover
   ----------------------------------------------------------------------------- */

.wss-trabajos-item__info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 1;
}

.wss-trabajos-item__link:hover .wss-trabajos-item__info {
    opacity: 1;
}

.wss-trabajos-item__title {
    font-family: "Franklin Gothic URW", "Franklin Gothic Medium", "ITC Franklin Gothic", Franklin, sans-serif;
    font-size: 30px;
    line-height: 34px;
    color: #d6001c;
    font-weight: 400;
}

.wss-trabajos-item__subtit {
    font-family: "Franklin Gothic URW", "Franklin Gothic Medium", "ITC Franklin Gothic", Franklin, sans-serif;
    font-size: 30px;
    line-height: 34px;
    color: #222222;
    font-weight: 400;
}

/* -----------------------------------------------------------------------------
   6. Infinite scroll: loader + sentinel
   ----------------------------------------------------------------------------- */

.wss-trabajos-sentinel {
    height: 1px;
    width: 100%;
    margin-top: 26px;
}

.wss-trabajos-loader {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 32px 0 24px;
}

.wss-trabajos-loader.is-visible {
    display: flex;
}

.wss-trabajos-loader span {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #222222;
    animation: wss-dot-blink 1.2s infinite ease-in-out both;
}

.wss-trabajos-loader span:nth-child(1) { animation-delay: -0.32s; }
.wss-trabajos-loader span:nth-child(2) { animation-delay: -0.16s; }
.wss-trabajos-loader span:nth-child(3) { animation-delay: 0s; }

@keyframes wss-dot-blink {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1);   opacity: 1; }
}

/* -----------------------------------------------------------------------------
   7. Load more button
   ----------------------------------------------------------------------------- */

.wss-trabajos-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 32px 0 0;
}

.wss-trabajos-load-more-wrap.wss-is-hidden {
    display: none;
}

.wss-trabajos-load-more-btn {
    font-family: "Franklin Gothic URW", "Franklin Gothic Medium", "ITC Franklin Gothic", Franklin, sans-serif;
    font-size: 18px;
    line-height: 22px;
    color: #000000;
    background: none;
    border: 1px solid #dadbdd;
    border-radius: 0;
    padding: 12px 32px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.wss-trabajos-load-more-btn:hover {
    color: #ffffff;
    background-color: #d6001c;
    border-color: #d6001c;
}

.wss-trabajos-load-more-btn:focus {
    outline: none;
}

/* -----------------------------------------------------------------------------
   8. Responsive
   ----------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .wss-trabajos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Reset all column positions to auto-flow on 2-col layout */
    .wss-item-pos-1,  .wss-item-pos-2,  .wss-item-pos-3,
    .wss-item-pos-4,  .wss-item-pos-5,  .wss-item-pos-6,
    .wss-item-pos-7,  .wss-item-pos-8,  .wss-item-pos-9,
    .wss-item-pos-10, .wss-item-pos-11, .wss-item-pos-12 {
        grid-column: auto;
    }

    .wss-trabajos-item {
        aspect-ratio: 3 / 2;
    }

    .wss-item-pos-5,
    .wss-item-pos-9 {
        aspect-ratio: 3 / 2;
        align-self: auto;
    }
}

@media (max-width: 600px) {
    .wss-trabajos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .wss-trabajos-filter__list {
        gap: 16px 28px;
    }

    .wss-trabajos-filter__item {
        font-size: 16px;
    }
}
