/*
Theme Name: dds_union-des-acteurs-du-compostable.com
Author: Наталья Савина
Description: Информационная тема об экологии, раздельном сборе, компостировании и бытовых экологичных привычках. Дизайн в духе японского минимализма и ваби-саби с имитацией натуральных текстур.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: ecobyt
*/

/* ================================================================== *
 *  Переменные и сброс
 * ================================================================== */
:root {
    --bg:        #F9F6F0;
    --bg-alt:    #F3EFE6;
    --bg-craft:  #E8E0D4;
    --footer-bg: #2E2C27;
    --ink:       #2C2A26;
    --accent:    #8B6B4D;
    --accent-2:  #6A8D73;
    --muted:     #9A948C;
    --pale-num:  #E0D6C8;
    --shell:     1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", "Arial", "Noto Sans", sans-serif;
    font-size: 17px;
    line-height: 1.72;
    color: var(--ink);
    background-color: var(--bg);
    /* Тонкая фактура «шероховатой бумаги»: мелкие точки низкой непрозрачности. */
    background-image: radial-gradient(rgba(44, 42, 38, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    overflow-x: hidden;
}

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

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: color .12s;
}
a:hover {
    text-decoration-style: solid;
    color: #6f543b;
}

h1, h2, h3, h4 {
    font-family: "Segoe UI Semibold", "Futura", "Century Gothic", "Segoe UI", sans-serif;
    color: var(--ink);
    line-height: 1.22;
    letter-spacing: .01em;
    font-weight: 600;
}

p { margin: 0 0 1.1em; }

/* ================================================================== *
 *  Контейнер
 * ================================================================== */
.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

/* ================================================================== *
 *  Заголовки секций — левое выравнивание, линия со сдвигом,
 *  декоративная японская точка «、»
 * ================================================================== */
.section-title {
    position: relative;
    font-size: 2rem;
    margin: 0 0 1.8rem;
    text-align: left;
    padding-bottom: 1.1rem;
}
.section-title::after {
    content: "";
    position: absolute;
    left: 30%;
    bottom: 0;
    width: 46%;
    height: 1px;
    background: rgba(139, 107, 77, 0.4);
}
.section-title .dot {
    color: var(--accent-2);
    font-weight: 400;
    margin-left: .15em;
}

/* ================================================================== *
 *  Кнопки — обводка-«штамп»
 * ================================================================== */
.btn {
    display: inline-block;
    padding: .68em 1.5em;
    border: 2px solid var(--accent);
    border-radius: 4px;
    color: var(--accent);
    background: transparent;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
}
.btn:hover {
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
}

/* ================================================================== *
 *  Шапка
 * ================================================================== */
.site-header {
    background: transparent;
    border-bottom: 1px solid rgba(139, 107, 77, 0.14);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    padding: 1.3rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
    min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; max-height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-family: "Segoe UI Semibold", "Century Gothic", sans-serif;
    font-weight: 600;
    font-size: 1.06rem;
    color: var(--ink);
    line-height: 1.25;
    letter-spacing: .01em;
}
.brand-desc {
    display: block;
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.35;
    margin-top: .15rem;
}

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

.nav-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 1px solid rgba(139, 107, 77, 0.4);
    border-radius: 4px;
    padding: .45rem .7rem;
    color: var(--ink);
    cursor: pointer;
    font-size: 1rem;
}

/* ================================================================== *
 *  Общая раскладка контента
 * ================================================================== */
.site-main { padding: 2.4rem 0 3.2rem; }

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

.content-area { min-width: 0; }

.sidebar { min-width: 0; }
.sidebar .widget {
    margin-bottom: 2rem;
    padding-left: 1.1rem;
    border-left: 1px solid rgba(139, 107, 77, 0.25);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    margin: 0 0 .8rem;
    color: var(--ink);
}
.sidebar a { color: var(--accent); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: .3rem 0; border-bottom: 1px dotted rgba(139, 107, 77, 0.2); }
.sidebar .post-date { display: block; font-size: .78rem; color: var(--muted); }

/* ================================================================== *
 *  Хлебные крошки
 * ================================================================== */
.breadcrumbs {
    font-size: .86rem;
    color: var(--muted);
    margin: 0 0 1.6rem;
}
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; text-decoration-style: solid; }
.breadcrumbs .sep { margin: 0 .35rem; color: var(--muted); }

/* ================================================================== *
 *  Карточки записей (F.4)
 * ================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 0;
    /* Рамка-«край бумаги»: только снизу и слева. */
    border-left: 1px solid rgba(139, 107, 77, 0.2);
    border-bottom: 1px solid rgba(139, 107, 77, 0.2);
    padding: 0 0 1.4rem;
    transition: transform .12s, box-shadow .12s;
}
.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(139, 107, 77, 0.08);
}

/* Миниатюра сверху, шириной 70%, сдвинута вправо. */
.card-thumb {
    display: block;
    width: 70%;
    margin-left: 30%;
    margin-bottom: 1rem;
    overflow: hidden;
}
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.card-body {
    flex: 1;
    padding: 0 1.2rem;
    min-width: 0;
}
.card-title {
    font-size: 1.16rem;
    margin: 0 0 .5rem;
    line-height: 1.3;
}
.card-title a { text-decoration: none; color: var(--ink); }
.card-title a:hover { color: var(--accent); }
.card-meta {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .6rem;
}
.card-excerpt { font-size: .95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: .3rem;
    font-size: .9rem;
    font-weight: 600;
}
.card-more a { text-decoration: none; }
.card-more a:hover { text-decoration: underline; text-decoration-style: solid; }

/* ================================================================== *
 *  Пагинация (D5)
 * ================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 2.6rem 0 0;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .6rem;
    border: 1px solid rgba(139, 107, 77, 0.35);
    border-radius: 4px;
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
}
.pagination a.page-numbers:hover {
    background: var(--accent);
    color: var(--bg);
}
.pagination .page-numbers.current {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
.pagination .page-numbers.dots {
    border: none;
    color: var(--muted);
}

/* ================================================================== *
 *  Записи и страницы
 * ================================================================== */
.entry-header { margin-bottom: 1.4rem; }
.entry-title { font-size: 2.3rem; margin: 0 0 .5rem; }
.entry-meta { font-size: .86rem; color: var(--muted); }
.entry-thumb { margin: 0 0 1.6rem; }
.entry-thumb img { display: block; width: 100%; object-fit: cover; }

.entry-content { font-size: 1.02rem; }
.entry-content h2 { font-size: 1.6rem; margin: 1.8rem 0 .8rem; }
.entry-content h3 { font-size: 1.3rem; margin: 1.5rem 0 .7rem; }
.entry-content img { height: auto; }
.entry-content a { color: var(--accent); }

/* Маркеры списков — стилизованная «повёрнутая скобка». */
.entry-content ul {
    list-style: none;
    padding-left: 1.4rem;
}
.entry-content ul > li {
    position: relative;
    margin-bottom: .4rem;
}
.entry-content ul > li::before {
    content: "︶";
    position: absolute;
    left: -1.3rem;
    top: -.15rem;
    color: var(--accent-2);
    font-size: .9rem;
}

/* Цитаты — «эко-след»: цепочка из трёх квадратов слева. */
.entry-content blockquote {
    position: relative;
    margin: 1.6rem 0;
    padding: .4rem 0 .4rem 1.6rem;
    color: var(--ink);
    font-style: italic;
    background: var(--bg-craft);
    /* «эко-след» рисуем псевдоэлементом слева */
}
.entry-content blockquote {
    padding: 1.2rem 1.4rem 1.2rem 2rem;
    border-radius: 4px;
    /* диагональная штриховка */
    background-color: var(--bg-craft);
    background-image: repeating-linear-gradient(45deg, rgba(139,107,77,0.05) 0, rgba(139,107,77,0.05) 1px, transparent 1px, transparent 7px);
}
.entry-content blockquote::before {
    content: "";
    position: absolute;
    left: .7rem;
    top: 50%;
    width: 4px;
    height: 4px;
    background: var(--accent);
    box-shadow: 0 -7px 0 -1px var(--accent), 0 7px 0 -1px var(--accent);
    transform: translateY(-50%);
}
.entry-content blockquote p { margin: 0; }

/* Таблицы. */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4rem 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid rgba(139, 107, 77, 0.35);
}
.entry-content th,
.entry-content td { padding: .6rem .8rem; text-align: left; }
.entry-content th { background: var(--bg-alt); }

.entry-footer { margin-top: 1.8rem; font-size: .88rem; }
.entry-footer .tags a {
    display: inline-block;
    margin: .2rem .3rem .2rem 0;
    padding: .15rem .55rem;
    background: rgba(106, 141, 115, 0.14);
    color: var(--accent-2);
    border-radius: 4px;
    text-decoration: none;
    font-size: .82rem;
}

/* ================================================================== *
 *  Комментарии
 * ================================================================== */
.comments-area { margin-top: 3rem; }
.comments-title { font-size: 1.4rem; margin-bottom: 1.2rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ol { list-style: none; }
.comment-item { margin-bottom: 1.4rem; }
.comment-inner {
    padding: 1rem 1.2rem;
    border-left: 1px solid rgba(139, 107, 77, 0.2);
    border-bottom: 1px solid rgba(139, 107, 77, 0.2);
}
.comment-head { display: flex; gap: 1rem; align-items: baseline; margin-bottom: .4rem; }
.comment-author { font-weight: 600; }
.comment-date { font-size: .8rem; color: var(--muted); }
.comment-await { color: var(--accent-2); font-size: .85rem; }
.comment-respond { margin-top: 1.6rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid rgba(139, 107, 77, 0.35);
    border-radius: 4px;
    background: #fff;
    font: inherit;
    margin-top: .3rem;
}
.comment-form .form-submit input {
    display: inline-block;
    padding: .68em 1.5em;
    border: 2px solid var(--accent);
    border-radius: 4px;
    color: var(--accent);
    background: transparent;
    font-weight: 600;
    cursor: pointer;
}
.comment-form .form-submit input:hover { background: var(--accent); color: var(--bg); }

/* ================================================================== *
 *  Форма поиска
 * ================================================================== */
.search-form {
    display: flex;
    gap: .5rem;
    max-width: 460px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: .6rem .7rem;
    border: 1px solid rgba(139, 107, 77, 0.35);
    border-radius: 4px;
    background: #fff;
    font: inherit;
}
.search-form .search-submit {
    padding: .6rem 1.1rem;
    border: 2px solid var(--accent);
    border-radius: 4px;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--accent); color: var(--bg); }

/* ================================================================== *
 *  ГЛАВНАЯ
 * ================================================================== */
.front-section { padding: 5rem 0; }
.front-section.alt {
    background: var(--bg-alt);
}

/* Вертикальный пунктир-«след» слева у секции. */
.front-section .shell { position: relative; }
.front-section .shell::before {
    content: "";
    position: absolute;
    left: -18px;
    top: .4rem;
    bottom: .4rem;
    width: 2px;
    background-image: repeating-linear-gradient(to bottom, var(--accent) 0, var(--accent) 3px, transparent 3px, transparent 8px);
    opacity: .5;
}

/* --- Hero --- */
.hero {
    position: relative;
    padding: 6rem 0 5rem;
    background: linear-gradient(120deg, var(--bg) 0%, #FFFFFF 100%);
    overflow: hidden;
}
.hero .shell::before { display: none; }
.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}
.hero-copy { max-width: 40ch; }
.hero h1 {
    font-size: 3.8rem;
    line-height: 1.08;
    margin: 0 0 1.2rem;
    letter-spacing: .01em;
}
.hero-lead {
    font-size: 1.12rem;
    color: #4a463f;
    margin-bottom: 1.8rem;
}
.hero-art { position: relative; justify-self: center; }
.hero-art svg { display: block; width: 100%; max-width: 340px; height: auto; }
/* Абстрактный blob в левом нижнем углу hero. */
.hero::after {
    content: "";
    position: absolute;
    left: -60px;
    bottom: -80px;
    width: 320px;
    height: 320px;
    background: var(--accent-2);
    opacity: .05;
    border-radius: 46% 54% 60% 40% / 50% 42% 58% 50%;
    pointer-events: none;
}

/* --- Пошаговый блок (вертикальный таймлайн) --- */
.steps { position: relative; }
.steps-list {
    position: relative;
    margin: 0;
    padding: 0 0 0 4.5rem;
    list-style: none;
}
.steps-list::before {
    content: "";
    position: absolute;
    left: 3.4rem;
    top: .5rem;
    bottom: .5rem;
    width: 1px;
    background: var(--accent);
}
.step {
    position: relative;
    min-height: 3rem;
    margin-bottom: 3.75rem;
}
.step:last-child { margin-bottom: 0; }
.step-num {
    position: absolute;
    left: -4.5rem;
    top: -1.4rem;
    font-family: "Century Gothic", "Segoe UI", sans-serif;
    font-size: 4.4rem;
    font-weight: 700;
    color: var(--pale-num);
    line-height: 1;
    z-index: 0;
}
.step-body { position: relative; z-index: 1; }
.step-title { font-size: 1.2rem; margin: 0 0 .4rem; }
.step-body p { margin: 0; color: #4a463f; }

/* --- Статистика / Факты --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
}
.stat {
    padding: .5rem 1.4rem;
    position: relative;
    text-align: left;
}
.stat + .stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12%;
    height: 56%;
    width: 1px;
    background: rgba(139, 107, 77, 0.3);
}
.stat-num {
    font-family: "Century Gothic", "Segoe UI", sans-serif;
    font-size: 2.9rem;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent);
}
.stat-label {
    display: block;
    margin-top: .4rem;
    font-size: .88rem;
    color: var(--muted);
}

/* --- Карта тем / Рубрикатор --- */
.rubric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
}
.rubric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .9rem;
    padding: 1.6rem 1.4rem;
    background-color: #FFFFFF;
    background-image: radial-gradient(rgba(44, 42, 38, 0.04) 1px, transparent 1px);
    background-size: 14px 14px;
    border: 1px solid rgba(139, 107, 77, 0.14);
    border-radius: 4px;
    text-decoration: none;
    color: var(--ink);
    transition: background-color .12s, color .12s, border-color .12s;
}
.rubric:hover {
    background-color: var(--accent);
    background-image: none;
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}
.rubric svg { width: 40px; height: 40px; }
.rubric svg [stroke] { stroke: var(--accent); }
.rubric:hover svg [stroke] { stroke: #fff; }
.rubric-name { font-weight: 600; font-size: 1.05rem; }

/* --- Секция последних записей на главной --- */
.front-latest .front-latest-more { margin-top: 2.2rem; }

/* ================================================================== *
 *  Подвал
 * ================================================================== */
.site-footer {
    position: relative;
    background: var(--footer-bg);
    color: #cfc9be;
    margin-top: 3rem;
    overflow: hidden;
}
.site-footer::before {
    content: "";
    position: absolute;
    right: -70px;
    top: -90px;
    width: 300px;
    height: 300px;
    background: var(--accent-2);
    opacity: .05;
    border-radius: 46% 54% 60% 40% / 50% 42% 58% 50%;
    pointer-events: none;
}
.footer-cols {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.4rem;
    padding: 3rem 0 2rem;
}
.footer-cols .widget { min-width: 0; }
.footer-cols .widget-title {
    font-size: 1.05rem;
    color: #F3EFE6;
    margin: 0 0 .9rem;
}
.footer-cols,
.footer-cols p { color: #cfc9be; }
.footer-cols a { color: #d8b79a; text-decoration: none; }
.footer-cols a:hover { color: #F9F6F0; text-decoration: underline; text-decoration-style: solid; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { padding: .28rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.footer-cols .post-date { display: block; font-size: .76rem; color: #8f8a80; }

.site-copyright {
    position: relative;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.2rem 0;
    font-size: .84rem;
    color: #9a948c;
}

/* ================================================================== *
 *  Cookie-баннер (D6, A11)
 * ================================================================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding: 1rem 1.4rem;
    background: rgba(46, 44, 39, 0.97);
    color: #ECE6DA;
    font-size: .9rem;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; }
.cookie-banner a { color: #d8b79a; }
.cookie-accept {
    padding: .55em 1.3em;
    border: 2px solid #d8b79a;
    border-radius: 4px;
    background: transparent;
    color: #d8b79a;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: #d8b79a; color: var(--footer-bg); }

/* ================================================================== *
 *  Страница 404
 * ================================================================== */
.error-404 { padding: 1rem 0 2rem; }
.error-404 .code { font-size: 5rem; color: var(--pale-num); font-weight: 700; line-height: 1; }
.error-404 h1 { font-size: 1.8rem; margin: .4rem 0 1rem; }

/* Статичные контакты. */
.contact-static a { color: var(--accent); }

/* ================================================================== *
 *  Адаптив
 * ================================================================== */
@media (max-width: 960px) {
    .hero h1 { font-size: 2.9rem; }
    .rubric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 0; }
    .stat:nth-child(3)::before { display: none; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }
    .layout-single .content-area { width: 100%; }
    .hero-inner { grid-template-columns: minmax(0, 1fr); }
    .hero-art { order: -1; max-width: 220px; }
    .hero h1 { font-size: 2.3rem; }
    .front-section { padding: 3rem 0; }
    .hero { padding: 3.4rem 0 3rem; }
    .steps-list { padding-left: 3.4rem; }
    .steps-list::before { left: 2.4rem; }
    .step-num { left: -3.4rem; font-size: 3.2rem; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rubric-grid { grid-template-columns: minmax(0, 1fr); }
    .card-thumb { width: 100%; margin-left: 0; }

    .main-nav {
        margin-left: 0;
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: .6rem; }
    .nav-toggle { display: inline-block; }
    .header-inner { gap: 1rem; }
    .front-section .shell::before { display: none; }
}

/* Smooth scroll для якорей. */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}
