/*
Theme Name: dds_aurummm.com
Author: Анна Вербицкая
Description: Образовательный блог о здоровом питании, экологичном образе жизни, агрообразовании и устойчивом развитии. Тёплая «органик»-эстетика, адаптивная вёрстка.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: aurummm
*/

/* =========================================================================
   Переменные и базовые стили
   ====================================================================== */
:root {
    --bg: #f6f3ea;
    --surface: #fffdf7;
    --surface-2: #f0ece0;
    --ink: #2a2a22;
    --ink-soft: #5c5d4f;
    --green: #2e4a32;
    --green-mid: #4a6b48;
    --green-dark: #20301d;
    --leaf: #9bbf6a;
    --accent: #c2703d;
    --line: #e2dccb;
    --foot-ink: #e8ecdf;
    --foot-ink-soft: #b7c2a6;
    --radius: 14px;
    --shell: min(92%, 1180px);
    --serif: Georgia, 'Times New Roman', 'PT Serif', serif;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden; /* A12.5 */
    -webkit-font-smoothing: antialiased;
}

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

p { margin: 0 0 1.1em; } /* без background-color (F) */

a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

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

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

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--green);
    color: #fff;
    padding: 10px 16px;
    z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }

/* =========================================================================
   Шапка
   ====================================================================== */
.site-head {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.head-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.brand-link { display: inline-flex; flex: 0 0 auto; }
.brand-logo { width: 48px; height: 48px; object-fit: contain; display: block; }
.brand-mark svg { display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--green);
    line-height: 1.25;
    /* длинное «название» не должно ломать шапку */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 46ch;
}
.brand-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 56ch;
}

.primary-nav { margin-left: auto; }
.nav-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.nav-list a {
    color: var(--ink);
    font-weight: 600;
    font-size: 0.98rem;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}
.nav-list a:hover,
.nav-list .current-menu-item > a {
    color: var(--green);
    border-bottom-color: var(--leaf);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 0;
    width: 42px; height: 42px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--green);
    transition: transform .25s, opacity .2s;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================================
   Хлебные крошки
   ====================================================================== */
.crumbs {
    font-size: 0.86rem;
    color: var(--ink-soft);
    padding: 1.2rem 0 0.2rem;
}
.crumbs a { color: var(--green-mid); }
.crumbs .sep { margin: 0 0.35rem; color: var(--line); }

/* =========================================================================
   Раскладки
   ====================================================================== */
.site-main { padding-bottom: 3rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr); /* A12.6 */
    gap: 6%;
    align-items: start;
    padding: 1.4rem 0 2rem;
}
.layout-single {
    display: block; /* A12.3 */
    padding: 1.4rem 0 2rem;
}
.layout-single .content-area { width: 100%; }

@media (max-width: 960px) {
    .layout-with-sidebar { display: block; }
    .layout-with-sidebar .sidebar { margin-top: 2.5rem; }
}

/* =========================================================================
   Сетка карточек (A8)
   ====================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.6rem;
}
.card {
    display: flex;
    flex-direction: column; /* A8 */
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0; /* A12.6 */
}
.card-thumb {
    display: block;
    overflow: hidden;
}
.card-thumb img {
    display: block; /* A8/A10 */
    width: 100%;
    aspect-ratio: 16 / 10; /* вертикальная карточка — A10 */
    object-fit: cover;
    transition: transform .4s ease;
}
.card-thumb:hover img { transform: scale(1.04); }
.card-body {
    flex: 1; /* A8 */
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.4rem;
}
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    font-size: 0.78rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.card-cat { color: var(--accent); font-weight: 600; }
.card-title { font-size: 1.25rem; margin-bottom: 0.5rem; }
.card-title a { color: var(--green); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); font-size: 0.96rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; } /* A8 */
.card-more {
    margin-top: auto;
    padding-top: 0.8rem;
    font-weight: 600;
    color: var(--green-mid);
}

/* =========================================================================
   Главная — слайдер (D9)
   ====================================================================== */
.hero { background: var(--green-dark); }
.slider {
    position: relative;
    width: var(--shell);
    margin-inline: auto;
    overflow: hidden;
}
.slides { position: relative; }
.slide { display: none; position: relative; }
.slide.is-active { display: block; }
.slide img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
}
@media (max-width: 700px) {
    .slide img { aspect-ratio: 4 / 5; }
}
.slide-cap {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 2.4rem clamp(1.2rem, 4vw, 3rem) 2rem;
    background: linear-gradient(to top, rgba(20,30,18,0.85), rgba(20,30,18,0.15) 70%, transparent);
    color: #fff;
}
.slide-cap h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 2.2rem); margin-bottom: 0.4rem; max-width: 22ch; }
.slide-cap p { color: #eef1e6; margin: 0; max-width: 50ch; }
.slide-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--leaf) !important;
    margin-bottom: 0.6rem;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px; height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.82);
    color: var(--green);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.slider-btn:hover { background: #fff; }
.slider-prev { left: 14px; }
.slider-next { right: 14px; }
.slider-dots {
    position: absolute;
    top: 16px;
    right: 18px;
    display: flex;
    gap: 8px;
}
.slider-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0;
}
.slider-dot.is-active { background: var(--leaf); }

/* =========================================================================
   Главная — блоки
   ====================================================================== */
.block { padding: 3rem 0; }
.block-title { font-size: clamp(1.5rem, 3vw, 2.1rem); text-align: center; }
.block-lead {
    text-align: center;
    max-width: 60ch;
    margin: 0 auto 2rem;
    color: var(--ink-soft);
}
.btn-link {
    display: inline-block;
    font-weight: 600;
    color: var(--green);
}
.latest-all { text-align: center; margin-top: 1.8rem; }

.value-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.4rem;
}
.value-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.8rem 1.5rem;
    text-align: center;
    min-width: 0;
}
.value-ico { display: inline-flex; margin-bottom: 0.6rem; }
.value-card h3 { font-size: 1.15rem; }
.value-card p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.6rem;
}
.topic {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.topic img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}
.topic-body { padding: 1.2rem 1.3rem 1.4rem; flex: 1; }
.topic-body h3 { font-size: 1.2rem; }
.topic-body p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

.about-cta {
    background: var(--surface-2);
    border-radius: calc(var(--radius) + 6px);
    margin: 3rem 0;
}
.about-cta-inner {
    text-align: center;
    max-width: 64ch;
    margin: 0 auto;
    padding: 0 1rem;
}
.about-contacts { font-size: 1.05rem; }
.about-contacts a { color: var(--accent); font-weight: 600; }
.about-links { display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap; }
.about-links .btn-link {
    border: 1px solid var(--green);
    border-radius: 999px;
    padding: 0.5rem 1.3rem;
}
.about-links .btn-link:hover { background: var(--green); color: #fff; text-decoration: none; }

/* =========================================================================
   Заголовки списков / архивов
   ====================================================================== */
.list-head { margin-bottom: 1.6rem; }
.page-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.archive-desc { color: var(--ink-soft); }
.empty-note {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    color: var(--ink-soft);
}

/* =========================================================================
   Одиночная запись / страница
   ====================================================================== */
.single-post {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.4rem, 4vw, 2.6rem);
}
.single-head { margin-bottom: 1.2rem; }
.single-title { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.single-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.single-cat { color: var(--accent); font-weight: 600; }
.single-thumb { margin: 0 0 1.6rem; }
.single-thumb img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    aspect-ratio: 16 / 8;
    object-fit: cover;
}
.single-content { font-size: 1.04rem; }
.single-content h2 { margin-top: 1.6em; }
.single-content h3 { margin-top: 1.4em; }
.single-content img { border-radius: 10px; display: block; }
.single-content blockquote {
    margin: 1.4em 0;
    padding: 0.6em 1.2em;
    border-left: 4px solid var(--leaf);
    background: var(--surface-2);
    font-style: italic;
}
.single-content a { text-decoration: underline; }

.single-tags { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-chip {
    font-size: 0.82rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    color: var(--green-mid);
}
.tag-chip:hover { background: var(--green); color: #fff; text-decoration: none; }

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.6rem;
    flex-wrap: wrap;
}
.post-nav a {
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem 1.1rem;
    font-weight: 600;
}
.post-nav-next { margin-left: auto; text-align: right; }

.page-links { margin-top: 1.2rem; font-weight: 600; }

/* =========================================================================
   Таблицы и контент
   ====================================================================== */
.single-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--line);
}
.single-content th,
.single-content td {
    border: 1px solid var(--line);
    padding: 0.6em 0.8em;
    text-align: left;
}
.single-content th { background: var(--surface-2); }

/* =========================================================================
   Сайдбар (светлый фон → тёмный текст)
   ====================================================================== */
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    color: var(--green);
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--leaf);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--line);
}
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: var(--ink); font-weight: 600; }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar .widget .post-date { display: block; font-size: 0.78rem; color: var(--ink-soft); }

/* =========================================================================
   Подвал (тёмный фон → светлый текст)
   ====================================================================== */
.site-foot {
    background: var(--green-dark);
    color: var(--foot-ink);
    margin-top: 3rem;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 2rem;
    padding: 3rem 0 2rem;
}
.foot-col { min-width: 0; }
.site-foot .widget { color: var(--foot-ink); }
.site-foot .widget-title {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.9rem;
}
.site-foot .widget p { color: var(--foot-ink); }
.site-foot .widget ul { list-style: none; margin: 0; padding: 0; }
.site-foot .widget li { padding: 0.35rem 0; }
.site-foot .widget a { color: var(--foot-ink); }
.site-foot .widget a:hover { color: var(--leaf); text-decoration: none; }
.site-foot .widget .post-date { display: block; font-size: 0.78rem; color: var(--foot-ink-soft); }

.foot-base {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 1.4rem 0;
}
.copyright { margin: 0; font-size: 0.88rem; color: var(--foot-ink-soft); }

/* =========================================================================
   Пагинация (D5 — type=plain, .page-numbers)
   ====================================================================== */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2.4rem;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover { background: var(--green); color: #fff; border-color: var(--green); }
.pager .page-numbers.current {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}
.pager .page-numbers.dots {
    border: 0;
    background: none;
    min-width: auto;
}

.comments-pagination { margin-top: 1.5rem; display: flex; gap: 0.5rem; }

/* =========================================================================
   Формы (поиск, комментарии)
   ====================================================================== */
.search-form { display: flex; gap: 0.5rem; margin: 1rem 0; }
.search-field {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font: inherit;
    color: var(--ink);
}
.search-submit,
.comment-form input[type="submit"],
.form-submit input[type="submit"] {
    padding: 0.7rem 1.3rem;
    border: 0;
    border-radius: 10px;
    background: var(--green);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.search-submit:hover,
.comment-form input[type="submit"]:hover { background: var(--accent); }

/* =========================================================================
   Комментарии
   ====================================================================== */
.comments {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.2rem, 3vw, 2rem);
}
.comments-title { font-size: 1.3rem; }
.comment-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.comment-list ol { list-style: none; padding-left: 1.5rem; }
.comment-list .comment-body {
    border-bottom: 1px solid var(--line);
    padding: 1rem 0;
}
.comment-author { font-weight: 700; color: var(--green); }
.comment-meta { font-size: 0.8rem; color: var(--ink-soft); }
.comment-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: var(--surface-2);
    margin-bottom: 1rem;
}

/* =========================================================================
   404
   ====================================================================== */
.error-404 { text-align: center; padding: 2rem 0 3rem; }
.error-code { font-family: var(--serif); font-size: 5rem; color: var(--leaf); margin: 0; line-height: 1; }
.error-text { max-width: 50ch; margin: 0 auto 1.5rem; color: var(--ink-soft); }
.error-404 .search-form { max-width: 440px; margin-inline: auto; }
.error-home { margin-top: 1.4rem; }

/* =========================================================================
   Cookie-баннер (A11 — правило [hidden] выше основного блока)
   ====================================================================== */
.cookie-banner[hidden] { display: none !important; } /* A11 */

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem clamp(1rem, 4vw, 2rem);
    background: var(--green-dark);
    color: var(--foot-ink);
    box-shadow: 0 -4px 18px rgba(0,0,0,0.18);
}
.cookie-text { margin: 0; font-size: 0.9rem; max-width: 70ch; }
.cookie-accept {
    border: 0;
    border-radius: 999px;
    background: var(--leaf);
    color: var(--green-dark);
    font: inherit;
    font-weight: 700;
    padding: 0.6rem 1.6rem;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: #fff; }

/* =========================================================================
   Адаптив
   ====================================================================== */
@media (max-width: 960px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        margin-left: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }
    .primary-nav.is-open { max-height: 60vh; }
    .nav-list {
        flex-direction: column;
        gap: 0;
        padding-top: 0.5rem;
    }
    .nav-list li { border-bottom: 1px solid var(--line); }
    .nav-list a { display: block; padding: 0.7rem 0; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .block { padding: 2.2rem 0; }
    .slide-cap { padding: 1.6rem 1.2rem 1.4rem; }
    .post-nav-next { margin-left: 0; text-align: left; }
}
