/* ==========================================================================
   ChemIndia - Gallery Page Styles
   ========================================================================== */

/* Main Gallery Grid */
.grid-wrapper {
    display: grid;
    grid-gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 200px;
    grid-auto-flow: dense;
}

.grid-wrapper > div {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.grid-wrapper > div > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    vertical-align: middle;
    display: inline-block;
}

.grid-wrapper > div:hover > img {
    transform: scale(1.04);
}

/* Hover Caption - Pure transparent background with high-contrast text shadow */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent !important;
    color: #ffffff !important;
    padding: 10px 14px;
    font-size: 0.88rem;
    line-height: 1.35;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.85), 1px 1px 2px #000000;
    transform: translateY(100%);
    transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    font-family: 'Poppins', sans-serif;
}

.grid-wrapper > div:hover .gallery-caption {
    transform: translateY(0);
    opacity: 1;
}

/* Grid Spanning Classes */
.grid-wrapper .wide {
    grid-column: span 2;
}

.grid-wrapper .tall {
    grid-row: span 2;
}

.grid-wrapper .big {
    grid-column: span 2;
    grid-row: span 2;
}

/* Lightbox Modal & Image Display */
.modal {
    display: none;
    position: fixed;
    z-index: 100000 !important;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    display: block;
    margin: 0 auto;
    max-width: 80%;
    max-height: 80%;
}

.modal img {
    width: 100%;
    height: auto;
}

#modalCaption {
    text-align: center;
    color: #ffffff;
    padding: 12px;
    font-size: 1.05rem;
    font-family: 'Poppins', sans-serif;
    max-width: 80%;
    margin: 10px auto 0 auto;
}

/* Navigation Buttons */
.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
}

.prev {
    left: 0;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Close Button */
.close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.85;
}

.close:hover {
    color: #ffffff;
    opacity: 1;
}

