/*
Theme Name: BalticVoice.ru Material Final
Text Domain: bv
Version: 1.1
*/

/* ============================================================
   1. ПЕРЕМЕННЫЕ
   ============================================================ */
:root {
    --bg-main: #ffffff;
    --separator: rgb(248, 247, 252);
    --text-dark: #222222;
    --text-light: #555555;
    --accent: #6200ee;
    --accent2: #008bee;
    --fira: 'Fira Sans', sans-serif;
    --lora: 'Lora', serif;
    --primary-font: 'Fira Sans', sans-serif;
    --secondary-font: 'Lora', serif; /* Для заголовков и лид-абзацев */
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-main);
    margin: 0;
    padding: 0;
    font-family: var(--lora);
    font-size: 16.8px;
    line-height: 26.88px;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   2. ТИПОГРАФИКА
   ============================================================ */
h1, h2, h3, h4, h5, h6,
.site-logo,
.nav-links a,
.search-input-full,
.sidebar-title,
.sidebar-post-title,
.main-pagination a,
.main-pagination span,
.tag-link,
.widget-title {
    font-family: var(--fira) !important;
    font-weight: 600 !important;
}

/* Плавный переход для всех ссылок */
a {
    transition: color 0.2s ease-in-out;
}

/* Хлебные крошки */
.breadcrumb {
    font-size: 11px;
    color: #ccc;
}

.breadcrumb a {
    font-size: 11px;
    font-weight: 300;
    color: var(--accent2);
}

/* ============================================================
   3. ДЛЯ СКРИНРИДЕРОВ И SKIP-LINK
   ============================================================ */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    word-wrap: normal !important;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 10px;
    z-index: 100000;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border-radius: 0 0 4px 4px;
    font-family: var(--fira);
    font-size: 14px;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

/* ============================================================
   4. СЕТКА (750px контент + 320px сайдбар)
   ============================================================ */
.main-layout {
    display: grid;
    grid-template-columns: minmax(0, 750px) 320px;
    max-width: 1140px;
    margin: 40px auto;
    gap: 70px;
    padding: 0 20px;
}

.content-area {
    min-width: 0;
    overflow: hidden; /* Гарантирует, что ничего не вылезет */
}

.sidebar-area { width: 320px; }

/* ============================================================
   5. ХЕДЕР И ВЫЕЗЖАЮЩИЙ ПОИСК
   ============================================================ */
.main-header {
    border-bottom: 1px solid var(--separator);
    height: 70px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #f0f5f7;
}

.header-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.site-logo { font-size: 24px; text-decoration: none; color: #000; text-transform: uppercase; }

.nav-links { display: flex; list-style: none; gap: 25px; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: #000; text-transform: uppercase; font-size: 14px; }

/* Состояния поиска */
#search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #fff;
    display: none;
    align-items: center;
    z-index: 1100;
    padding: 0 20px;
}

#search-overlay.is-active { display: flex; }

.search-form-fullscreen {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
}

.search-input-full {
    flex-grow: 1;
    border: none;
    font-size: 18px;
    padding: 10px 20px;
    outline: none;
}

.search-trigger, .search-close, .menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.menu-toggle { display: none; } /* Скрыт на десктопе */

/* ============================================================
   6. ГЛАВНАЯ: СПИСОК ПОСТОВ
   ============================================================ */
.post-item-list {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    padding: 30px 0 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    clear: both;
}

.post-item-image {
    flex: 0 0 200px; /* Фиксированная ширина колонки для фото */
    height: 155px;   /* Фиксированная высота для всех фото в ленте */
    overflow: hidden;
    border-radius: 4px;
}

.post-item-image a {
    display: block;
    overflow: hidden;
    border-radius: 4px;
}

.post-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Фото заполнит блок, лишнее обрежется */
    object-position: center;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease !important;
}

.post-item-image:hover img {
    filter: brightness(1.05);
    transform: scale(1.03);
}

.post-item-content h2 { margin: 0 0 10px 0; font-size: 24px; line-height: 1.2; }

/* Заголовок: меняет цвет только при наведении на него самого */
.post-item-list .post-item-content h2 a {
    color: var(--text-dark);
    text-decoration: none !important;
    transition: color 0.2s ease-in-out !important;
}

.post-item-list .post-item-content h2 a:hover {
    color: #0077CC !important;
}

.entry-excerpt {
    color: var(--text-light);
}

/* ============================================================
   7. HERO-СЕТКА ГЛАВНОЙ (1 большая + 2featured)
   ============================================================ */
.vd-hero-section-wrapper {
    background-color: #f9fbff !important;
    padding: 25px;
    margin-bottom: 35px;
    border-radius: 4px;
    border: 1px solid #eef4f9;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* Сбрасываем flex-layout для постов внутри Hero */
.vd-hero-section-wrapper .post-item-list {
    display: block !important;
    border-bottom: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Первый пост: на всю ширину и с разделителем снизу */
.vd-hero-section-wrapper .vd-hero-post {
    grid-column: 1 / -1;
    border-bottom: 1px solid #e1eff7 !important;
    padding-bottom: 25px !important;
    margin-bottom: 5px !important;
}

/* Исправляем картинки: отменяем 200x155px из ленты */
.vd-hero-section-wrapper .post-item-image {
    width: 100% !important;
    height: auto !important;
    flex: none !important;
    margin-bottom: 15px;
}

.vd-hero-post .post-item-image img {
    height: 380px !important;
    width: 100% !important;
    object-fit: cover;
}

.vd-featured-post .post-item-image img {
    height: 200px !important;
    width: 100% !important;
    object-fit: cover;
}

/* Типографика Hero */
.vd-hero-post .post-item-content h2 {
    font-size: 28px !important;
    margin-bottom: 10px !important;
}

.vd-featured-post .post-item-content h2 {
    font-size: 20px !important;
}

.vd-hero-section-wrapper .entry-excerpt {
    font-size: 15px !important;
    line-height: 1.5;
    color: var(--text-light);
}

/* Стандартный список после Hero */
.vd-standard-post .post-item-content h2 {
    font-size: 19px !important;
    line-height: 1.15 !important;
    margin-bottom: 6px !important;
    letter-spacing: -0.2px;
}

.vd-standard-post .entry-excerpt {
    font-family: var(--lora) !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: #444 !important;
}

.post-item-list.vd-standard-post {
    padding: 20px 0 25px !important;
    margin-bottom: 25px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    gap: 20px !important;
}

/* Убираем лишний отступ у последнего поста перед пагинацией */
.vd-standard-post:last-of-type {
    border-bottom: none !important;
}

/* ============================================================
   8. ТЕГИ-КНОПКИ
   ============================================================ */
.post-tags-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--separator);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-link {
    background-color: rgb(248, 247, 252) !important;
    color: var(--text-dark) !important;
    padding: 8px 18px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center;
    border: 1px solid rgb(235, 235, 245);
    transition: all 0.2s ease;
}

.tag-link:hover {
    background-color: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent);
}

/* ============================================================
   9. СТРАНИЦА ЗАПИСИ (SINGLE)
   ============================================================ */
.news-post {
    max-width: 100%;
    margin-bottom: 3rem;
}

.entry-title {
    font-size: 2.2em;
    line-height: 1.2;
    margin-bottom: 20px;
    font-family: var(--secondary-font);
    font-weight: 700;
}

.post-main-image { margin-bottom: 25px; }
.post-main-image img { width: 100%; height: auto; border-radius: 4px; }

.post-date {
    color: #888;
    font-family: var(--secondary-font);
    font-size: 11px;
    margin-bottom: 10px;
}

/* Плашка-подпись поверх фото в тексте (генерируется темой) */
.image-caption {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);       /* Полупрозрачный чёрный фон */
    backdrop-filter: blur(4px);            /* Эффект матового стекла */
    -webkit-backdrop-filter: blur(4px);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--lora);
    font-size: 14px;
    font-style: italic;
    line-height: 1.2;
    pointer-events: none;                  /* Не мешает кликать по ссылке-картинке */
    z-index: 10;
    max-width: 95%;
    text-align: right;
    overflow-wrap: anywhere;               /* Длинные подписи переносятся, а не уезжают за экран */
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

/* У фигур с подписью плашка чуть выше */
figcaption.image-caption { bottom: 15px; }

.post-inline-image:hover .image-caption { opacity: 1; }

.cap-sep {
    opacity: 0.5;
    margin: 0 4px;
    font-weight: 300;
}

.img-source { opacity: 0.9; margin-left: 5px; }
.cap-text { display: inline-block; }

/* Лид-абзац статьи — полужирный */
.entry-content p:first-of-type {
    font-weight: 600;
    font-size: 1em;
    color: #1f201d;
    line-height: 1.5;
    font-family: var(--lora);
}

/* ============================================================
   10. САЙДБАР
   ============================================================ */
.sidebar-widget { margin-bottom: 45px; }

.sidebar-title {
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    margin-bottom: 20px;
    font-size: 16px;
    text-transform: uppercase;
}

.sidebar-small-post { display: flex; gap: 15px; text-decoration: none; color: inherit; margin-bottom: 20px; }

.sidebar-thumb { flex-shrink: 0; width: 65px; height: 65px; border-radius: 4px; overflow: hidden; }
.sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-post-title {
    font-size: 0.9em;
    line-height: 1.3em;
}

/* ============================================================
   11. ПАГИНАЦИЯ
   ============================================================ */
.main-pagination {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.main-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #e1eff7;
    color: #333;
    font-family: 'Fira Sans', sans-serif;
    font-size: 15px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Стили для стрелок */
.main-pagination .prev,
.main-pagination .next {
    font-size: 18px;
    font-weight: bold;
    color: rgb(0, 122, 255);
}

/* Активная страница и ховер */
.main-pagination .page-numbers:hover {
    border-color: #0077CC !important;
    color: #0077CC !important;
    background-color: rgb(229, 246, 255);
}

.main-pagination .current {
    background-color: #0077CC !important;
    border-color: #0077CC !important;
    color: #ffffff !important;
}

/* ============================================================
   12. КНОПКА «НАВЕРХ»
   ============================================================ */
#backToTop {
    display: none; /* Скрыта по умолчанию */
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    width: 45px;
    height: 45px;
    border: none;
    outline: none;
    background-color: #0077CC;
    color: white;
    cursor: pointer;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#backToTop:hover {
    background-color: #0055aa;
    transform: translateY(-50%) scale(1.1);
}

/* Стрелка внутри кнопки */
.arrow-up {
    border: solid white;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(-135deg);
    -webkit-transform: rotate(-135deg);
    margin-top: 5px;
}

/* ============================================================
   13. МОБИЛЬНАЯ ШТОРКА МЕНЮ
   ============================================================ */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -320px; /* Скрыта слева */
    width: 300px;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transition: all 0.3s ease;
    padding: 30px 20px;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}

.mobile-drawer.is-active { left: 0; }

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 9998;
}

.mobile-drawer-overlay.is-active { display: block; }

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.mobile-nav-links { list-style: none; padding: 0; }
.mobile-nav-links li { margin-bottom: 20px; }
.mobile-nav-links a { text-decoration: none; color: #000; font-family: var(--fira); font-weight: 600; font-size: 18px; }

/* ============================================================
   14. ФУТЕР
   ============================================================ */
.site-footer {
    background-color: #f0f5f7;
    padding: 60px 0;
    margin-top: 60px;
    color: var(--text-dark);
}

.footer-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Контент в левой колонке, как в исходнике */
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 60px;
}

.footer-description { margin: 20px 0; font-size: 15px; color: var(--text-light); }

.footer-legal-blocks { margin-top: 30px; }
.legal-item { font-size: 14px; margin: 10px 0; }
.tiny-text { font-size: 14px; color: var(--text-light); line-height: 1.4; }

.footer-separator { height: 1px; background: rgba(0,0,0,0.1); margin: 15px 0; }

.footer-copyright-block { font-size: 13px; color: var(--text-light); }
.footer-copyright-block a { color: inherit; text-decoration: underline; }

.footer-partners {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 15px;
    font-size: 13px;
}
.footer-partners img {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.footer-partners a { text-decoration: none; color: inherit; }
.footer-partners a:hover { text-decoration: underline; }
.footer-partners .sep { color: #ccc; margin: 0 5px; }

/* ============================================================
   15. СТРАНИЦЫ ПОИСКА И АРХИВОВ
   ============================================================ */
.page-header {
    border-bottom: 1px solid var(--separator);
    padding-bottom: 15px;
    margin: 0 0 30px;
}

.page-title {
    font-family: var(--secondary-font);
    font-size: 28px;
    text-transform: uppercase;
    margin: 0;
    padding-bottom: 5px;
    letter-spacing: -0.5px;
}

.archive-description {
    max-width: 750px;
    margin: 10px 0 30px;
    line-height: 1.5;
    font-family: var(--primary-font);
    font-size: 15px;
    font-style: italic;
    color: #666;
}

.search-results .post-item-list {
    border-color: var(--separator);
}

.archive-item {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--separator);
    padding-bottom: 20px;
    display: flex;
    gap: 20px;
}
.archive-item .post-item-image { flex: 0 0 200px; }
.archive-item .post-item-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}
.archive-item .post-item-content { flex: 1; }
.archive-item .entry-title {
    margin: 0 0 10px 0;
    font-family: var(--secondary-font);
    font-size: 1.3rem;
}
.archive-item .entry-title a {
    text-decoration: none;
    color: #222;
}
.archive-item .post-date {
    margin-top: 12px;
    font-family: var(--secondary-font);
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
}

.archive-pagination {
    font-family: var(--secondary-font);
    margin-top: 40px;
    display: flex;
    gap: 10px;
}
.archive-pagination a, .archive-pagination span {
    padding: 8px 12px;
    background: var(--separator);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
}

/* ============================================================
   16. ТАБЛИЦЫ
   ============================================================ */
.wp-block-table {
    border-radius: 12px;
    border: 1px solid #e0e6ed;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin: 35px 0;
    background: #fff;
    display: block;
    overflow-x: auto; /* Для мобильных */
    font-family: "Fira Sans";
}

.wp-block-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.wp-block-table th {
    background-color: #f8fafd;
    color: #8898aa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #e0e6ed;
}

.wp-block-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 15px;
    color: #32325d;
}

.wp-block-table tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   17. ВИДЕО
   ============================================================ */
.entry-content iframe,
.entry-content object,
.entry-content embed,
.wp-block-embed {
    max-width: 100%; /* Видео никогда не выйдет за границы текста */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Фикс для блоков Gutenberg (YouTube, Vimeo) */
.wp-block-embed-youtube,
.wp-block-embed {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.wp-block-embed__wrapper {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* Соотношение сторон 16:9 */
    height: 0;
    overflow: hidden;
}

.wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wp-block-video {
    width: 100% !important;
    max-width: 100% !important;
    margin: 30px 0;
    box-sizing: border-box;
}

.wp-block-video video {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: block;
}

.wp-block-video figcaption {
    margin-top: 12px;
    font-size: 13px;
    color: #8898aa;
    text-align: center;
    font-style: italic;
    font-family: 'Fira Sans', sans-serif;
}

/* ============================================================
   18. ФОТО И ГАЛЕРЕИ
   ============================================================ */
/* Общая подпись WP под медиа */
figcaption {
    font-family: var(--lora);
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
    margin: 12px 0 30px 0;
    font-style: italic;
}

figure {
    margin: 10px 0 !important;
}

/* Исправление для всех изображений в контенте */
.entry-content img,
.wp-block-image img,
.wp-block-image {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-block-image img {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.wp-block-image figcaption {
    font-size: 13px;
    color: #8898aa;
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* Картинки, обёрнутые темой в figure.post-inline-image */
.post-inline-image {
    position: relative;
    margin: 20px 0;
    display: inline-block;
    line-height: 0;
    vertical-align: top;
}

.post-inline-image a {
    display: block;
    line-height: 0;
}

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

/* Контейнер галереи */
.wp-block-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0 !important;
    padding: 0 !important;
    list-style-type: none !important;
}

/* Элементы галереи (фигуры) */
.wp-block-gallery .wp-block-image {
    margin: 0 !important;
    flex-grow: 1;
    width: calc(33.33% - 15px);
    position: relative; /* Чтобы подпись позиционировалась относительно фото */
}

.wp-block-gallery figure img {
    width: 100% !important;
    height: 250px !important; /* Фиксированная высота для ровной сетки */
    object-fit: cover !important;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.wp-block-gallery figure img:hover {
    transform: scale(1.02);
}

/* Подпись поверх фото в галерее */
.wp-block-gallery .wp-block-image figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 !important;
    padding: 20px 10px 10px !important;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #ffffff !important;
    font-size: 12px !important;
    text-align: center;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wp-block-gallery .wp-block-image:hover figcaption {
    opacity: 1;
}

/* ============================================================
   19. БЛОК «ЧИТАЙТЕ ТАКЖЕ»
   ============================================================ */
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.related-item {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.related-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #d1e7ff;
    cursor: pointer;
}

.related-item a {
    text-decoration: none;
    color: inherit;
}

.related-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background-color: #f0f0f0;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.related-item:hover .related-thumb img {
    transform: scale(1.05);
}

.related-post-title {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.related-item:hover .related-post-title {
    color: #0088cc;
}

/* ============================================================
   20. УНИВЕРСАЛЬНАЯ TELEGRAM-ФОРМА (страницы)
   ============================================================ */
.vd-tg-form-wrapper {
    background: #f7fcff;
    color: #333;
    padding: 25px;
    border-radius: 12px;
    font-family: inherit;
    margin: 20px 0;
    border: 1px solid #e1e8ed;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.vd-tg-form-wrapper h3 {
    margin-top: 0;
    color: #2c3e50 !important;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.vd-tg-form-wrapper input[type="text"],
.vd-tg-form-wrapper input[type="email"],
.vd-tg-form-wrapper textarea {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

.vd-tg-form-wrapper input:focus,
.vd-tg-form-wrapper textarea:focus {
    border-color: #e67e22;
    outline: none;
}

.vd-tg-form-wrapper .form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.vd-tg-form-wrapper .form-col {
    flex: 1;
    min-width: 200px;
}

.vd-tg-form-wrapper .file-upload {
    margin-bottom: 15px;
    font-size: 0.9em;
}

.vd-tg-form-wrapper .file-upload label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.vd-tg-form-wrapper .form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.vd-tg-form-wrapper .privacy-note {
    font-size: 0.78em;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.4;
    max-width: 70%;
}

.vd-tg-form-wrapper .submit-btn {
    background: #e67e22;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.vd-tg-form-wrapper .submit-btn:hover {
    background: #d35400;
    transform: translateY(-1px);
}

.vd-tg-form-wrapper .success-msg {
    background: #eafaf1;
    border: 1px solid #27ae60;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #27ae60;
}

/* Кнопка Material на фоне футера (страницы) */
.footer-feedback-btn.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: #1976d2 !important;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    letter-spacing: 0.8px;
    border-radius: 4px;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-feedback-btn.md-btn:hover {
    background-color: #f0f7ff;
    box-shadow: 0 5px 12px rgba(25, 118, 210, 0.15);
    transform: translateY(-2px);
}

.footer-feedback-btn.md-btn:active {
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    transform: translateY(0);
}

/* Гутенберг: блоки с фоном */
.has-background { padding: 10px !important; }

/* Рекламный блок: защита от прыжков вёрстки */
.yandex-ad-block {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================================
   21. МЕДИА-ЗАПРОСЫ (собраны в конец файла — раньше были
   размазаны по коду и перебивались базовыми стилями ниже:
   на 769–900px исчезало всё меню, на планшетах сетка
   переполняла экран)
   ============================================================ */

/* Планшеты: сайдбар уходит вниз */
@media (max-width: 1024px) {
    .main-layout { grid-template-columns: 1fr; max-width: 800px; }
    .sidebar-area { width: 100%; }
}

/* До 900px: гамбургер вместо верхнего меню */
@media (max-width: 900px) {
    .desktop-nav { display: none; }
    .menu-toggle { display: flex; }

    .footer-container { grid-template-columns: 1fr; gap: 40px; margin: 0 auto; }

    /* Hero в одну колонку */
    .vd-hero-section-wrapper {
        grid-template-columns: 1fr;
        padding: 15px;
    }
}

/* Полная мобильная адаптация (850px и ниже) */
@media (max-width: 850px) {
    .main-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 15px !important;
        box-sizing: border-box !important;
    }

    /* Контент (Hero + Список) — ПЕРВЫЙ */
    .content-area {
        order: 1 !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* Сайдбар — ВТОРОЙ (после всех новостей) */
    .sidebar-area {
        order: 2 !important;
        width: 100% !important;
        margin-top: 50px !important;
        padding-top: 30px;
        border-top: 2px solid #f0f0f0;
    }

    /* Hero-блок: от края до края экрана */
    .vd-hero-section-wrapper {
        display: block !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        padding: 20px 20px !important;
        background-color: #f9fbff !important;
        border-top: 1px solid #eef4f9 !important;
        border-bottom: 1px solid #eef4f9 !important;
        box-sizing: border-box !important;
        border-radius: 0 !important;
    }

    .vd-hero-section-wrapper .post-item-image {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 15px !important;
    }

    .vd-hero-section-wrapper .post-item-image img {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover;
        border-radius: 4px;
    }

    .vd-hero-section-wrapper .post-item-list {
        display: block !important;
        margin-bottom: 25px !important;
        padding-bottom: 20px !important;
        border-bottom: 1px solid #e1eff7 !important;
    }

    .vd-hero-section-wrapper .post-item-content {
        padding: 0 5px !important;
    }

    /* Обычные посты под Hero */
    .post-item-list.vd-standard-post {
        flex-direction: column !important; /* Фото над текстом */
        padding: 20px 0 !important;
    }

    .post-item-list.vd-standard-post .post-item-image {
        width: 100% !important;
        height: 200px !important;
        margin-bottom: 15px;
    }

    /* Заголовок записи */
    .entry-title {
        font-size: 24px !important;
        line-height: 1.2 !important;
        margin-bottom: 15px !important;
        padding: 0 5px !important;
    }

    /* Уменьшаем отступ шапки, чтобы контент был выше */
    .main-header {
        padding: 5px 0 !important;
    }
}

/* Узкие экраны (768px и ниже) */
@media (max-width: 768px) {
    /* Лента: фото над текстом */
    .post-item-list { flex-direction: column; }
    .post-item-image { flex: 0 0 auto; width: 100%; height: 200px; }

    /* Галереи: 2 колонки */
    .wp-block-gallery .wp-block-image { width: calc(50% - 15px); }
    .wp-block-gallery figure img { height: 180px !important; }

    /* Лид-абзац чуть компактнее */
    .entry-content p:first-of-type {
        font-size: 1.05em;
        line-height: 1.4;
        margin-bottom: 15px;
    }

    /* «Читайте также» в одну колонку */
    .related-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .related-post-title { font-size: 18px; }

    .footer-feedback-btn.md-btn {
        display: flex;
        width: 100%;
        max-width: 300px;
        margin: 10px auto;
    }
}

/* Совсем маленькие экраны */
@media (max-width: 600px) {
    .vd-standard-post .post-item-content h2 { font-size: 18px !important; }
}

@media (max-width: 480px) {
    /* Галереи в одну колонку */
    .wp-block-gallery .wp-block-image { width: 100%; }
}
