@import url('https://fonts.googleapis.com/css2?family=Rochester&family=Junge&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Junge', serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #1d1d1d;
    line-height: 1.6;
}

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

.gallery-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #819f59;
}

.gallery-header h1 {
    font-family: 'Rochester', cursive;
    font-size: 4rem;
    color: #819f59;
    margin-bottom: 10px;
    font-weight: 400;
    letter-spacing: 1px;
}

.gallery-header .subtitle {
    font-family: 'Junge', serif;
    font-size: 1.2rem;
    color: #1d1d1d;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Masonry Grid Layout */
.masonry-grid {
    column-count: 4;
    column-gap: 15px;
    margin-bottom: 30px;
}

@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: 15px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    border: 2px solid transparent;
}

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(129, 159, 89, 0.3);
    border-color: #819f59;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.masonry-item:hover .gallery-image {
    opacity: 0.9;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #1d1d1d;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #819f59;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* End Message */
.end-message {
    text-align: center;
    padding: 40px;
    color: #1d1d1d;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #819f59;
}

.end-message p {
    margin: 10px 0;
    font-family: 'Junge', serif;
}

.photo-count {
    font-size: 0.9rem;
    color: #819f59;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(29, 29, 29, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-info {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    text-align: center;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(129, 159, 89, 0.3);
    border: 2px solid #819f59;
    color: white;
    font-size: 3rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-nav:hover:not(:disabled) {
    background: rgba(129, 159, 89, 0.6);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(129, 159, 89, 0.3);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

@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.5rem;
    }

    .gallery-header h1 {
        font-size: 3rem;
    }
    
    .gallery-header .subtitle {
        font-size: 1rem;
    }
}
