/* =====================================================
   GALERÍAS DE TRABAJOS INGPRO
===================================================== */

.work-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.3rem;
}

.work-gallery__item {
    position: relative;

    min-height: 280px;
    padding: 0;
    overflow: hidden;

    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-medium);

    background-color: var(--color-primary-dark);
    box-shadow: var(--shadow-small);

    cursor: pointer;

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.work-gallery__item:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-medium);
    transform: translateY(-5px);
}

.work-gallery__item.is-hidden {
    display: none;
}

.work-gallery__image {
    width: 100%;
    height: 280px;

    object-fit: cover;

    transition: transform 0.5s ease;
}

.work-gallery__item:hover .work-gallery__image {
    transform: scale(1.05);
}

.work-gallery__overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: flex-end;

    padding: 1.15rem;

    background:
        linear-gradient(to top,
            rgba(10, 24, 54, 0.88),
            transparent 60%);

    color: #ffffff;

    opacity: 0;
    transition: opacity var(--transition);
}

.work-gallery__item:hover .work-gallery__overlay,
.work-gallery__item:focus-visible .work-gallery__overlay {
    opacity: 1;
}

.work-gallery__overlay span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    font-weight: 750;
}

.work-gallery__overlay span::before {
    content: "＋";

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border-radius: 50%;

    background-color: var(--color-accent);
    color: var(--color-primary-dark);

    font-size: 1.15rem;
}

.work-gallery__actions {
    display: flex;
    justify-content: center;

    margin-top: 2.3rem;
}

/* =====================================================
   VENTANA AMPLIADA
===================================================== */

body.gallery-open {
    overflow: hidden;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 2rem;

    background-color: rgba(5, 13, 31, 0.94);
}

.gallery-modal.gallery-modal--open {
    display: flex;
}

.gallery-modal__content {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(100%, 1100px);
    max-height: 94vh;
}

.gallery-modal__image {
    display: block;

    max-width: 100%;
    max-height: 78vh;

    border-radius: var(--border-radius-medium);

    object-fit: contain;

    background-color: #ffffff;
    box-shadow: var(--shadow-large);
}

.gallery-modal__caption {
    margin-top: 1rem;

    color: rgba(255, 255, 255, 0.88);
    text-align: center;
}

.gallery-modal__counter {
    display: block;

    margin-top: 0.25rem;

    color: var(--color-accent);

    font-size: 0.9rem;
    font-weight: 750;
}

.gallery-modal__close,
.gallery-modal__control {
    position: absolute;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;

    background-color: rgba(10, 24, 54, 0.82);
    color: #ffffff;

    transition:
        background-color var(--transition),
        color var(--transition),
        border-color var(--transition);
}

.gallery-modal__close:hover,
.gallery-modal__control:hover {
    border-color: var(--color-accent);
    background-color: var(--color-accent);
    color: var(--color-primary-dark);
}

.gallery-modal__close {
    top: -1rem;
    right: -1rem;

    width: 48px;
    height: 48px;

    font-size: 1.8rem;
}

.gallery-modal__control {
    top: 50%;

    width: 52px;
    height: 52px;

    font-size: 2.2rem;

    transform: translateY(-50%);
}

.gallery-modal__control--previous {
    left: -4.5rem;
}

.gallery-modal__control--next {
    right: -4.5rem;
}

/* =====================================================
   RESPONSIVIDAD
===================================================== */

@media (max-width: 900px) {
    .work-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-modal__control--previous {
        left: 0.75rem;
    }

    .gallery-modal__control--next {
        right: 0.75rem;
    }
}

@media (max-width: 580px) {
    .work-gallery {
        grid-template-columns: 1fr;
    }

    .work-gallery__item,
    .work-gallery__image {
        height: 260px;
        min-height: 260px;
    }

    .gallery-modal {
        padding: 1rem;
    }

    .gallery-modal__image {
        max-height: 72vh;
    }

    .gallery-modal__close {
        top: 0.5rem;
        right: 0.5rem;

        width: 42px;
        height: 42px;
    }

    .gallery-modal__control {
        top: auto;
        bottom: 3.4rem;

        width: 44px;
        height: 44px;

        transform: none;
    }

    .gallery-modal__control--previous {
        left: 1rem;
    }

    .gallery-modal__control--next {
        right: 1rem;
    }

    .work-gallery__overlay {
        opacity: 1;
    }
}