/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #000;
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    padding: 2rem 0;
    text-align: center;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #fff;
}

/* Sort controls */
.sort-controls {
    position: absolute;
    top: 2rem;
    right: 0;
}

.sort-selector {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.sort-selector:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.sort-selector:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.sort-selector option {
    background: #333;
    color: #fff;
}

/* Main content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0;
}

/* Gallery grid - JavaScript Masonry with equal gaps */
.gallery {
    position: relative;
    margin-bottom: 4rem;
}

/* Photo items */
.photo-item {
    position: absolute;
    cursor: pointer;
    overflow: hidden;
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.02);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .sort-controls {
        position: static;
        margin-top: 1rem;
        text-align: center;
    }

    main {
        padding: 0 1rem;
    }
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

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

.lightbox-close {
    position: absolute;
    top: -3rem;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-title {
    color: white;
    font-size: 0.95rem;
    font-weight: 300;
    margin-top: 1.25rem;
    text-align: center;
    opacity: 0.85;
    max-width: 90vw;
    line-height: 1.5;
    letter-spacing: 0.025em;
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    font-size: 1.1rem;
    color: #666;
}


/* Smooth transitions */
.gallery {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.gallery.loading {
    opacity: 0.7;
}