/*
Theme Name: dds_mosoblfarm.ru
Author: Анна Громова
Description: Научно-информационный портал о качестве воздуха и его влиянии на здоровье дыхательной системы.
Version: 1.1
Text Domain: cleanair
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ============================================================
   Переменные и сброс
   ============================================================ */
:root {
    --c-bg: #eef4f5;
    --c-surface: #ffffff;
    --c-primary: #0f7a8a;
    --c-primary-dark: #0a5560;
    --c-accent: #4aa05a;
    --c-text: #1d2b30;
    --c-muted: #5b6c72;
    --c-border: #d4e0e3;
    --c-footer-bg: #0c3940;
    --c-footer-text: #d3e6e9;
    --c-footer-muted: #8fb6bc;
    --shell: 1180px;
    --radius: 12px;
    --shadow: 0 6px 24px rgba(12, 57, 64, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PT Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--c-text);
    background-color: var(--c-bg);
    overflow-x: hidden;
}

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

a {
    color: var(--c-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    line-height: 1.25;
    color: var(--c-primary-dark);
    margin: 0 0 0.6em;
}

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

p {
    margin: 0 0 1.1em;
}

/* Единый контейнер ширины (A12.7) */
.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.brand-logo,
.brand-fallback {
    display: block;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
}

.brand-fallback {
    border-radius: 12px;
}

.brand-meta {
    min-width: 0;
}

.site-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--c-primary-dark);
}

.site-title a {
    color: inherit;
}

.site-description {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--c-muted);
    line-height: 1.4;
}

/* Навигация */
.nav-toggle {
    display: none;
    background: var(--c-primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 1rem;
    cursor: pointer;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--c-text);
    font-weight: 600;
    font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--c-bg);
    color: var(--c-primary-dark);
    text-decoration: none;
}

/* ============================================================
   Раскладка контента
   ============================================================ */
.site-main {
    padding: 36px 0 56px;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 40px;
    align-items: start;
}

.layout-single .content-area {
    width: 85%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

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

/* Хлебные крошки */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--c-muted);
    margin-bottom: 22px;
}

.breadcrumbs a {
    color: var(--c-primary);
}

.breadcrumbs .sep {
    margin: 0 6px;
    color: var(--c-muted);
}

/* ============================================================
   Сайдбар
   ============================================================ */
.sidebar {
    min-width: 0;
}

.sidebar .widget {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
    color: var(--c-text);
}

.sidebar .widget-title {
    font-size: 1.1rem;
    margin-top: 0;
    color: var(--c-primary-dark);
}

.sidebar .widget a {
    color: var(--c-primary);
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar li {
    padding: 8px 0;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text);
}

.sidebar li:last-child {
    border-bottom: 0;
}

.sidebar .post-date {
    display: block;
    font-size: 0.8rem;
    color: var(--c-muted);
}

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card-thumb {
    display: block;
    overflow: hidden;
}

.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

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

.card-title {
    font-size: 1.2rem;
    margin: 0 0 8px;
}

.card-title a {
    color: var(--c-primary-dark);
}

.card-meta {
    font-size: 0.8rem;
    color: var(--c-muted);
    margin-bottom: 10px;
}

.card-excerpt {
    color: var(--c-text);
    margin-bottom: 16px;
}

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-more {
    margin-top: auto;
    align-self: flex-start;
    display: inline-block;
    padding: 9px 18px;
    background: var(--c-primary);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.card-more:hover {
    background: var(--c-primary-dark);
    text-decoration: none;
    color: #fff;
}

/* Горизонтальная карточка (лента статей) — A10 position:absolute */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.post-row {
    display: flex;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}

.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-row .card-body {
    min-width: 0;
}

/* ============================================================
   Запись и страница
   ============================================================ */
.entry {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.entry-header {
    margin-bottom: 20px;
}

.entry-title {
    margin: 0 0 10px;
}

.entry-meta {
    font-size: 0.85rem;
    color: var(--c-muted);
}

.entry-thumb {
    margin: 0 0 24px;
}

.entry-thumb img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
}

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

.entry-content img {
    border-radius: 8px;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.3em;
}

/* Таблицы (F) */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.2em;
}

.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--c-border);
}

.entry-content th,
.entry-content td {
    padding: 10px 12px;
    text-align: left;
}

.entry-content th {
    background: var(--c-bg);
}

/* ============================================================
   Главная страница
   ============================================================ */
.section {
    padding: 30px 0;
}

.section-narrow {
    width: 85%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    text-align: center;
    margin-bottom: 8px;
}

.section-lead {
    text-align: center;
    color: var(--c-muted);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
}

/* Hero / текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 36px;
    align-items: center;
}

.split-media img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.split.reverse .split-media {
    order: -1;
}

.split-text {
    min-width: 0;
}

/* Сетка фактов */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 22px;
}

.fact {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 26px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    min-width: 0;
}

.fact-num {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--c-primary);
    display: block;
}

.fact-label {
    color: var(--c-muted);
    font-size: 0.95rem;
}

/* Пошаговый блок */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    counter-reset: step;
}

.step {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 26px 22px;
    box-shadow: var(--shadow);
    min-width: 0;
    position: relative;
}

.step-num {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--c-accent);
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.step h3 {
    margin: 0 0 8px;
}

/* Галерея */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-grid figure {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.gallery-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* CTA-секция */
.cta {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 44px 32px;
    text-align: center;
}

.cta h2 {
    color: #fff;
    margin-top: 0;
}

.cta p {
    color: #e3f1f3;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 13px 28px;
    border-radius: 9px;
    font-weight: 700;
    background: #fff;
    color: var(--c-primary-dark);
}

.btn:hover {
    text-decoration: none;
    background: var(--c-bg);
    color: var(--c-primary-dark);
}

/* Цитата / акцент */
.pullquote {
    background: var(--c-primary-dark);
    color: #fff;
    border-radius: var(--radius);
    padding: 42px 36px;
    text-align: center;
    font-size: 1.4rem;
    line-height: 1.5;
    font-weight: 600;
}

.pullquote cite {
    display: block;
    margin-top: 14px;
    font-size: 0.95rem;
    font-style: normal;
    color: #9fd0d6;
}

/* FAQ */
.faq {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.faq details {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 4px 22px;
    margin-bottom: 14px;
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 16px 0;
    color: var(--c-primary-dark);
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    float: right;
    font-size: 1.4rem;
    color: var(--c-primary);
    line-height: 1;
}

.faq details[open] summary::after {
    content: "–";
}

.faq details > p {
    margin-top: 0;
    color: var(--c-text);
}

/* ============================================================
   Латест записи на главной
   ============================================================ */
.latest-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.latest-head h2 {
    margin: 0;
}

/* ============================================================
   Пагинация (D5, type=plain)
   ============================================================ */
.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;
    padding: 9px 14px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-surface);
    color: var(--c-text);
    font-weight: 600;
    text-decoration: none;
}

.pager a.page-numbers:hover {
    background: var(--c-bg);
    border-color: var(--c-primary);
}

.pager .page-numbers.current {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}

.pager .page-numbers.dots {
    border: 0;
    background: none;
}

/* ============================================================
   Поиск
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 1rem;
}

.search-form button {
    border: 0;
    background: var(--c-primary);
    color: #fff;
    padding: 11px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.search-form button:hover {
    background: var(--c-primary-dark);
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    margin-top: 36px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 28px 32px;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin: 0 0 0 28px;
    padding: 0;
}

.comment-item {
    border-bottom: 1px solid var(--c-border);
    padding: 16px 0;
}

.comment-meta {
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 700;
    color: var(--c-primary-dark);
}

.comment-date {
    color: var(--c-muted);
    margin-left: 10px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 12px;
}

.comment-form input[type="submit"] {
    border: 0;
    background: var(--c-primary);
    color: #fff;
    padding: 12px 26px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================================
   404
   ============================================================ */
.error-404 {
    text-align: center;
    padding: 40px 0;
}

.error-404 .big {
    font-size: 5rem;
    font-weight: 800;
    color: var(--c-primary);
    line-height: 1;
}

.error-404 .search-form {
    max-width: 460px;
    margin: 24px auto 0;
}

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--c-footer-bg);
    color: var(--c-footer-text);
    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;
}

/* Контраст текста в футере (F) */
.site-footer .widget {
    color: var(--c-footer-text);
}

.site-footer .widget-title {
    color: #fff;
    font-size: 1.1rem;
    margin-top: 0;
}

.site-footer .widget a {
    color: var(--c-footer-text);
}

.site-footer .widget a:hover {
    color: #fff;
}

.site-footer .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer .widget li {
    padding: 6px 0;
    color: var(--c-footer-text);
}

.site-footer .post-date {
    color: var(--c-footer-muted);
    font-size: 0.8rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 22px 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--c-footer-muted);
}

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

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--c-primary-dark);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
}

.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    max-width: 760px;
}

.cookie-banner a {
    color: #9fd0d6;
}

.cookie-accept {
    border: 0;
    background: #fff;
    color: var(--c-primary-dark);
    padding: 11px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}

.cookie-accept:hover {
    background: var(--c-bg);
}

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        flex-basis: 100%;
    }

    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 4px;
        margin-top: 10px;
    }

    .main-nav.is-open ul {
        display: flex;
    }

    .layout-single .content-area,
    .section-narrow {
        width: 100%;
    }

    .post-row {
        flex-direction: column;
    }

    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }

    .card-thumb-wrap a {
        position: static;
    }

    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .entry {
        padding: 22px;
    }

    .split.reverse .split-media {
        order: 0;
    }
}
