/*
Theme Name: dds_vetafarm.ru
Author: Елена Калинина
Description: Научно-популярная тема об экологическом влиянии природной среды на психическое здоровье. Эстетика «экологичного минимализма с доказательным акцентом» — полевые блокноты, ботанические зарисовки, медицинские графики.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: vetafarm
*/

/* ==========================================================================
   Переменные
   ========================================================================== */
:root {
    --bg: #F9F7F3;
    --moss: #3A6B4B;
    --sage: #6A7A5F;
    --water: #2F6B6B;
    --sand: #C8C2AE;
    --text: #1F2A1E;
    --text-muted: #4A5B43;
    --terracotta: #D98C5F;
    --panel: #ECE8DA;
    --line: #DCD7C6;
    --footer-bg: #27331F;
    --footer-text: #E8E4D6;
    --footer-muted: #AFB59C;
    --serif: "DM Serif Display", Georgia, serif;
    --body: "Atkinson Hyperlegible", system-ui, sans-serif;
    --mono: "Fira Code", "Courier New", monospace;
}

/* ==========================================================================
   Базовая типографика
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.18;
    color: var(--text);
    margin: 0 0 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.95rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1.1em; }

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

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

blockquote {
    margin: 1.6em 0;
    padding: 0.6em 1.4em;
    border-left: 3px solid var(--sage);
    background: #F2EFE6;
    font-family: var(--mono);
    font-size: 0.95rem;
    color: var(--text-muted);
}

code, pre {
    font-family: var(--mono);
    font-size: 0.9em;
}

pre {
    background: var(--panel);
    padding: 1em 1.2em;
    border-radius: 4px;
    overflow-x: auto;
}

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

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

/* ==========================================================================
   Таблицы
   ========================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--line);
}
th, td {
    border: 1px solid var(--line);
    padding: 0.6em 0.9em;
    text-align: left;
}
th {
    background: var(--panel);
    font-family: var(--mono);
    font-size: 0.9rem;
}

/* ==========================================================================
   Кнопки
   ========================================================================== */
.btn {
    display: inline-block;
    font-family: var(--body);
    font-size: 0.98rem;
    padding: 0.6em 1.5em;
    border: 1px solid var(--moss);
    border-radius: 20px;
    background: transparent;
    color: var(--moss);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
}
.btn:hover {
    background: var(--moss);
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   Шапка
   ========================================================================== */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 1.2rem 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1 1 280px;
}
.brand-logo { display: block; flex: none; }
.brand-text { min-width: 0; }
.site-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    line-height: 1.25;
    margin: 0;
}
.site-title a { color: var(--text); }
.site-description {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--moss);
    border-radius: 8px;
    color: var(--moss);
    font-family: var(--body);
    padding: 0.45em 0.9em;
    cursor: pointer;
}

.main-navigation { flex: 0 0 auto; }
.main-navigation ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.3rem;
    margin: 0;
    padding: 0;
}
.main-navigation a {
    color: var(--text);
    font-size: 0.98rem;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: var(--moss);
    border-bottom-color: var(--moss);
    text-decoration: none;
}

/* ==========================================================================
   Основная раскладка
   ========================================================================== */
.site-main { padding: 2.6rem 0 3.4rem; }

.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);
    gap: 3%;
    align-items: start;
}
.layout-with-sidebar .content-area { min-width: 0; }

.full-width { width: 85%; margin-left: auto; margin-right: auto; }

/* ==========================================================================
   Хлебные крошки
   ========================================================================== */
.breadcrumbs {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 1.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed var(--line);
}
.breadcrumbs a { color: var(--water); }
.breadcrumbs .sep { color: var(--sand); margin: 0 0.15em; }

/* ==========================================================================
   Карточки записей — «полевой журнал»
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: 28px;
}

.card {
    display: flex;
    flex-direction: column;
    position: relative;
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 5px;
    overflow: hidden;
    min-width: 0;
}
.card::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 16px;
    background-image: radial-gradient(circle, var(--bg) 3px, transparent 3.6px);
    background-size: 16px 17px;
    background-repeat: repeat-y;
    background-position: center;
    z-index: 2;
}

.card-thumb-wrap {
    display: block;
    overflow: hidden;
    background: var(--panel);
}
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.3rem 1.7rem;
}
.card-obs {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--water);
    margin-bottom: 0.45rem;
}
.card-title {
    font-size: 1.3rem;
    margin: 0 0 0.5rem;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--moss); text-decoration: none; }
.card-meta {
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}
.card-cat {
    color: var(--moss);
    border: 1px solid var(--sand);
    border-radius: 10px;
    padding: 0.05em 0.6em;
    margin-left: 0.3em;
}
.card-excerpt {
    font-size: 0.96rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-excerpt p:last-child { margin-bottom: 0; }

.card-more {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: auto;
    font-size: 0.86rem;
    color: var(--moss);
}
.card-more:hover { text-decoration: none; }
.card-more-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--sand);
    color: var(--moss);
    font-size: 1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.card-more:hover .card-more-circle {
    background: var(--moss);
    color: #fff;
}

/* ==========================================================================
   Главная страница
   ========================================================================== */
.section { padding: 2.4rem 0; }
.section + .section { border-top: 1px dashed var(--line); }

.section-kicker {
    font-family: var(--mono);
    font-size: 0.76rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--water);
    margin-bottom: 0.4rem;
}
.section-title { font-size: 2.1rem; margin-bottom: 0.6rem; }
.section-lead {
    color: var(--text-muted);
    max-width: 60ch;
}

.hero {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2.6rem 2.2rem;
}
.hero h1 { font-size: 2.7rem; }
.hero p { color: var(--text-muted); max-width: 62ch; }
.hero .data-figure {
    font-family: var(--mono);
    color: var(--terracotta);
    font-weight: 500;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 18px;
    margin-top: 1.6rem;
}
.level-card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--moss);
    border-radius: 4px;
    padding: 1.2rem 1.2rem 1.3rem;
}
.level-card h3 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.level-card p { font-size: 0.92rem; color: var(--text-muted); margin: 0; }
.level-mark {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--water);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Слайдер научных фактов */
.facts-slider {
    background: var(--water);
    color: #F4F1E8;
    border-radius: 6px;
    padding: 2.2rem 2.2rem 1.8rem;
    position: relative;
}
.facts-slider .section-kicker { color: #BFD6D2; }
.facts-slider .section-title { color: #F4F1E8; }
.fact-slide { display: none; }
.fact-slide.is-active { display: block; }
.fact-slide p {
    font-family: var(--mono);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 0 0.6rem;
}
.fact-source { font-size: 0.82rem; color: #BFD6D2; }
.fact-dots {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.2rem;
}
.fact-dot {
    width: 11px; height: 11px;
    border-radius: 50%;
    border: 1px solid #BFD6D2;
    background: transparent;
    cursor: pointer;
    padding: 0;
}
.fact-dot.is-active { background: var(--terracotta); border-color: var(--terracotta); }

/* Блок об авторе / контакты */
.author-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 20px;
    margin-top: 1.4rem;
}
.author-field {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1.1rem 1.2rem;
}
.author-field h4 {
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--water);
    margin-bottom: 0.4rem;
}
.author-field p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { margin-bottom: 0.35rem; font-size: 0.95rem; }

/* Индекс стресса/восстановления — декоративная полоса */
.stress-index {
    height: 8px;
    border-radius: 4px;
    margin-top: 1.6rem;
    background: linear-gradient(90deg, var(--terracotta), var(--sand) 55%, var(--moss));
}
.stress-caption {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* ==========================================================================
   Записи и страницы
   ========================================================================== */
.entry-header { margin-bottom: 1.4rem; }
.entry-title { font-size: 2.3rem; }
.entry-meta {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.entry-thumb { margin: 1.2rem 0; }
.entry-thumb img { display: block; width: 100%; border-radius: 5px; }
.entry-content { font-size: 1.02rem; }
.entry-content img { border-radius: 5px; }
.entry-content h2 { margin-top: 1.5em; }
.entry-content h3 { margin-top: 1.3em; }

.entry-footer {
    margin-top: 1.8rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.entry-footer a { color: var(--water); }

.post-list-item {
    padding: 1.6rem 0;
    border-bottom: 1px dashed var(--line);
}

/* ==========================================================================
   Сайдбар и виджеты
   ========================================================================== */
.sidebar { min-width: 0; }

.sidebar .widget {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1.3rem 1.3rem 1.4rem;
    margin-bottom: 1.6rem;
    color: var(--text);
}
.sidebar .widget-title {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--moss);
}
.sidebar .widget a { color: var(--moss); }
.sidebar .widget ul {
    list-style: none;
    margin: 0; padding: 0;
}
.sidebar .widget li {
    padding: 0.4rem 0;
    border-bottom: 1px dotted var(--line);
    font-size: 0.95rem;
}
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget .post-date {
    display: block;
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Природный маяк */
.beacon {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.6rem;
}
.beacon-title {
    font-family: var(--mono);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--water);
    margin-bottom: 0.4rem;
}
.beacon p { margin: 0; font-size: 0.88rem; color: var(--text-muted); }

/* ==========================================================================
   Подвал
   ========================================================================== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2.8rem 0 1.6rem;
    font-size: 0.92rem;
}
.footer-strip {
    height: 6px;
    background: linear-gradient(90deg, var(--terracotta), var(--sand) 50%, var(--moss));
}
.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 32px;
}
.site-footer .widget { min-width: 0; margin-bottom: 0; color: var(--footer-text); }
.site-footer .widget-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 0.7rem;
}
.site-footer .widget p { color: var(--footer-text); }
.site-footer .widget a { color: var(--sand); }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget ul {
    list-style: none;
    margin: 0; padding: 0;
}
.site-footer .widget li {
    padding: 0.3rem 0;
    border-bottom: 1px dotted rgba(255,255,255,0.12);
    font-size: 0.88rem;
}
.site-footer .widget li:last-child { border-bottom: 0; }
.site-footer .widget .post-date {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--footer-muted);
}

.site-info {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.14);
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--footer-muted);
}

/* ==========================================================================
   Пагинация
   ========================================================================== */
.pagination { margin-top: 2.2rem; }
.pagination ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0; padding: 0;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.4em 0.8em;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
}
.pagination a:hover { background: var(--panel); }
.pagination .current {
    background: var(--moss);
    border-color: var(--moss);
    color: #fff;
}

/* ==========================================================================
   Поиск
   ========================================================================== */
.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.search-field {
    flex: 1 1 200px;
    min-width: 0;
    padding: 0.55em 0.9em;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: var(--body);
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
}
.search-submit {
    padding: 0.55em 1.3em;
    border: 1px solid var(--moss);
    border-radius: 20px;
    background: transparent;
    color: var(--moss);
    font-family: var(--body);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.search-submit:hover { background: var(--moss); color: #fff; }

/* ==========================================================================
   Комментарии
   ========================================================================== */
.comments-area {
    margin-top: 2.6rem;
    padding-top: 1.6rem;
    border-top: 1px dashed var(--line);
}
.comments-title { font-size: 1.6rem; }
.comment-list {
    list-style: none;
    margin: 1.4rem 0;
    padding: 0;
}
.comment-list ol { list-style: none; padding-left: 1.6rem; }
.comment-inner {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}
.comment-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.comment-author { font-weight: 700; }
.comment-date {
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--text-muted);
}
.comment-text { font-size: 0.96rem; }
.comment-pending { font-size: 0.85rem; color: var(--terracotta); }
.comment-actions { font-family: var(--mono); font-size: 0.8rem; }

.comment-respond {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1.4rem 1.4rem 1.6rem;
    margin-top: 1.6rem;
}
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 0.55em 0.8em;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: var(--body);
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
}
.comment-respond textarea { min-height: 130px; }
.comment-form-comment,
.comment-form-author,
.comment-form-email,
.comment-form-url { margin-bottom: 0.9rem; }
.comment-respond .submit {
    padding: 0.55em 1.6em;
    border: 1px solid var(--moss);
    border-radius: 20px;
    background: transparent;
    color: var(--moss);
    font-family: var(--body);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.comment-respond .submit:hover { background: var(--moss); color: #fff; }

/* ==========================================================================
   404
   ========================================================================== */
.error-404 { text-align: center; padding: 2rem 0; }
.error-404 .big-code {
    font-family: var(--serif);
    font-size: 5rem;
    color: var(--sage);
    line-height: 1;
}
.error-404 .search-form { max-width: 420px; margin: 1.4rem auto; }

/* ==========================================================================
   Cookie-баннер
   ========================================================================== */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--footer-bg);
    color: var(--footer-text);
    border-top: 3px solid var(--moss);
    padding: 1rem 0;
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.cookie-inner p {
    margin: 0;
    flex: 1 1 280px;
    min-width: 0;
    font-size: 0.86rem;
}
.cookie-inner a { color: var(--sand); }
.cookie-accept {
    padding: 0.5em 1.5em;
    border: 1px solid var(--sand);
    border-radius: 20px;
    background: transparent;
    color: var(--footer-text);
    font-family: var(--body);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.cookie-accept:hover { background: var(--sand); color: var(--text); }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 2.4rem;
    }
    .nav-toggle { display: inline-block; }
    .main-navigation {
        flex-basis: 100%;
        display: none;
    }
    .main-navigation.is-open { display: block; }
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }
    .main-navigation li {
        border-bottom: 1px dotted var(--line);
        padding: 0.2rem 0;
    }
    h1 { font-size: 2.1rem; }
    .hero h1 { font-size: 2.1rem; }
    .section-title { font-size: 1.7rem; }
    .entry-title { font-size: 1.85rem; }
}

@media (max-width: 600px) {
    body { font-size: 17px; }
    .layout-single .content-area,
    .full-width { width: 100%; }
    .hero { padding: 1.8rem 1.3rem; }
    .facts-slider { padding: 1.6rem 1.3rem; }
    .cookie-inner { justify-content: flex-start; }
    .site-main { padding: 1.8rem 0 2.6rem; }
}
