/* Overlay */
#isp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Popup container */
#isp-popup {
    background: #f5e6d8;
    padding: 4px;
    box-sizing: border-box;
    position: relative; /* Needed for arrows */
    
    max-width: 95vw;
    max-height: 95vh;
    
    /* Shrink-wrap logic */
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Slide Wrapper */
.isp-slide {
    display: none; /* Hide all by default */
    line-height: 0;
    width: fit-content;
    max-width: 100%;
    transition: opacity 0.3s ease; /* Optional fade effect */
}

/* The Active Slide */
.isp-slide.active {
    display: block; /* Only show the active one */
}

/* Image styling */
.isp-slide img {
    display: block;
    height: auto;
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

/* Close button */
#isp-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #fff;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    z-index: 100;
}

/* Navigation Arrows */
.isp-prev, .isp-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 10px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    text-decoration: none;
    z-index: 90;
}

.isp-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.isp-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.isp-prev:hover, .isp-next:hover {
    background-color: rgba(0,0,0,0.8);
}