/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(to bottom, #fcfdff, #e8f7fa);
    padding: 30px 15px;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    color: #262032;
    font-size: 20px;
    line-height: 1.1em;
    font-family: "Brandon Text W01 Bold", Montserrat, sans-serif;
}

/* --- 3-Column Masonry Layout --- */
.masonry-gallery {
    column-count: 3;
    column-gap: 20px;
}

.gallery-item {
    background-color: #fff;
    margin-bottom: 20px;
    break-inside: avoid;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
}

.gallery-item img {
    width: 100%;
    display: block;
    height: auto;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

/* Responsive adjustments for smaller devices */
@media (max-width: 800px) {
    .masonry-gallery {
        column-count: 2;
    }
}

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

/* --- Screen-Fit Lightbox Layout --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 10, 10, 0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    user-select: none;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 85%;
    height: 90%;
}

/* Image scaling to perfectly fit within screen limits safely */
.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
}

/* UI Control Buttons */
.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #fff;
    font-size: 42px;
    font-weight: 300;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    z-index: 2100;
}

.close-btn:hover {
    color: #00ffff;
    transform: scale(1.1);
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #fff;
    font-size: 32px;
    padding: 20px 15px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 2100;
    border-radius: 4px;
    margin: 0 10px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #00ffff;
}

/* Hide navigation arrows on small mobile displays to avoid overlaps */
@media (max-width: 600px) {
    .nav-btn {
        padding: 12px 8px;
        font-size: 24px;
        margin: 0 4px;
    }
    .lightbox-content {
        max-width: 75%;
    }
}