/* Правки поверх шаблона themesflat (ТЗ, этапы 3–5).
   Подключается после style.css и responsive.css. */

/* H1 вместо div/a/p: сохраняем прежний вид */
h1.page-title-heading { margin: 0; }
h1.section-heading-jost-size28 { margin: 0 0 10px; line-height: 1.3; }
h1.title-text { font-size: 30px; margin: 20px 0 10px; }
h1.reserve-name { font-size: inherit; font-weight: 700; line-height: inherit; margin: 0 0 10px; }

/* Главная: вступительный блок с названием платформы */
.platform-intro { padding: 56px 0 8px; text-align: center; }
.platform-intro-title {
    margin: 0 0 14px;
    font-family: 'Golos Text', sans-serif;
    font-size: 40px;
    line-height: 1.2;
    font-weight: 700;
    color: #18613e;
}
.platform-intro-text { max-width: 760px; margin: 0 auto; font-size: 18px; line-height: 1.6; }
@media (max-width: 767px) {
    .platform-intro { padding: 36px 0 0; }
    .platform-intro-title { font-size: 28px; }
    .platform-intro-text { font-size: 16px; }
}

/* Меню с клавиатуры: подменю открывается и при фокусе, как при наведении */
#mainnav .menu > li.focus-within > .sub-menu {
    display: block !important;
    opacity: 1;
    visibility: visible;
    left: 0;
    transform: translateY(0);
}
#mainnav .menu > li > a[role="button"] { cursor: pointer; }
:focus-visible { outline: 2px solid #18613e; outline-offset: 2px; }

/* Скорость (этап 4) */
/* width/height у картинок — только для резерва места; размеры по-прежнему задаёт CSS темы */
:where(img[width][height]) { height: auto; }
/* Прелоадер скрывал страницу до загрузки всех картинок */
.preloader { display: none !important; }
/* Появление блоков: быстро и без задержек */
.wow { animation-duration: .4s !important; animation-delay: 0s !important; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .wow { visibility: visible !important; }
}

/* Меню в одну строку на ширине от 1200px (этап 5): «Bosh sahifa» убран из меню
   (index.php), освободившееся место — на отступы между пунктами */
@media (min-width: 1200px) {
    #mainnav .menu > li > a { margin: 0 9px; }
}

/* Главная (этап 5): карточки «кому», сетки материалов и игр */
.platform-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 36px;
    text-align: left;
}
.platform-card {
    display: block;
    padding: 28px 26px;
    border-radius: 16px;
    background: #e6f4e7;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
}
a.platform-card:hover, a.platform-card:focus { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(24, 97, 62, .15); color: inherit; }
.platform-card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; margin-bottom: 14px;
    border-radius: 50%; background: #18613e; color: #fff; font-size: 22px;
}
.platform-card-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: #18613e; }
.platform-card p { margin: 0 0 14px; line-height: 1.55; }
.platform-card-more { font-weight: 500; color: #18613e; }
.platform-card-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.platform-card-links a {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    background: #fff; color: #18613e; font-weight: 500;
}
.platform-card-links a:hover, .platform-card-links a:focus { background: #18613e; color: #fff; }

/* Цитаты одной высоты */
.flat-testimonials .owl-stage { display: flex; }
.flat-testimonials .owl-item { display: flex; }
.flat-testimonials .owl-item > .item,
.flat-testimonials .list-testimonials,
.flat-testimonials .box-item { display: flex; flex-direction: column; width: 100%; height: 100%; }
.flat-testimonials .box-item .icon-box { margin-top: auto; }

/* Красная книга на главной: 6 карточек сеткой */
.redbook-home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.redbook-home-grid .blog-item { height: 100%; margin: 0; }
.redbook-home-grid .image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.redbook-home-grid .sub-title { margin: 12px 0 0; padding-bottom: 0; }
.redbook-home-more { margin: 28px 0 60px; text-align: center; }

/* Последние материалы и игры */
.home-block { padding: 20px 0 50px; }
.home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.home-card {
    display: flex; flex-direction: column;
    border-radius: 14px; overflow: hidden; background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06); color: inherit;
    transition: transform .2s, box-shadow .2s;
}
.home-card:hover, .home-card:focus { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(24, 97, 62, .15); color: inherit; }
.home-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.home-card-label { margin: 14px 18px 0; font-size: 13px; color: #18613e; text-transform: uppercase; letter-spacing: .04em; }
.home-card-title { margin: 6px 18px 18px; font-size: 18px; line-height: 1.35; font-weight: 500; }
.nf-btn {
    display: inline-block; padding: 12px 28px; border: 0; border-radius: 12px;
    background: #18613e; color: #fff; font-weight: 500;
}
.nf-btn:hover, .nf-btn:focus { background: #0f4a2e; color: #fff; }

@media (max-width: 991px) {
    .platform-cards, .redbook-home-grid, .home-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .platform-cards, .redbook-home-grid, .home-cards { grid-template-columns: 1fr; gap: 16px; }
}

/* Поиск в верхней строке с адресом, справа.
   Тема задаёт полям высоту 45px и margin-bottom 20px, иконкам в .top-header1 — тёмный цвет
   с !important и отступ, поэтому селекторы здесь конкретнее */
.top-header1 .top-bar-right,
.top-header .top-bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; height: 50px; padding-right: 0; }
/* правый край поиска — по правому краю белой шапки (у неё margin-right: 1%) */
.top-header1 .top-bar-right { padding-right: 1%; }
.topbar-search { display: flex; align-items: center; margin: 0; line-height: normal; }
.topbar-search input[type=search] {
    display: block; width: 220px; height: 36px; margin: 0; padding: 0 14px;
    border: 1px solid #cfe3d2; border-right: 0; border-radius: 18px 0 0 18px;
    background: #fff; color: #333; font-size: 14px; line-height: 36px;
}
.topbar-search input[type=search]:focus { border-color: #18613e; }
.topbar-search button {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 36px; margin: 0; padding: 0;
    border: 0; border-radius: 0 18px 18px 0; background: #18613e;
}
.topbar-search button:hover, .topbar-search button:focus { background: #0f4a2e; }
.top-header1 .topbar-search .fa,
.top-header .topbar-search .fa,
.topbar-search .fa { color: #fff !important; padding: 0; font-size: 15px; }
@media (max-width: 767px) {
    .top-header1 .top-bar-right, .top-header .top-bar-right { justify-content: center; height: auto; padding-right: 0; }
    .topbar-search { width: 100%; max-width: 360px; margin: 6px auto; }
    .topbar-search input[type=search] { flex: 1; width: auto; min-width: 0; }
}

/* ===== Страница новостей (/media/news): сетка карточек ===== */
.news-page { --news-green: #18613e; --news-accent: #348e38; }
.news-page .news-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 24px;
}
@media (max-width: 991px) {
    .news-page .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.news-card {
    display: flex; flex-direction: column; margin: 0;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 6px 20px rgba(16, 60, 36, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 2px 4px rgba(16, 60, 36, .08), 0 14px 32px rgba(16, 60, 36, .14);
}
.news-card__media {
    position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
    background: #e3efe4; text-decoration: none !important;
}
.news-card__media img,
.news-card__placeholder {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transition: transform .6s ease;
}
.news-card:hover .news-card__media img { transform: scale(1.05); }
.news-card__placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1f7a45 0%, #6cb45a 100%);
    color: rgba(255, 255, 255, .35); font-size: 96px;
}
.news-card__media::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(6,30,18,.55) 65%, rgba(6,30,18,.88) 100%);
}
.news-card__date {
    position: absolute; top: 14px; left: 14px; z-index: 2;
    padding: 5px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .92); color: var(--news-green);
    font-size: 13px; font-weight: 600; line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.news-card__date .fa { margin-right: 4px; color: var(--news-accent); }
.news-card__title {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; margin: 0;
    padding: 0 20px 18px;
    font-family: 'Golos Text', sans-serif; font-size: 19px; font-weight: 600;
    line-height: 1.35; letter-spacing: -.2px; color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card__media:focus-visible { outline: 3px solid var(--news-accent); outline-offset: -3px; }
.news-card__body {
    display: flex; flex-direction: column; flex: 1; padding: 16px 20px 18px;
}
.news-card__text {
    margin: 0 0 12px; color: #4a5a50; font-size: 15px; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card__more {
    margin-top: auto; align-self: flex-start;
    color: var(--news-accent) !important; font-size: 14px; font-weight: 600; line-height: 1.4;
}
.news-card__more i { margin-left: 6px; transition: transform .2s ease; }
.news-card:hover .news-card__more i { transform: translateX(4px); }

/* Пагинация */
.news-pagination {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 44px 0 10px;
}
.news-pagination a, .news-pagination span.news-pagination__page, .news-pagination span.news-pagination__arrow {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px;
    background: #e8f3e9; color: var(--news-green); font-weight: 600; font-size: 15px;
    text-decoration: none !important; transition: background .2s, color .2s;
}
.news-pagination a:hover, .news-pagination a:focus-visible { background: var(--news-accent); color: #fff; }
.news-pagination .is-current { background: var(--news-green) !important; color: #fff !important; }
.news-pagination .is-disabled { opacity: .4; }

.news-page .widget.widget_lastest ul li { border-color: #e1ebe2; border-radius: 12px; transition: background .3s, border-color .3s; }
.news-page .widget.widget_lastest .thumb img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; }

@media (max-width: 767px) {
    .news-page .news-grid { grid-template-columns: 1fr; gap: 20px; }
    .news-card__title { font-size: 18px; padding: 0 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .news-card, .news-card__media img, .news-card__more i { transition: none; }
    .news-card:hover { transform: none; }
    .news-card:hover .news-card__media img { transform: none; }
}

/* ===== Шапка сайта (templates/site_header.tpl) ===== */
.site-topbar, .site-header { --hdr-green: #18613e; --hdr-dark: #0f3d27; --hdr-accent: #348e38; --hdr-soft: #eef6ef; --hdr-text: #1d3527; }

/* Верхняя строка: адрес, почта, поиск */
.site-topbar { background: var(--hdr-dark); color: rgba(255, 255, 255, .82); font-size: 13px; line-height: 1.4; }
.site-topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; }
.site-topbar__contacts { display: flex; align-items: center; gap: 24px; min-width: 0; }
.site-topbar__item { display: inline-flex; align-items: center; gap: 7px; color: rgba(255, 255, 255, .82) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-topbar__item .fa { color: #8fd18a; font-size: 14px; }
a.site-topbar__item:hover { color: #fff !important; }
.site-topbar__actions { display: flex; align-items: center; gap: 14px; }
.site-topbar .topbar-search input[type=search] {
    width: 200px; height: 30px; line-height: 30px; padding: 0 12px; font-size: 13px;
    border: 1px solid rgba(255, 255, 255, .18); border-right: 0; border-radius: 15px 0 0 15px;
    background: rgba(255, 255, 255, .1); color: #fff;
}
.site-topbar .topbar-search input[type=search]::placeholder { color: rgba(255, 255, 255, .6); }
.site-topbar .topbar-search input[type=search]:focus { background: #fff; color: #222; border-color: #fff; outline: none; }
.site-topbar .topbar-search button { width: 38px; height: 30px; border-radius: 0 15px 15px 0; background: var(--hdr-accent); }
.site-topbar .topbar-search button:hover, .site-topbar .topbar-search button:focus { background: #2b7a2f; }
.site-topbar .topbar-search .fa { font-size: 13px; }
.site-topbar__social { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; line-height: 1; }
.site-topbar__social a { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff !important; }
.site-topbar__social a:hover { background: var(--hdr-accent); }
.site-topbar__social .fa { padding: 0 !important; color: inherit !important; font-size: 13px; }

/* Основная полоса: логотип + меню */
#header.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: saturate(160%) blur(8px); backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid #e3ece4;
    box-shadow: 0 4px 18px rgba(16, 60, 36, .06);
}
.site-header__inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.site-header__logo { display: flex; align-items: center; flex-shrink: 0; }
.site-header__logo img { display: block; width: auto; height: 33px; }
#header.site-header .nav-wrap { padding: 0; line-height: normal; text-align: right; flex: 1; min-width: 0; }
#header.site-header #mainnav .menu { display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 2px; margin: 0; padding: 0; white-space: nowrap; }
#header.site-header #mainnav .menu > li { display: block; position: relative; }
#header.site-header #mainnav .menu > li > a {
    display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 10px 11px;
    line-height: 1.3; border-radius: 10px;
    font-size: 15px; font-weight: 500; color: var(--hdr-text);
    transition: background .2s, color .2s;
}
#header.site-header #mainnav > ul > li > a::before { display: none; }
#header.site-header #mainnav > ul > li.menu-item-has-children > a::after {
    margin-left: 2px; font-size: 13px; color: currentColor; opacity: .6; transition: transform .2s;
}
#header.site-header #mainnav .menu > li:hover > a,
#header.site-header #mainnav .menu > li.focus-within > a { background: var(--hdr-soft); color: var(--hdr-green); }
#header.site-header #mainnav .menu > li:hover > a::after { transform: rotate(180deg); }
#header.site-header #mainnav .menu > li.is-active > a { color: var(--hdr-green); font-weight: 600; background: var(--hdr-soft); }

/* Выпадающее подменю */
#header.site-header #mainnav .menu > li > .sub-menu {
    top: calc(100% + 6px); left: 0; width: auto; min-width: 250px; padding: 8px;
    background: #fff; border: 1px solid #e3ece4; border-radius: 14px;
    box-shadow: 0 14px 36px rgba(16, 60, 36, .16);
    transform: translateY(8px); z-index: 1001 !important;
}
#header.site-header #mainnav .menu > li > .sub-menu::before { /* мостик, чтобы подменю не закрывалось в зазоре */
    content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px;
}
#header.site-header #mainnav .menu > li:hover > .sub-menu,
#header.site-header #mainnav .menu > li.focus-within > .sub-menu { transform: translateY(0); }
#header.site-header #mainnav .menu > li > .sub-menu > li { border: 0; }
#header.site-header #mainnav .menu > li > .sub-menu > li > a {
    display: block; padding: 9px 12px; border-radius: 8px;
    font-size: 14.5px; font-weight: 500; line-height: 1.35; color: var(--hdr-text) !important;
    background: transparent; white-space: nowrap; text-align: left;
}
#header.site-header #mainnav .menu > li > .sub-menu > li:hover > a,
#header.site-header #mainnav .menu > li > .sub-menu > li > a:focus-visible { background: var(--hdr-soft); color: var(--hdr-green) !important; }
#header.site-header #mainnav .menu > li > .sub-menu > li.is-active > a { background: var(--hdr-green); color: #fff !important; }
/* последние пункты справа — подменю выравниваем по правому краю, чтобы не вылезало за экран */
#header.site-header #mainnav .menu > li:nth-last-child(-n+2) > .sub-menu { left: auto; right: 0; }

/* Главная: шапка поверх слайдера */
.site-header-overlay { position: absolute; top: 0; left: 0; right: 0; z-index: 1000; }
/* шапка закреплена; top = высота верхней строки минус прокрутка (--hdr-top ставит fixes.js) */
.site-header-overlay #header.site-header { position: fixed; left: 0; right: 0; top: var(--hdr-top, 42px); }

/* Планшеты и телефоны: бургер, мобильное меню (main.js переносит #mainnav в #header как #mainnav-mobi) */
.site-header__inner::before, .site-header__inner::after, .site-topbar__inner::before, .site-topbar__inner::after { display: none; } /* clearfix Bootstrap ломает flex */
.site-header__logo { width: auto; margin: 0; padding: 0; line-height: 0; }
.site-header__logo img { max-width: none; width: auto !important; }
/* Шапка по ширине контента (.container): меню компактнее, чтобы было в одну строку */
@media (min-width: 992px) {
    .site-header__inner { gap: 16px; }
    #header.site-header #mainnav .menu > li > a { padding: 9px 9px; font-size: 15px; }
    #header.site-header #mainnav > ul > li.menu-item-has-children > a::after { font-size: 12px; margin-left: 0; }
    .site-header__logo img { height: 33px; }  /* SVG-логотип 6.65:1: 33px ≈ 219px ширины, меню 15px ≈ 895px */
}
@media (max-width: 1199px) and (min-width: 992px) {
    .site-header__inner { gap: 10px; }
    #header.site-header #mainnav .menu > li > a { padding: 8px 5px; font-size: 13.5px; }
    #header.site-header #mainnav > ul > li.menu-item-has-children > a::after { font-size: 11px; }
    .site-header__logo img { height: 25px; }
}
@media (max-width: 991px) {
    .site-header__inner { min-height: 64px; }
    .site-header__logo img { height: 30px; }
    #header.site-header .nav-wrap { display: none; }
    #header.site-header .btn-menu {
        position: relative; right: auto; display: block; float: none; flex-shrink: 0;
        width: 44px; height: 44px; margin: 0; border-radius: 12px; background: var(--hdr-soft);
    }
    #header.site-header .btn-menu::before, #header.site-header .btn-menu::after, #header.site-header .btn-menu span {
        left: 12px; width: 20px; background-color: var(--hdr-green);
    }
    #header.site-header #mainnav-mobi {
        top: 100%; background: #fff; border-top: 1px solid #e3ece4;
        box-shadow: 0 16px 30px rgba(16, 60, 36, .14);
        max-height: calc(100vh - 64px); overflow-y: auto;
    }
    #header.site-header #mainnav-mobi ul li { border-bottom: 1px solid #edf3ee; }
    #header.site-header #mainnav-mobi ul > li > a { display: block; padding: 0 20px; line-height: 52px; color: var(--hdr-text); font-weight: 500; }
    #header.site-header #mainnav-mobi ul.sub-menu { background: #f6faf6; }
    #header.site-header #mainnav-mobi ul.sub-menu > li > a { padding: 0 32px; line-height: 46px; font-size: 14.5px; }
    #header.site-header #mainnav-mobi li.is-active > a { color: var(--hdr-green); font-weight: 600; }
    #header.site-header #mainnav-mobi .btn-submenu { right: 0; width: 56px; height: 52px; font-size: 18px; line-height: 52px; }
}
@media (max-width: 767px) {
    .site-topbar__inner { min-height: 0; padding-top: 8px; padding-bottom: 8px; }
    .site-topbar__contacts { display: none; }
    .site-topbar__actions { width: 100%; }
    .site-topbar .topbar-search { flex: 1; max-width: none; margin: 0; }
    .site-topbar .topbar-search input[type=search] { flex: 1; width: auto; }
}

/* ===== Заголовок раздела (.page-title) — компактный, свой цвет и значок у каждого раздела =====
   Класс раздела ставит top.tpl: .page-act-{act} .page-sub-{sub} */
.boxed { --pt-accent: #348e38; --pt-bg: #dcefdd; --pt-bg2: #eef8ef; --pt-icon: "\f06c"; --pt-pattern: url("/assets/images/page-title/problems.svg"); } /* по умолчанию: лист */
/* Узор фона по разделам (assets/images/page-title/*.svg; генератор — контурные иконки 48×48 на плитке 840×170) */
.page-act-media       { --pt-pattern: url("/assets/images/page-title/media.svg"); }
.page-act-category    { --pt-pattern: url("/assets/images/page-title/category.svg"); }
.page-act-category.page-sub-problem { --pt-pattern: url("/assets/images/page-title/problems.svg"); }
.page-act-journey     { --pt-pattern: url("/assets/images/page-title/journey.svg"); }
.page-act-redbook     { --pt-pattern: url("/assets/images/page-title/redbook.svg"); }
.page-act-forteachers, .page-act-literature { --pt-pattern: url("/assets/images/page-title/forteachers.svg"); }
.page-act-theory      { --pt-pattern: url("/assets/images/page-title/theory.svg"); }
/* Подразделы — свой набор иконок, цвет остаётся цветом раздела (узор общий для баннера и полей по краям) */
.page-sub-news { --pt-pattern: url("/assets/images/page-title/news.svg"); }
.page-sub-videos { --pt-pattern: url("/assets/images/page-title/videos.svg"); }
.page-sub-photogallery { --pt-pattern: url("/assets/images/page-title/photogallery.svg"); }
.page-sub-animations { --pt-pattern: url("/assets/images/page-title/animations.svg"); }
.page-sub-steps { --pt-pattern: url("/assets/images/page-title/steps.svg"); }
.page-sub-interesting { --pt-pattern: url("/assets/images/page-title/interesting.svg"); }
.page-sub-doyouknow { --pt-pattern: url("/assets/images/page-title/doyouknow.svg"); }
.page-sub-ecohistory { --pt-pattern: url("/assets/images/page-title/ecohistory.svg"); }
.page-sub-folklor { --pt-pattern: url("/assets/images/page-title/folklor.svg"); }
.page-sub-reserves { --pt-pattern: url("/assets/images/page-title/reserves.svg"); }
.page-sub-routes { --pt-pattern: url("/assets/images/page-title/routes.svg"); }
.page-sub-camping { --pt-pattern: url("/assets/images/page-title/camping.svg"); }
.page-sub-animals { --pt-pattern: url("/assets/images/page-title/animals.svg"); }
.page-sub-plants { --pt-pattern: url("/assets/images/page-title/plants.svg"); }
.page-sub-literature { --pt-pattern: url("/assets/images/page-title/literature.svg"); }
.page-sub-scientific { --pt-pattern: url("/assets/images/page-title/scientific.svg"); }
.page-sub-lesson-developments { --pt-pattern: url("/assets/images/page-title/lesson-developments.svg"); }
.page-sub-presentations { --pt-pattern: url("/assets/images/page-title/presentations.svg"); }
.page-sub-ecothemes { --pt-pattern: url("/assets/images/page-title/ecothemes.svg"); }
.page-sub-hierarchy { --pt-pattern: url("/assets/images/page-title/hierarchy.svg"); }
.page-sub-direct-indirect { --pt-pattern: url("/assets/images/page-title/direct-indirect.svg"); }
.boxed[class*="page-sub-games"] { --pt-pattern: url("/assets/images/page-title/games.svg"); }
.page-act-category.page-sub-problem { --pt-pattern: url("/assets/images/page-title/problems.svg"); }
.page-act-media       { --pt-accent: #2f8a3a; --pt-bg: #d6eed9; --pt-bg2: #edf8ee; --pt-icon: "\f1ea"; } /* газета */
.page-sub-videos      { --pt-icon: "\f144"; }
.page-sub-photogallery{ --pt-icon: "\f030"; }
.page-sub-animations  { --pt-icon: "\f008"; }
.page-sub-games, .page-sub-games2, .page-sub-games3 { --pt-icon: "\f11b"; }
.page-sub-steps       { --pt-icon: "\f1bb"; }
.page-act-category    { --pt-accent: #b26b12; --pt-bg: #f8e3bf; --pt-bg2: #fdf3e1; --pt-icon: "\f0eb"; } /* лампочка */
.page-act-journey     { --pt-accent: #0e7c86; --pt-bg: #cdebed; --pt-bg2: #e9f6f7; --pt-icon: "\f1bb"; } /* дерево */
.page-sub-routes      { --pt-icon: "\f278"; }
.page-sub-camping     { --pt-icon: "\f0e7"; }
.page-act-redbook     { --pt-accent: #b8322a; --pt-bg: #f6d3cf; --pt-bg2: #fcecea; --pt-icon: "\f1b0"; } /* лапа */
.page-act-redbook.page-sub-plants { --pt-icon: "\f06c"; }
.page-act-forteachers, .page-act-literature
                      { --pt-accent: #2d5fa6; --pt-bg: #d4e2f5; --pt-bg2: #ecf2fb; --pt-icon: "\f19d"; } /* шапочка */
.page-act-theory      { --pt-accent: #6a4c9c; --pt-bg: #e2d8f2; --pt-bg2: #f3eefa; --pt-icon: "\f0e8"; } /* схема */

.page-title .container-fluid, .page-title .row { padding: 0; margin: 0; }
/* карточка по ширине контента (как .container), со скруглением и мягкой тенью */
.page-title .inner-title {
    position: relative; height: auto; overflow: hidden;
    width: calc(100% - 30px); max-width: 1170px; margin: 18px auto 0; border-radius: 20px;
    background:
        radial-gradient(ellipse 60% 140% at 100% 50%, color-mix(in srgb, var(--pt-accent) 14%, transparent), transparent 70%),
        linear-gradient(115deg, var(--pt-bg) 0%, var(--pt-bg2) 100%);
    border: 1px solid color-mix(in srgb, var(--pt-accent) 16%, transparent);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--pt-accent) 10%, transparent), 0 10px 30px color-mix(in srgb, var(--pt-accent) 12%, transparent);
}
@media (min-width: 768px)  { .page-title .inner-title { width: 720px; } }
@media (min-width: 992px)  { .page-title .inner-title { width: 940px; } }
@media (min-width: 1200px) { .page-title .inner-title { width: 1170px; } }
/* узор из тематических иконок раздела (--pt-pattern); под заголовком слева плавно гаснет */
.page-title .inner-title::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-color: var(--pt-accent); opacity: .22;
    -webkit-mask: var(--pt-pattern) 0 50% / auto 100% repeat-x, linear-gradient(90deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.35) 30%, #000 65%);
    -webkit-mask-composite: source-in;
            mask: var(--pt-pattern) 0 50% / auto 100% repeat-x, linear-gradient(90deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.35) 30%, #000 65%);
            mask-composite: intersect;
}
.page-title .overlay-image { display: none; }
/* значок раздела справа — поверх узора, непрозрачный, с градиентом в цвете раздела */
.page-title .inner-title::after {
    content: var(--pt-icon); font-family: 'FontAwesome';
    position: absolute; right: 48px; top: 50%; z-index: 1;
    transform: translateY(-50%);
    font-size: 80px; line-height: 1; pointer-events: none;
    background: linear-gradient(150deg, color-mix(in srgb, var(--pt-accent) 75%, #fff) 0%, var(--pt-accent) 55%, color-mix(in srgb, var(--pt-accent) 80%, #000) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--pt-accent) 35%, transparent));
}
.page-title .banner-title {
    position: relative; top: auto; left: auto; transform: none; z-index: 1;
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    width: auto; max-width: none; margin: 0; padding: 22px 170px 20px 32px; text-align: left;
}
.page-title .page-title-heading {
    position: relative; margin: 0; padding-left: 18px;
    font-family: 'Golos Text', sans-serif; font-size: 34px; font-weight: 700; line-height: 1.2;
    letter-spacing: -.4px; color: #14271c;
}
.page-title .page-title-heading::before {               /* цветная вертикальная полоска слева от заголовка */
    content: ""; position: absolute; left: 0; top: .15em; bottom: .15em; width: 5px; border-radius: 3px;
    background: linear-gradient(180deg, var(--pt-accent), color-mix(in srgb, var(--pt-accent) 45%, #fff));
}
/* «хлебные крошки» — в полупрозрачной белой «таблетке» */
.page-title .page-title-content {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0; margin-left: 18px;
    padding: 4px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--pt-accent) 12%, transparent);
    font-size: 13.5px; font-weight: 500; line-height: 1.5; color: color-mix(in srgb, #14271c 60%, transparent);
}
.page-title .page-title-content a,
.page-title .link-style6 a { color: var(--pt-accent); }
.page-title .link-style6 a:hover { color: #14271c; text-decoration: underline; }
.page-title .page-title-content .home::before { content: "\f015"; font-family: 'FontAwesome'; margin-right: 6px; }
.page-title .page-title-content-inner::before { content: "\f105"; font-family: 'FontAwesome'; padding: 0 8px; opacity: .6; }
.page-title .page-title-content-inner > span::before { content: none; }

/* Отступ между заголовком раздела и контентом был рассчитан на высокий баннер */
.page-title ~ section > .container > .row > .col-md-12:first-child > .themesflat-spacer { height: 24px !important; }

@media (max-width: 767px) {
    .page-title .inner-title { margin-top: 14px; border-radius: 16px; }
    .page-title .banner-title { padding: 16px 84px 14px 16px; gap: 6px; }
    .page-title .page-title-heading { font-size: 24px; padding-left: 14px; }
    .page-title .page-title-heading::before { width: 4px; }
    .page-title .page-title-content { font-size: 12.5px; margin-left: 14px; padding: 3px 10px; }
    .page-title .inner-title::after { font-size: 56px; right: 18px; }
}

/* ===== Сетки медиа (видео, фотогалерея, анимации, игры): uk-grid внутри .row выходил за край контента ===== */
.uk-child-width-1-3\@m[uk-grid] {
    display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px;
    margin: 0 !important; padding: 0; list-style: none;
}
.row > .uk-child-width-1-3\@m[uk-grid] { margin: 0 15px !important; }
.uk-child-width-1-3\@m[uk-grid] > * {
    width: auto !important; max-width: none !important; float: none !important;
    margin: 0 !important; padding: 0 !important;
}
.uk-child-width-1-3\@m[uk-grid] > * > article { height: 100%; margin: 0; }
@media (max-width: 991px) {
    .uk-child-width-1-3\@m[uk-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
    .uk-child-width-1-3\@m[uk-grid] { grid-template-columns: 1fr; gap: 20px; }
}

/* ===== Шапка-карточка: меню в ограниченной ширине (как баннер раздела и контент) ===== */
#header.site-header {
    padding: 10px 0 0; background: transparent; border: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none;
}
#header.site-header > * { pointer-events: auto; }
.container.site-header__inner {
    width: calc(100% - 30px); max-width: 1170px; min-height: 70px; padding: 0 22px;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
    border: 1px solid #e1ebe2; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .05), 0 10px 28px rgba(16, 60, 36, .09);
}
@media (min-width: 768px)  { .container.site-header__inner { width: 720px; } }
@media (min-width: 992px)  { .container.site-header__inner { width: 940px; padding: 0 12px; } }
@media (min-width: 1200px) { .container.site-header__inner { width: 1170px; padding: 0 22px; } }
@media (min-width: 1200px) {
    .site-header__logo img { height: 31px; }
}
@media (max-width: 1199px) and (min-width: 992px) {
    #header.site-header #mainnav .menu > li > a { padding: 8px 5px; font-size: 13px; gap: 2px; }
    .site-header__logo img { height: 23px; }
}
/* баннер раздела — чуть ниже карточки меню */
.page-title .inner-title { margin-top: 14px; }
/* мобильное меню — выпадает карточкой под шапкой */
@media (max-width: 991px) {
    #header.site-header { padding-top: 8px; }
    .container.site-header__inner { min-height: 60px; padding: 0 10px 0 16px; border-radius: 16px; }
    #header.site-header #mainnav-mobi {
        top: calc(100% + 6px); left: 15px; right: 15px; width: auto;
        border: 1px solid #e1ebe2; border-radius: 16px; overflow: hidden auto;
        max-height: calc(100vh - 90px);
    }
}
@media (min-width: 768px) and (max-width: 991px) {
    #header.site-header #mainnav-mobi { left: calc(50% - 360px); right: calc(50% - 360px); }
}

/* ===== Шапка при прокрутке: плавный переход белый → зелёный =====
   fixes.js ставит --hdr-p от 0 (верх страницы) до 1 (прокручено ≥120px) и класс .is-scrolled при p > .5 */
#header.site-header { --hdr-p: 0; padding-top: calc(10px * (1 - var(--hdr-p))); }
#header.site-header .container.site-header__inner {
    min-height: calc(70px - 8px * var(--hdr-p));
    border-radius: calc(18px * (1 - var(--hdr-p))) calc(18px * (1 - var(--hdr-p))) 18px 18px;
    background: color-mix(in srgb, #18613e calc(var(--hdr-p) * 100%), rgba(255, 255, 255, .96));
    border-color: color-mix(in srgb, #18613e calc(var(--hdr-p) * 100%), #e1ebe2);
    box-shadow: 0 2px 4px rgba(10, 45, 28, calc(.05 + .07 * var(--hdr-p))), 0 12px 30px rgba(10, 45, 28, calc(.09 + .19 * var(--hdr-p)));
    transition: none;
}
#header.site-header #mainnav .menu > li > a { color: color-mix(in srgb, #fff calc(var(--hdr-p) * 100%), #1d3527); }
/* логотипы наложены: обычный гаснет, белый проявляется */
.site-header__logo { position: relative; }
.site-header__logo-img--green { position: absolute; left: 0; top: 50%; transform: translateY(-50%); opacity: var(--hdr-p); }
.site-header__logo-img:not(.site-header__logo-img--green) { opacity: calc(1 - var(--hdr-p)); }
/* наведение и текущий раздел — белые «таблетки», когда фон уже в основном зелёный */
#header.site-header.is-scrolled #mainnav .menu > li:hover > a,
#header.site-header.is-scrolled #mainnav .menu > li.focus-within > a { background: rgba(255, 255, 255, .12); color: #fff; }
#header.site-header.is-scrolled #mainnav .menu > li.is-active > a { background: rgba(255, 255, 255, .18); color: #fff; }
#header.site-header.is-scrolled .btn-menu { background: rgba(255, 255, 255, .14); }
#header.site-header.is-scrolled .btn-menu::before,
#header.site-header.is-scrolled .btn-menu::after,
#header.site-header.is-scrolled .btn-menu span { background-color: #fff; }
@media (max-width: 991px) {
    #header.site-header { padding-top: calc(8px * (1 - var(--hdr-p))); }
    #header.site-header .container.site-header__inner {
        min-height: calc(60px - 4px * var(--hdr-p));
        border-radius: calc(16px * (1 - var(--hdr-p))) calc(16px * (1 - var(--hdr-p))) 16px 16px;
    }
}

/* При прокрутке карточка меню плавно становится шире контента на 5px с каждой стороны */
#header.site-header { --hdr-w: calc(100% - 30px); }
@media (min-width: 768px)  { #header.site-header { --hdr-w: 720px; } }
@media (min-width: 992px)  { #header.site-header { --hdr-w: 940px; } }
@media (min-width: 1200px) { #header.site-header { --hdr-w: 1170px; } }
#header.site-header .container.site-header__inner {
    width: calc(var(--hdr-w) + 10px * var(--hdr-p));
    max-width: none;
}

/* ===== Страница новости (/media/news/{id}) ===== */
.news-detail {
    margin: 0; padding: 32px 36px 30px; background: #fff; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 8px 26px rgba(16, 60, 36, .08);
}
.news-detail__title {
    margin: 0 0 14px; font-family: 'Golos Text', sans-serif; font-size: 30px; font-weight: 700;
    line-height: 1.25; letter-spacing: -.4px; color: #14271c;
}
.news-detail__meta { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 22px; }
.news-detail__meta span {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
    background: #eef6ef; color: #18613e; font-size: 13.5px; font-weight: 500; line-height: 1.5;
}
.news-detail__meta .fa { color: #348e38; }
.news-detail__photo { margin: 0 0 26px; border-radius: 14px; overflow: hidden; background: #e3efe4; aspect-ratio: 16 / 9; }
.news-detail__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-detail__text { font-size: 17px; line-height: 1.75; color: #2b3a31; }
.news-detail__text * { font-size: inherit !important; font-family: inherit !important; line-height: inherit !important; white-space: normal !important; }
.news-detail__text p, .news-detail__text div { margin: 0 0 1em; }
.news-detail__text a { color: #2f8a3a; text-decoration: underline; text-underline-offset: 2px; }
.news-detail__text em { color: #6a7a70; }
.news-detail__siblings {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin: 30px 0 22px; padding-top: 24px; border-top: 1px solid #e6eee7;
}
.news-detail__sibling {
    display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px;
    background: #f5faf5; border: 1px solid #e3ece4; text-decoration: none !important; transition: background .2s, border-color .2s;
}
.news-detail__sibling:hover { background: #eaf5ea; border-color: #bcd9bf; }
.news-detail__sibling--next { text-align: right; align-items: flex-end; }
.news-detail__sibling-label { font-size: 13px; font-weight: 600; color: #348e38; }
.news-detail__sibling-title {
    font-size: 15px; font-weight: 500; line-height: 1.4; color: #1d3527;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-detail__back {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px;
    background: #18613e; color: #fff !important; font-weight: 600; font-size: 14.5px; text-decoration: none !important;
}
.news-detail__back:hover { background: #0f4a2e; }

.news-page .widget.widget_lastest h2 { padding-top: 0; }
@media (max-width: 767px) {
    .news-detail { padding: 20px 18px; border-radius: 14px; }
    .news-detail__title { font-size: 23px; }
    .news-detail__text { font-size: 16px; }
    .news-detail__siblings { grid-template-columns: 1fr; }
    .news-detail__sibling--next { text-align: left; align-items: flex-start; }
}

/* Блок подвала (логотип + контакты) заходит вверх на контент — оставляем запас под ним */
.flat-blog-standard.news-page { padding-bottom: 80px; }
/* заголовок боковой панели — вровень с верхом карточки новости */
.news-page .side-bar .widget.widget_lastest h2 { margin-top: 0; padding: 0 0 4px 3px; line-height: 1.2; }
.news-page .side-bar .widget.widget_lastest ul li:first-child { margin-top: 12px; }
@media (max-width: 991px) {
    /* тема на планшетах/телефонах даёт секции 60px сверху — под компактным баннером это лишнее */
    .page-title ~ .flat-blog-standard { padding-top: 0; }
    .flat-blog-standard.news-page { padding-bottom: 60px; }
}
@media (max-width: 767px) {
    /* блок подвала с логотипом на телефоне не показывается — большой запас не нужен */
    .flat-blog-standard.news-page { padding-bottom: 32px; }
    /* пагинация в одну строку */
    .news-pagination { gap: 5px; margin-top: 28px; }
    .news-pagination a, .news-pagination span.news-pagination__page, .news-pagination span.news-pagination__arrow {
        min-width: 36px; height: 38px; padding: 0 8px; border-radius: 10px; font-size: 14px;
    }
}

/* ===== Боковая панель новости: «So‘nggi yangiliklar» одной карточкой ===== */
.news-page .side-bar .widget.widget_lastest {
    padding: 20px 20px 8px; background: #fff; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 8px 26px rgba(16, 60, 36, .08);
}
.news-page .side-bar .widget.widget_lastest h2 {
    margin: 0 0 6px; padding: 0; font-size: 19px; font-weight: 700; line-height: 1.3; color: #14271c;
    display: flex; align-items: center; gap: 8px;
}
.news-page .side-bar .widget.widget_lastest h2::before { content: "\f1ea"; font-family: 'FontAwesome'; font-weight: 400; color: #348e38; font-size: 17px; }
.news-page .side-bar .widget.widget_lastest ul li,
.news-page .side-bar .widget.widget_lastest ul li:first-child {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 0 -10px; padding: 12px 10px; border: 0; border-radius: 12px; background: none;
    position: relative;
}
.news-page .side-bar .widget.widget_lastest ul li + li::before {
    content: ""; position: absolute; top: 0; left: 10px; right: 10px; height: 1px; background: #edf3ee;
}
.news-page .side-bar .widget.widget_lastest ul li:hover { background: #f3f9f3; border: 0; }
.news-page .side-bar .widget.widget_lastest ul li:hover + li::before, .news-page .side-bar .widget.widget_lastest ul li:hover::before { opacity: 0; }
.news-page .side-bar .widget.widget_lastest .thumb { float: none; flex-shrink: 0; }
.news-page .side-bar .widget.widget_lastest .thumb img { display: block; width: 76px; height: 60px; object-fit: cover; border-radius: 10px; }
.news-page .side-bar .widget.widget_lastest .text { padding: 0; min-width: 0; }
.news-page .side-bar .widget.widget_lastest h3 { margin: 0 0 4px; font-size: 14.5px; line-height: 1.4; }
.news-page .side-bar .widget.widget_lastest h3 a {
    color: #1d3527 !important; font-weight: 500;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-page .side-bar .widget.widget_lastest li:hover h3 a { color: #18613e !important; }
.news-page .side-bar .widget.widget_lastest .date { font-size: 12.5px; color: #7a8c80; }

/* ===== «Qizil kitobdan» — случайный организм из Красной книги ===== */
.redbook-pick {
    display: block; margin-top: 22px; overflow: hidden; background: #fff; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(120, 30, 20, .06), 0 8px 26px rgba(120, 30, 20, .10);
    text-decoration: none !important; position: relative; transition: transform .25s ease, box-shadow .25s ease;
}
.redbook-pick:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(120, 30, 20, .08), 0 14px 32px rgba(120, 30, 20, .16); }
.redbook-pick__label {
    position: absolute; top: 14px; left: 14px; z-index: 1;
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    background: #b8322a; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.4;
    box-shadow: 0 3px 10px rgba(184, 50, 42, .35);
}
.redbook-pick__photo { display: block; aspect-ratio: 16 / 11; background: #f6e6e4; overflow: hidden; }
.redbook-pick__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.redbook-pick:hover .redbook-pick__photo img { transform: scale(1.05); }
.redbook-pick__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px 16px; border-top: 3px solid #b8322a; }
.redbook-pick__cat { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #b8322a; }
.redbook-pick__name { font-size: 17px; font-weight: 700; line-height: 1.3; color: #14271c; }
.redbook-pick__more { margin-top: 6px; font-size: 14px; font-weight: 600; color: #b8322a; }
.redbook-pick__more i { margin-left: 4px; transition: transform .2s ease; }
.redbook-pick:hover .redbook-pick__more i { transform: translateX(4px); }

/* «So‘nggi yangiliklar»: фото на всю высоту строки (без пустого места под ним), все строки одинаково выровнены */
.news-page .side-bar .widget.widget_lastest ul li:nth-child(n) {
    align-items: stretch; margin: 0 -10px; padding: 12px 10px;
}
.news-page .side-bar .widget.widget_lastest .thumb { display: flex; width: 84px; margin: 0; padding: 0; }
.news-page .side-bar .widget.widget_lastest .thumb img { width: 84px; height: 100%; min-height: 72px; }
.news-page .side-bar .widget.widget_lastest .text { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.news-page .side-bar .widget.widget_lastest h3 { margin: 0; }
.news-page .side-bar .widget.widget_lastest .date { line-height: 1.3; }
/* clearfix у <li> во flex-строке давал первой новости лишний «элемент» и сдвиг вправо */
.news-page .side-bar .widget.widget_lastest ul li:first-child::before,
.news-page .side-bar .widget.widget_lastest ul li::after { content: none; display: none; }

/* Боковая панель новости прилипает; если она выше экрана — прилипает нижним краем,
   чтобы все блоки было видно целиком (top считает fixes.js → --sb-top) */
@media (min-width: 992px) {
    .news-page .container > .row { display: flex; flex-wrap: wrap; }
    .news-page .col-md-4 > .side-bar { position: sticky; top: var(--sb-top, 96px); }
}

/* ===== Поля по краям широких экранов — узор в стиле баннера раздела (--pt-pattern, --pt-accent) =====
   Видно только по бокам от контента (контейнер 1200px); к контенту узор плавно растворяется. */
@media (min-width: 1400px) {
    .boxed::before {
        content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
        background-color: var(--pt-accent); opacity: .13;
        -webkit-mask: var(--pt-pattern) 0 0 / 630px auto repeat,
            linear-gradient(to right, #000 0, #000 calc(50% - 680px), transparent calc(50% - 590px), transparent calc(50% + 590px), #000 calc(50% + 680px), #000 100%);
        -webkit-mask-composite: source-in;
                mask: var(--pt-pattern) 0 0 / 630px auto repeat,
            linear-gradient(to right, #000 0, #000 calc(50% - 680px), transparent calc(50% - 590px), transparent calc(50% + 590px), #000 calc(50% + 680px), #000 100%);
                mask-composite: intersect;
    }
}
/* тема задаёт списку 100px снизу и минимальную высоту 1150px — на страницах новостей это лишний отступ до подвала */
.news-page .post-wrap { margin-bottom: 0; min-height: 0; }

/* ===== Подвал: адрес в одну строку (колонка по ширине содержимого, разделитель сразу после адреса) ===== */
.footer .footer-contact-info { align-items: center; }
.footer .footer-contact-info .footer-info-item,
.footer .footer-contact-info .footer-info-items { width: auto; flex: 0 1 auto; min-width: 0; }
.footer .footer-contact-info .location {
    position: relative; height: 122px; line-height: 1.4; align-items: center;
    padding: 0 32px 0 30px;
}
.footer .footer-contact-info .location::after { left: auto; right: 0; top: 50%; transform: translateY(-50%); }
.footer .icon-location::before { line-height: 1; padding: 0 12px 0 0; }
.footer .content-location { padding: 0; min-width: 0; }
.footer .content-location .heading-16px-rubik { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.footer .footer-contact-info .email { padding-left: 32px; line-height: 1.4; height: 122px; align-items: center; }
.footer .icon-email::before { line-height: 1; padding: 0 12px 0 0; margin-left: 0; }

/* ===== Подвал: меню разделов плитками (иконка в цвете раздела + название) вместо контактов ===== */
.footer .top-footer-right { flex: 1; min-width: 0; }
.footer .footer-nav {
    display: flex; align-items: stretch; height: 122px; margin-left: 10px; margin-right: -0.5%; padding: 10px 8px;
    background-color: var(--primary-color3); border-radius: 10px;
}
.footer .footer-nav__item {
    --fn-c: #348e38; --fn-i: "\f06c";
    position: relative; flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    padding: 6px 4px; border-radius: 10px; text-align: center; text-decoration: none !important;
    transition: background .2s;
}
.footer .footer-nav__item + .footer-nav__item::before {      /* тонкий разделитель между плитками */
    content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: rgba(24, 97, 62, .14);
}
.footer .footer-nav__icon {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
    background: #fff; color: var(--fn-c); box-shadow: 0 2px 8px rgba(16, 60, 36, .08);
    transition: background .2s, color .2s, transform .2s;
}
.footer .footer-nav__icon::before { content: var(--fn-i); font-family: 'FontAwesome'; font-size: 17px; line-height: 1; }
.footer .footer-nav__label { font-size: 13.5px; font-weight: 600; line-height: 1.25; color: #1d3527; }
.footer .footer-nav__item:hover, .footer .footer-nav__item:focus-visible { background: rgba(255, 255, 255, .7); }
.footer .footer-nav__item:hover .footer-nav__icon, .footer .footer-nav__item:focus-visible .footer-nav__icon { background: var(--fn-c); color: #fff; transform: translateY(-2px); }
.footer .footer-nav__item:hover .footer-nav__label { color: var(--fn-c); }
/* цвет и значок — как у баннера раздела */
.footer .footer-nav--media       { --fn-c: #2f8a3a; --fn-i: "\f1ea"; }
.footer .footer-nav--category    { --fn-c: #b26b12; --fn-i: "\f0eb"; }
.footer .footer-nav--journey     { --fn-c: #0e7c86; --fn-i: "\f1bb"; }
.footer .footer-nav--redbook     { --fn-c: #b8322a; --fn-i: "\f1b0"; }
.footer .footer-nav--forteachers { --fn-c: #2d5fa6; --fn-i: "\f19d"; }
.footer .footer-nav--testing     { --fn-c: #18613e; --fn-i: "\f046"; }
.footer .footer-nav--theory      { --fn-c: #6a4c9c; --fn-i: "\f0e8"; }

/* нижняя строка: слева копирайт, справа почта и соцсети */
.footer-bottom .footer-bottom-row {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
    padding-top: 26px;
}
.footer-bottom .footer-bottom-row .copyright-text { margin: 0 !important; padding: 0; text-align: left; line-height: 1.4; }
.footer-bottom .footer-contacts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0 !important; padding: 0; font-size: 14.5px; line-height: 1.4; }
.footer-bottom .copyright { padding-bottom: 26px; }
.footer-bottom .footer-contacts a { color: rgba(255, 255, 255, .8) !important; text-decoration: none !important; }
.footer-bottom .footer-contacts a:hover { color: #fff !important; }
.footer-bottom .footer-contacts .fa { color: #8fd18a; margin-right: 4px; }
.footer-bottom .footer-social { display: inline-flex; gap: 8px; }
.footer-bottom .footer-social a { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.footer-bottom .footer-social .fa { margin: 0; color: #fff; }
@media (max-width: 767px) {
    .footer-bottom .footer-bottom-row { flex-direction: column-reverse; justify-content: center; text-align: center; }
    .footer-bottom .footer-bottom-row .copyright-text { text-align: center; }
    .footer-bottom .footer-contacts { justify-content: center; }
}

/* ===== Видео и анимации: карточки в стиле новостей, превью 16:9 с кнопкой «▶» ===== */
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .flat-WCU-box {
    display: flex; flex-direction: column; height: 100%; margin: 0; overflow: hidden;
    background: #fff; border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 60, 36, .06), 0 6px 20px rgba(16, 60, 36, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .flat-WCU-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 2px 4px rgba(16, 60, 36, .08), 0 14px 32px rgba(16, 60, 36, .14);
}
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .WCU-image {
    position: relative; height: auto; aspect-ratio: 16 / 9; border-radius: 0; background: #e3efe4;
}
:is(.page-sub-videos, .page-sub-animations) .WCU-image > a { position: absolute; inset: 0; display: block; }
:is(.page-sub-videos, .page-sub-animations) .WCU-image img {
    width: 100%; height: 100% !important; object-fit: cover; transition: transform .6s ease;
}
:is(.page-sub-videos, .page-sub-animations) .flat-WCU-box:hover .WCU-image img { transform: scale(1.05); }
/* затемнение и кнопка «▶» по центру */
:is(.page-sub-videos, .page-sub-animations) .WCU-image > a::before {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(6,30,18,.35) 100%);
}
:is(.page-sub-videos, .page-sub-animations) .WCU-image > a::after {
    content: "\f04b"; font-family: 'FontAwesome';
    position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%);
    display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%;
    padding-left: 4px; font-size: 20px; color: #18613e; background: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25); transition: background .25s, color .25s, transform .25s;
}
:is(.page-sub-videos, .page-sub-animations) .flat-WCU-box:hover .WCU-image > a::after {
    background: #348e38; color: #fff; transform: translate(-50%, -50%) scale(1.08);
}
/* заголовок: компактно, без пустого места */
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .features-box { height: auto !important; flex: 1; margin: 0; }
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .content-features { padding: 14px 18px 18px !important; }
:is(.page-sub-videos, .page-sub-animations) .content-features h3 {
    margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.1px; color: #1d3527;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
:is(.page-sub-videos, .page-sub-animations) .flat-WCU-box:hover .content-features h3 { color: #18613e; }
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .mg-bottom-60 { margin-bottom: 0 !important; }
/* пагинация темы на видео/анимациях без страниц (все материалы на одной странице) — только пустые стрелки */
:is(.page-sub-videos, .page-sub-animations) .flat-why-choose-us .themesflat-pagination { display: none; }
