/* Core Styling & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    padding: 40px 20px;
}

.gallery-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}
.gallery-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Professional Masonry Grid Layout */
.gallery-grid {
    column-count: 4; /* Number of columns for desktop */
    column-gap: 24px;
    width: 100%;
}

/* Gallery Cards */
.gallery-item {
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 24px;
    break-inside: avoid; /* Prevents card splitting across columns */
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
    cursor: pointer;
}
.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.img-wrapper {
    width: 100%;
    overflow: hidden;
}
.gallery-item img {
    width: 100%;
    height: auto; /* Keeps native image proportions perfectly */
    display: block;
}

/* Text Captions Under Gallery Images */
.item-caption, .modal-caption-box {
    padding: 16px;
}
.item-caption h4, .modal-caption-box h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-caption p, .modal-caption-box p {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
    /* Clean 2-line text clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- LIGHTBOX MODAL --- */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 17, 23, 0.95);
    align-items: center;
    justify-content: center;
}

/* The Modal Container adjusts dynamically to image sizes */
.modal-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    max-width: 85%;
    max-height: 85vh;
	margin-top: 5px;    /* AKASH 02 Jun 2026 */
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    animation: zoomIn 0.25s ease-out;
    
/* Add this line to shift it down slightly from the very top 
    margin-top: 5px;
    padding-top: 5px;    
    */
}
#lightboxImg {
    max-width: 100%;
    max-height: 65vh; /* Leaves room for text underneath */
    object-fit: contain; /* Automatically scales without distortion */
    display: block;
    margin: 0 auto;
}
.modal-caption-box {
    background: #ffffff;
    border-top: 1px solid #efefef;
}

/* Controls */
.close-btn {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #a0aec0;
    font-size: 44px;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: #fff; }

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: none;
    font-size: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.2); }
.prev-btn { left: 30px; }
.next-btn { right: 30px; }

/* Micro-interaction Animation */
@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive Grid Adjustments */
@media (max-width: 1024px) { .gallery-grid { column-count: 3; } }
@media (max-width: 768px) { 
    .gallery-grid { column-count: 2; }
    .nav-btn { width: 44px; height: 44px; font-size: 18px; }
    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }
}
@media (max-width: 480px) { .gallery-grid { column-count: 1; } }