/*
Theme Name: dds_rheumo.ru
Author: Анна Соколова
Description: Информационная тема для экспертного медицинского портала о профилактике и лечении остеопороза и ревматологии.
Version: 1.1
Text Domain: rheumo
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ============================ Переменные ============================ */
:root {
    --bg:        #f6f8f7;
    --surface:   #ffffff;
    --ink:       #20302f;
    --muted:     #5b6c6a;
    --teal:      #0e7c6e;
    --teal-dk:   #0a5b50;
    --teal-soft: #e3f1ee;
    --sand:      #f3ede2;
    --line:      #dde5e2;
    --footer-bg: #16302c;
    --footer-ink:#cfe0db;
    --footer-hd: #ffffff;
    --maxw:      1180px;
    --radius:    14px;
    --shadow:    0 6px 24px rgba(16, 60, 52, 0.08);
}

/* ============================ База ============================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    font-size: 17px;
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); }
h1 { font-size: 2rem; margin: 0 0 0.6em; }
h2 { font-size: 1.55rem; margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 0 0 0.5em; }

p { margin: 0 0 1em; }

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

/* ============================ Шапка ============================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo, .brand-svg { flex: 0 0 auto; display: block; }
.brand-text { min-width: 0; }
.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    display: block;
    line-height: 1.3;
    max-width: 520px;
}
.brand-name a { color: inherit; text-decoration: none; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    display: block;
    margin-top: 4px;
    max-width: 560px;
}

.main-nav { margin-left: auto; }
.nav-toggle {
    display: none;
    background: var(--teal);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 1rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.97rem;
}
.main-nav a:hover { background: var(--teal-soft); text-decoration: none; }
.main-nav .current-menu-item > a { background: var(--teal-soft); color: var(--teal-dk); }

/* ============================ Макет ============================ */
.site-main { padding: 34px 0 48px; }

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

.content-narrow { width: 85%; margin-inline: auto; }

/* ============================ Хлебные крошки ============================ */
.crumbs {
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 20px;
}
.crumbs a { color: var(--teal); }
.crumbs .sep { margin: 0 6px; color: var(--muted); }

/* ============================ Карточки записей ============================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 24px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.card-thumb-wrap:hover img { transform: scale(1.04); }
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}
.card-title { font-size: 1.12rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--teal); text-decoration: none; }
.card-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }
.card-meta a { color: var(--muted); }
.card-excerpt { color: var(--muted); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 600;
    color: var(--teal);
}

/* Горизонтальная карточка (последние записи на главной) */
.card-row {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ============================ Контент записи / страницы ============================ */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
    box-shadow: var(--shadow);
}
.entry-thumb { margin: 0 0 22px; border-radius: 10px; overflow: hidden; }
.entry-thumb img { width: 100%; display: block; }
.entry-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 18px; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
table th, table td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
}
table th { background: var(--teal-soft); }

/* ============================ Сайдбар / виджеты ============================ */
.sidebar { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
}
.widget-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: var(--ink);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--teal-soft);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--teal); }
.widget .post-date { color: var(--muted); }

/* ============================ Секции главной ============================ */
.section { padding: 16px 0 14px; }
.section + .section { margin-top: 6px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 26px; }
.section-head p { color: var(--muted); }

/* блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.split.reverse .split-media { order: 2; }
.split-media img { width: 100%; border-radius: 10px; display: block; }
.split-body { min-width: 0; }

/* блок: сетка иконок-преимуществ */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 22px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    min-width: 0;
}
.feature .icon { width: 56px; height: 56px; margin: 0 auto 14px; display: block; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* блок: пошаговый */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px 24px;
    box-shadow: var(--shadow);
    min-width: 0;
    position: relative;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    background: var(--teal);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 14px;
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* блок: факты / статистика */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 22px;
    background: var(--teal);
    border-radius: var(--radius);
    padding: 34px 28px;
}
.fact { text-align: center; color: #fff; min-width: 0; }
.fact-num { font-size: 2.2rem; font-weight: 800; display: block; }
.fact-label { font-size: 0.95rem; opacity: 0.92; }

/* блок: FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 4px 20px;
    margin-bottom: 12px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 14px 0;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--teal); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); margin: 0 0 14px; }

/* блок: цитата */
.quote-block {
    background: var(--sand);
    border-left: 5px solid var(--teal);
    border-radius: var(--radius);
    padding: 34px 38px;
}
.quote-block blockquote {
    margin: 0;
    font-size: 1.3rem;
    font-style: italic;
    color: var(--ink);
}
.quote-block cite { display: block; margin-top: 14px; font-size: 0.92rem; color: var(--muted); font-style: normal; }

/* CTA */
.cta-block {
    background: linear-gradient(135deg, var(--teal), var(--teal-dk));
    border-radius: var(--radius);
    padding: 40px 34px;
    text-align: center;
    color: #fff;
}
.cta-block h2 { color: #fff; }
.cta-block p { color: #eaf6f3; margin-bottom: 22px; }
.btn {
    display: inline-block;
    background: #fff;
    color: var(--teal-dk);
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 700;
}
.btn:hover { background: var(--sand); color: var(--teal-dk); text-decoration: none; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--teal);
    color: var(--teal);
}
.btn-outline:hover { background: var(--teal); color: #fff; }

.home-latest { padding-top: 10px; }

/* ============================ Пагинация ============================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 34px 0 8px;
}
.pager .page-numbers {
    display: inline-block;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    line-height: 1;
}
.pager a.page-numbers:hover { background: var(--teal-soft); text-decoration: none; }
.pager .page-numbers.current { background: var(--teal); color: #fff; border-color: var(--teal); }
.pager .page-numbers.dots { border: 0; background: none; }

/* ============================ Комментарии ============================ */
.comments-area { margin-top: 34px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.comment-meta { font-size: 0.85rem; margin-bottom: 6px; }
.comment-author { font-weight: 700; }
.comment-date { color: var(--muted); margin-left: 8px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    margin-top: 4px;
}
.comment-form .form-submit input,
.search-form button {
    background: var(--teal);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 22px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================ Форма поиска ============================ */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

/* ============================ Подвал ============================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 46px 0 0;
    margin-top: 30px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
}
.site-footer .widget {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--footer-ink);
}
.site-footer .widget-title { color: var(--footer-hd); border-bottom-color: rgba(255,255,255,0.18); }
.site-footer .widget a { color: var(--footer-ink); }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget li { border-bottom-color: rgba(255,255,255,0.1); }
.site-footer .widget .post-date,
.site-footer .widget .post-cat { color: #9fb8b2; }
.footer-copy {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    font-size: 0.86rem;
    color: #9fb8b2;
}

/* ============================ Контакты статичные ============================ */
.contact-line { margin: 6px 0; }
.social-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.social-links a { font-weight: 600; }

/* ============================ 404 ============================ */
.notfound { text-align: center; padding: 30px 0; }
.notfound .big { font-size: 5rem; font-weight: 800; color: var(--teal-soft); margin: 0; }

/* ============================ Cookie-баннер ============================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 16px 0;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
}
.cookie-inner p { margin: 0; font-size: 0.9rem; }
.cookie-inner a { color: #9fd4c9; }
.cookie-accept {
    background: var(--teal);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

/* ============================ Адаптив ============================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .layout-single .content-area,
    .content-narrow { width: 100%; }
    .footer-cols { grid-template-columns: 1fr; gap: 28px; }
    .split { grid-template-columns: 1fr; }
    .split.reverse .split-media { order: 0; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    .nav-toggle { display: block; }
    .main-nav { margin-left: auto; position: relative; }
    .main-nav ul {
        display: none;
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        flex-direction: column;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 8px;
        min-width: 220px;
        box-shadow: var(--shadow);
        z-index: 50;
    }
    .main-nav ul.is-open { display: flex; }
    .entry { padding: 22px 18px; }
    .split { padding: 22px; }
}
