/*
Theme Name: dds_tms-neuromag.ru
Author: Ольга Вячеславовна Сомова
Description: Тема для клинического справочника по детской речевой неврологии, нейропсихологии и нейрореабилитации.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: neuromag
*/

/* ============================================================
   1. Переменные и база
   ============================================================ */

:root {
    --paper: #F4F7FA;
    --alt: #E8EEF4;
    --ink: #1E2A36;
    --accent: #2B6C8E;
    --accent-2: #4A8BA7;
    --muted: #7A8B9F;
    --line: #DCE4EC;
    --deep: #1B2A3B;
    --warm: #9E4A4A;
    --white: #FFFFFF;
    --font-head: "Futura", "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    --font-body: "Charter", Georgia, "Times New Roman", serif;
    --gap-section: 120px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--paper);
    background-image:
        radial-gradient(circle at 1px 1px, rgba(30, 42, 54, 0.055) 1px, transparent 0),
        radial-gradient(circle at 4px 6px, rgba(30, 42, 54, 0.035) 1px, transparent 0);
    background-size: 7px 7px, 11px 11px;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--accent);
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--ink);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: left;
    margin: 0 0 0.7em;
}

h1 {
    font-size: 3.5rem;
    letter-spacing: 0.01em;
    margin-bottom: 1em;
}

h2 { font-size: 2rem; }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.2rem; }

p {
    margin: 0 0 1.2em;
}

.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Ссылки в текстовом потоке — подчёркивание появляется справа налево */
.entry-body a,
.card-excerpt a,
.widget-area a,
.comment-text a {
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 100% 100%;
    background-repeat: no-repeat;
    background-size: 0 1px;
    transition: background-size 0.28s ease, color 0.2s ease;
    padding-bottom: 1px;
}

.entry-body a:hover,
.card-excerpt a:hover,
.widget-area a:hover,
.comment-text a:hover {
    background-size: 100% 1px;
    color: var(--accent-2);
}

/* ============================================================
   2. Кнопки
   ============================================================ */

.btn {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.85rem 1.8rem;
    border: 2px solid var(--accent);
    border-radius: 4px;
    color: var(--accent);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.btn:hover,
.btn:focus {
    background: var(--accent);
    color: var(--white);
    transform: translateY(2px);
}

.btn-solid {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.btn-solid:hover,
.btn-solid:focus {
    background: var(--deep);
    border-color: var(--deep);
    color: var(--white);
}

.btn-cut {
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

/* ============================================================
   3. Шапка
   ============================================================ */

.site-header {
    position: relative;
    background: rgba(244, 247, 250, 0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 1.6rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.brand-logo,
.brand-mark {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    display: block;
}

.brand-text {
    min-width: 0;
}

.brand-title {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.35;
    color: var(--ink);
    max-width: 46ch;
}

.brand-desc {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--muted);
    margin-top: 0.4rem;
    max-width: 52ch;
    display: none;
}

.nav-toggle {
    display: none;
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: 4px;
    color: var(--accent);
    padding: 0.55rem 1rem;
    cursor: pointer;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.main-nav a {
    font-family: var(--font-head);
    font-size: 0.92rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink);
    position: relative;
    padding-bottom: 4px;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: auto;
    right: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.28s ease;
}

.main-nav a:hover::after,
.main-nav .current-menu-item > a::after {
    width: 100%;
    left: 0;
    right: auto;
}

.main-nav .current-menu-item > a {
    color: var(--accent);
}

/* ============================================================
   4. Общая раскладка страниц
   ============================================================ */

.site-main {
    padding: 3.2rem 0 5rem;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    column-gap: 6%;
    align-items: start;
}

.layout-single {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

.content-area {
    min-width: 0;
}

.breadcrumbs {
    font-family: var(--font-head);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 2.2rem;
}

.breadcrumbs a {
    color: var(--muted);
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumbs .sep {
    margin: 0 0.45rem;
    color: var(--accent-2);
}

.page-head {
    margin-bottom: 3rem;
}

.page-head h1 {
    font-size: 2.6rem;
    margin-bottom: 0.6rem;
}

.page-head .page-sub {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 62ch;
}

/* Заголовок секции: синий квадрат слева + линия 2/3 снизу */
.sec-title {
    position: relative;
    padding-left: 26px;
    padding-bottom: 20px;
    margin-bottom: 2.4rem;
    font-size: 1.9rem;
}

.sec-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 10px;
    height: 10px;
    background: var(--accent);
}

.sec-title::after {
    content: "";
    position: absolute;
    left: 26px;
    bottom: 0;
    width: 66%;
    height: 1px;
    background: var(--line);
}

.sec-note {
    color: var(--muted);
    max-width: 66ch;
    margin: -1.2rem 0 2.6rem 26px;
}

/* ============================================================
   5. Карточки записей
   ============================================================ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.card-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

.card {
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 2px;
    overflow: hidden;
    min-width: 0;
    transition: background-color 0.25s ease;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.35s ease;
    z-index: 2;
}

.card:hover::before {
    width: 100%;
}

.card:hover {
    background: #EEF3F8;
}

.card-thumb-wrap {
    display: block;
    overflow: hidden;
    background: var(--alt);
}

.card-thumb-wrap a {
    display: block;
}

.card-thumb-wrap img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    filter: grayscale(1) sepia(1) hue-rotate(165deg) saturate(2.2) contrast(0.95);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.5rem 1.7rem;
    min-width: 0;
}

.card-meta {
    font-family: var(--font-head);
    font-size: 0.76rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.7rem;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 0.7rem;
}

.card-title a {
    color: var(--ink);
}

.card-title a:hover {
    color: var(--accent);
}

.card-excerpt {
    color: #33475A;
    font-size: 0.95rem;
    margin-bottom: 1.3rem;
}

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-more {
    margin-top: auto;
    font-family: var(--font-head);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    align-self: flex-start;
    border-bottom: 1px solid transparent;
}

.card-more:hover {
    border-bottom-color: var(--accent);
}

/* Горизонтальные карточки в ленте */
.card-list .card {
    flex-direction: row;
}

.card-list .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}

.card-list .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.card-list .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    display: block;
}

/* ============================================================
   6. Главная страница
   ============================================================ */

.front-section {
    padding: var(--gap-section) 0;
}

.front-section.is-alt {
    background: var(--alt);
}

/* 6.1 Hero */
.fs-hero {
    position: relative;
    padding: 5.5rem 0 6rem;
    background: linear-gradient(135deg, #E8EEF4 0%, #F4F7FA 100%);
    overflow: hidden;
}

.fs-hero::after {
    content: "";
    position: absolute;
    right: -140px;
    bottom: -180px;
    width: 480px;
    height: 480px;
    border-radius: 48% 52% 60% 40% / 55% 45% 55% 45%;
    background: var(--accent);
    opacity: 0.05;
    filter: blur(6px);
    pointer-events: none;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 60px;
    align-items: center;
}

.hero-eyebrow {
    font-family: var(--font-head);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.6rem;
    display: block;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 500;
    margin-bottom: 1.4rem;
}

.hero-title .accent-warm {
    color: var(--warm);
    display: block;
    margin-left: -0.06em;
}

.hero-lead {
    color: #33475A;
    max-width: 54ch;
    margin-bottom: 2.4rem;
}

.hero-text,
.hero-art,
.footer-col {
    min-width: 0;
}

.hero-art img {
    width: 100%;
    height: auto;
}

/* 6.2 Глоссарий */
.glossary-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.glossary-row {
    display: grid;
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
    gap: 40px;
    padding: 1.9rem 0;
    border-bottom: 1px solid #D3DDE7;
}

.glossary-row:first-child {
    border-top: 1px solid #D3DDE7;
}

.glossary-term {
    position: relative;
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink);
    padding-left: 24px;
    min-width: 0;
}

.glossary-term::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 10px;
    height: 10px;
    background: var(--accent);
}

.glossary-def {
    font-size: 0.94rem;
    color: #33475A;
    min-width: 0;
}

.glossary-def p:last-child {
    margin-bottom: 0;
}

/* 6.3 Последние записи */
.fs-latest .latest-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.fs-latest .latest-all {
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
}

.fs-latest .latest-all:hover {
    border-bottom-color: var(--accent);
}

/* 6.4 Таймлайн */
.timeline {
    position: relative;
    padding-left: 46px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 6px;
    background: #CBD6E1;
}

.tl-item {
    position: relative;
    padding: 0 0 2.8rem;
    min-width: 0;
}

.tl-item:last-child {
    padding-bottom: 0;
}

.tl-item::before {
    content: "";
    position: absolute;
    left: -46px;
    top: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--paper);
    border: 3px solid var(--accent);
    transition: background-color 0.25s ease;
}

.front-section.is-alt .tl-item::before {
    background: var(--alt);
}

.tl-item:hover::before {
    background: var(--accent);
}

.tl-stage {
    font-family: var(--font-head);
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 0.5rem;
}

.tl-item h3 {
    font-size: 1.22rem;
    margin-bottom: 0.5rem;
}

.tl-item p {
    color: #33475A;
    font-size: 0.95rem;
    max-width: 72ch;
    margin-bottom: 0;
}

/* 6.5 Рубрикатор */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

.topic-tile {
    position: relative;
    display: block;
    min-width: 0;
    padding: 2.2rem 1.9rem 2.4rem;
    border: 1px solid rgba(43, 108, 142, 0.45);
    border-radius: 2px;
    background: var(--paper);
    color: var(--ink);
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.topic-tile:hover {
    transform: translateY(6px);
    border-color: var(--accent);
    border-width: 2px;
    background: var(--white);
}

.topic-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    opacity: 0.55;
}

.topic-tile h3 {
    font-size: 1.18rem;
    margin: 0 0 0.7rem;
    padding-right: 44px;
}

.topic-tile p {
    font-size: 0.92rem;
    color: #33475A;
    margin: 0;
}

.topic-more {
    display: inline-block;
    margin-top: 1.2rem;
    font-family: var(--font-head);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ============================================================
   7. Запись и страница
   ============================================================ */

.entry-header {
    margin-bottom: 2.4rem;
}

.entry-header h1 {
    font-size: 2.7rem;
    margin-bottom: 0.8rem;
}

.entry-meta {
    font-family: var(--font-head);
    font-size: 0.8rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}

.entry-thumb {
    margin-bottom: 2.4rem;
}

.entry-thumb img {
    width: 100%;
    display: block;
    filter: grayscale(1) sepia(1) hue-rotate(165deg) saturate(2.2) contrast(0.95);
}

.entry-body {
    font-size: 1.03rem;
}

.entry-body h2,
.entry-body h3,
.entry-body h4 {
    margin-top: 2.2rem;
}

.entry-body h2 {
    position: relative;
    padding-left: 26px;
}

.entry-body h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 10px;
    height: 10px;
    background: var(--accent);
}

.entry-body img {
    height: auto;
    margin: 1.6rem 0;
}

.entry-body ul {
    list-style: none;
    padding-left: 0;
    margin: 0 0 1.4em;
}

.entry-body ul li,
.widget ul li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 0.55em;
}

.entry-body ul li::before,
.widget ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 8px;
    height: 8px;
    background: var(--accent);
}

.entry-body ol {
    list-style: none;
    counter-reset: neuro-ol;
    padding-left: 0;
    margin: 0 0 1.4em;
}

.entry-body ol > li {
    counter-increment: neuro-ol;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    column-gap: 18px;
    margin-bottom: 0.7em;
}

.entry-body ol > li::before {
    content: counter(neuro-ol);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--accent);
    text-align: right;
    line-height: 1.5;
}

.entry-body blockquote {
    margin: 2rem 0;
    padding: 1.6rem 1.8rem;
    border-left: 4px solid var(--accent);
    background: linear-gradient(120deg, var(--alt) 0%, var(--paper) 100%);
    color: #2A3A4A;
    font-size: 1.05rem;
}

.entry-body blockquote p:last-child {
    margin-bottom: 0;
}

.entry-body table,
.comment-text table,
.widget table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6rem 0;
    font-size: 0.94rem;
    background: var(--white);
}

.entry-body table th,
.entry-body table td,
.comment-text table th,
.comment-text table td,
.widget table th,
.widget table td {
    border: 1px solid var(--line);
    padding: 0.7rem 0.9rem;
    text-align: left;
}

.entry-body table th {
    background: var(--alt);
    font-family: var(--font-head);
    letter-spacing: 0.03em;
}

/* «Асимметричный бордер» для акцентных блоков внутри статьи */
.entry-body .wp-block-group,
.callout {
    position: relative;
    padding: 1.6rem 1.8rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 2px;
    margin: 2rem 0 2.6rem;
}

.callout::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 10px;
    bottom: -10px;
    width: 1px;
    background: var(--accent-2);
}

.entry-tags {
    margin-top: 2.6rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
    color: var(--muted);
}

.entry-tags a {
    display: inline-block;
    margin-right: 0.6rem;
}

/* ============================================================
   8. Сайдбар и виджеты
   ============================================================ */

.sidebar {
    min-width: 0;
    background: var(--white);
    box-shadow: 0 2px 18px rgba(27, 42, 59, 0.07);
    padding: 1.8rem 1.6rem 2rem;
    border-radius: 2px;
}

.sidebar .widget {
    margin-bottom: 2.2rem;
    color: var(--ink);
}

.sidebar .widget:last-child {
    margin-bottom: 0;
}

.sidebar .widget-title {
    position: relative;
    font-size: 1.05rem;
    padding-left: 22px;
    padding-bottom: 14px;
    margin-bottom: 1.2rem;
    color: var(--ink);
}

.sidebar .widget-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 10px;
    height: 10px;
    background: var(--accent);
}

.sidebar .widget-title::after {
    content: "";
    position: absolute;
    left: 22px;
    bottom: 0;
    width: 60%;
    height: 1px;
    background: var(--line);
}

.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
}

.sidebar .widget ul li {
    margin-bottom: 0.85em;
    color: var(--ink);
}

.sidebar .widget a {
    color: var(--ink);
}

.sidebar .widget a:hover {
    color: var(--accent);
}

.sidebar .widget .post-date {
    display: block;
    font-family: var(--font-head);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-top: 0.2rem;
}

/* ============================================================
   9. Подвал
   ============================================================ */

.site-footer {
    background: var(--deep);
    color: #C6D2DE;
    padding: 4.5rem 0 2.2rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 44px;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(198, 210, 222, 0.18);
}

.footer-cols .widget {
    min-width: 0;
    color: #C6D2DE;
    font-size: 0.94rem;
}

.footer-cols .widget p {
    color: #C6D2DE;
}

.footer-cols .widget-title {
    position: relative;
    color: var(--white);
    font-size: 1rem;
    padding-left: 22px;
    margin-bottom: 1.2rem;
}

.footer-cols .widget-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 10px;
    height: 10px;
    background: var(--accent-2);
}

.footer-cols .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-cols .widget ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 0.7em;
}

.footer-cols .widget ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 7px;
    height: 7px;
    background: var(--accent-2);
}

.footer-cols .widget a {
    color: #C6D2DE;
}

.footer-cols .widget a:hover {
    color: var(--white);
}

.footer-cols .widget .post-date {
    display: block;
    font-size: 0.78rem;
    color: #93A5B8;
}

.site-copy {
    padding-top: 1.8rem;
    font-family: var(--font-head);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    color: #93A5B8;
}

/* ============================================================
   10. Пагинация, поиск, комментарии
   ============================================================ */

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 3.2rem;
}

.pager .page-numbers {
    display: inline-block;
    min-width: 44px;
    text-align: center;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--white);
    font-family: var(--font-head);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: var(--ink);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pager a.page-numbers:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    transform: translateY(2px);
}

.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.pager .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form .search-field {
    flex: 1 1 200px;
    min-width: 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
}

.search-form .search-field:focus {
    outline: 2px solid var(--accent-2);
    outline-offset: 1px;
}

.comments-area {
    margin-top: 4rem;
    padding-top: 2.4rem;
    border-top: 1px solid var(--line);
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 1.8rem;
}

.comment-list {
    list-style: none;
    margin: 0 0 2.4rem;
    padding: 0;
}

.comment-list ol.children {
    list-style: none;
    margin: 1.4rem 0 0;
    padding-left: 1.8rem;
    border-left: 1px solid var(--line);
}

.comment-inner {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 1.3rem 1.5rem;
    margin-bottom: 1.4rem;
}

.comment-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.7rem;
}

.comment-author {
    font-family: var(--font-head);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.comment-date,
.comment-hold {
    font-size: 0.8rem;
    color: var(--muted);
}

.comment-actions {
    font-family: var(--font-head);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.comment-respond {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 1.8rem 1.8rem 2rem;
}

.comment-respond .comment-reply-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--paper);
}

.comment-form textarea {
    min-height: 150px;
}

.comment-form .submit {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.8rem 1.7rem;
    border: 2px solid var(--accent);
    border-radius: 4px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.comment-form .submit:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(2px);
}

/* ============================================================
   11. 404
   ============================================================ */

.error-block {
    padding: 1rem 0 3rem;
}

.error-code {
    font-family: var(--font-head);
    font-size: 5rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 1.4rem;
}

.error-block .search-form {
    max-width: 520px;
    margin: 2rem 0;
}

/* ============================================================
   12. Cookie-баннер
   ============================================================ */

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.6rem;
    flex-wrap: wrap;
    padding: 1.1rem 2rem;
    background: var(--deep);
    color: #D5DEE7;
    border-top: 3px solid var(--accent);
    font-size: 0.9rem;
}

.cookie-banner p {
    margin: 0;
    min-width: 0;
    max-width: 78ch;
}

.cookie-banner a {
    color: #9FC4D8;
}

.cookie-accept {
    flex: 0 0 auto;
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.65rem 1.5rem;
    border: 2px solid var(--accent-2);
    border-radius: 4px;
    background: transparent;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.22s ease, transform 0.22s ease;
}

.cookie-accept:hover {
    background: var(--accent);
    transform: translateY(2px);
}

/* ============================================================
   13. Адаптив
   ============================================================ */

@media (min-width: 961px) {
    .brand-desc {
        display: block;
    }
}

@media (max-width: 960px) {
    :root {
        --gap-section: 78px;
    }

    h1 { font-size: 2.5rem; }
    .hero-title { font-size: 2.6rem; }

    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 46px;
    }

    .layout-single {
        width: 100%;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-toggle {
        display: inline-block;
    }

    .main-nav {
        flex: 1 1 100%;
    }

    .main-nav[hidden] {
        display: none !important;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-top: 1.4rem;
    }
}

@media (max-width: 600px) {
    :root {
        --gap-section: 58px;
    }

    body {
        font-size: 16px;
    }

    h1 { font-size: 2.05rem; }
    h2 { font-size: 1.6rem; }

    .hero-title { font-size: 2.15rem; }

    .fs-hero {
        padding: 3.4rem 0 3.8rem;
    }

    .site-main {
        padding: 2.2rem 0 3.4rem;
    }

    .card-grid,
    .topic-grid,
    .footer-cols {
        grid-template-columns: minmax(0, 1fr);
    }

    .glossary-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .card-list .card {
        flex-direction: column;
    }

    .card-list .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }

    .card-list .card-thumb-wrap a {
        position: static;
    }

    .card-list .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .entry-body blockquote {
        padding: 1.2rem 1.2rem;
    }

    .topic-tile {
        padding: 1.8rem 1.4rem 2rem;
    }

    .comment-respond {
        padding: 1.3rem 1.2rem 1.5rem;
    }

    .cookie-banner {
        padding: 1rem 1.2rem;
    }

    .sidebar {
        padding: 1.4rem 1.2rem 1.6rem;
    }

    .timeline {
        padding-left: 34px;
    }

    .timeline::before {
        left: 5px;
    }

    .tl-item::before {
        left: -34px;
        width: 16px;
        height: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}
