/**
 * Agrandissement d'un composant image au clic, a sa taille reelle.
 * Classe a contribuer dans Jahia : `js-image-zoom`.
 */

.js-image-zoom {
    cursor: zoom-in;
}

.js-image-zoom img {
    display: block;
    height: auto;
    max-width: 100%;
}

.js-image-zoom:focus-visible {
    outline: 3px solid #2a2a2a;
    outline-offset: 4px;
}

body.image-zoom-open {
    overflow: hidden;
}

.image-zoom-modal {
    background: rgba(0, 0, 0, 0.85);
    box-sizing: border-box;
    display: none;
    height: 100%;
    left: 0;
    overflow: auto;
    padding: 4rem 1.25rem 1.25rem;
    position: fixed;
    text-align: center;
    top: 0;
    width: 100%;
    z-index: 10000;
}

.image-zoom-modal.is-visible {
    display: block;
}

.image-zoom-modal__content {
    background: #fff;
    border-radius: 0.625rem;
    box-sizing: border-box;
    display: inline-block;
    max-width: none;
    min-width: min-content;
    padding: 0.625rem;
    position: relative;
    text-align: center;
}

/*
 * Aucun max-width ni max-height : l'image s'affiche a ses dimensions
 * intrinseques completes. Si elle depasse l'ecran, la modale peut defiler.
 */
.image-zoom-modal__image {
    display: block;
    height: auto;
    max-height: none;
    max-width: none;
    object-fit: none;
    width: auto;
}

.image-zoom-modal__caption {
    color: #2a2a2a;
    font-size: 1rem;
    margin: 0.75rem 0 0.25rem;
    text-align: center;
}

.image-zoom-modal__close {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 50%;
    color: #2a2a2a;
    cursor: pointer;
    display: flex;
    font-size: 2rem;
    height: 2.75rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 0;
    top: -3.25rem;
    width: 2.75rem;
}

.image-zoom-modal__close:hover,
.image-zoom-modal__close:focus-visible {
    background: #ffd400;
}

.image-zoom-modal__close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

@media screen and (max-width: 35em) {
    .image-zoom-modal {
        padding-left: 0.625rem;
        padding-right: 0.625rem;
    }
}
