body {
    background-color: #000;
    margin: 0;
    overflow: hidden;
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.preloader.removed {
    display: none;
}

#my-scrollbar {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    overflow-x: hidden;
    overflow-y: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

/* Блок описания */
.description-block {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    padding: 80px 60px;
    max-width: 1400px;
    margin: 0 auto;
    color: white;
    min-height: auto;
}

.description-title h1 {
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 48px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
}

.description-text {
    font-family: 'PT Sans', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.description-text p {
    margin: 0 0 8px 0;
}

.description-text p:last-child {
    margin-bottom: 0;
}

.description-date-container {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.description-date-label {
    font-family: 'PT Sans', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    opacity: 0.6;
}

.description-date {
    font-style: italic;
    margin: 0;
}

.gallery {
    position: relative;
    width: max-content; /* Ширина подстраивается под контент */
    min-height: 250vh;
    padding: 10px;
}

/* На ПК - абсолютное позиционирование */
.gallery-item {
    position: absolute;
    object-fit: cover;
    filter: grayscale(100%) !important;
    transition: filter 0.4s ease-in;
    cursor: pointer;
    transform-origin: center center;
    will-change: transform;
    border-radius: 8px;
}

.gallery-item:hover {
    filter: grayscale(0%) !important;
}

/* Позиционирование картинок - абсолютное позиционирование с слоями для эффекта заспамленности */
/* Используем JavaScript для установки z-index на основе data-layer */








.scrollbar-track {
    display: none !important;
}

/* Кнопка описания для мобильных */
.info-button-mobile {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.info-button-mobile:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Bottom sheet для описания */
.description-bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.description-bottom-sheet.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.bottom-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.98);
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    backdrop-filter: blur(20px);
    will-change: transform;
}

.description-bottom-sheet.active .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-sheet-header h2 {
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
}

.bottom-sheet-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-family: 'PT Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
}

.bottom-sheet-body p {
    margin: 0 0 16px 0;
}

.bottom-sheet-body p:last-of-type {
    margin-bottom: 20px;
}

.bottom-sheet-button {
    margin: 0 20px 20px;
    padding: 16px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-family: 'PT Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bottom-sheet-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Адаптация для планшетов и мобильных */
@media (max-width: 1024px) {
    #my-scrollbar {
        overflow: hidden; /* Отключаем скролл для transform-based pan */
        overflow-x: hidden;
        /* Скрываем scrollbar визуально */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE и Edge */
    }
    
    #my-scrollbar::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .description-block {
        display: none;
    }

    .info-button-mobile {
        display: flex;
    }

    .description-title h1 {
        font-size: 40px;
    }

    .description-text {
        font-size: 17px;
    }

    .description-date-label {
        font-size: 17px;
    }

    /* Планшеты - Transform-based канвас (Figma-style) */
    .gallery {
        position: relative;
        width: 100%;
        height: 100vh;
        overflow: hidden; /* Отключаем нативный скролл */
        touch-action: none; /* Предотвращаем конфликты жестов браузера */
        /* Скрываем scrollbar визуально */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE и Edge */
    }
    
    .gallery::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .gallery-container {
        position: relative;
        /* Размеры устанавливаются через JS в applyMobileLayout() */
        will-change: transform; /* Оптимизация для transform */
    }

    .gallery-item {
        position: absolute !important;
        object-fit: cover;
        filter: none !important; /* Убираем grayscale на планшетах */
        border-radius: 8px;
        cursor: pointer;
        pointer-events: auto;
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation; /* Разрешаем только tap, предотвращаем двойной тап для зума */
    }

    /* Hover эффект отключен на планшетах */
}

@media (max-width: 768px) {
    .description-block {
        padding: 40px 30px;
        gap: 32px;
    }

    .description-title h1 {
        font-size: 36px;
    }

    .description-text {
        font-size: 16px;
        line-height: 1.6;
    }

    .description-text p {
        margin-bottom: 8px;
    }

    .description-date-label {
        font-size: 16px;
    }

    /* Мобильные - Transform-based канвас (Figma-style) */
    .gallery {
        position: relative;
        width: 100%;
        height: 100vh;
        overflow: hidden; /* Отключаем нативный скролл */
        touch-action: none; /* Предотвращаем конфликты жестов браузера */
        /* Скрываем scrollbar визуально */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE и Edge */
    }
    
    .gallery::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .gallery-container {
        position: relative;
        /* Размеры устанавливаются через JS в applyMobileLayout() */
        will-change: transform; /* Оптимизация для transform */
    }

    .gallery-item {
        position: absolute !important;
        object-fit: cover;
        filter: none !important; /* Убираем grayscale на мобильных */
        border-radius: 8px;
        cursor: pointer;
        pointer-events: auto;
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Hover эффект отключен на мобильных */
}

@media (max-width: 430px) {
    .description-block {
        padding: 30px 20px;
        gap: 24px;
    }

    .description-title h1 {
        font-size: 32px;
    }

    .description-text {
        font-size: 15px;
    }

    .description-date-label {
        font-size: 15px;
    }

    .gallery {
        padding: 16px 12px;
        gap: 10px;
    }
}

/* Модальное окно для просмотра фото */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

.image-modal.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

.image-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.image-modal-content {
    position: relative;
    width: auto;
    max-width: 90vw;
    height: auto;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    margin: auto;
    transition: clip-path 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: circle(0px at 50% 50%);
}

.image-modal-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transform-origin: center center;
}

.image-modal-close {
    position: absolute;
    top: -12px;
    right: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10003;
    backdrop-filter: blur(10px);
    margin: 0;
    padding: 0;
    transform: translateY(-100%);
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
    -webkit-focus-ring-color: transparent;
}

.image-modal.active .image-modal-close {
    display: flex;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-modal-close:active {
    background: rgba(255, 255, 255, 0.3);
}

.image-modal-close:focus {
    outline: none;
}

.image-modal.active .image-modal-backdrop {
    animation: backdropFadeIn 0.4s ease forwards;
}

.image-modal:not(.active) .image-modal-backdrop {
    animation: backdropFadeOut 0.3s ease forwards;
}

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

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

/* Убираем дефолтные ховеры на кнопках */
button,
.image-modal-close,
.info-button-mobile,
.bottom-sheet-button {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-focus-ring-color: transparent;
    outline: none;
}

button:focus,
.image-modal-close:focus,
.info-button-mobile:focus,
.bottom-sheet-button:focus {
    outline: none;
}

button:active,
.info-button-mobile:active,
.bottom-sheet-button:active {
    -webkit-tap-highlight-color: transparent;
}
