    /* Стили для галереи */
    .gallery-item {
        position: relative;
        margin-bottom: 25px;
        cursor: pointer;
        transition: all 0.3s ease;
        overflow: hidden;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        background: #f8f9fa;
        height: 220px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .gallery-item:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 25px rgba(0,0,0,0.15);
    }
    
    /* Фото */
    .gallery-item.photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }
    
    .gallery-item.photo:hover img {
        transform: scale(1.08);
    }
    
    /* Видео - текстовый блок */
    .gallery-item.video {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px;
        text-align: center;
    }
    
    .video-content {
        color: white;
        text-align: center;
    }
    
    .video-icon {
        font-size: 48px;
        margin-bottom: 15px;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    }
    
    .video-title {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 8px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 2.6em;
    }
    
    .video-duration {
        font-size: 12px;
        opacity: 0.8;
        background: rgba(255,255,255,0.2);
        padding: 4px 8px;
        border-radius: 12px;
        display: inline-block;
    }
    
    /* Иконки */
    .media-icon {
        position: absolute;
        top: 12px;
        left: 12px;
        background: rgba(0,0,0,0.6);
        color: white;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
        box-shadow: 0 3px 10px rgba(0,0,0,0.2);
        backdrop-filter: blur(5px);
        border: 1px solid rgba(255,255,255,0.2);
    }
    
    .media-icon svg {
        width: 20px;
        height: 20px;
        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    }
    
    /* Модальное окно с менее затемненным фоном */
    .modal-backdrop.in {
        opacity: 0.85;
        background: #000;
    }
    
    /* Контент в модальном окне */
    #modal-media-container {
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    }
    
    #modal-media-container img {
        max-width: 100%;
        max-height: 80vh;
        display: block;
    }
    
    #modal-media-container video {
        max-width: 100%;
        max-height: 80vh;
        background: #000;
        display: block;
    }
    
    /* Новые кнопки навигации */
    .modal-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 60px;
        height: 60px;
        background: rgba(0,0,0,0.5);
        color: white;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        border: 2px solid rgba(255,255,255,0.3);
    }
    
    .modal-arrow:hover {
        background: rgba(0,0,0,0.7);
        transform: translateY(-50%) scale(1.1);
        border-color: rgba(255,255,255,0.5);
    }
    
    .modal-arrow:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        transform: translateY(-50%);
    }
    
    .modal-arrow:disabled:hover {
        background: rgba(0,0,0,0.5);
        transform: translateY(-50%);
    }
    
    .modal-arrow-left {
        left: 20px;
    }
    
    .modal-arrow-right {
        right: 20px;
    }
    
    /* Кнопки пагинации галереи */
    .gallery-nav-btn {
        background: linear-gradient(135deg, #670099, #8a2be2);
        color: white;
        border: none;
        padding: 12px 28px;
        border-radius: 50px;
        margin: 0 12px;
        font-weight: 600;
        font-size: 15px;
        transition: all 0.3s ease;
        box-shadow: 0 5px 15px rgba(103, 0, 153, 0.3);
    }
    
    .gallery-nav-btn:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(103, 0, 153, 0.4);
        background: linear-gradient(135deg, #8a2be2, #670099);
    }
    
    .gallery-nav-btn:disabled {
        background: #e9ecef;
        color: #6c757d;
        box-shadow: none;
        cursor: not-allowed;
        transform: none;
    }
    
    #gallery-page-info {
        font-weight: 600;
        margin: 0 20px;
        font-size: 16px;
        color: #670099;
    }
    
    /* Индикатор загрузки */
    .loading {
        display: inline-block;
        width: 50px;
        height: 50px;
        border: 4px solid rgba(103, 0, 153, 0.2);
        border-radius: 50%;
        border-top-color: #670099;
        animation: spin 1s ease-in-out infinite;
    }
    
    @keyframes spin {
        to { transform: rotate(360deg); }
    }
    
    /* Адаптивность */
    @media (max-width: 991px) {
        .gallery-item {
            height: 200px;
        }
    }
    
    @media (max-width: 767px) {
        .col-xs-12.col-sm-6.col-md-4.col-lg-3 {
            width: 100%;
        }
        
        .gallery-item {
            height: 250px;
        }
        
        .modal-dialog {
            max-width: 98%;
            margin: 10px auto;
        }
        
        .modal-arrow {
            width: 50px;
            height: 50px;
        }
        
        .modal-arrow-left {
            left: 10px;
        }
        
        .modal-arrow-right {
            right: 10px;
        }
        
        #modal-media-container {
            max-width: 95%;
            max-height: 85%;
        }
        
        /* Адаптивная пагинация для мобильных */
        .gallery-nav-btn {
            padding: 10px 15px;
            margin: 0 5px;
        }
        
        .btn-text {
            display: none;
        }
        
        #gallery-page-info {
            font-size: 14px;
            margin: 0 10px;
        }
        
        .video-title {
            font-size: 14px;
        }
    }
    
    @media (max-width: 480px) {
        .gallery-item {
            height: 200px;
        }
        
        #modal-caption {
            font-size: 16px;
            max-width: 90%;
        }
        
        .video-icon {
            font-size: 36px;
        }
    }
    
    /* Полоса с описанием для фото */
.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 15px 12px 8px;
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.gallery-item.photo:hover .photo-caption {
    opacity: 1;
}

.photo-caption-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.6em;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Убедимся, что контейнер фото имеет правильное позиционирование */
.gallery-item.photo {
    position: relative;
    overflow: hidden;
}

/* Для видео оставляем существующие стили, но добавим hover эффект */
.gallery-item.video:hover .video-content {
    transform: scale(1.05);
}

.video-content {
    transition: transform 0.3s ease;
}

/* Адаптивность для полосы с описанием */
@media (max-width: 767px) {
    .photo-caption {
        opacity: 1; /* На мобильных показываем всегда */
        padding: 12px 8px 6px;
        font-size: 12px;
    }
    
    .photo-caption-text {
        -webkit-line-clamp: 2;
        max-height: 2.4em;
    }
}

@media (max-width: 480px) {
    .photo-caption {
        padding: 10px 6px 5px;
        font-size: 11px;
    }
}

/* Все права защищены nescoke.ru (vk.com/bynescoke в соц. сетях, если сайт не работает)
Кодер: Иванов Артур Артёмович (89621626539)

Сделано для сайта армянская-церковь37.рф
*/