/*
Theme Name: dds_noidormed.ru
Theme URI: https://noidormed.ru/
Author: Соколов Артём
Author URI: https://noidormed.ru/
Description: Тема для информационного сайта о ЗОЖ и медицине в России. Современная медицинская журналистика с акцентом на доверие и читаемость.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dds_noidormed
*/

/* === ПЕРЕМЕННЫЕ === */
:root {
    --bg-main: #F9FBF9;
    --accent: #2C7A4D;
    --accent-dark: #1F5E3A;
    --accent-secondary: #1F5E8E;
    --text-main: #1E2A2E;
    --text-second: #5A6C6F;
    --warning: #D97846;
    --warning-bg: #FEF9F0;
    --border: #DCE4E2;
    --hover-soft: #F4F6F2;
    --chip-bg: #EDF2EF;
    --shadow-soft: 0 1px 3px rgba(30, 42, 46, 0.06), 0 4px 12px rgba(30, 42, 46, 0.04);
    --shadow-mid: 0 4px 14px rgba(30, 42, 46, 0.08);
    --radius-pill: 40px;
    --radius-card: 14px;
    --radius-soft: 12px;
}

/* === БАЗА === */
* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', 'PT Serif', Georgia, serif;
    color: var(--text-main);
    letter-spacing: -0.3px;
    line-height: 1.3;
    margin: 1.5em 0 0.6em;
}

h1 { font-size: 2.1rem; margin-top: 0.4em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.12rem; }

p { margin: 0 0 1em; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.18s ease;
}
a:hover { color: var(--accent-dark); text-decoration: underline; }

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

ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }

blockquote {
    border-left: 3px solid var(--accent-secondary);
    background: #F2F6FA;
    margin: 1.4em 0;
    padding: 0.9em 1.2em;
    color: var(--text-main);
    border-radius: 0 var(--radius-soft) var(--radius-soft) 0;
    font-style: italic;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-soft);
    overflow: hidden;
}
th, td {
    border: 1px solid var(--border);
    padding: 0.6em 0.85em;
    text-align: left;
}
th {
    background: var(--hover-soft);
    font-weight: 600;
}

code {
    background: var(--chip-bg);
    padding: 0.12em 0.4em;
    border-radius: 4px;
    font-size: 0.92em;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
}

hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 2em 0;
}

/* === КОНТЕЙНЕРЫ === */
.site-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.layout-main {
    display: flex;
    gap: 40px;
    margin: 32px auto;
}

.layout-content {
    flex: 1;
    min-width: 0;
}

.layout-content--full {
    width: 85%;
    max-width: 85%;
    margin: 0 auto;
    flex: none;
}

.layout-sidebar {
    flex: 0 0 27%;
    max-width: 27%;
}

.layout-content--with-sidebar {
    flex: 0 0 67%;
    max-width: 67%;
}

@media (max-width: 960px) {
    .layout-main { flex-direction: column; gap: 32px; }
    .layout-content,
    .layout-content--with-sidebar,
    .layout-content--full,
    .layout-sidebar {
        flex: none;
        width: 100%;
        max-width: 100%;
    }
}

/* === ШАПКА === */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    flex: 0 1 auto;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
    display: block;
}

.brand-text { line-height: 1.2; }
.brand-name {
    font-family: 'Merriweather', 'PT Serif', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.2px;
}
.brand-desc {
    font-size: 0.78rem;
    color: var(--text-second);
    margin-top: 3px;
    max-width: 380px;
}

.brand:hover .brand-name { color: var(--accent); }

/* Главное меню */
.nav-main { flex: 1 1 auto; }
.nav-main ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.nav-main li { margin: 0; }
.nav-main a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.97rem;
    transition: background 0.18s ease, color 0.18s ease;
}
.nav-main a:hover,
.nav-main .current-menu-item > a,
.nav-main .current_page_item > a {
    background: var(--hover-soft);
    color: var(--accent);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: var(--hover-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.95rem;
}

@media (max-width: 760px) {
    .nav-toggle { display: inline-flex; align-items: center; gap: 8px; }
    .nav-main {
        flex-basis: 100%;
        display: none;
    }
    .nav-main.is-open { display: block; }
    .nav-main ul {
        flex-direction: column;
        gap: 2px;
        margin-top: 14px;
    }
    .nav-main a { display: block; }
    .header-inner { gap: 14px; }
    .brand-desc { display: none; }
}

/* === ХЛЕБНЫЕ КРОШКИ === */
.crumbs {
    margin: 18px 0 4px;
    font-size: 0.86rem;
    color: var(--text-second);
}
.crumbs a { color: var(--text-second); }
.crumbs a:hover { color: var(--accent); }
.crumbs .crumb-sep { margin: 0 7px; opacity: 0.55; }
.crumbs .crumb-current { color: var(--text-main); }

/* === КАРТОЧКИ ЗАПИСЕЙ === */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 26px;
    margin: 22px 0;
}

@media (max-width: 760px) {
    .posts-grid { grid-template-columns: 1fr; gap: 20px; }
}

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-mid);
    border-color: #c9d6cf;
}

.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--hover-soft);
    border-bottom: 1px solid var(--border);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}

.card-cats {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: var(--text-second);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}
.card-cats .cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-second);
    font-weight: 600;
}
.card-cats .cat-chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.card-cats a:hover { color: var(--accent); }

.card-title {
    font-family: 'Merriweather', 'PT Serif', Georgia, serif;
    font-size: 1.18rem;
    margin: 0 0 10px;
    line-height: 1.32;
    letter-spacing: -0.2px;
}
.card-title a { color: var(--text-main); }
.card-title a:hover { color: var(--accent); text-decoration: none; }

.card-excerpt {
    color: var(--text-second);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 0 14px;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-excerpt p:last-child { margin-bottom: 0; }

.card-meta {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-second);
}

.btn-read {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.86rem;
    font-weight: 500;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}
.btn-read:hover {
    background: var(--accent-dark);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(31, 94, 58, 0.25);
}

/* === КНОПКИ === */
.btn,
button.btn,
input[type="submit"].btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    border: 0;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.98rem;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; box-shadow: 0 4px 10px rgba(31, 94, 58, 0.25); }

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}
.btn-ghost:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: none;
}

/* === ОДИНОЧНАЯ ЗАПИСЬ === */
.entry-header { margin: 18px 0 24px; }
.entry-meta-cats {
    font-size: 0.82rem;
    color: var(--text-second);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.entry-meta-cats::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.entry-title {
    font-size: 2.1rem;
    margin: 0 0 14px;
    line-height: 1.22;
}
.entry-meta-line {
    font-size: 0.86rem;
    color: var(--text-second);
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 22px;
}

.entry-thumb {
    width: 100%;
    border-radius: var(--radius-card);
    margin-bottom: 22px;
    display: block;
    aspect-ratio: 16 / 8;
    object-fit: cover;
}

.entry-content {
    font-size: 1.02rem;
    line-height: 1.7;
}
.entry-content > p:first-of-type {
    font-size: 1.2rem;
    line-height: 1.7;
}
.entry-content > p:first-of-type::first-letter {
    font-family: 'Merriweather', 'PT Serif', Georgia, serif;
    font-size: 3.2rem;
    float: left;
    line-height: 0.92;
    padding: 4px 12px 0 0;
    color: var(--accent);
    font-weight: 700;
}

.entry-content h2,
.entry-content h3 { color: var(--text-main); }

.entry-tags {
    margin: 24px 0;
    font-size: 0.9rem;
    color: var(--text-second);
}
.entry-tags a {
    display: inline-block;
    background: var(--chip-bg);
    color: var(--text-main);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    margin: 0 4px 4px 0;
    font-size: 0.83rem;
}
.entry-tags a:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* === САЙДБАР === */
.sidebar-widget {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 18px 20px;
    margin-bottom: 22px;
}
.widget-title {
    font-family: 'Merriweather', 'PT Serif', Georgia, serif;
    font-size: 1.05rem;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    letter-spacing: -0.2px;
}
.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-widget li {
    padding: 5px 0;
    border-bottom: 1px dashed var(--border);
    margin: 0;
}
.sidebar-widget li:last-child { border-bottom: 0; }
.sidebar-widget a {
    color: var(--text-main);
    font-size: 0.94rem;
}
.sidebar-widget a:hover { color: var(--accent); }

/* === ПАГИНАЦИЯ === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 32px 0;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.pagination .page-numbers:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.pagination .dots {
    background: transparent;
    border: 0;
}
.pagination .dots:hover { background: transparent; color: var(--text-second); }

/* === ФУТЕР === */
.site-footer {
    background: #18242C;
    color: #C7D5D2;
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}
.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='52' viewBox='0 0 60 52'><polygon points='30,2 56,16 56,40 30,54 4,40 4,16' fill='none' stroke='%232C7A4D' stroke-opacity='0.18' stroke-width='1'/></svg>");
    opacity: 0.5;
    pointer-events: none;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
    padding: 44px 0 28px;
    position: relative;
    z-index: 1;
}
@media (max-width: 760px) {
    .footer-cols { grid-template-columns: 1fr; gap: 28px; padding: 30px 0 18px; }
}
.footer-col h3 {
    font-family: 'Merriweather', 'PT Serif', Georgia, serif;
    font-size: 1rem;
    color: #fff;
    margin: 0 0 14px;
    letter-spacing: -0.2px;
}
.footer-col,
.footer-col p,
.footer-col li,
.footer-col a {
    color: #C7D5D2;
    font-size: 0.92rem;
    line-height: 1.6;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col li { margin-bottom: 7px; }
.footer-col a:hover { color: #fff; }

.site-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 0;
    text-align: center;
    font-size: 0.84rem;
    color: #8DA29B;
    position: relative;
    z-index: 1;
}

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

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 200;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(30, 42, 46, 0.16);
    border-radius: var(--radius-card);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 720px;
    margin: 0 auto;
    font-size: 0.9rem;
}
.cookie-banner p { margin: 0; }
.cookie-banner button {
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 8px 22px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.18s ease;
}
.cookie-banner button:hover { background: var(--accent-dark); }

@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

/* === ГЛАВНАЯ === */
.hero-section {
    background: linear-gradient(135deg, #EAF3EE 0%, #E6EFF6 100%);
    border-radius: var(--radius-card);
    padding: 50px 40px;
    margin: 28px 0;
    position: relative;
    overflow: hidden;
}
.hero-section::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 240px;
    height: 240px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='52' viewBox='0 0 60 52'><polygon points='30,2 56,16 56,40 30,54 4,40 4,16' fill='none' stroke='%232C7A4D' stroke-opacity='0.18' stroke-width='1'/></svg>");
    opacity: 0.7;
    pointer-events: none;
}
.hero-section h1 {
    font-size: 2.3rem;
    margin: 0 0 14px;
    max-width: 720px;
    position: relative;
    z-index: 1;
}
.hero-section p {
    font-size: 1.1rem;
    color: var(--text-main);
    max-width: 640px;
    margin: 0 0 18px;
    position: relative;
    z-index: 1;
}
.hero-section .btn { position: relative; z-index: 1; }

@media (max-width: 600px) {
    .hero-section { padding: 28px 22px; }
    .hero-section h1 { font-size: 1.55rem; }
    .hero-section p { font-size: 1rem; }
}

.section-block {
    margin: 36px 0;
}
.section-block h2 {
    font-size: 1.7rem;
    margin: 0 0 18px;
}

.feature-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 14px;
}
@media (max-width: 760px) {
    .feature-row { grid-template-columns: 1fr; }
}

.feature-tile {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 22px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.feature-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-tile h3 {
    font-size: 1.08rem;
    margin: 0 0 8px;
}
.feature-tile p { color: var(--text-second); margin: 0; font-size: 0.95rem; }
.feature-tile .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    margin-bottom: 12px;
    font-family: 'Merriweather', serif;
}

.note-block {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning);
    padding: 18px 22px;
    border-radius: 0 var(--radius-soft) var(--radius-soft) 0;
    margin: 22px 0;
}
.note-block .note-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 6px;
}
.note-block p { margin: 0; }

/* === ФОРМА ПОИСКА === */
.search-form {
    display: flex;
    gap: 8px;
    margin: 14px 0;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.96rem;
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(44, 122, 77, 0.12);
}
.search-form button {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.18s ease;
}
.search-form button:hover { background: var(--accent-dark); }

/* === КОММЕНТАРИИ === */
.comments-area {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.comments-area h3 {
    font-size: 1.3rem;
    margin: 0 0 18px;
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
}
.comment-list li {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 14px 18px;
    margin-bottom: 12px;
}
.comment-list .comment-author {
    font-weight: 600;
    color: var(--text-main);
}
.comment-list .comment-date {
    font-size: 0.82rem;
    color: var(--text-second);
    margin-left: 10px;
}
.comment-list .comment-body { margin-top: 8px; }

.comment-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.92rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 12px;
    background: #fff;
    color: var(--text-main);
}
.comment-form textarea { min-height: 110px; resize: vertical; }
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(44, 122, 77, 0.12);
}

/* === 404 === */
.error-404-page {
    text-align: center;
    padding: 60px 20px;
}
.error-404-page .err-num {
    font-family: 'Merriweather', serif;
    font-size: 6rem;
    color: var(--accent);
    margin: 0;
    line-height: 1;
    letter-spacing: -2px;
}
.error-404-page h1 {
    font-size: 1.5rem;
    margin: 12px 0 18px;
}
.error-404-page .search-form { max-width: 460px; margin: 22px auto; }

/* === АРХИВЫ === */
.archive-header {
    margin: 18px 0 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.archive-header h1 { margin: 0 0 6px; }
.archive-header p { color: var(--text-second); margin: 0; }

/* === УТИЛИТЫ === */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.65rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    .site-wrap { padding: 0 16px; }
    .entry-title { font-size: 1.55rem; }
    .entry-content > p:first-of-type { font-size: 1.05rem; }
    .entry-content > p:first-of-type::first-letter { font-size: 2.6rem; }
}
