/*
Theme Name: dds_triagestat.com
Author: Дмитрий Кравченко
Description: Информационно-аналитическая тема о цифровых технологиях в организации здравоохранения. Адаптивный дизайн, собственные иллюстрации, без сторонних плагинов.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: tgst
*/

/* ============================================================
   Переменные и сброс
   ============================================================ */
:root {
    --teal-900: #04363f;
    --teal-800: #073e47;
    --teal-700: #0d4f5c;
    --teal-500: #2ec4b6;
    --teal-300: #9be7dc;
    --teal-100: #e3f4f1;
    --ink: #15252b;
    --muted: #5a6b71;
    --bg: #f6faf9;
    --card-bg: #ffffff;
    --line: #dfeae8;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(13, 79, 92, 0.08);
    --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --serif: 'PT Serif', Georgia, 'Times New Roman', serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
}

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

a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.2; color: var(--ink); }

p { margin: 0 0 1em; }

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

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--teal-700); color: #fff; padding: 10px 16px; z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ============================================================
   Контейнер ширины (единый источник)
   ============================================================ */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}
.front-shell {
    width: min(86%, 1180px);
    margin-inline: auto;
}

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-link { display: inline-flex; flex: 0 0 auto; }
.brand-logo { width: 44px; height: 44px; display: block; }
.brand-mark svg { display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title {
    font-weight: 800;
    font-size: 17px;
    color: var(--teal-700);
    line-height: 1.25;
    max-width: 520px;
}
.brand-desc {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 4px;
    max-width: 560px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.main-nav { min-width: 0; }
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.nav-list a {
    display: block;
    padding: 8px 14px;
    border-radius: 9px;
    color: var(--ink);
    font-weight: 600;
    font-size: 15px;
}
.nav-list a:hover { background: var(--teal-100); text-decoration: none; color: var(--teal-700); }
.nav-list .current-menu-item > a { background: var(--teal-700); color: #fff; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 40px;
    background: var(--teal-100);
    border: none; border-radius: 10px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--teal-700);
    margin: 0 auto;
    border-radius: 2px;
}

/* ============================================================
   Кнопки
   ============================================================ */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .12s ease, background .15s ease;
}
.btn-primary {
    background: var(--teal-700);
    color: #fff;
}
.btn-primary:hover { background: var(--teal-800); text-decoration: none; color: #fff; transform: translateY(-1px); }
.btn-secondary {
    background: transparent;
    color: var(--teal-700);
    border-color: var(--teal-700);
}
.btn-secondary:hover { background: var(--teal-700); color: #fff; text-decoration: none; }

/* ============================================================
   Главная — общие блоки
   ============================================================ */
.site-main { padding: 0; }
.block { padding: 56px 0; }
.block + .block { border-top: 1px solid var(--line); }
.block-head { margin-bottom: 32px; max-width: 760px; }
.block-title { font-size: clamp(24px, 3vw, 32px); margin: 0 0 10px; }
.block-sub { color: var(--muted); margin: 0; font-size: 17px; }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--teal-500);
    margin: 0 0 12px;
}

/* Блок 1: текст + иллюстрация */
.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 48px;
    align-items: center;
}
.intro-title { font-size: clamp(28px, 4vw, 44px); margin: 0 0 18px; }
.intro-lead { font-size: 18px; color: var(--muted); margin-bottom: 26px; }
.intro-media img { display: block; width: 100%; height: auto; border-radius: var(--radius); }

/* Блок 2: сетка карточек */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.topic-card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}
.topic-ic { display: inline-flex; margin-bottom: 14px; }
.topic-ic svg { display: block; }
.topic-card h3 { font-size: 18px; margin: 0 0 8px; }
.topic-card p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Последние записи */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.latest-cta { margin-top: 32px; }

/* Блок 3: шаги */
.steps-list {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.step {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}
.step-num {
    flex: 0 0 auto;
    font-weight: 800;
    font-size: 22px;
    color: #fff;
    background: var(--teal-700);
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.step-body { min-width: 0; }
.step-body h3 { margin: 0 0 6px; font-size: 18px; }
.step-body p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Блок 4: FAQ */
.faq-list { display: grid; gap: 14px; max-width: 860px; }
.faq-item {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 22px;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 17px;
    padding: 18px 0;
    list-style: none;
    position: relative;
    padding-right: 30px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 2px; top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--teal-500);
    font-weight: 400;
}
.faq-item[open] summary::after { content: '–'; }
.faq-answer { padding: 0 0 18px; color: var(--muted); }
.faq-answer p { margin: 0; }

.empty-note { color: var(--muted); }

/* ============================================================
   Карточки записей (A8 / A10)
   ============================================================ */
.card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb-wrap {
    overflow: hidden;
}
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img,
.card-thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px;
}
.card-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.card-meta a { color: var(--teal-700); font-weight: 600; }
.card-meta .post-meta-cat::before { content: '• '; color: var(--line); }
.card-title { font-size: 19px; margin: 0 0 12px; line-height: 1.3; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--teal-700); text-decoration: none; }
.card-excerpt { color: var(--muted); font-size: 15.5px; margin-bottom: 16px; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 700;
    color: var(--teal-700);
}

/* ============================================================
   Раскладки страниц (A12)
   ============================================================ */
.page-wrap { padding: 32px 0 64px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    column-gap: 6%;
    align-items: start;
}
.layout-single { display: block; }
.layout-single .content-area {
    width: 85%;
    margin-inline: auto;
}

.page-head { margin-bottom: 28px; }
.page-title { font-size: clamp(26px, 3.4vw, 38px); margin: 0; }
.archive-desc { color: var(--muted); margin-top: 10px; }

.post-feed { display: grid; gap: 26px; }

/* ============================================================
   Сайдбар (светлый фон → тёмный текст)
   ============================================================ */
.sidebar {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    color: var(--ink);
}
.sidebar .widget + .widget { margin-top: 26px; }
.sidebar .widget-title {
    font-size: 16px;
    margin: 0 0 14px;
    color: var(--teal-700);
    border-bottom: 2px solid var(--teal-100);
    padding-bottom: 8px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin-bottom: 10px; line-height: 1.4; }
.sidebar a { color: var(--ink); }
.sidebar a:hover { color: var(--teal-700); }
.sidebar .post-date { display: block; font-size: 12.5px; color: var(--muted); }

/* ============================================================
   Одиночная запись / страница
   ============================================================ */
.single-post { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.single-head { margin-bottom: 22px; }
.single-title { font-size: clamp(26px, 3.6vw, 40px); margin: 0 0 14px; }
.single-meta { font-size: 14px; color: var(--muted); }
.single-meta a { color: var(--teal-700); font-weight: 600; }
.single-thumb { margin: 0 0 26px; border-radius: var(--radius); overflow: hidden; }
.single-thumb img { display: block; width: 100%; height: auto; }
.entry-content { font-family: var(--serif); font-size: 18px; line-height: 1.75; }
.entry-content h2 { font-family: var(--sans); font-size: 26px; margin: 1.6em 0 .5em; }
.entry-content h3 { font-family: var(--sans); font-size: 21px; margin: 1.4em 0 .5em; }
.entry-content img { border-radius: 12px; display: block; }
.entry-content a { text-decoration: underline; }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 16px 22px;
    border-left: 4px solid var(--teal-500);
    background: var(--teal-100);
    border-radius: 0 12px 12px 0;
    font-style: italic;
}
.single-tags { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
    background: var(--teal-100);
    color: var(--teal-700);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 600;
}
.tag-chip:hover { background: var(--teal-300); text-decoration: none; }

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 26px 0;
    font-weight: 600;
}
.post-nav-next { text-align: right; margin-left: auto; }

/* Таблицы в контенте */
.entry-content table { border-collapse: collapse; width: 100%; margin: 1.4em 0; }
.entry-content table, .entry-content th, .entry-content td { border: 1px solid var(--line); }
.entry-content th, .entry-content td { padding: 10px 14px; text-align: left; }
.entry-content th { background: var(--teal-100); }

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area { margin-top: 34px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.comments-title { font-size: 22px; margin: 0 0 20px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list ol.children { list-style: none; padding-left: 26px; }
.comment-inner { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.comment-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.comment-author { font-weight: 700; }
.comment-date { font-size: 12.5px; color: var(--muted); }
.comment-await { color: #b06a00; font-size: 14px; }
.comment-reply a { font-weight: 600; font-size: 14px; }
.comment-form { display: grid; gap: 14px; }
.comment-form label { font-weight: 600; font-size: 14px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: 15px;
}
.comment-form textarea { min-height: 130px; }

/* ============================================================
   Поиск
   ============================================================ */
.search-form { display: flex; gap: 8px; max-width: 480px; margin: 16px 0; }
.search-field {
    flex: 1; min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit; font-size: 15px;
}
.search-submit {
    padding: 12px 20px;
    background: var(--teal-700);
    color: #fff;
    border: none; border-radius: 10px;
    font-weight: 700; cursor: pointer;
}
.search-submit:hover { background: var(--teal-800); }

/* ============================================================
   Хлебные крошки
   ============================================================ */
.breadcrumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.breadcrumbs a { color: var(--teal-700); }
.breadcrumbs .sep { margin: 0 6px; color: #aac4bf; }

/* ============================================================
   Пагинация (type => plain → .page-numbers)
   ============================================================ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 36px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.pagination a.page-numbers:hover { border-color: var(--teal-500); color: var(--teal-700); }
.pagination .page-numbers.current {
    background: var(--teal-700);
    border-color: var(--teal-700);
    color: #fff;
}
.pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* ============================================================
   404
   ============================================================ */
.error-404 { text-align: center; padding: 40px 0; }
.error-code { font-size: clamp(64px, 12vw, 120px); font-weight: 800; color: var(--teal-100); margin: 0; line-height: 1; }
.error-text { color: var(--muted); max-width: 520px; margin: 12px auto 22px; }
.error-404 .search-form { margin-inline: auto; }
.error-home { margin-top: 24px; }

/* ============================================================
   Подвал (тёмный фон → светлый текст виджетов)
   ============================================================ */
.site-footer {
    background: var(--teal-900);
    color: #cfe2e0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 52px 0 40px;
}
.footer-col .widget + .widget { margin-top: 24px; }
.footer-col .widget-title {
    color: #ffffff;
    font-size: 16px;
    margin: 0 0 14px;
}
.footer-col,
.footer-col p,
.footer-col li,
.footer-col .widget {
    color: #cfe2e0;
    font-size: 15px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #9be7dc; }
.footer-col a:hover { color: #ffffff; }
.footer-col .post-date { color: #8fb3af; font-size: 12.5px; display: block; }

.footer-bottom {
    background: rgba(0, 0, 0, 0.22);
    padding: 18px 0;
}
.copyright { margin: 0; font-size: 14px; color: #a9c6c2; }

/* ============================================================
   Cookie-баннер (A11: правило [hidden] до основного блока)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    background: var(--teal-900);
    color: #e6f1ef;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; font-size: 14px; flex: 1; min-width: 220px; }
.cookie-accept {
    flex: 0 0 auto;
    padding: 11px 26px;
    background: var(--teal-500);
    color: var(--teal-900);
    border: none; border-radius: 10px;
    font-weight: 700; cursor: pointer;
}
.cookie-accept:hover { background: var(--teal-300); }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .intro-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
    .intro-media { order: -1; }
    .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); row-gap: 36px; }
    .layout-single .content-area { width: 100%; }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: flex; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .nav-list { flex-direction: column; gap: 4px; }
    .nav-list a { padding: 12px 14px; }
    .topics-grid { grid-template-columns: minmax(0, 1fr); }
    .latest-grid { grid-template-columns: minmax(0, 1fr); }
    .steps-list { grid-template-columns: minmax(0, 1fr); }
    .footer-cols { grid-template-columns: minmax(0, 1fr); }
    .block { padding: 40px 0; }
    .single-post { padding: 22px; }
    .post-nav { flex-direction: column; }
    .post-nav-next { text-align: left; margin-left: 0; }
    .brand-desc { display: none; }
}
