/* =========================================
   ФОТОГАЛЕРЕЯ
   ========================================= */

.gallery-container {
    padding-bottom: 100px;
    min-height: 60vh;
}

/* Заголовок страницы */
.gallery-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
}

.gallery-header h1 {
    font-family: 'Gotham', sans-serif;
    color: #003c82;
    margin-top: 15px;
    font-size: 2.5rem;
    text-transform: uppercase;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #00a0c8;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.3s;
}
.back-link:hover { color: #003c82; }

/* --- СЕТКА (GRID) --- */
.gallery-grid {
    display: grid;
    /* Автоматическое заполнение: минимум 300px ширины у колонки */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    background: #000;

    /* Соотношение сторон 4:3 для красивых плиток */
    aspect-ratio: 4 / 3;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 60, 130, 0.2);
}

.gallery-img-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет блок, обрезая лишнее */
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.05); /* Зум при наведении */
    opacity: 0.8;
}

/* Иконка лупы */
.zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    background: rgba(0, 60, 130, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    z-index: 2;
}

.gallery-item:hover .zoom-icon {
    transform: translate(-50%, -50%) scale(1);
}


/* --- МОДАЛЬНОЕ ОКНО (LIGHTBOX) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.95); /* Почти черный фон */
    backdrop-filter: blur(10px);
}

/* Картинка внутри модалки */
.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform:scale(0.9); opacity: 0;}
    to {transform:scale(1); opacity: 1;}
}

/* Кнопка Закрыть */
.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: #00a0c8;
}

/* Стрелки */
.prev-slide, .next-slide {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background: rgba(0,0,0,0.2);
}

.next-slide {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev-slide {
    left: 0;
}

.prev-slide:hover, .next-slide:hover {
    background-color: rgba(0, 60, 130, 0.8);
}

/* Адаптив */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Маленькие плитки на телефоне */
        gap: 10px;
    }
    .gallery-header h1 {
        font-size: 1.8rem;
    }
    .modal-content {
        width: 100%;
    }
}

/* --- РАЗДЕЛИТЕЛЬ ПО ГОДАМ --- */
.gallery-year-section {
    margin-bottom: 60px; /* Отступ между блоками лет */
}

.year-separator {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
}

.year-label {
    font-family: 'Gotham', sans-serif;
    font-size: 2rem;
    color: #003c82; /* Цвет бренда */
    font-weight: 700;
}

/* Декоративная линия после года */
.year-line {
    flex: 1;
    height: 18px;
    background: linear-gradient(90deg, #003c82 0%, rgba(0, 60, 130, 0) 100%);
    opacity: 0.5;
    border-radius: 20px;
}