/*
Theme Name: dds_nutrimoms.ru
Author: Ирина Соловьева
Description: Информационно-образовательный портал о семейной нутрициологии: программы обучения, практические кейсы и карьерное развитие специалистов. Спокойная природно-зелёная палитра, адаптивная вёрстка, без динамических данных и форм сбора контактов.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: nutrimoms
*/

/* ============================================================
   Переменные
   ============================================================ */
:root {
    --bg: #FEF9F0;
    --green: #2B6E4E;
    --green-dark: #1F543E;
    --amber: #E6A157;
    --text: #2C2C2C;
    --sage: #E9F1EC;
    --white: #FFFFFF;
    --muted: #6B6B63;
    --border: #E4DCCB;
    --radius: 12px;
    --shadow: 0 8px 28px rgba(43, 110, 78, 0.08);
    --shell: min(92%, 1180px);
}

/* ============================================================
   Сброс / база
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--green);
    margin: 0 0 0.6em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

/* Глобальный p без фона (F) */
p { background-color: transparent; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.4em; }

blockquote {
    margin: 1.5em 0;
    padding: 1.1em 1.4em;
    background: var(--sage);
    border-left: 4px solid var(--green);
    border-radius: 0 var(--radius) var(--radius) 0;
}
blockquote p:last-child { margin-bottom: 0; }

code, pre {
    font-family: 'SFMono-Regular', Consolas, monospace;
    background: var(--sage);
    border-radius: 6px;
}
code { padding: 0.1em 0.4em; }
pre { padding: 1em; overflow-x: auto; }

/* Таблицы (F) */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    border: 1px solid var(--border);
}
th, td {
    border: 1px solid var(--border);
    padding: 0.6em 0.9em;
    text-align: left;
}
th { background: var(--sage); color: var(--green-dark); font-weight: 700; }

/* ============================================================
   Контейнер ширины (единственное место — A12.7)
   ============================================================ */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

.site-main { padding: 32px 0 56px; }

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
    display: inline-block;
    padding: 0.7em 1.5em;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}
.btn-primary {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}
.btn-primary:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
    color: var(--white);
    text-decoration: none;
}
.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--amber);
}
.btn-secondary:hover {
    background: rgba(230, 161, 87, 0.1);
    color: var(--text);
    text-decoration: none;
}

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--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;
}
.brand-logo { display: block; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--green);
    line-height: 1.25;
    display: block;
}
.brand-name:hover { text-decoration: none; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.35;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Навигация */
.main-nav { min-width: 0; margin-left: auto; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
.main-nav a {
    color: var(--text);
    font-weight: 600;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.main-nav a:hover {
    color: var(--green);
    border-color: var(--amber);
    text-decoration: none;
}
.current-menu-item > a { color: var(--green); border-color: var(--green); }

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--green);
    margin: 4px 0;
}

.login-link {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--amber);
    padding: 0.5em 1em;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}
.login-link:hover { background: rgba(230, 161, 87, 0.1); color: var(--text); text-decoration: none; }

/* ============================================================
   Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--green); }
.breadcrumbs .sep { color: var(--amber); margin: 0 2px; }

/* ============================================================
   Раскладки
   ============================================================ */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 38px;
    align-items: start;
}
.layout-single .content-area {
    width: 85%;
    margin-inline: auto;
}
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 32px; }
    .layout-single .content-area { width: 100%; }
}

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

/* ============================================================
   Сайдбар + виджеты (контраст задаётся явно — F)
   ============================================================ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 26px;
    color: var(--text);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    color: var(--green);
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sage);
}
.sidebar a { color: var(--green); }
.sidebar a:hover { color: var(--green-dark); }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li {
    padding: 8px 0;
    border-bottom: 1px solid var(--sage);
    color: var(--text);
}
.sidebar li:last-child { border-bottom: none; }
.sidebar .post-date,
.sidebar .rss-date { color: var(--muted); font-size: 0.82rem; }

/* ============================================================
   Карточки записей (A8, A10 — вертикальный паттерн)
   ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: 26px;
    margin: 0 0 36px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(43, 110, 78, 0.14); }

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

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    min-width: 0;
}
.card-cats {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.card-cat {
    display: inline-block;
    background: var(--sage);
    color: var(--green-dark);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 3px 11px;
    border-radius: 999px;
}
.card-title { font-size: 1.2rem; margin: 0 0 8px; }
.card-title a { color: var(--green); }
.card-title a:hover { color: var(--green-dark); text-decoration: none; }
.card-meta {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 10px;
}
.card-excerpt { color: var(--text); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 14px;
    align-self: flex-start;
    font-weight: 600;
    color: var(--amber);
}
.card-more:hover { color: var(--green); text-decoration: none; }

/* ============================================================
   Одиночная запись / страница
   ============================================================ */
.entry {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px;
    min-width: 0;
}
.entry-header { margin-bottom: 22px; }
.entry-title { margin-bottom: 10px; }
.entry-meta { color: var(--muted); font-size: 0.9rem; }
.entry-meta a { color: var(--green); }
.entry-thumb { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { display: block; width: 100%; }
.entry-content img { border-radius: var(--radius); }
.entry-content h2 { margin-top: 1.4em; }
.entry-content h3 { margin-top: 1.2em; }
.entry-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
}
.entry-footer a {
    display: inline-block;
    background: var(--sage);
    color: var(--green-dark);
    padding: 3px 11px;
    border-radius: 999px;
    margin: 0 4px 6px 0;
    font-size: 0.82rem;
}
.entry-footer a:hover { background: var(--green); color: var(--white); text-decoration: none; }

.page-title-block { margin-bottom: 22px; }

/* ============================================================
   Пагинация
   ============================================================ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
}
.pagination .page-numbers {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    font-weight: 600;
}
.pagination .page-numbers:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--green);
    border-color: var(--green);
    color: var(--white);
}
.pagination .dots { border: none; background: transparent; }

/* ============================================================
   Главная страница
   ============================================================ */
.front-wrap { width: 85%; margin-inline: auto; }
@media (max-width: 960px) { .front-wrap { width: 100%; } }

.front-section { margin-bottom: 56px; }

.hero {
    background: linear-gradient(135deg, var(--sage), #DCEAE1);
    border-radius: 20px;
    padding: 54px 46px;
    text-align: center;
}
.hero h1 { font-size: 2.4rem; margin-bottom: 14px; }
.hero p { font-size: 1.12rem; max-width: 720px; margin-inline: auto; color: var(--text); }
.hero-actions {
    margin-top: 26px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.section-head { text-align: center; margin-bottom: 30px; }
.section-head h2 { margin-bottom: 8px; }
.section-head p { color: var(--muted); max-width: 680px; margin-inline: auto; }

/* Сетка тематических колонок */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 24px;
}
.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 24px;
    min-width: 0;
}
.feature-icon {
    width: 46px;
    height: 46px;
    color: var(--green);
    margin-bottom: 14px;
}
.feature-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature-card p { color: var(--text); margin-bottom: 0; }

/* Метки категорий */
.cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.cat-pill {
    background: var(--sage);
    color: var(--green-dark);
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.cat-pill:hover, .cat-pill.is-active {
    background: var(--green);
    color: var(--white);
    text-decoration: none;
}

/* Маршрут нутрициолога — таймлайн */
.roadmap {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
}
.roadmap-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 28px;
    counter-reset: step;
    margin-top: 10px;
}
.roadmap-step {
    position: relative;
    padding-top: 16px;
    border-top: 3px solid var(--sage);
    min-width: 0;
}
.roadmap-step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -16px;
    left: 0;
    width: 30px;
    height: 30px;
    background: var(--amber);
    color: var(--white);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.roadmap-step h4 { color: var(--green); margin: 0 0 6px; font-size: 1.05rem; }
.roadmap-step p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* Слайдер «Опыт коллег» */
.quote-slider {
    background: var(--sage);
    border-radius: 20px;
    padding: 44px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.quote-slide {
    display: none;
}
.quote-slide.is-active { display: block; }
.quote-slide blockquote {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--green-dark);
}
.quote-author {
    margin-top: 18px;
    font-weight: 600;
    color: var(--text);
}
.quote-format {
    display: inline-block;
    margin-top: 8px;
    background: var(--white);
    color: var(--green);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 999px;
}
.quote-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}
.quote-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(43, 110, 78, 0.3);
    border: none;
    cursor: pointer;
    padding: 0;
}
.quote-dot.is-active { background: var(--green); }

.recent-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 34px;
    margin-top: 30px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-item { margin-bottom: 18px; }
.comment-body {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.comment-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.comment-author { font-weight: 700; color: var(--green); }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-reply a { font-size: 0.85rem; font-weight: 600; }

.comment-form-wrap { margin-top: 28px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--white);
    margin-bottom: 6px;
}
.comment-form label { font-weight: 600; font-size: 0.9rem; }

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form { display: flex; gap: 8px; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
}
.search-form .search-submit {
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0 18px;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--green-dark); }

/* ============================================================
   404
   ============================================================ */
.error-404 {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 50px 40px;
    text-align: center;
}
.error-404 .big { font-size: 4rem; color: var(--amber); margin: 0; line-height: 1; }
.error-404 .search-form { max-width: 460px; margin: 24px auto 0; }

/* ============================================================
   Подвал (тёмный фон → светлый текст виджетов — F)
   ============================================================ */
.site-footer {
    background: var(--green-dark);
    color: #EAF1EC;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 36px;
    padding: 46px 0 30px;
}
.footer-col { min-width: 0; }
.site-footer .widget { color: #EAF1EC; margin-bottom: 0; }
.site-footer .widget-title {
    color: var(--white);
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 14px;
}
.site-footer p { color: #D6E2DA; }
.site-footer a { color: #F2D9B6; }
.site-footer a:hover { color: var(--white); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer .widget li { padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.site-footer .widget li:last-child { border-bottom: none; }
.site-footer .post-date,
.site-footer .rss-date { color: #B9C9BE; font-size: 0.82rem; }

.footer-contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-weight: 600;
}
.footer-contact svg { width: 18px; height: 18px; flex: none; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding: 18px 0;
    font-size: 0.88rem;
    color: #C7D6CC;
    text-align: center;
}

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

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.18);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 240px; font-size: 0.92rem; }
.cookie-banner .btn { white-space: nowrap; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .brand { order: 1; }
    .header-actions { order: 2; margin-left: auto; }
    .nav-toggle { display: block; }
    .main-nav {
        margin-left: 0;
        flex-basis: 100%;
        order: 3;
    }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 0;
        margin-top: 12px;
        border-top: 1px solid var(--border);
    }
    .main-nav.is-open ul { display: flex; }
    .main-nav li { border-bottom: 1px solid var(--sage); }
    .main-nav a { display: block; padding: 12px 0; border-bottom: none; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .hero { padding: 38px 24px; }
    .hero h1 { font-size: 1.9rem; }
    .entry { padding: 24px 20px; }
    .roadmap, .quote-slider { padding: 30px 22px; }
    .btn { display: block; text-align: center; width: 100%; }
    .hero-actions .btn { width: auto; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .search-form .search-submit { padding: 11px 16px; }
}
