/* =============================================================
   Seth Anandram Jaipuria College — gallery.css
   Masonry grid + lightbox modal
   Load after styles.css and inner-page.css
   ============================================================= */


/* ===== MASONRY GRID ===== */

.masonry {
    column-count: 3;
    column-gap: 10px;
}

.brick {
    break-inside: avoid;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    line-height: 0; /* collapses the gap under inline images */
}

.brick a {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: zoom-in;
}

.brick img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    border: 0;
    transition: transform 0.32s ease, filter 0.25s ease;
}

/* Zoom + dim on hover */
.brick a:hover img {
    transform: scale(1.05);
    filter: brightness(0.82);
}

/* Expand icon that appears on hover */
.brick a::after {
    content: '\f065'; /* fa-expand */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
}

.brick a:hover::after {
    opacity: 1;
}


/* ===== LIGHTBOX MODAL ===== */

.lb-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-modal[hidden] {
    display: none;
}

/* Dark backdrop */
.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 15, 30, 0.94);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* Image + caption wrapper */
.lb-stage {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0;
    max-width: 90vw;
}

.lb-img {
    display: block;
    max-width: 88vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.6);
    transition: opacity 0.15s ease;
}

.lb-caption {
    margin-top: 0.8rem;
    font-family: var(--font-body, sans-serif);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    max-width: 65ch;
    line-height: 1.5;
    min-height: 1.2em; /* prevents layout jump when caption is empty */
}

/* Photo counter  e.g.  "3 / 22" */
.lb-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.4);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
}

/* Close button — top right */
.lb-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
    line-height: 1;
}

.lb-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Prev / Next arrow buttons */
.lb-prev,
.lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, transform 0.18s;
    line-height: 1;
}

.lb-prev { left: 1.1rem; }
.lb-next { right: 1.1rem; }

.lb-prev:hover,
.lb-next:hover {
    background: var(--primary-blue, #1a4480);
    transform: translateY(-50%) scale(1.1);
}


/* ===== RESPONSIVE ===== */

@media (max-width: 992px) {
    .masonry {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .masonry {
        column-count: 2;
        column-gap: 6px;
    }
    .brick {
        margin-bottom: 6px;
    }
    .lb-prev { left: 0.4rem; }
    .lb-next { right: 0.4rem; }
    .lb-prev,
    .lb-next {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}

@media (max-width: 380px) {
    .masonry {
        column-count: 1;
    }
}
