/*
Theme Name: dds_cmk56.ru
Description: Тема «Ясность» для независимого медицинского справочника с экспертной редакцией.
Author: Анна Ковалёва
Version: 1.1
Text Domain: yasmed
*/

:root {
    --bg: #F7FAFC;
    --bg-alt: #EDF2F7;
    --ink: #1A202C;
    --ink-soft: #4A5568;
    --muted: #718096;
    --accent: #2B6CB0;
    --accent-2: #38B2AC;
    --line: #E2E8F0;
    --line-2: #CBD5E0;
    --deep: #1A365D;
    --side: #F0F5FA;
    --pale: #BEE3F8;
    --font-head: "Manrope", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    --font-body: "Source Sans Pro", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --shadow-card: 0 2px 8px rgba(26, 54, 93, 0.08);
    --shadow-card-hover: 0 8px 20px rgba(26, 54, 93, 0.12);
}

/* скрытие через атрибут hidden — до основных стилей элементов */
.cookie-banner[hidden] { display: none !important; }
[hidden] { display: none !important; }

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        repeating-linear-gradient(45deg, rgba(226, 232, 240, 0.15) 0 1px, transparent 1px 14px),
        repeating-linear-gradient(-45deg, rgba(226, 232, 240, 0.15) 0 1px, transparent 1px 14px);
}

body::after {
    content: "";
    position: fixed;
    top: 40px;
    right: -60px;
    width: 420px;
    height: 420px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.04;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M38 4h24v34h34v24H62v34H38V62H4V38h34z' fill='%232B6CB0'/%3E%3C/svg%3E");
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--ink);
    line-height: 1.22;
    letter-spacing: -0.01em;
    margin: 0 0 0.6em;
}

h1 { font-size: 3.2rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1.1em; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: 0.4em; }

/* --- контейнеры ------------------------------------------------------- */

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

.site-main { display: block; padding-bottom: 80px; }
.page-body { padding-top: 34px; }

.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
    min-width: 0;
}

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

.layout-with-sidebar .content-area { min-width: 0; }

/* --- верхняя полоса и шапка ------------------------------------------ */

.topline {
    height: 3px;
    background: linear-gradient(to right, var(--accent) 0 60%, var(--accent-2) 60% 100%);
}

.site-head {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.head-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 320px;
}

.brand-mark { display: block; flex: 0 0 auto; line-height: 0; }
.brand-mark img { display: block; max-height: 56px; width: auto; }

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

.brand-name {
    display: block;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.3;
    color: var(--ink);
}

.brand-desc {
    margin: 4px 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--muted);
    max-width: 46ch;
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font: inherit;
    font-size: 0.9rem;
    color: var(--accent);
    background: transparent;
    border: 1.5px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
}

.site-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin: 0;
    padding: 0;
}

.site-nav li { margin: 0; }

.site-nav a {
    position: relative;
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    padding-bottom: 3px;
}

.site-nav a::after,
.entry-content a:not(.btn)::after,
.crumbs a::after,
.widget a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--accent-2);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
}

.site-nav a:hover::after,
.entry-content a:not(.btn):hover::after,
.crumbs a:hover::after,
.widget a:hover::after { transform: scaleX(1); }

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

.entry-content a:not(.btn),
.crumbs a,
.widget a { position: relative; display: inline; }

/* --- кнопки ----------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 12px 26px;
    font-family: var(--font-head);
    font-size: 0.97rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.btn-filled { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--accent); }

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.25);
}

.btn-hero {
    background: #fff;
    color: var(--accent);
    border-color: #fff;
}

.btn-hero:hover {
    background: transparent;
    color: #fff;
    border-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* --- хлебные крошки --------------------------------------------------- */

.crumbs {
    font-size: 0.86rem;
    color: var(--muted);
    padding: 22px 0 6px;
}

.crumbs .sep { margin: 0 7px; color: var(--line-2); }

/* --- заголовки секций и контента -------------------------------------- */

.sec-title {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 2rem;
    margin: 0 0 1.4rem;
}

.sec-title::before {
    content: "";
    flex: 0 0 40px;
    width: 40px;
    height: 2px;
    background: var(--accent);
}

.page-title { margin: 0 0 1.6rem; font-size: 2.4rem; }

.entry-content h2,
.entry-content h3 { position: relative; padding-left: 18px; }

.entry-content h2::before,
.entry-content h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-2);
}

/* --- главная: секции --------------------------------------------------- */

.fs { padding: 86px 0; }
.fs-main { background: var(--bg); }
.fs-alt { background: linear-gradient(to bottom, var(--bg-alt), var(--bg)); }

/* Блок 1 — hero */

.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #fff;
}

.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
}

.hero-veil {
    position: absolute;
    inset: 0;
    background: rgba(26, 54, 93, 0.7);
    z-index: 1;
}

.hero-inner {
    position: relative;
    z-index: 2;
    padding: 74px 0;
    max-width: 780px;
}

.hero h1 { color: #fff; margin-bottom: 0.5em; }

.hero-sub {
    color: var(--pale);
    font-size: 1.16rem;
    max-width: 62ch;
    margin-bottom: 1.8em;
}

/* Блок 2 — статистика */

.stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 26px;
}

.stat {
    flex: 1 1 180px;
    min-width: 0;
    position: relative;
    text-align: center;
    padding: 0 12px;
}

.stat + .stat::before {
    content: "";
    position: absolute;
    left: -13px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: var(--line-2);
}

.stat-num {
    font-family: var(--font-head);
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--accent);
}

.stat-label {
    margin: 8px 0 0;
    font-size: 0.93rem;
    color: var(--muted);
}

/* Блок 3 — шаги */

.steps {
    position: relative;
    padding-left: 34px;
    border-left: 1px solid var(--accent);
    display: grid;
    gap: 40px;
}

.step {
    display: grid;
    grid-template-columns: minmax(0, 96px) minmax(0, 1fr);
    align-items: start;
    gap: 22px;
}

.step-num {
    font-family: var(--font-head);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: rgba(56, 178, 172, 0.3);
}

.step h3 { margin: 0 0 0.4em; }
.step p { margin: 0; color: var(--ink-soft); }

/* Блок 4 — FAQ */

.faq { display: block; max-width: 900px; }

.faq-item { border-bottom: 1px solid var(--line-2); }

.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    padding: 20px 4px;
    font-family: var(--font-head);
    font-size: 1.08rem;
    font-weight: 600;
    text-align: left;
    color: var(--ink);
    background: none;
    border: 0;
    cursor: pointer;
}

.faq-mark {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--accent);
    transition: transform 0.28s ease;
}

.faq-item.is-open .faq-mark { transform: rotate(180deg); }

.faq-a {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
}

.faq-a-inner {
    padding: 0 4px 22px 24px;
    color: var(--ink-soft);
}

.faq-a-inner p:last-child { margin-bottom: 0; }

/* --- карточки записей -------------------------------------------------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent);
}

.card-thumb {
    display: block;
    border-bottom: 1px solid var(--bg-alt);
}

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

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 22px 22px 24px;
}

.card-title {
    font-size: 1.22rem;
    margin: 0 0 0.6em;
}

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

.card-excerpt {
    color: var(--ink-soft);
    font-size: 0.97rem;
    margin-bottom: 1.1em;
}

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

.card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.card-date { font-size: 0.85rem; color: var(--muted); }

.card-more {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--accent);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.tag {
    display: inline-block;
    padding: 3px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.6;
}

/* --- записи и страницы ------------------------------------------------- */

.entry-header { margin-bottom: 26px; }

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 14px;
}

.entry-thumb {
    margin: 0 0 28px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.entry-thumb img { display: block; width: 100%; height: auto; }

.entry-content { font-size: 1.04rem; }

.entry-content img { border-radius: 10px; }

.entry-content blockquote {
    margin: 1.8em 0;
    padding: 22px 26px;
    background: var(--bg-alt);
    border-left: 3px solid var(--accent-2);
    border-radius: 10px;
    color: var(--ink-soft);
}

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

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    border: 1px solid var(--line-2);
}

.entry-content th,
.entry-content td {
    border: 1px solid var(--line-2);
    padding: 10px 14px;
    text-align: left;
}

.entry-content th { background: var(--bg-alt); font-family: var(--font-head); }

.table-scroll { overflow-x: auto; }

.entry-footer {
    margin-top: 32px;
    padding: 20px 22px;
    background: var(--side);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 0.93rem;
    color: var(--ink-soft);
}

/* --- сайдбар ----------------------------------------------------------- */

.sidebar {
    min-width: 0;
    background: var(--side);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px 24px 8px;
}

.sidebar .widget { margin-bottom: 26px; }

.sidebar .widget-title {
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 0.8em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.sidebar .widget,
.sidebar .widget p,
.sidebar .widget li { color: var(--ink-soft); }

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

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

.sidebar .widget li {
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.96rem;
}

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

.sidebar .post-date { display: block; font-size: 0.82rem; color: var(--muted); }

/* --- пагинация --------------------------------------------------------- */

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 44px;
}

.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pager a.page-numbers:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.25);
    border-color: var(--accent);
}

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

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

/* --- поиск ------------------------------------------------------------- */

.search-form {
    display: flex;
    gap: 10px;
    max-width: 480px;
}

.search-form .search-field {
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 15px;
    font: inherit;
    font-size: 0.97rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 8px;
}

.search-form .search-field:focus {
    outline: none;
    border-color: var(--accent);
}

/* --- комментарии ------------------------------------------------------- */

.comments-area {
    margin-top: 48px;
    padding-top: 34px;
    border-top: 1px solid var(--line);
}

.comment-list { list-style: none; margin: 0 0 32px; padding: 0; }
.comment-list .children { list-style: none; margin: 0; padding-left: 26px; }

.comment-inner {
    padding: 20px 22px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}

.comment-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 8px;
}

.comment-author { font-family: var(--font-head); font-weight: 600; }
.comment-date { font-size: 0.84rem; color: var(--muted); }
.comment-wait { font-size: 0.88rem; color: var(--accent-2); }
.comment-actions { font-size: 0.9rem; }

.comment-respond {
    padding: 26px 26px 10px;
    background: var(--side);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    font: inherit;
    font-size: 0.97rem;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 8px;
}

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

.comment-form .submit {
    display: inline-block;
    padding: 12px 26px;
    font-family: var(--font-head);
    font-size: 0.97rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.comment-form .submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.25);
}

/* --- 404 --------------------------------------------------------------- */

.page404 {
    padding: 30px 30px 34px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}

.page404 .code {
    font-family: var(--font-head);
    font-size: 4.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    margin-bottom: 0.2em;
}

.page404 .search-form { margin: 24px 0; }

/* --- подвал ------------------------------------------------------------ */

.site-foot {
    background: var(--deep);
    color: #CBD5E0;
    padding: 62px 0 0;
}

.foot-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 34px;
    padding-bottom: 42px;
}

.foot-col { min-width: 0; }

.site-foot .widget-title {
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 0.9em;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.site-foot .widget,
.site-foot .widget p,
.site-foot .widget li,
.site-foot .widget .post-date { color: #CBD5E0; font-size: 0.95rem; }

.site-foot .widget a { color: var(--pale); }
.site-foot .widget a:hover { color: var(--accent-2); }

.site-foot .widget a::after { background: var(--accent-2); }

.site-foot .widget ul { list-style: none; padding: 0; margin: 0; }

.site-foot .widget li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-foot .widget li:last-child { border-bottom: 0; }

.foot-bottom {
    padding: 20px 0 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.87rem;
    color: #A7BBD1;
}

/* --- cookie-баннер ------------------------------------------------------ */

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 26px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid var(--accent);
    box-shadow: 0 -4px 18px rgba(26, 54, 93, 0.12);
}

.cookie-banner p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--ink-soft);
    min-width: 0;
    flex: 1 1 380px;
}

/* --- адаптив ------------------------------------------------------------ */

@media (max-width: 960px) {
    h1 { font-size: 2.3rem; }
    .sec-title { font-size: 1.7rem; }

    .layout-with-sidebar {
        display: block;
    }

    .layout-with-sidebar .content-area { margin-bottom: 36px; }

    .layout-single .content-area { width: 100%; }

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

    .site-nav {
        flex: 1 1 100%;
        display: none;
    }

    .site-nav.is-open { display: block; }

    .site-nav ul {
        flex-direction: column;
        gap: 0;
        padding-top: 10px;
    }

    .site-nav li { border-bottom: 1px solid var(--line); }
    .site-nav a { display: block; padding: 11px 0; }

    .fs { padding: 60px 0; }
    .hero-inner { padding: 60px 0; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.9rem; }
    .page-title { font-size: 1.8rem; }
    .sec-title { font-size: 1.45rem; gap: 12px; }
    .sec-title::before { flex-basis: 26px; width: 26px; }

    .shell, .shell-wide { width: 92%; }

    .fs { padding: 48px 0; }

    .stat { flex: 1 1 100%; }
    .stat + .stat::before { display: none; }

    .steps { padding-left: 20px; gap: 30px; }

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

    .step-num { font-size: 2.4rem; }

    .hero { min-height: 0; }
    .hero-inner { padding: 52px 0; }
    .hero-sub { font-size: 1.02rem; }

    .card-body { padding: 18px 18px 20px; }

    .sidebar { padding: 20px 20px 4px; }

    .comment-list .children { padding-left: 12px; }

    .cookie-banner { padding: 14px 18px; }

    .entry-footer { padding: 18px 18px; }

    .page404 { padding: 24px 20px 26px; }
}
