/* ==========================================
   1. БАЗОВЫЕ НАСТРОЙКИ СЕТКИ (GRID)
   ⚠️ ВАЖНО: Bootstrap 5 уже содержит все необходимые
   отступы для .container, .container-fluid, .row и .col-*.
   Мы НЕ переопределяем padding/margin, чтобы сохранить
   нативный ритм сетки и избежать конфликтов с ядром BS.
   ========================================== */

/* ==========================================
   2. КОНТЕНТ ЗАПИСИ (SINGLE POST CONTENT)
   Вертикальный ритм для блоков the_content()
   ========================================== */
.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.post-content p,
.post-content ul,
.post-content ol {
    margin-bottom: 1em;
}

.post-content img {
    border-radius: 0.5rem; /* Эквивалент Bootstrap .rounded-3 */
}

/* ==========================================
   3. САЙДБАР И ВИДЖЕТЫ (SIDEBAR & WIDGETS)
   Адаптация стандартных виджетов WP под стиль BS5
   ========================================== */
.widget-area .widget {
    margin-bottom: 1.5rem; /* Единый отступ между виджетами */
}

.widget-area .widget-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.widget-area ul {
    list-style: none;
    padding-left: 0; /* Убираем стандартный отступ списка */
}

.widget-area ul li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.widget-area ul li:last-child {
    border-bottom: none;
}

.widget-area a {
    text-decoration: none;
    color: var(--bs-body-color);
}

.widget-area a:hover {
    color: var(--bs-primary);
}

/* ==========================================
   4. GUTENBERG: ВЫРАВНИВАНИЯ БЛОКОВ (ALIGNS)
   Позволяют блокам выходить за пределы .container
   ========================================== */
.entry-content .wp-block.alignwide {
    max-width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
}

.entry-content .wp-block.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* Предотвращаем горизонтальный скролл при alignfull */
body,
.entry-content {
    overflow-x: hidden;
}

/* ==========================================
   5. CSS-ПЕРЕМЕННЫЕ (SYNC GUTENBERG ↔ BOOTSTRAP)
   Связываем палитру WP (theme.json) с классами BS5
   ========================================== */
:root {
    --bs-primary: var(--wp--preset--color--primary);
    --bs-secondary: var(--wp--preset--color--secondary);
    --bs-success: var(--wp--preset--color--success);
    --bs-danger: var(--wp--preset--color--danger);
    --bs-warning: var(--wp--preset--color--warning);
    --bs-info: var(--wp--preset--color--info);
    --bs-light: var(--wp--preset--color--light);
    --bs-dark: var(--wp--preset--color--dark);
    --bs-body-bg: var(--wp--preset--color--body);
    --bs-body-color: var(--wp--preset--color--body-text);
}

/* ==========================================
   6. КАСТОМНЫЕ УТИЛИТЫ (CUSTOM HELPERS)
   ========================================== */
.vt-img-16-9 img {
    object-fit: cover;
    aspect-ratio: 16 / 9;
    width: 100%;
    max-width: 100%;
}