/*
Theme Name: dds_ti-rads.com
Author: Ольга Медведева
Description: Информационная тема для портала о расшифровке УЗИ-заключений.
Version: 1.1
Text Domain: tirads
*/

/* ============================================================
   Переменные и базовые стили
   ============================================================ */
:root {
    --ink: #1b2a36;
    --ink-soft: #46586a;
    --line: #dde6ec;
    --bg: #f4f8fa;
    --bg-card: #ffffff;
    --teal: #0e8a8a;
    --teal-dark: #0a6b6b;
    --teal-soft: #e4f3f2;
    --navy: #163a4d;
    --navy-deep: #102a38;
    --accent: #e88a3c;
    --radius: 14px;
    --shell: min(92%, 1180px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'PT Serif', Georgia, serif;
    line-height: 1.25;
    color: var(--navy);
    margin: 0 0 0.5em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

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

.shell {
    width: var(--shell);
    margin-inline: auto;
}

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--bg-card);
    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;
    flex: 1;
}
.brand-logo { display: block; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: 'PT Serif', serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--navy);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.brand-name a { color: inherit; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Навигация */
.main-nav { width: 100%; border-top: 1px solid var(--line); }
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.nav-menu li { margin: 0; }
.nav-menu a {
    display: block;
    padding: 13px 16px;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.96rem;
    border-bottom: 3px solid transparent;
}
.nav-menu a:hover { color: var(--teal-dark); text-decoration: none; }
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
    color: var(--teal-dark);
    border-bottom-color: var(--teal);
}

.nav-toggle {
    display: none;
    background: var(--teal);
    color: #fff;
    border: 0;
    padding: 11px 16px;
    border-radius: 9px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================================
   Раскладки страниц
   ============================================================ */
.site-main { padding: 34px 0 48px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: 67% 27%;
    gap: 6%;
    align-items: start;
}
.layout-with-sidebar .content-area { min-width: 0; }

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

/* ============================================================
   Хлебные крошки
   ============================================================ */
.crumbs {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 18px;
}
.crumbs a { color: var(--teal-dark); }
.crumbs .sep { color: #aab8c2; margin: 0 5px; }

/* ============================================================
   Записи и статьи
   ============================================================ */
.entry {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
}
.entry-title { margin-bottom: 0.3em; }
.entry-meta {
    font-size: 0.84rem;
    color: var(--ink-soft);
    margin-bottom: 20px;
}
.entry-content { min-width: 0; }
.entry-content p,
.entry-content li { color: var(--ink); }
.entry-content h2 { margin-top: 1.4em; }
.entry-content img { border-radius: 10px; display: block; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }

/* Таблицы */
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
}
.entry-content th,
.entry-content td {
    padding: 10px 13px;
    text-align: left;
}
.entry-content th { background: var(--teal-soft); }

/* ============================================================
   Карточки записей (A8, A10)
   ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
}
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-ph {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--teal-soft), #d6ebf0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal-dark);
}
.card-body {
    flex: 1;
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.card-title {
    font-size: 1.18rem;
    margin-bottom: 0.4em;
}
.card-title a { color: var(--navy); }
.card-meta {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-bottom: 12px;
}
.card-excerpt {
    color: var(--ink-soft);
    font-size: 0.95rem;
    flex: 1;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: 14px;
    font-weight: 600;
    color: var(--teal-dark);
    align-self: flex-start;
}

/* ============================================================
   Главная — тематические блоки
   ============================================================ */
.front section { margin-bottom: 56px; }

.front-section-head {
    text-align: center;
    max-width: 720px;
    margin-inline: auto;
    margin-bottom: 34px;
}
.front-section-head p { color: var(--ink-soft); }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
    color: #eaf4f6;
    border-radius: 20px;
    padding: 54px 48px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
}
.hero h1 { color: #fff; font-size: 2.3rem; }
.hero p { color: #c3d8de; font-size: 1.05rem; }
.hero-cta {
    display: inline-block;
    margin-top: 8px;
    background: var(--teal);
    color: #fff;
    padding: 13px 28px;
    border-radius: 10px;
    font-weight: 700;
}
.hero-cta:hover { background: var(--teal-dark); text-decoration: none; }
.hero-art { min-width: 0; }
.hero-art img, .hero-art svg { width: 100%; height: auto; display: block; }

/* Блок текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 44px;
    align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media { min-width: 0; }
.split-media img {
    width: 100%;
    border-radius: var(--radius);
    display: block;
}
.split-text { min-width: 0; }

/* Сетка иконок-направлений */
.org-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.org-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    min-width: 0;
}
.org-card svg { width: 46px; height: 46px; margin-bottom: 12px; }
.org-card h3 { font-size: 1.1rem; }
.org-card p { color: var(--ink-soft); font-size: 0.93rem; margin: 0; }

/* Пошаговый блок */
.steps {
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}
.step {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 24px 24px;
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-family: 'PT Serif', serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.08rem; }
.step p { color: var(--ink-soft); font-size: 0.93rem; margin: 0; }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
}
.faq-item summary {
    padding: 18px 22px;
    cursor: pointer;
    font-weight: 700;
    color: var(--navy);
    list-style: none;
    position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 22px;
    color: var(--teal);
    font-size: 1.4rem;
    line-height: 1;
}
.faq-item[open] summary::after { content: '−'; }
.faq-answer { padding: 0 22px 20px; color: var(--ink-soft); }
.faq-answer p { margin: 0; }

/* Факты / статистика */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 22px;
    background: var(--teal-soft);
    border-radius: 20px;
    padding: 40px 34px;
}
.fact { text-align: center; min-width: 0; }
.fact-num {
    font-family: 'PT Serif', serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--teal-dark);
    line-height: 1;
}
.fact-label { color: var(--ink-soft); font-size: 0.92rem; margin-top: 8px; }

/* Цитата / акцент */
.quote-block {
    background: var(--navy);
    color: #eaf4f6;
    border-radius: 20px;
    padding: 50px 44px;
    text-align: center;
}
.quote-block blockquote {
    margin: 0;
    font-family: 'PT Serif', serif;
    font-size: 1.5rem;
    line-height: 1.5;
    font-style: italic;
}
.quote-block cite {
    display: block;
    margin-top: 18px;
    font-style: normal;
    font-size: 0.9rem;
    color: #9fc0c8;
}

/* CTA */
.cta-block {
    text-align: center;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff;
    border-radius: 20px;
    padding: 46px 40px;
}
.cta-block h2 { color: #fff; }
.cta-block p { color: #d6f0ee; max-width: 600px; margin-inline: auto; }
.cta-btn {
    display: inline-block;
    margin-top: 10px;
    background: #fff;
    color: var(--teal-dark);
    padding: 13px 30px;
    border-radius: 10px;
    font-weight: 700;
}
.cta-btn:hover { background: #eaf4f6; text-decoration: none; }

/* Последние записи на главной */
.latest-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 26px;
}
.latest-head a { font-weight: 600; }

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

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--navy-deep);
    color: #c3d3da;
    padding: 50px 0 0;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 36px;
    padding-bottom: 40px;
}
.footer-col { min-width: 0; }
/* Контраст текста виджетов на тёмном фоне футера */
.footer-col .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
}
.footer-col .widget-title {
    color: #ffffff;
    border-bottom-color: rgba(255,255,255,0.15);
}
.footer-col .widget,
.footer-col .widget p,
.footer-col .widget li {
    color: #c3d3da;
}
.footer-col .widget a { color: #8fd4d0; }
.footer-col .widget a:hover { color: #b7e6e3; }
.footer-col .widget li { border-bottom-color: rgba(255,255,255,0.12); }
.footer-col .widget .post-date { color: #92a6ae; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 20px 0;
    font-size: 0.82rem;
    color: #92a6ae;
    text-align: center;
}

/* ============================================================
   Пагинация (D5 — type=plain, .page-numbers)
   ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 36px;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-card);
    color: var(--ink);
    font-weight: 600;
}
.pager a.page-numbers:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
    text-decoration: none;
}
.pager .page-numbers.current {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.pager .page-numbers.dots {
    border: 0;
    background: none;
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-top: 28px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 28px; padding: 0; }
.comment-item { margin-bottom: 18px; }
.comment-inner {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
}
.comment-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.comment-author { font-weight: 700; color: var(--navy); }
.comment-date { font-size: 0.8rem; color: var(--ink-soft); }
.comment-reply a { font-size: 0.85rem; font-weight: 600; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    margin-top: 5px;
}
.comment-form label { font-weight: 600; font-size: 0.9rem; }
.comment-form p { margin-bottom: 14px; }
.comment-form .submit,
.search-submit {
    background: var(--teal);
    color: #fff;
    border: 0;
    padding: 12px 26px;
    border-radius: 9px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.comment-form .submit:hover,
.search-submit:hover { background: var(--teal-dark); }

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
}

/* ============================================================
   404
   ============================================================ */
.error-404 {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 50px 40px;
}
.error-404 .big { font-size: 4rem; color: var(--teal); font-family: 'PT Serif', serif; }
.error-404 .search-form { max-width: 460px; margin: 24px auto 0; }
.home-link {
    display: inline-block;
    margin-top: 20px;
    background: var(--teal);
    color: #fff;
    padding: 12px 26px;
    border-radius: 9px;
    font-weight: 700;
}
.home-link:hover { background: var(--teal-dark); text-decoration: none; }

/* Карта сайта */
.sitemap-list { columns: 2; gap: 30px; }
.sitemap-list a { display: block; padding: 6px 0; }

/* ============================================================
   Cookie-баннер (D6, A11)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--navy-deep);
    color: #dfe9ee;
    padding: 16px 0;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-inner p { margin: 0; font-size: 0.9rem; min-width: 0; flex: 1; }
.cookie-inner a { color: #8fd4d0; }
.cookie-accept {
    background: var(--teal);
    color: #fff;
    border: 0;
    padding: 11px 26px;
    border-radius: 9px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--teal-dark); }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 36px; }
    .layout-single { width: 100%; }
    .hero { grid-template-columns: 1fr; padding: 40px 30px; }
    .hero h1 { font-size: 1.9rem; }
    .split { grid-template-columns: 1fr; gap: 26px; }
    .split.reverse .split-media { order: 0; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .nav-toggle { display: inline-block; margin: 0 0 10px; }
    .nav-menu { display: none; flex-direction: column; }
    .nav-menu.is-open { display: flex; }
    .nav-menu a { border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
    .nav-menu .current-menu-item > a { border-bottom-color: var(--line); border-left-color: var(--teal); }
    .entry { padding: 22px 20px; }
    .sitemap-list { columns: 1; }
    .facts, .quote-block, .cta-block { padding: 32px 22px; }
    .quote-block blockquote { font-size: 1.25rem; }
}
