/* ========================================
   ОСНОВНЫЕ СТИЛИ
   ======================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}

a {
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
}


/* Карточки с текстом на картинке (главная) */
.featured-main-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.featured-main-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.small-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.small-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12) !important;
}

/* ========================================
   ОБЛАКО ТЕГОВ
   ======================================== */
.tag-cloud .badge {
    background-color: #e9ecef;
    color: #495057;
    text-decoration: none;
    margin: 0.2rem;
    font-weight: 400;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tag-cloud .badge:hover {
    background-color: #0d6efd;
    color: #fff;
}

/* ========================================
   КОНТЕНТ ПОСТА
   ======================================== */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #212529;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.75rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content h4 { font-size: 1.25rem; }

.post-content p {
    margin-bottom: 1rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.post-content blockquote {
    border-left: 4px solid #0d6efd;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    color: #495057;
    font-style: italic;
}

.post-content blockquote p {
    margin-bottom: 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.post-content table th,
.post-content table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}

.post-content table th {
    background-color: #e9ecef;
    font-weight: 600;
}

.post-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.post-content code {
    background: #f1f3f4;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Мета-информация поста */
.post-meta {
    font-size: 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
}

/* Похожие посты */
.related-posts .card {
    transition: transform 0.2s ease;
}

.related-posts .card:hover {
    transform: translateY(-2px);
}

/* ========================================
   ПАГИНАЦИЯ
   ======================================== */
.pagination .page-link {
    color: #0d6efd;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin: 0 0.1rem;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    color: #0a58ca;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background: transparent;
}

/* ========================================
   МНОГОУРОВНЕВОЕ МЕНЮ
   ======================================== */
/* Базовые стили для dropdown */
.dropdown:hover > .dropdown-menu {
    display: block;
}

.dropdown > .dropdown-menu {
    display: none;
    margin-top: 0;
}

/* Темное выпадающее меню */
.dropdown-menu-dark {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dropdown-menu-dark .dropdown-item {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-weight: 400;
}

.dropdown-menu-dark .dropdown-item:hover,
.dropdown-menu-dark .dropdown-item:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-menu-dark .dropdown-item:active {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Стрелки для подменю */
.dropdown-menu-dark .dropdown-toggle::after {
    margin-left: auto;
}

/* Подменю второго уровня */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropdown-submenu > .dropdown-menu {
    display: none;
    top: -0.5rem;
    left: 100%;
    margin-top: 0;
    margin-left: 0.25rem;
    border-radius: 0.5rem;
}

.dropdown-submenu .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-submenu .dropdown-item i {
    margin-right: 0.5rem;
}

/* Стрелка у пункта с подменю */
.dropdown-submenu > .dropdown-item::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    margin-left: 0.75rem;
    opacity: 0.6;
    transition: transform 0.25s ease;
}

.dropdown-submenu:hover > .dropdown-item::after {
    transform: translateX(4px);
    opacity: 1;
}

/* Плавное появление меню */
.dropdown-menu-dark {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.dropdown:hover > .dropdown-menu-dark,
.dropdown-submenu:hover > .dropdown-menu-dark {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ========================================
   АДАПТИВ
   ======================================== */

/* Планшеты и маленькие ноутбуки */
@media (max-width: 992px) {
    /* Меню — раскрытие по клику */
    .dropdown:hover > .dropdown-menu {
        display: none;
    }

    .dropdown.show > .dropdown-menu {
        display: block;
    }

    .dropdown-submenu:hover > .dropdown-menu {
        display: none;
    }

    .dropdown-submenu.show > .dropdown-menu {
        display: block;
    }

    .dropdown-menu-dark {
        background-color: transparent;
        border: none;
        box-shadow: none;
        padding-left: 1.25rem;
        padding-top: 0;
        padding-bottom: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }

    .dropdown-menu-dark .dropdown-item {
        color: rgba(255, 255, 255, 0.75);
        padding: 0.4rem 1rem;
    }

    .dropdown-menu-dark .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .dropdown-submenu > .dropdown-menu {
        padding-left: 1.25rem;
        background-color: transparent;
        border: none;
        box-shadow: none;
    }

    .dropdown-submenu > .dropdown-item::after {
        content: '\f078';
    }

    .dropdown-submenu.show > .dropdown-item::after {
        transform: rotate(180deg);
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {


    .post-content {
        font-size: 1rem;
    }

    .post-content h1 { font-size: 1.5rem; }
    .post-content h2 { font-size: 1.25rem; }
    .post-content h3 { font-size: 1.125rem; }

    .post-content table {
        font-size: 0.85rem;
    }

    .post-content table th,
    .post-content table td {
        padding: 0.25rem 0.5rem;
    }

    .featured-main-card .position-relative {
        height: 250px !important;
    }

    .small-card .position-relative {
        height: 150px !important;
    }
}

/* Маленькие телефоны */
@media (max-width: 576px) {
    .featured-main-card .position-relative {
        height: 220px !important;
    }
}


/* ============================================ */
/* ФАЙЛЫ ИЗ ПАПКИ (fileFolder)                 */
/* ============================================ */

.file-list-block {
    margin: 1.5em 0;
}

.file-list-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 12px;
    color: #2d3436;
}

.file-list-empty {
    padding: 16px;
    text-align: center;
    color: #b2bec3;
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 8px;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: border-color 0.15s, background 0.15s;
}

.file-list-item:hover {
    border-color: #0984e3;
    background: #f0f8ff;
}

.file-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.file-link {
    flex: 1;
    min-width: 0;
    color: #2d3436;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    word-break: break-word;
}

.file-link:hover {
    color: #0984e3;
    text-decoration: underline;
}

.file-size {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}

.file-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #27ae60;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.file-download-btn:hover {
    background: #219a52;
    color: #fff;
}


/* ============================================ */
/* ВИД: СПИСОК (по умолчанию)                  */
/* ============================================ */

/* .file-list--list — уже базовые стили выше */


/* ============================================ */
/* ВИД: ПЛИТКА                                 */
/* ============================================ */

.file-list--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.file-list--grid .file-list-item {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 20px 14px;
    margin-bottom: 0;
    min-height: 140px;
    justify-content: center;
    position: relative;
}

.file-list--grid .file-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

.file-list--grid .file-link {
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
    margin-bottom: 8px;
    flex: 0 1 auto;
}

.file-list--grid .file-size {
    font-size: 11px;
    text-align: center;
    margin-bottom: 8px;
    display: block;
}

.file-list--grid .file-download-btn {
    padding: 6px 12px;
    font-size: 12px;
    justify-content: center;
}


/* ============================================ */
/* ВИД: КОМПАКТНЫЙ                             */
/* ============================================ */

.file-list--compact .file-list-item {
    padding: 6px 10px;
    margin-bottom: 2px;
    gap: 8px;
    border-radius: 6px;
}

.file-list--compact .file-icon {
    font-size: 14px;
}

.file-list--compact .file-link {
    font-size: 13px;
    font-weight: 400;
}

.file-list--compact .file-size {
    font-size: 11px;
}

.file-list--compact .file-download-btn {
    padding: 3px 8px;
    font-size: 11px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.file-list--compact .file-list-item:hover .file-download-btn {
    opacity: 1;
}


/* ============================================ */
/* АДАПТИВ                                     */
/* ============================================ */

@media (max-width: 576px) {
    .file-list--grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .file-list--grid .file-icon {
        font-size: 32px;
    }

    .file-list--grid .file-list-item {
        min-height: 120px;
    }

    /* В списке — уменьшаем отступы */
    .file-list-item {
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: wrap;
    }
}


/* ========================================
   УВЕЛИЧЕНИЕ КАРТИНКИ ПРИ НАВЕДЕНИИ (РАБОЧАЯ ВЕРСИЯ)
   ======================================== */

.image-zoom-wrap {
    overflow: hidden !important;
    position: relative;
}

.image-zoom {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    will-change: transform;
}

/* Наведение на ссылку (обертка карточки) */
a:hover .image-zoom {
    transform: scale(1.1) !important;
}

/* Наведение на карточку */
.card:hover .image-zoom {
    transform: scale(1.1) !important;
}

/* Наведение на контейнер */
.image-zoom-wrap:hover .image-zoom {
    transform: scale(1.1) !important;
}

/* Универсальный селектор на всякий случай */
[class*="card"]:hover .image-zoom {
    transform: scale(1.1) !important;
}

/* ========================================
   ВСТРАИВАЕМЫЕ ВИДЕО
   ======================================== */

.video-embed-wrapper {
    margin: 1.5rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .video-embed iframe {
        height: 300px;
    }

    .video-embed-wrapper {
        padding: 0.25rem;
    }
}

/* ========================================
   COOKIE СОГЛАСИЕ (GDPR) - БАННЕР ВНИЗУ
   ======================================== */

.cookie-consent {
    position: fixed;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #1a1a2e !important;
    color: #fff !important;
    padding: 0.75rem 2rem !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
    z-index: 99999 !important;
    border-top: 2px solid rgba(255, 255, 255, 0.08) !important;
    display: none;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-text {
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
    min-width: 200px;
    color: #fff;
}

.cookie-text i {
    color: #fbbf24;
    font-size: 1.1rem;
}

.cookie-link {
    color: #60a5fa !important;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.cookie-link:hover {
    color: #93bbfc !important;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-buttons .btn-primary {
    background: #3b82f6 !important;
    border: none !important;
    padding: 0.4rem 1.2rem !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    transition: background 0.2s ease;
    color: #fff !important;
}

.cookie-buttons .btn-primary:hover {
    background: #2563eb !important;
}

.cookie-buttons .btn-outline-secondary {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #d1d5db !important;
    padding: 0.4rem 1.2rem !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    background: transparent !important;
    transition: all 0.2s ease;
}

.cookie-buttons .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* ========================================
   АДАПТИВ ДЛЯ COOKIE
   ======================================== */

@media (max-width: 768px) {
    .cookie-consent {
        padding: 0.6rem 1rem !important;
    }

    .cookie-consent-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .cookie-text {
        font-size: 0.8rem;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: flex-end;
    }

    .cookie-buttons .btn-primary,
    .cookie-buttons .btn-outline-secondary {
        padding: 0.3rem 1rem !important;
        font-size: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .cookie-consent {
        padding: 0.5rem 0.75rem !important;
    }

    .cookie-text {
        font-size: 0.7rem;
    }

    .cookie-buttons {
        gap: 0.3rem;
    }

    .cookie-buttons .btn-primary,
    .cookie-buttons .btn-outline-secondary {
        padding: 0.2rem 0.75rem !important;
        font-size: 0.7rem !important;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 1.5rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
}


/* =======================
Стили колонок
======================= */

.tiptap-columns {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
    margin: 1.5em 0;
}

.tiptap-column {
    position: relative;
    flex-basis: 0;
    /* 👈 то же, что в редакторе */
    flex-grow: 1;
    /* fallback */
    min-width: 0;
    /* 👈 ключевое — не даёт картинке диктовать ширину */
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.tiptap-column img {
    max-width: 100%;
    /* 👈 картинка не выходит за колонку */
    height: auto;
}

/* Адаптив: на мобильных — в столбик */
@media (max-width: 768px) {
    .tiptap-columns {
        flex-direction: column;
    }
}

.tiptap-column iframe,
.tiptap-column video,
.tiptap-column img,
.tiptap-column table {
    max-width: 100%;
}

.tiptap-column table td,
.tiptap-column table th {
    word-break: break-word;
    overflow-wrap: anywhere;
}


/* ============================================ */
/* ТАБЛИЦЫ В КОНТЕНТЕ                          */
/* ============================================ */

.tiptap-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 1.5em 0;
    -webkit-overflow-scrolling: touch;
}

.tiptap-table {
    --table-header-bg: #e9ecef;
    --table-border-color: #d0d7de;

    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0;
    background: #ffffff;
    font-size: 15px;
    min-width: 500px;
    border-radius: 8px;
    overflow: hidden;
}

.tiptap-table th,
.tiptap-table td {
    border: 1px solid var(--table-border-color);
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    color: #2d3436;
}

.tiptap-table th {
    background: var(--table-header-bg);
    font-weight: 600;
}

/* Zebra-полосы */
.tiptap-table--zebra tbody tr:nth-child(odd):not(:nth-child(1)) td {
    background: #fafbfc;
}

.tiptap-table p {
    margin: 0;
}

/* Компактный режим */
.tiptap-table--compact th,
.tiptap-table--compact td {
    padding: 4px 8px;
    font-size: 13px;
}

/* ================
Видео
================ */

.tiptap-youtube {
    margin: 1.5em 0;
    display: flex;
    justify-content: center;
}

.tiptap-youtube iframe {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.tiptap-math-inline {
    font-family: 'KaTeX_Main', serif;
    padding: 0 2px;
}

.tiptap-math-block {
    display: block;
    text-align: center;
    margin: 1.5em 0;
    font-family: 'KaTeX_Main', serif;
}


/* ============================================ */
/* ГАЛЕРЕЯ НА САЙТЕ */
/* ============================================ */

.tiptap-gallery {
    margin: 1.5em 0;
}

.tiptap-gallery__title {
    margin: 0 0 12px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #2d3436;
}

.tiptap-gallery__grid {
    display: grid;
    gap: 8px;
}

/* Отступы */
.tiptap-gallery--gap-small .tiptap-gallery__grid {
    gap: 4px;
}

.tiptap-gallery--gap-medium .tiptap-gallery__grid {
    gap: 8px;
}

.tiptap-gallery--gap-large .tiptap-gallery__grid {
    gap: 16px;
}

/* Стили картинок */
.tiptap-gallery__item {
    display: block;
    overflow: hidden;
    background: #f0f0f0;
}

.tiptap-gallery__item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tiptap-gallery__item:hover img {
    transform: scale(1.05);
}

/* Скругление */
.tiptap-gallery--rounded .tiptap-gallery__item {
    border-radius: 8px;
}

/* Тени */
.tiptap-gallery--shadow .tiptap-gallery__item {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tiptap-gallery--shadow .tiptap-gallery__item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ============================================ */
/* РАСКЛАДКА: GRID (равные квадраты) */
/* ============================================ */

.tiptap-gallery--grid .tiptap-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
}

.tiptap-gallery--grid.tiptap-gallery--cols-2 .tiptap-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
}

.tiptap-gallery--grid.tiptap-gallery--cols-3 .tiptap-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
}

.tiptap-gallery--grid.tiptap-gallery--cols-4 .tiptap-gallery__grid {
    grid-template-columns: repeat(4, 1fr);
}

.tiptap-gallery--grid .tiptap-gallery__item {
    aspect-ratio: 1 / 1;
}

/* ============================================ */
/* РАСКЛАДКА: MASONRY (плитка, разная высота) */
/* ============================================ */

.tiptap-gallery--masonry .tiptap-gallery__grid {
    display: block;
    column-count: 3;
    column-gap: 8px;
}

.tiptap-gallery--masonry.tiptap-gallery--gap-small .tiptap-gallery__grid {
    column-gap: 4px;
}

.tiptap-gallery--masonry.tiptap-gallery--gap-medium .tiptap-gallery__grid {
    column-gap: 8px;
}

.tiptap-gallery--masonry.tiptap-gallery--gap-large .tiptap-gallery__grid {
    column-gap: 16px;
}

.tiptap-gallery--masonry.tiptap-gallery--cols-2 .tiptap-gallery__grid {
    column-count: 2;
}

.tiptap-gallery--masonry.tiptap-gallery--cols-3 .tiptap-gallery__grid {
    column-count: 3;
}

.tiptap-gallery--masonry.tiptap-gallery--cols-4 .tiptap-gallery__grid {
    column-count: 4;
}

.tiptap-gallery--masonry .tiptap-gallery__item {
    display: block;
    break-inside: avoid;
    margin-bottom: 8px;
}

.tiptap-gallery--masonry.tiptap-gallery--gap-small .tiptap-gallery__item {
    margin-bottom: 4px;
}

.tiptap-gallery--masonry.tiptap-gallery--gap-medium .tiptap-gallery__item {
    margin-bottom: 8px;
}

.tiptap-gallery--masonry.tiptap-gallery--gap-large .tiptap-gallery__item {
    margin-bottom: 16px;
}

.tiptap-gallery--masonry .tiptap-gallery__item img {
    height: auto;
}

/* ============================================ */
/* РАСКЛАДКА: JUSTIFIED (по ширине) */
/* ============================================ */

.tiptap-gallery--justified .tiptap-gallery__grid {
    display: flex;
    flex-wrap: wrap;
}

.tiptap-gallery--justified .tiptap-gallery__item {
    flex: 1 1 auto;
    min-width: 150px;
}

.tiptap-gallery--justified .tiptap-gallery__item img {
    height: 220px;
    object-fit: cover;
}

/* ============================================ */
/* АДАПТИВ */
/* ============================================ */

@media (max-width: 768px) {

    .tiptap-gallery--grid.tiptap-gallery--cols-3 .tiptap-gallery__grid,
    .tiptap-gallery--grid.tiptap-gallery--cols-4 .tiptap-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tiptap-gallery--masonry.tiptap-gallery--cols-3 .tiptap-gallery__grid,
    .tiptap-gallery--masonry.tiptap-gallery--cols-4 .tiptap-gallery__grid {
        column-count: 2;
    }
}

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

    .tiptap-gallery--masonry .tiptap-gallery__grid {
        column-count: 1;
    }

    .tiptap-gallery--justified .tiptap-gallery__item img {
        height: 160px;
    }
}


/* ============================================ */
/* ДОКУМЕНТ */
/* ============================================ */

.document-empty {
    padding: 16px;
    text-align: center;
    color: #b2bec3;
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ---- ВЬЮЕР С ТАБАМИ ---- */

.document-viewer {
    margin: 1.5em 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.document-viewer__tabs {
    display: flex;
    background: #f6f8fa;
    border-bottom: 1px solid #e0e0e0;
}

.document-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: #636e72;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.document-tab:hover {
    color: #0984e3;
}

.document-tab.is-active {
    color: #0984e3;
    border-bottom-color: #0984e3;
}

.document-viewer__frame {
    background: #f8f9fa;
}

/* ---- ПРОСТОЙ ВЬЮЕР (для PDF) ---- */

.document-embed {
    margin: 1.5em 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.document-embed iframe {
    display: block;
    width: 100%;
    border: 0;
}

/* ---- ССЫЛКА СКАЧИВАНИЯ ПОД ВЬЮЕРОМ ---- */

.document-download-line {
    padding: 10px 14px;
    background: #f6f8fa;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    text-align: center;
}

.document-download-line a {
    color: #0984e3;
    text-decoration: none;
}

.document-download-line a:hover {
    text-decoration: underline;
}

.document-download-line strong {
    font-weight: 600;
}

/* ---- РЕЖИМ ССЫЛКИ ---- */

.document-link-block {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1em 0;
    padding: 10px 14px;
    background: #f0f8ff;
    border: 1px solid #cfe5ff;
    border-radius: 8px;
    flex-wrap: wrap;
}

.document-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0984e3;
    text-decoration: none;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.document-link:hover {
    text-decoration: underline;
}

.document-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #27ae60;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.document-download-btn:hover {
    background: #219a52;
}

.document-icon {
    font-size: 1.1em;
}

/* ---- Картинка-документ ---- */

.document-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 1.5em 0;
}


/* ============================================ */
/* ВКЛАДКИ */
/* ============================================ */

.tabs-wrapper {
    margin: 1.5em 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.tabs-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #f6f8fa;
    border-bottom: 1px solid #e0e0e0;
}

.tabs-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #636e72;
    transition: color 0.15s, background 0.15s;
    border-bottom: 2px solid transparent;
    font-family: inherit;
}

.tabs-tab:hover {
    color: #0984e3;
    background: #eef2f7;
}

.tabs-tab.is-active {
    color: #0984e3;
    border-bottom-color: #0984e3;
    background: #fff;
}

.tabs-body {
    position: relative;
}

.tab-panel {
    display: none;
    padding: 16px 20px;
    background: #fff;
}

.tab-panel.is-active {
    display: block;
}

/* ============================================ */
/* ТЕМЫ */
/* ============================================ */

.tabs-theme-dark {
    border-color: #2d3436;
}

.tabs-theme-dark .tabs-header {
    background: #2d3436;
    border-bottom-color: #1a1a1a;
}

.tabs-theme-dark .tabs-tab {
    color: #b2bec3;
}

.tabs-theme-dark .tabs-tab:hover {
    color: #fff;
    background: #3d4a4d;
}

.tabs-theme-dark .tabs-tab.is-active {
    color: #fff;
    background: #1a1a1a;
    border-bottom-color: #74b9ff;
}

.tabs-theme-dark .tab-panel {
    background: #1a1a1a;
    color: #dfe6e9;
}

.tabs-theme-blue {
    border-color: #0984e3;
}

.tabs-theme-blue .tabs-header {
    background: #e8f4fd;
    border-bottom-color: #cfe5ff;
}

.tabs-theme-blue .tabs-tab {
    color: #074b8a;
}

.tabs-theme-blue .tabs-tab:hover {
    background: #d4ebfc;
}

.tabs-theme-blue .tabs-tab.is-active {
    color: #0984e3;
    background: #fff;
    border-bottom-color: #0984e3;
}

/* ============================================ */
/* ФОРМЫ */
/* ============================================ */

.tabs-shape-sharp .tabs-tab {
    border-radius: 0;
}

.tabs-shape-rounded .tabs-header {
    padding: 6px 8px 0;
    gap: 4px;
}

.tabs-shape-rounded .tabs-tab {
    border-radius: 6px 6px 0 0;
}

.tabs-shape-pills .tabs-header {
    padding: 8px 12px;
    gap: 6px;
    border-bottom: none;
}

.tabs-shape-pills .tabs-tab {
    border-radius: 999px;
    border-bottom: none;
}

.tabs-shape-pills .tabs-tab.is-active {
    background: #0984e3;
    color: #fff;
}

.tabs-shape-pills.tabs-theme-dark .tabs-tab.is-active {
    background: #74b9ff;
    color: #1a1a1a;
}

/* Иконка в заголовке вкладки */
.tabs-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tabs-tab__icon {
    font-size: 13px;
    opacity: 0.85;
}

.tabs-tab.is-active .tabs-tab__icon {
    opacity: 1;
}

.tabs-tab__label {
    /* пусто — просто обёртка */
}


/* ============================================ */
/* ПОДПИСАННЫЙ ДОКУМЕНТ */
/* ============================================ */

.dsb-block {
    margin: 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dsb-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    flex-wrap: nowrap;
}

.dsb-icon-wrapper {
    position: relative;
    display: inline-flex;
    cursor: help;
    flex-shrink: 0;
}

.dsb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    transition: transform 0.2s;
}

.dsb-icon-wrapper:hover .dsb-icon {
    transform: scale(1.1);
}

.dsb-link-wrapper {
    flex: 1;
    min-width: 0;
}

.dsb-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 400;
    word-break: break-word;
    display: inline-block;
    max-width: 100%;
    line-height: 1.3;
    transition: color 0.2s;
}

.dsb-link:hover {
    color: #00a0d2;
    text-decoration: underline;
}

.dsb-download-wrapper {
    flex-shrink: 0;
}

.dsb-download {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.dsb-download:hover {
    opacity: 0.9;
}

/* ============================================ */
/* ТУЛТИП */
/* ============================================ */

.dsb-tooltip {
    display: none;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 280px;
    white-space: normal;
}

.dsb-icon-wrapper:hover .dsb-tooltip {
    display: block;
}

.dsb-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: currentColor transparent transparent transparent;
}

.dsb-tooltip-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.dsb-tooltip-icon {
    font-size: 20px;
    line-height: 1;
}

.dsb-tooltip-details {
    flex: 1;
}

.dsb-tooltip-details p {
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
}

.dsb-tooltip-details p:first-child {
    margin-top: 0;
}

.dsb-tooltip-details p:last-child {
    margin-bottom: 0;
}

.dsb-tooltip-details strong {
    color: #555;
    font-weight: 600;
}

/* ============================================ */
/* СПОЙЛЕР (DETAILS) — С АНИМАЦИЕЙ И ИКОНКАМИ  */
/* ============================================ */

.tiptap-details {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin: 1.5em 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: var(--details-content-bg, #ffffff);
    position: relative;
    transition: box-shadow 0.2s ease;
}

.tiptap-details:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ============================================ */
/* ЗАГОЛОВОК */
/* ============================================ */

.tiptap-details summary,
.tiptap-details .tiptap-details-summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    list-style: none;
    background: var(--details-bg, #f0f0f0) !important;
    color: var(--details-text, #2d3436) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: filter 0.2s ease;
    user-select: none;
    border-radius: 12px;
    position: relative;
}

.tiptap-details summary:hover,
.tiptap-details .tiptap-details-summary:hover {
    filter: brightness(0.96);
}

.tiptap-details summary::-webkit-details-marker {
    display: none;
}

/* ============================================ */
/* ИКОНКИ — разные стили                       */
/* ============================================ */

/* Своя иконка через ::before */
.tiptap-details summary::before,
.tiptap-details .tiptap-details-summary::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
    font-size: 14px;
    transition: transform 0.3s ease;
    opacity: 0.7;
    position: relative;
}

/* Треугольник ▼ */
.tiptap-details[data-icon-style="triangle"] summary::before {
    content: '▶';
    transform-origin: center;
}

.tiptap-details[data-icon-style="triangle"][open] summary::before,
.tiptap-details[data-icon-style="triangle"].is-open summary::before {
    transform: rotate(90deg);
}

/* Плюс/минус */
.tiptap-details[data-icon-style="plus"] summary::before {
    content: '+';
    font-size: 20px;
    font-weight: 400;
    line-height: 0.9;
}

.tiptap-details[data-icon-style="plus"][open] summary::before,
.tiptap-details[data-icon-style="plus"].is-open summary::before {
    content: '−';
}

/* Стрелка → */
.tiptap-details[data-icon-style="arrow"] summary::before {
    content: '→';
    font-size: 16px;
}

.tiptap-details[data-icon-style="arrow"][open] summary::before,
.tiptap-details[data-icon-style="arrow"].is-open summary::before {
    transform: rotate(90deg);
}

/* Шеврон › */
.tiptap-details[data-icon-style="chevron"] summary::before {
    content: '›';
    font-size: 22px;
    font-weight: 400;
    line-height: 0.8;
}

.tiptap-details[data-icon-style="chevron"][open] summary::before,
.tiptap-details[data-icon-style="chevron"].is-open summary::before {
    transform: rotate(90deg);
}

/* ============================================ */
/* ПОЗИЦИЯ ИКОНКИ                              */
/* ============================================ */

/* Иконка справа — обратный порядок */
.tiptap-details[data-icon-position="right"] summary {
    flex-direction: row-reverse;
}

.tiptap-details[data-icon-position="right"] summary::before {
    margin-left: 8px;
}

/* ============================================ */
/* СОДЕРЖИМОЕ — С АНИМАЦИЕЙ                    */
/* ============================================ */

.tiptap-details [data-type="detailsContent"],
.tiptap-details .tiptap-details-content {
    padding: 20px 24px;
    background: var(--details-content-bg, #ffffff) !important;
    color: var(--details-content-text, #2d3436) !important;
    line-height: 1.6;
    animation: detailsFadeIn 0.3s ease-out;
}

@keyframes detailsFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tiptap-details [data-type="detailsContent"] p,
.tiptap-details .tiptap-details-content p {
    color: inherit;
}

.tiptap-details .tiptap-details-content>*:first-child {
    margin-top: 0;
}

.tiptap-details .tiptap-details-content>*:last-child {
    margin-bottom: 0;
}

/* ============================================ */
/* ВЛОЖЕННЫЕ СПОЙЛЕРЫ                          */
/* ============================================ */

.tiptap-details .tiptap-details {
    margin: 1em 0;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    box-shadow: none;
}

.tiptap-details .tiptap-details summary {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 10px;
}

.tiptap-details .tiptap-details>div,
.tiptap-details .tiptap-details .tiptap-details-content {
    padding: 16px 20px;
}

/* ============================================ */
/* КНОПКА РАСКРЫТИЯ В АДМИНКЕ                  */
/* ============================================ */

.tiptap-details>button {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 0;
    color: transparent;
    overflow: hidden;
}

.tiptap-details>button:hover {
    background: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tiptap-details>button:active {
    transform: scale(0.95);
}

.tiptap-details>button svg,
.tiptap-details>button::after {
    display: none !important;
}

.tiptap-details>button::before {
    content: '▶';
    font-size: 12px;
    color: #2d3436;
    transition: transform 0.3s ease;
    display: block;
    line-height: 1;
}

.tiptap-details.is-open>button::before,
.tiptap-details[open]>button::before {
    transform: rotate(90deg);
}

/* ============================================ */
/* АДАПТИВ */
/* ============================================ */

@media (max-width: 768px) {
    .dsb-container {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .dsb-icon-wrapper {
        order: 1;
    }

    .dsb-download-wrapper {
        order: 2;
        margin-left: auto;
    }

    .dsb-link-wrapper {
        order: 3;
        width: 100%;
        margin-top: 5px;
    }

    .dsb-tooltip {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        top: auto;
        transform: none;
        width: auto;
        max-width: none;
    }

    .dsb-tooltip::after {
        display: none;
    }
}


/* ============================================ */
/* ЛЕНТА ПОСТОВ */
/* ============================================ */

.posts-feed {
    margin: 2em 0;
}

.posts-feed__title {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 1em 0;
    color: #2d3436;
}

/* Общие элементы */
.posts-feed__name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
    transition: color 0.2s ease;
}

.posts-feed__bento-card:hover .posts-feed__name,
.posts-feed__bento-main:hover .posts-feed__name {
    color: #74b9ff;
}

.posts-feed__list-item:hover .posts-feed__name {
    color: #0984e3;
}

.posts-feed__excerpt {
    font-size: 13px;
    color: #b2bec3;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.posts-feed__overlay .posts-feed__excerpt {
    color: rgba(255, 255, 255, 0.85);
}

/* Большая карточка — 3 строки анонса */
.posts-feed__bento-card.is-large .posts-feed__excerpt {
    -webkit-line-clamp: 3;
    font-size: 14px;
}

/* Маленькие карточки — 1 строка */
.posts-feed__bento-card:not(.is-large) .posts-feed__excerpt {
    -webkit-line-clamp: 1;
    font-size: 12px;
}

/* Bento-main — 3 строки */
.posts-feed__bento-main .posts-feed__excerpt {
    -webkit-line-clamp: 3;
}

.posts-feed__overlay {
    width: 100%;
    padding: 16px 18px;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.95) 0%,
            rgba(0, 0, 0, 0.75) 40%,
            rgba(0, 0, 0, 0.4) 75%,
            transparent 100%);
    color: #fff;
    transition: background 0.25s ease;
}

/* затемнение усиливается при наведении на карточку */
.posts-feed__bento-card:hover .posts-feed__overlay,
.posts-feed__bento-main:hover .posts-feed__overlay {
    background: linear-gradient(to top,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.85) 40%,
            rgba(0, 0, 0, 0.55) 75%,
            rgba(0, 0, 0, 0.1) 100%);
}

/* ============================================ */
/* BENTO */
/* ============================================ */

.posts-feed__bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.posts-feed__bento-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    min-height: 160px;
    text-decoration: none;
    transition: transform 0.2s;
}

.posts-feed__bento-card:hover {
    transform: translateY(-2px);
}

.posts-feed__bento-card.is-large {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 332px;
}

.posts-feed__bento-card.is-large .posts-feed__name {
    font-size: 20px;
}

/* ============================================ */
/* BENTO + LIST */
/* ============================================ */

.posts-feed__bento-wrap {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}

.posts-feed__bento-main {
    position: relative;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    min-height: 320px;
    text-decoration: none;
    transition: transform 0.2s;
}

.posts-feed__bento-main:hover {
    transform: translateY(-2px);
}

.posts-feed__bento-main .posts-feed__name {
    font-size: 20px;
}

.posts-feed__side {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============================================ */
/* LIST */
/* ============================================ */

.posts-feed__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.posts-feed__list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.posts-feed__list-item:hover {
    background: #f8f9fa;
}

.posts-feed__thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.posts-feed__thumb--empty {
    background: #f0f0f0;
}

.posts-feed__list-text {
    flex: 1;
    min-width: 0;
}

.posts-feed__list-item .posts-feed__excerpt {
    -webkit-line-clamp: 2;
    font-size: 12px;
    color: #b2bec3;
    margin-top: 2px;
}

/* ============================================ */
/* GRID */
/* ============================================ */

.posts-feed__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.posts-feed__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.posts-feed__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.posts-feed__card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}

.posts-feed__card-img--empty {
    background: #f0f0f0;
}

.posts-feed__card-body {
    padding: 14px;
}

.posts-feed__overlay .posts-feed__excerpt {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================ */
/* АДАПТИВ */
/* ============================================ */

@media (max-width: 1024px) {
    .posts-feed__bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .posts-feed__bento-card.is-large {
        grid-column: span 2;
    }

    .posts-feed__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .posts-feed__bento-grid {
        grid-template-columns: 1fr;
    }

    .posts-feed__bento-card.is-large {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 200px;
    }

    .posts-feed__bento-wrap {
        grid-template-columns: 1fr;
    }

    .posts-feed__grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================ */
/* ГРАДИЕНТЫ ДЛЯ КАРТОЧЕК БЕЗ КАРТИНКИ */
/* ============================================ */

.gradient-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.gradient-5 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.gradient-6 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.gradient-7 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.gradient-8 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

/* ============================================ */
/* ИНИЦИАЛ */
/* ============================================ */

.posts-feed__initial {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 56px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    user-select: none;
    pointer-events: none;
    line-height: 1;
}

.posts-feed__bento-card.is-large .posts-feed__initial,
.posts-feed__bento-main .posts-feed__initial {
    font-size: 96px;
}

/* Для grid — картинка становится контейнером с position: relative */
.posts-feed__card-img {
    position: relative;
    overflow: hidden;
}

/* Для list — маленький квадрат с буквой */
.posts-feed__thumb--initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

/* Серый placeholder больше не нужен, но можно оставить */
.posts-feed__thumb--empty {
    background: #f0f0f0;
}

.posts-feed__list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.posts-feed__list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(9, 132, 227, 0.3);
    transform: translateY(-2px);
}

.tiptap-html-block {
    margin: 1.5em 0;
}

/* ============================================
   ШИРИНА КОНТЕЙНЕРА
   ============================================ */
.container {
    max-width: 1600px;
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
}

@media (min-width: 1600px) {
    .container {
        max-width: 1700px;
    }
}


/* ============================================
   САЙДБАРЫ
   ============================================ */
.site-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Отступы между виджетами внутри сайдбара */
.site-sidebar>* {
    margin-bottom: 20px;
}

.site-sidebar>*:last-child {
    margin-bottom: 0;
}


.site-sidebar h5 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2d3436;
}


/* ============================================ */
/* ВЕРТИКАЛЬНОЕ МЕНЮ */
/* ============================================ */

.menu-vertical {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-vertical ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-vertical__item {
    position: relative;
    margin-bottom: 2px;
}

/* ============================================ */
/* ГЛАВНЫЕ ПУНКТЫ (level-0) — усиленные */
/* ============================================ */

.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__link,
.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__row {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 4px;
}

.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__link {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #2d3436;
}

.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__row>.menu-vertical__link {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #2d3436;
}

.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__link:hover,
.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__row:hover>.menu-vertical__link {
    color: #0984e3;
}

.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__row:hover {
    background: #eef4fd;
}

.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__link.active,
.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__row:has(.active) {
    background: #e1f0ff;
}

/* Убираем разделители — теперь фон и отступы */
.menu-vertical--level-0>.menu-vertical__item--bordered {
    border-bottom: none;
}

/* ============================================ */
/* СТРЕЛКА у главных */
/* ============================================ */

.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__row>.menu-vertical__arrow {
    width: 40px;
    color: #636e72;
}

.menu-vertical--level-0>.menu-vertical__item>.menu-vertical__row:hover>.menu-vertical__arrow {
    color: #0984e3;
}

/* ============================================ */
/* СТРОКА (для родительских) */
/* ============================================ */

.menu-vertical__row {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    transition: background 0.15s;
}

/* ============================================ */
/* ССЫЛКИ */
/* ============================================ */

.menu-vertical__link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    color: #2d3436;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    min-width: 0;
    transition: color 0.15s;
    border-radius: 8px;
}

.menu-vertical__link:hover {
    color: #0984e3;
}

.menu-vertical__link.active {
    color: #0984e3;
    font-weight: 600;
}

/* Простые пункты (не родительские) */
.menu-vertical__item>.menu-vertical__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    color: #2d3436;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.menu-vertical__item>.menu-vertical__link:hover {
    background: #f5f7fa;
    color: #0984e3;
}

.menu-vertical__item>.menu-vertical__link.active {
    color: #0984e3;
    font-weight: 600;
    background: #f0f8ff;
}

/* ============================================ */
/* СТРЕЛКА (общий стиль) */
/* ============================================ */

.menu-vertical__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #b2bec3;
    transition: color 0.15s;
    flex-shrink: 0;
    border-radius: 8px;
}

.menu-vertical__row:hover .menu-vertical__arrow {
    color: #0984e3;
}

.menu-vertical__arrow i {
    font-size: 11px;
    transition: transform 0.25s;
}

.menu-vertical__arrow[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* ============================================ */
/* ВЛОЖЕННОЕ МЕНЮ — сдвиг вправо */
/* ============================================ */

.menu-vertical__sub-wrapper {
    overflow: hidden;
    padding-left: 16px;
    /* 👈 сдвиг дочерних */
    margin-top: 2px;
    margin-bottom: 4px;
}

.menu-vertical__sub {
    list-style: none;
    padding: 4px 0 4px 12px;
    margin: 0;
    border-left: 2px solid rgba(9, 132, 227, 0.2);
}

.menu-vertical__sub .menu-vertical__item {
    margin-bottom: 0;
}

/* Дочерние пункты — чуть меньше и с отступом */
.menu-vertical--level-1>.menu-vertical__item>.menu-vertical__link,
.menu-vertical--level-1>.menu-vertical__item>.menu-vertical__row>.menu-vertical__link {
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 400;
    color: #636e72;
}

.menu-vertical--level-1>.menu-vertical__item>.menu-vertical__row {
    background: transparent;
    margin-bottom: 0;
}

.menu-vertical--level-1>.menu-vertical__item>.menu-vertical__row:hover {
    background: #f5f7fa;
}

.menu-vertical--level-1>.menu-vertical__item>.menu-vertical__link:hover {
    background: #f5f7fa;
}

/* Уровень 2 */
.menu-vertical--level-2>.menu-vertical__item>.menu-vertical__link,
.menu-vertical--level-2>.menu-vertical__item>.menu-vertical__row>.menu-vertical__link {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 400;
    color: #636e72;
}

/* Уровень 3 */
.menu-vertical--level-3>.menu-vertical__item>.menu-vertical__link,
.menu-vertical--level-3>.menu-vertical__item>.menu-vertical__row>.menu-vertical__link {
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 400;
    color: #7f8c8d;
}

/* Активный подпункт */
.menu-vertical__sub .menu-vertical__link.active {
    color: #0984e3;
    font-weight: 500;
}


/* ============================================ */
/* ИЗОБРАЖЕНИЕ — рамка, тень, подпись, выравнивание */
/* ============================================ */

.tiptap-image-link {
    display: inline-block;
    max-width: 100%;
}

.tiptap-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Рамка */
.tiptap-image--frame {
    border: 1px solid #e5e7eb;
    padding: 4px;
    background: #fff;
}

/* Тень */
.tiptap-image--shadow {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Картинка-ссылка: не открывается в лайтбоксе */
.tiptap-image-link--external {
    cursor: pointer;
    text-decoration: none;
}

.tiptap-image-link--external img {
    transition: opacity 0.15s;
}

.tiptap-image-link--external:hover img {
    opacity: 0.9;
}

/* ============================================ */
/* ВЫРАВНИВАНИЕ (без подписи)                  */
/* ============================================ */

.tiptap-image-wrap {
    margin: 1.5em 0;
}

.tiptap-image-wrap--left {
    text-align: left;
}

.tiptap-image-wrap--center {
    text-align: center;
}

.tiptap-image-wrap--right {
    text-align: right;
}


/* ============================================ */
/* ВЫРАВНИВАНИЕ (с подписью)                   */
/* ============================================ */

.tiptap-image-figure {
    margin: 1.5em 0;
}

.tiptap-image-figure--left {
    text-align: left;
}

.tiptap-image-figure--center {
    text-align: center;
}

.tiptap-image-figure--right {
    text-align: right;
}

.tiptap-image-figure .tiptap-image-link {
    display: inline-block;
}

/* Подпись */
.tiptap-image-caption {
    margin-top: 8px;
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    line-height: 1.5;
    padding: 0 12px;
    display: block;
    max-width: 100%;
}


/* ============================================ */
/* РАСПОЛОЖЕНИЕ ВКЛАДОК                         */
/* ============================================ */

/* Сверху (по умолчанию) — как сейчас */

/* Снизу */
.tabs-layout-bottom {
    display: flex;
    flex-direction: column-reverse;
}

.tabs-layout-bottom .tabs-header {
    border-bottom: none;
    border-top: 1px solid #e0e0e0;
}

.tabs-layout-bottom.tabs-shape-rounded .tabs-tab {
    border-radius: 0 0 6px 6px;
}

/* Слева — вертикальные вкладки */
.tabs-layout-left {
    display: flex;
    flex-direction: row;
}

.tabs-layout-left .tabs-header {
    flex-direction: column;
    flex-wrap: nowrap;
    border-bottom: none;
    border-right: 1px solid #e0e0e0;
    min-width: 180px;
    max-width: 260px;
}

.tabs-layout-left .tabs-tab {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    border-bottom: none;
    border-right: 2px solid transparent;
    border-radius: 0;
}

.tabs-layout-left .tabs-tab.is-active {
    border-right-color: var(--site-primary, #0984e3);
    border-bottom: none;
}

.tabs-layout-left .tabs-body {
    flex: 1;
    min-width: 0;
}

/* Для тёмной темы — левый layout */
.tabs-layout-left.tabs-theme-dark .tabs-header {
    border-right-color: #1a1a1a;
}

.tabs-layout-left.tabs-theme-dark .tabs-tab.is-active {
    border-right-color: #74b9ff;
}

/* Для синей темы */
.tabs-layout-left.tabs-theme-blue .tabs-header {
    border-right-color: #cfe5ff;
}

.tabs-layout-left.tabs-theme-blue .tabs-tab.is-active {
    border-right-color: #0984e3;
}


/* ============================================ */
/* АНИМАЦИЯ ПЕРЕКЛЮЧЕНИЯ КОНТЕНТА               */
/* ============================================ */

.tabs-body .tab-panel.is-active {
    display: block;
    animation: tabFadeIn 0.25s ease-out;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Уменьшаем анимацию для пользователей с настройкой "reduce motion" */
@media (prefers-reduced-motion: reduce) {
    .tabs-body .tab-panel.is-active {
        animation: none;
    }
}


/* ============================================ */
/* ФОРМА: КЛАССИЧЕСКИЕ (сверху закруглённые)    */
/* ============================================ */

.tabs-shape-classic .tabs-header {
    background: transparent;
    padding: 0;
    border-bottom: 1px solid #e0e0e0;
    gap: 4px;
}

.tabs-shape-classic .tabs-tab {
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid transparent;
    padding: 10px 20px;
    background: #f8f9fa;
    position: relative;
    margin-bottom: -1px;
}

.tabs-shape-classic .tabs-tab:hover {
    background: #eef2f7;
}

.tabs-shape-classic .tabs-tab.is-active {
    background: #fff;
    border-color: #e0e0e0;
    border-bottom-color: #fff;
    margin-bottom: -1px;
    z-index: 1;
}

/* Тёмная тема для классических */
.tabs-shape-classic.tabs-theme-dark .tabs-header {
    background: transparent;
    border-bottom-color: #1a1a1a;
}

.tabs-shape-classic.tabs-theme-dark .tabs-tab {
    background: #2d3436;
    color: #b2bec3;
}

.tabs-shape-classic.tabs-theme-dark .tabs-tab.is-active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
    border-bottom-color: #1a1a1a;
}

/* Синяя тема для классических */
.tabs-shape-classic.tabs-theme-blue .tabs-header {
    background: transparent;
    border-bottom-color: #cfe5ff;
}

.tabs-shape-classic.tabs-theme-blue .tabs-tab {
    background: #e8f4fd;
    color: #074b8a;
}

.tabs-shape-classic.tabs-theme-blue .tabs-tab.is-active {
    background: #fff;
    color: #0984e3;
    border-color: #cfe5ff;
    border-bottom-color: #fff;
}


/* ============================================ */
/* СКРОЛЛ ДЛЯ ДЛИННЫХ СПИСКОВ ВКЛАДОК           */
/* ============================================ */

.tabs-header {
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.tabs-header::-webkit-scrollbar {
    height: 4px;
}

.tabs-header::-webkit-scrollbar-track {
    background: transparent;
}

.tabs-header::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.tabs-header::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Для левого layout — скролл вертикальный */
.tabs-layout-left .tabs-header {
    overflow-x: visible;
    overflow-y: auto;
    max-height: 500px;
    scrollbar-width: thin;
}

.tabs-layout-left .tabs-header::-webkit-scrollbar {
    width: 4px;
    height: auto;
}


/* ============================================ */
/* АДАПТИВ                                      */
/* ============================================ */

@media (max-width: 768px) {

    /* На мобильном — левый layout становится верхним */
    .tabs-layout-left {
        flex-direction: column;
    }

    .tabs-layout-left .tabs-header {
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        min-width: 0;
        max-width: none;
    }

    .tabs-layout-left .tabs-tab {
        width: auto;
        border-right: none;
        border-bottom: 2px solid transparent;
    }

    .tabs-layout-left .tabs-tab.is-active {
        border-right-color: transparent;
        border-bottom-color: var(--site-primary, #0984e3);
    }
}


/* ============================================ */
/* ВИДЕО (YouTube / VK / Rutube) в редакторе    */
/* ============================================ */

.ProseMirror .tiptap-youtube {
    margin: 1.5em auto;
    max-width: 100%;
    position: relative;
}

/* Соотношение сторон через padding-hack */
.ProseMirror .tiptap-youtube::before {
    content: '';
    display: block;
    padding-bottom: 56.25%;
    /* 16:9 */
}

.ProseMirror .tiptap-youtube[style*="--video-aspect: 9:16"]::before {
    padding-bottom: 177.78%;
    /* 9:16 */
}

.ProseMirror .tiptap-youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    border-radius: inherit;
}

/* Тень */
.ProseMirror .tiptap-youtube--shadow {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Подпись */
.ProseMirror .tiptap-video-figure {
    margin: 1.5em auto;
}

.ProseMirror .tiptap-video-caption {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    font-style: italic;
}

/* Выделение при клике — рамка вокруг видео */
.ProseMirror .tiptap-youtube.ProseMirror-selectednode {
    outline: 2px solid #0984e3;
    outline-offset: 4px;
}