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

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300;400&family=Playfair+Display:wght@400;500&display=swap');

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #000000;
    overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 200px;
    height: 100vh;
    background-color: #ffffff;
    padding: 40px 20px;
    z-index: 1000;
    border-right: 1px solid #f0f0f0;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 200;
    letter-spacing: 4px;
    margin-bottom: 40px;
    text-transform: uppercase;
    color: #000;
    position: relative;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 12px;
}

.nav-menu a {
    color: #666;
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #000;
}

/* Gallery Container */
.gallery-container {
    margin-left: 200px;
    padding: 20px 50px 60px;
}

/* Masonry Gallery */
.masonry-gallery {
    column-count: 4;
    column-gap: 50px;
    column-fill: balance;
}

.masonry-item {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 70px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.masonry-item img,
.masonry-item video {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: #f5f5f5;
}

.masonry-item img.loaded,
.masonry-item video.loaded {
    opacity: 1;
    background: transparent;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Адаптивность для больших экранов */
@media (min-width: 5000px) {
    .masonry-gallery {
        column-count: 9;
        column-gap: 60px;
    }
}

@media (min-width: 4200px) and (max-width: 4999px) {
    .masonry-gallery {
        column-count: 8;
        column-gap: 60px;
    }
}

@media (min-width: 3400px) and (max-width: 4199px) {
    .masonry-gallery {
        column-count: 7;
        column-gap: 55px;
    }
}

@media (min-width: 2600px) and (max-width: 3399px) {
    .masonry-gallery {
        column-count: 6;
        column-gap: 50px;
    }
}

@media (min-width: 1801px) and (max-width: 2599px) {
    .masonry-gallery {
        column-count: 5;
        column-gap: 50px;
    }
}

/* Адаптивность для средних экранов */
@media (max-width: 1800px) {
    .masonry-gallery {
        column-count: 4;
    }
}

@media (max-width: 1400px) {
    .masonry-gallery {
        column-count: 3;
        column-gap: 40px;
    }
    
    .gallery-container {
        padding: 40px 30px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 150px;
    }
    
    .gallery-container {
        margin-left: 150px;
    }
    
    .masonry-gallery {
        column-count: 2;
        column-gap: 30px;
    }
    
    .masonry-item {
        margin-bottom: 50px;
    }
}

/* Mobile Header */
.mobile-header {
    display: none;
}

.hamburger {
    display: none;
}

.mobile-overlay {
    display: none;
}

@media (max-width: 768px) {
    /* Mobile sticky header */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        padding: 0 20px;
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-bottom: 1px solid rgba(240, 240, 240, 0.5);
        z-index: 1000;
    }
    
    .mobile-header .logo {
        font-family: 'Montserrat', sans-serif;
        font-size: 18px;
        font-weight: 200;
        letter-spacing: 3px;
        text-transform: uppercase;
        color: #000;
        line-height: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        margin: 0;
        padding: 0;
    }
    
    /* Hamburger button */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }
    
    .hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background: #000;
        transition: all 0.3s ease;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    /* Sidebar as slide-out menu */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: #fff;
        padding: 80px 30px 30px;
        border-right: 1px solid #f0f0f0;
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar .logo {
        display: none;
    }
    
    /* Mobile overlay */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Gallery */
    .gallery-container {
        margin-left: 0;
        margin-top: 60px;
        padding: 0;
    }
    
    .masonry-gallery {
        column-count: 2;
        column-gap: 0;
    }
    
    .masonry-item {
        margin-bottom: 0;
        vertical-align: top;
    }
    
    .masonry-item img,
    .masonry-item video {
        margin: 0;
        padding: 0;
        vertical-align: top;
        line-height: 0;
    }
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

/* Modal for fullscreen view */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.modal-content img,
.modal-content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 2001;
    transition: opacity 0.3s;
}

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

/* Navigation arrows */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 60px;
    cursor: pointer;
    z-index: 2001;
    padding: 20px;
    user-select: none;
    transition: opacity 0.3s;
}

.modal-nav:hover {
    opacity: 0.7;
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Counter */
.modal-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    z-index: 2001;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-nav {
        font-size: 40px;
        padding: 10px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
    
    .close-modal {
        top: 20px;
        right: 20px;
        font-size: 30px;
    }
}

