.iv-modal.hidden {
    display: none; 
}

.iv-modal {
    position: fixed; top:0; left:0; right:0; bottom:0; z-index:1000; 

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

.iv-backdrop {
    position: absolute; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.7); 
}

.iv-container {
    position: relative; 

    max-width: 1200px;
    width: 90%; 
    height: 75dvh; 
    max-height: 90%; 
    
    margin: auto;
    background: #fff; border-radius:8px; overflow: hidden;

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

    padding: 1.5em 1.75em 0 1.75em;
}

.iv-close {
    position: absolute; top: 8px; right: 8px; background:transparent; border:none; font-size: 1.5rem; cursor:pointer; 
    z-index: 2;
}

.iv-image-wrapper {
    flex:1; width:100%; overflow:hidden; position:relative; cursor: grab;
}

.iv-image-wrapper.grabbing {
    cursor: grabbing; 
}

.iv-main-img {
    position: absolute; 
    /* top:50%; left:50%; 
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center center; */
    user-select: none;
    touch-action: none;

    width: 100%;
    height: 100%;
    object-fit: contain;
    
    -webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.iv-main-img,
.iv-image-desc .readmore-text {
    -webkit-user-drag: none;
    -moz-user-drag: none;
    -ms-user-drag: none;
    user-drag: none;
}

.iv-image-desc {
    position: absolute;
    bottom: 0.5em;
    left: 50%;
    transform: translateX(-50%);

    padding: 0.5em 0.75em;
    border-radius: 0.5em;

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

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    max-width: 800px;
    width: 95%;

    font-size: 0.8em;
}

.iv-image-desc .readmore-text {
    color: white;

    width: unset;
    margin: 0 auto;
}

.iv-thumbnails {
    display: flex; 
    overflow-x: auto; 
    padding: 10px; 
    max-width: 100%;
}

.iv-thumbnails img {
    height: 60px; 
    margin: 0 0.25em;
    cursor: pointer; 
    opacity: 0.7; 
}

.iv-thumbnails img.active {
    border:2px solid #007bff; opacity:1; 
}

.iv-prev, .iv-next {
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%);
    background: rgba(255,255,255,0.8); 
    border: none;
    font-size: 1.5rem; 
    cursor: pointer;
    
    line-height: 1.5;
    padding: 0 5px;
}

.iv-prev {
    left: 5px; 
}

.iv-next {
    right: 5px; 
}

.iv-thumb {
    position: relative;
    cursor: pointer;
}

.iv-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.2s ease-in-out;
}

.iv-thumb:hover::after {
    background-color: rgba(0, 0, 0, 0.1);
}



@media only screen and (min-width: 800px) {

    .iv-container {
        width: 80%; 
        height: 90dvh; 
        max-height: 90%; 

        padding: 2.5em 2.5em 0 2.5em;
    }

    .iv-prev, .iv-next {
        font-size: 2rem; 
        line-height: 2;
        padding: 0 8px;
    }

    .iv-prev {
        left: 10px; 
    }

    .iv-next {
        right: 10px; 
    }

    .iv-image-desc {
        font-size: 1em;
        width: fit-content;
    }

}