/* Стили для галереи */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-title {
    font-size: 2.5rem;
    color: #ffb7c5; /* Пастельный розовый */
    margin-bottom: 15px;
    font-weight: 300;
}

.gallery-description {
    color: #888;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Фильтры */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    color: #666;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: #ffb7c5;
    border-color: #ffb7c5;
    color: white;
}

/* Сетка галереи */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    background: white;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.gallery-item-inner {
    aspect-ratio: 1 / 1;
    position: relative;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-link {
    color: white;
    text-decoration: none;
    display: block;
}

.gallery-item-title {
    font-size: 1.6rem;
    font-weight: 500;
    display: block;
    line-height: 1.4;
}

/* Лайтбокс */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    position: relative;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    border-radius: 5px;
}

.lightbox-caption {
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 1.2rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}

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

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Навигация лайтбокса */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 50px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2;
}

.lightbox button.lightbox-nav {
    padding: 0;
    border-radius: 50%;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Счетчик фото */
.lightbox-counter {
    margin-top: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

/* Анимация смены фото */
.lightbox-img {
    transition: opacity 0.3s ease;
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    border-radius: 5px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }

    /* Просто опускаем крестик на мобильных */
/* Просто опускаем крестик на мобильных */
@media (max-width: 768px) {
    .lightbox-close {
        top: 20px !important;
        right: 20px !important;
        width: 60px !important;
        height: 60px !important;
        font-size: 50px !important;
    }
}
    
    /* Увеличиваем зону клика для свайпов */
    .lightbox-content {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 18px;
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* Скрываем стрелки на очень маленьких экранах, оставляем только свайпы */
    .lightbox-nav {
        opacity: 0.7;
    }
    
    .lightbox-nav:active {
        opacity: 1;
        background: rgba(255, 255, 255, 0.3);
    }
}

/* Кнопка "Загрузить еще" */
.gallery-load-more {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    background: #ffb7c5;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.load-more-btn:hover {
    background: #ff9eb0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    .gallery-title {
        font-size: 2rem;
    }
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Лоадер */
.gallery-loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #ffb7c5;
    font-size: 1.1rem;
}

.gallery-no-items {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 1.2rem;
    background: #f9f9f9;
    border-radius: 10px;
}

.gallery-grid-inner {
    display: contents;
}

/* Ошибки и лоадеры */
.gallery-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #ff6b6b;
    background: #fff5f5;
    border-radius: 10px;
    margin: 20px 0;
}

.gallery-loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: #ffb7c5;
}

.gallery-no-items {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
    background: #f9f9f9;
    border-radius: 10px;
}

/* Лайтбокс */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.lightbox {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px); /* Добавляет легкое размытие */
    -webkit-backdrop-filter: blur(5px); /* Для Safari */
}

.lightbox.active {
    display: flex;
}

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

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    border-radius: 5px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-caption {
    text-align: center;
    padding: 15px;
    color: white;
}

.lightbox-post-link {
    color: #ffb7c5;
    text-decoration: none;
    font-size: 1.1rem;
}

.lightbox-post-link:hover {
    text-decoration: underline;
}

