@import url('https://fonts.googleapis.com/css2?family=Rochester&family=Junge&display=swap');

/* GLOBAL RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Junge', serif;
    background: #f7f7f5;
    color: #1d1d1d;
    line-height: 1.7;
    letter-spacing: 0.3px;
}

/* BACKGROUND BORDERS */
.gallery-bg-left,
.gallery-bg-right {
    position: fixed;
    top: 0;
    height: 100vh;
    opacity: 0.35;
    z-index: -1;
    filter: blur(1px) brightness(0.9);
}

.gallery-bg-left {
    left: -4vw;
    transform: rotate(95deg);
}

.gallery-bg-right {
    right: -4vw;
    transform: rotate(-100deg);
}

/* MAIN CONTAINER */
.gallery-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 40px 25px 80px;
}

/* HEADER */
.gallery-header {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 60px;
    background: rgba(255,255,255,0.85);
    border-top: 6px solid #819f59;
    border-bottom: 1px solid #dcdcdc;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    backdrop-filter: blur(4px);
}

    .gallery-header h1 {
        font-family: 'Rochester', cursive;
        font-size: 4.5rem;
        color: #819f59;
        margin-bottom: 15px;
        font-weight: 400;
    }

    .gallery-header .subtitle {
        font-size: 1.15rem;
        text-transform: uppercase;
        letter-spacing: 3px;
        opacity: 0.85;
        margin-top: 5px;
    }

/* MASONRY GRID */
.masonry-grid {
    column-count: 4;
    column-gap: 25px;
}

@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 25px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

    .masonry-item:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 35px rgba(129,159,89,0.25);
    }

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.masonry-item:hover .gallery-image {
    transform: scale(1.03);
    opacity: 0.95;
}

/* LOADING INDICATOR */
.loading-indicator {
    text-align: center;
    padding: 50px 0;
    opacity: 0.8;
}

.spinner {
    border: 4px solid #eee;
    border-top: 4px solid #819f59;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* END MESSAGE */
.end-message {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-top: 6px solid #819f59;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    margin-top: 40px;
}

    .end-message p {
        margin: 12px 0;
    }

.photo-count {
    font-size: 0.95rem;
    color: #819f59;
    letter-spacing: 1px;
}

/* LIGHTBOX */
.lightbox {
    position: fixed;
    inset: 0;
    padding: 2rem 0;
    background: rgba(20,20,20,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.25s ease;
    backdrop-filter: blur(3px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
}

.lightbox-content {
    position: relative;
    max-width: 92%;
    max-height: 92%;
}

    .lightbox-content img {
        max-width: 100%;
        max-height: 84vh;
        box-shadow: 0 20px 60px rgba(0,0,0,0.55);
        transition: transform 0.3s ease;
    }

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

    .lightbox-close:hover {
        opacity: 1;
    }

.lightbox-info {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    color: #eee;
    font-size: 1rem;
    letter-spacing: 1px;
}

/* LIGHTBOX NAV */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2.25rem;
    width: 65px;
    height: 65px;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .lightbox-nav:hover:not(:disabled) {
        transform: translateY(-50%) scale(1.05);
    }

    .lightbox-nav:disabled {
        opacity: 0.25;
        cursor: not-allowed;
    }

.lightbox-prev {
    left: -90px;
}

.lightbox-next {
    right: -90px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 2.4rem;
    }
}
