/**
 * @file: template/css/components/news-gallery.css
 * @description: Стили для фото-галерей в новостях (Magnific Popup)
 * @created: 2026-09-14
 */

/* Альбом галереи (вставка через CKEditor) */
.news-gallery-album {
    margin: 20px 0;
}

.news-gallery-album__title {
    display: none;
}

/* Сетка фото — 3 в ряд (для вставленных альбомов и авто-группировки) */
.news-gallery-album__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 10px 0;
}

.news-gallery-album__grid > div {
    margin: 0;
}

.news-gallery-album__grid .image-popup,
.news-gallery-album__grid > div > .image-popup {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 4px;
    background: #fff;
    text-decoration: none;
}

.news-gallery-album__grid .image-popup img,
.news-gallery-album__grid > div > .image-popup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-gallery-album__grid .image-popup:hover img,
.news-gallery-album__grid > div > .image-popup:hover img {
    transform: scale(1.05);
}

/* Адаптивность */
@media (max-width: 768px) {
    .news-gallery-album__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .news-gallery-album__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
}

/* Тёмная тема */
[data-theme="dark"] .news-gallery-album__grid .image-popup,
[data-theme="dark"] .news-gallery-album__grid > div > .image-popup {
    background: #333;
}

/* YouTube / видео-embed в контенте — по центру, адаптивный размер */
.news-text iframe[src*="youtube"],
.news-text iframe[src*="youtu.be"],
.news-text iframe[src*="vimeo"],
.collective_full iframe[src*="youtube"],
.collective_full iframe[src*="youtu.be"] {
    display: block;
    margin: 20px auto;
    max-width: 640px;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 8px;
}
