.media-gallery-header {
    max-width: 850px;

    margin: 0 auto 3rem;

    text-align: center;
}

.media-gallery-description {
    margin: 0;

    color: #595959;

    font-size: 1.05rem;
    line-height: 1.6;
}


/*
|--------------------------------------------------------------------------
| Grid
|--------------------------------------------------------------------------
*/

.media-gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 1.75rem;
}


/*
|--------------------------------------------------------------------------
| Tarjeta
|--------------------------------------------------------------------------
*/

.media-gallery-card {
    min-width: 0;

    overflow: hidden;

    background-color: #ffffff;

    border: 1px solid rgba(138, 21, 137, 0.12);
    border-radius: 14px;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.06);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.media-gallery-open {
    width: 100%;

    display: block;

    padding: 0;

    background: none;

    border: 0;

    cursor: pointer;
}


/*
|--------------------------------------------------------------------------
| Imagen
|--------------------------------------------------------------------------
*/

.media-gallery-image-wrapper {
    position: relative;

    width: 100%;
    aspect-ratio: 4 / 5;

    overflow: hidden;

    background-color: #f5f5f5;
}

.media-gallery-image {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.3s ease;
}


/*
|--------------------------------------------------------------------------
| Overlay
|--------------------------------------------------------------------------
*/

.media-gallery-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 0.5rem;

    color: #ffffff;

    background-color:
        rgba(45, 20, 49, 0.7);

    opacity: 0;

    transition:
        opacity 0.25s ease;
}

.media-gallery-overlay i {
    font-size: 1.8rem;
}

.media-gallery-overlay span {
    font-weight: 600;
}


/*
|--------------------------------------------------------------------------
| Texto
|--------------------------------------------------------------------------
*/

.media-gallery-content {
    padding: 1.25rem;
}

.media-gallery-card-title {
    margin-bottom: 0.5rem;

    color: #15233c;

    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}




/*
|--------------------------------------------------------------------------
| Hover
|--------------------------------------------------------------------------
*/

@media (hover: hover) {

    .media-gallery-card:hover {
        transform: translateY(-5px);

        box-shadow:
            0 14px 32px rgba(0, 0, 0, 0.1);
    }

    .media-gallery-card:hover
    .media-gallery-image {
        transform: scale(1.035);
    }

    .media-gallery-card:hover
    .media-gallery-overlay {
        opacity: 1;
    }
}


/*
|--------------------------------------------------------------------------
| Modal
|--------------------------------------------------------------------------
*/

.media-gallery-modal .modal-dialog {
    max-width: min(1200px, 94vw);
}

.media-gallery-modal .modal-content {
    position: relative;

    max-height: 94vh;

    overflow: hidden;

    background-color: #292929;

    border: 0;
    border-radius: 0;
}


/*
|--------------------------------------------------------------------------
| Barra superior
|--------------------------------------------------------------------------
*/

.media-gallery-modal-top {
    min-height: 44px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    padding: 0.5rem 1rem;

    color: #ffffff;

    background-color: #343434;
}

.media-gallery-modal-title {
    margin: 0;

    overflow: hidden;

    font-size: 0.95rem;
    font-weight: 500;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-gallery-modal-close {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    color: #ffffff;

    background: transparent;

    border: 0;

    font-size: 1.15rem;

    cursor: pointer;
}


/*
|--------------------------------------------------------------------------
| Área de imagen
|--------------------------------------------------------------------------
*/

.media-gallery-modal-body {
    position: relative;

    min-height: 300px;
    height: calc(94vh - 90px);

    display: flex;
    align-items: center;
    justify-content: center;

    background-color:
        rgba(0, 0, 0, 0.8);
}

.media-gallery-modal-image-area {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 1rem 4.5rem;
    background-color: #343434;
}

.media-gallery-modal-image {
    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 100%;

    display: block;

    object-fit: contain;
}


/*
|--------------------------------------------------------------------------
| Navegación
|--------------------------------------------------------------------------
*/

.media-gallery-modal-nav {
    position: absolute;
    top: 50%;

    z-index: 5;

    width: 50px;
    height: 60px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;

    background-color:
        rgba(0, 0, 0, 0.4);

    border: 0;

    font-size: 1.5rem;

    transform: translateY(-50%);

    cursor: pointer;
}

.media-gallery-modal-prev {
    left: 0.75rem;
}

.media-gallery-modal-next {
    right: 0.75rem;
}

.media-gallery-modal-nav[hidden] {
    display: none;
}


/*
|--------------------------------------------------------------------------
| Contador
|--------------------------------------------------------------------------
*/

.media-gallery-modal-counter {
    position: absolute;

    right: 1rem;
    bottom: 0.6rem;

    z-index: 10;

    color: #ffffff;

    font-size: 0.8rem;
}


/*
|--------------------------------------------------------------------------
| Tablet
|--------------------------------------------------------------------------
*/

@media (max-width: 1199.98px) {

    .media-gallery-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {

    .media-gallery-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/*
|--------------------------------------------------------------------------
| Móvil
|--------------------------------------------------------------------------
*/

@media (max-width: 575.98px) {

    .media-gallery-grid {
        grid-template-columns: 1fr;

        gap: 1.25rem;
    }

    .media-gallery-card {
        max-width: 420px;

        margin-left: auto;
        margin-right: auto;
    }

    .media-gallery-modal .modal-dialog {
        width: 100%;
        max-width: 100%;

        height: 100%;

        margin: 0;
    }

    .media-gallery-modal .modal-content {
        height: 100vh;
        max-height: 100vh;
    }

    .media-gallery-modal-body {
        height: calc(100vh - 45px);
    }

    .media-gallery-modal-image-area {
        padding:
            0.75rem
            2.75rem;
    }

    .media-gallery-modal-nav {
        width: 40px;
        height: 52px;

        font-size: 1.2rem;
    }

    .media-gallery-modal-prev {
        left: 0;
    }

    .media-gallery-modal-next {
        right: 0;
    }
}