.video-gallery-container {
    background-color: var(--text-white);
    padding: 60px 0 90px;
}

.video-gallery-title {
    font-weight: 700;
    font-size: 32px;
    line-height: 100%;
    color: var(--main-darck);
    padding-bottom: 60px;
    display: flex;
    justify-content: space-between;
}

/* Стили для ссылки "Все видео" */
.video-gallery-title a {
    font-size: 1rem;
    font-weight: 600;
    color: #454545;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color var(--transition-speed);
}

.video-gallery-title a:hover {
    color: var(--main-red);
}

.video-gallery-title a svg {
    fill: currentColor;
}

/* Контейнер сетки */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}

/* Обертка для отдельной карточки (ссылка + заголовок) */
.video-item {
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform var(--transition-speed) ease;
}

.video-item:hover {
    transform: translateY(-4px);
}


/* Миниатюра (сама ссылка) */
.video-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Задает соотношение сторон */
    overflow: hidden;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Убраны box-shadow и border-radius, так как они теперь на .video-item */
    transition: all ease var(--transition-speed);
    border-radius: 6px 6px 0 0; /* Сверху закругление */
    flex-shrink: 0;
}

.video-card img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.video-play {
    /* Стили, предоставленные пользователем, для иконки Play */
    backdrop-filter: blur(40px);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2); /* #FFFFFF33 */
    transition: all var(--transition-speed) ease;
}

.video-card:hover .video-play {
    transform: scale(1.1);
}

/* Заголовок под миниатюрой */
.video-card-title {
    padding: 15px; /* Увеличил отступы */
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--main-darck);
    text-align: left;
    flex-grow: 1;
}

/* --- Адаптивность галереи (Пользовательские стили) --- */

@media (max-width: 1025px) {
    .video-gallery-container {
        padding: 40px 0 60px;
    }

    .video-gallery-title {
        font-size: 28px;
        padding-bottom: 40px;
    }

    .video-grid {
        gap: 20px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .video-gallery-container {
        padding: 40px 0;
    }

    .video-gallery-title {
        padding-bottom: 32px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .video-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* --- Стили для модального окна (Пользовательские стили) --- */

/* Оверлей */
.videotube-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    z-index: 1000;
}

/* Контейнер видео */
#videotube-modal-container {
    z-index: 1001;
    background-color: #1f2937;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 0.75rem;
    overflow: hidden;
    /* Размеры устанавливаются динамически через JS */
}

/* iframe внутри контейнера */
#videotube-modal {
    display: block;
}

/* Стили для кнопки закрытия */
#videotube-modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 1002;
    line-height: 1;
    font-weight: 300;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    transition: color 0.2s ease;
}

#videotube-modal-close:hover {
    color: var(--main-red);
}

/* Дополнительная адаптация кнопки закрытия для мобильных */
@media (max-width: 640px) {
    #videotube-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 2rem;
    }
}