/* Основные стили галереи */
.gallery-container {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.gallery-header {
    margin-bottom: 30px;
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
}

/* Фильтры */
.gallery-filters {
    margin-bottom: 30px;
}

.filter-btn {
    background: none;
    border: 2px solid #333;
    padding: 8px 20px;
    margin: 0 5px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.filter-btn:hover {
    background: #333;
    color: white;
}

.filter-btn.active {
    background: #333;
    color: white;
}

/* Сетка галереи */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    max-width: 100%;
}

/* Сетка для годов и городов */
.gallery-grid.year-grid,
.gallery-grid.city-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 100%;
}

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

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    font-size: 0.9em;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Стили для элементов года и месяца */
.year-item,
.month-item,
.city-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.year-item:hover,
.month-item:hover,
.city-item:hover {
    background: #e9ecef;
    transform: translateY(-5px);
}

.year-item h2,
.month-item h2,
.city-item h2 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
}

.year-item a,
.month-item a,
.city-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
}

/* Лайтбокс */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    overflow: auto;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    margin: 50px auto;
    text-align: center;
    padding: 20px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    margin: 0 auto;
    display: block;
    object-fit: contain;
}

.lightbox-caption {
    color: white;
    padding: 10px;
    font-size: 1.2em;
    margin-top: 10px;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2em;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2em;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 10000;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Адаптивность для лайтбокса */
@media (max-width: 768px) {
    .lightbox-content {
        margin: 20px auto;
    }

    .lightbox-prev,
    .lightbox-next {
        position: fixed;
        top: auto;
        bottom: 20px;
        transform: none;
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next {
        right: 20px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }
}

/* Пагинация */
.gallery-pagination {
    text-align: center;
    margin-top: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-pagination a,
.gallery-pagination span {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid #333;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.gallery-pagination a:hover {
    background: #333;
    color: white;
}

.gallery-pagination span.current {
    background: #333;
    color: white;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .gallery-grid.year-grid,
    .gallery-grid.city-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid.year-grid,
    .gallery-grid.city-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-grid.year-grid,
    .gallery-grid.city-grid {
        grid-template-columns: 1fr;
    }
}

.country-item, .city-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    padding: 20px;
}

.country-item:hover, .city-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.country-item h2, .city-item h2 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.country-link, .city-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.country-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
}

.city-item {
    background: linear-gradient(135deg, #e4e8eb 0%, #d1d5d9 100%);
    position: relative;
}

.photo-count {
    font-size: 0.9em;
    color: #666;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    display: inline-block;
} 
.gallery-map-link {
    margin-top: 8px;
    text-align: center;
}

.gallery-map-link a {
    display: inline-block;
    padding: 5px 10px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.gallery-map-link a:hover {
    background: #555;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-size: 0.9em;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-map-link {
    margin-top: 8px;
    text-align: center;
}

.gallery-map-link a {
    display: inline-block;
    padding: 5px 10px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.gallery-map-link a:hover {
    background: #555;
}