/* blog-glue.css — minimal shim for Winter CMS blog */

/* Horizontal scroll for wide tables in articles */
.mgd-blog-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5em;
}

/* Заголовок блога над слайдером на главной */
.mgd-bloghome-title { margin: 4px 0 22px; }

/* Отступ снизу у блока «Содержание» в статье */
.entry-content .table-of-contents,
.table-of-contents { margin-bottom: 28px; }

/* Slider pagination dots */
.js-swiper-home-pagination {
    bottom: 16px;
}

/* ── Слайдер главной: клиппинг + позиции стрелок ──────────────────────────
   loop:true дублирует слайды; без overflow:hidden они (и стрелка next)
   вылезают за левый край экрана. Загруженный swiper CSS обрезает `.swiper`,
   но наша разметка — `.swiper-container`, поэтому клиппим явно. */
.js-swiper-home {
    position: relative;
    overflow: hidden;
}
.js-swiper-home .swiper-button-prev,
.js-swiper-home .swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    width: 44px;
    height: 44px;
    z-index: 10;
    color: #fff;
    cursor: pointer;
}
.js-swiper-home .swiper-button-prev { left: 16px; right: auto; }
.js-swiper-home .swiper-button-next { right: 16px; left: auto; }

/* Заголовки категорий на главной — крупнее (жёстко, т.к. WP перебивает,
   и размер задаётся на вложенной ссылке) */
.section-block__title,
.section-block__title a {
    font-size: 34px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
}
.section-block__title a { color: inherit; text-decoration: none; }
.section-block__title a:hover { opacity: .85; }

/* "Все статьи" link in section headers */
.section-block__more {
    font-size: 0.875rem;
    margin-left: auto;
    opacity: 0.7;
    text-decoration: none;
}
.section-block__more:hover { opacity: 1; }
.section-block__header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

/* ── Badge colour: match WP prod (single.css #933FA1, applied on all pages) ── */
.site .post-card__category {
    background-color: #933FA1 !important;
    font-size: 14px;
}

/* ── Cancel dark-theme nested <a> styling inside category badges
   (causes "strikethrough" / double-frame visual on entry-image badge) ── */
.post-card__category a {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-transform: inherit !important;
    letter-spacing: inherit !important;
}

/* ── entry-image on post page: standalone wrapper ── */
.entry-image {
    position: relative;
    margin-bottom: 28px;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}
.entry-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: inherit;
}
.entry-image .post-card__category {
    position: absolute;
    bottom: 15px;
    left: 15px;
    margin: 0;
    line-height: 1.2;
}

/* ── Social buttons: flex container with margin ── */
.social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
}

/* ── Match WP customizer inline CSS: meta icon ::before in purple ── */
.post-card__comments:before,
.post-card__views:before,
.post-card__date:before,
.post-card__like:before,
.post-card__author:before,
.entry-author:before,
.entry-date:before,
.entry-time:before,
.entry-views:before {
    color: #a336f7 !important;
}

/* ── entry-image badge: force solid purple pill regardless of WP customizer context ── */
.entry-image .post-card__category {
    background-color: #a336f7 !important;
    border-radius: 999px !important;
    padding: 4px 10px !important;
    display: inline-block !important;
    line-height: 1.4 !important;
}
.entry-image .post-card__category a {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

/* ── Star rating cursor ── */
.js-star-rating-item { cursor: pointer; }

/* Оценка: при наведении на виджет заполненные звёзды становятся фиолетовыми */
.rating-stars.js-rating .rating-star { cursor: pointer; transition: color .12s; }
.rating-stars.js-rating:hover .rating-star--filled { color: var(--mgd-purple, #c05dd0) !important; }

/* ── Прячем WP-CTA .title-link ("Получить подборку"): раньше его вырезала
   регулярка в PHP и рвала HTML статьи — теперь скрываем чисто через CSS. ── */
.entry-content .title-link { display: none !important; }

/* ── Убираем большой разрыв: браузер создаёт пустой <p> перед блочными
   вставками (скрытый .title-link, баннеры в <noindex>) — прячем такие. ── */
.entry-content p:empty { display: none !important; }

/* ── Пагинация: красивый отступ WP висит на `.pagination .nav-links`, а у нас
   класс `posts-navigation` → номера слипались. Задаём отступы явно. ── */
.posts-navigation,
.pagination { display: block !important; }
.posts-navigation .nav-links,
.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 30px;
}
.posts-navigation .nav-links .page-numbers,
.pagination .nav-links .page-numbers {
    margin: 0;
    padding: .55em 1em;
    border-radius: 8px;
    line-height: 1;
}

/* ── Слайдер: категория-подпись — прозрачная рамка (как на проде),
   а не залитый фиолетовый пилл (его форсит `.site .post-card__category`). ── */
.site .card-slider__body .post-card__category,
.site .swiper-slide .post-card__category {
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid rgba(255, 255, 255, .6) !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   ВИЗУАЛЬНАЯ ГАРМОНИЗАЦИЯ ПОД ДИЗАЙН-СИСТЕМУ (mgd) — только цвета/акценты,
   без изменения вёрстки. WP-синий #4d3bfe → mgd-purple; мягкие ховеры.
   Грузится после WP-css → !important при равной специфичности выигрывает.
   ───────────────────────────────────────────────────────────────────────── */

/* Блок-цитаты: акцентная полоса в фирменном фиолетовом */
.entry-content blockquote,
.entry-content .wp-block-quote {
    border-left-color: var(--mgd-purple, #c05dd0) !important;
}

/* Маркеры маркированных списков в тексте */
.entry-content ul:not([class]) > li:before {
    border-color: var(--mgd-purple, #c05dd0) !important;
}

/* Пагинация: активная и hover — в фирменном фиолетовом (вместо синего) */
.posts-navigation .nav-links .page-numbers.current,
.pagination .nav-links .page-numbers.current {
    box-shadow: inset 0 0 0 1px var(--mgd-purple, #c05dd0) !important;
    color: var(--mgd-purple-h, #d060e0) !important;
}
.posts-navigation .nav-links .page-numbers:not(.dots):not(.current):before,
.pagination .nav-links .page-numbers:not(.dots):not(.current):before {
    background: var(--mgd-purple, #c05dd0) !important;
}

/* «Содержание»: ссылки — фирменный hover, аккуратный отступ */
.table-of-contents__list a { transition: color .15s; }
.table-of-contents__list a:hover { color: var(--mgd-purple-h, #d060e0) !important; }

/* Сайдбар: мягкий зум превью в «Популярном» + акцент карточки при наведении */
.mgd-swidget { transition: border-color .18s; }
.mgd-swidget--popular:hover,
.mgd-swidget--cats:hover { border-color: var(--mgd-border-glow, #c05dd059); }
.mgd-pop-item__thumb { transition: transform .2s ease; }
.mgd-pop-item__link:hover .mgd-pop-item__thumb { transform: scale(1.05); }

/* Категории в сайдбаре: тонкий левый акцент при наведении */
.mgd-cat-list__item a {
    border-left: 2px solid transparent;
    padding-left: 0;
    transition: color .15s, border-color .15s, padding-left .15s;
}
.mgd-cat-list__item a:hover {
    border-left-color: var(--mgd-purple, #c05dd0);
    padding-left: 8px;
}
