/*
Theme Name: dds_smfoodi.ru
Author: Марина Леднёва
Description: Тема для проекта SMFoodi — еда как способ лучше понять себя.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: smfoodi
*/

/* ============ Базовые переменные и сброс ============ */
:root {
    --bg: #fbf7f0;
    --surface: #ffffff;
    --ink: #2c2521;
    --muted: #6f655d;
    --accent: #c0623d;
    --accent-dark: #9c4a2b;
    --sage: #6b7d5e;
    --sage-soft: #eef1e7;
    --cream: #f3ece0;
    --line: #e6ddd0;
    --footer-bg: #2a2420;
    --footer-ink: #e9e0d4;
    --footer-muted: #b3a695;
    --radius: 14px;
    --shell: min(92%, 1180px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.65;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    line-height: 1.22;
    color: var(--ink);
    margin: 0 0 0.5em;
}

h1 { font-size: 2.15rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

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

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

/* ============ Шапка ============ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-logo,
.brand-logo svg {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    display: block;
}
.brand-text { min-width: 0; }
.brand-name {
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    display: block;
}
.brand-name a { color: inherit; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-toggle {
    display: none;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--ink);
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 9px;
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-size: 0.98rem;
}
.main-nav a:hover {
    background: var(--cream);
    text-decoration: none;
}
.main-nav .current-menu-item > a {
    background: var(--accent);
    color: #fff;
}

/* ============ Структура контента ============ */
.site-main { padding: 34px 0 48px; }

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

.content-narrow { width: 85%; margin-inline: auto; }

/* ============ Хлебные крошки ============ */
.breadcrumbs {
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--accent-dark); }
.breadcrumbs .sep { margin: 0 6px; color: var(--line); }

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(44, 37, 33, 0.10);
}
.card-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 24px;
}
.card-title { font-size: 1.2rem; margin-bottom: 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-dark); }
.card-meta {
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 10px;
}
.card-excerpt { color: var(--muted); font-size: 0.97rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 14px;
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-dark);
}

/* ============ Сайдбар / виджеты ============ */
.sidebar {
    background: var(--sage-soft);
    border: 1px solid #e0e5d6;
    border-radius: var(--radius);
    padding: 22px 22px 26px;
    color: var(--ink);
}
.sidebar .widget { margin-bottom: 26px; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title,
.sidebar h2, .sidebar h3 {
    font-size: 1.05rem;
    color: var(--ink);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sage);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin-bottom: 9px; line-height: 1.4; }
.sidebar a { color: var(--accent-dark); }
.sidebar a:hover { color: var(--ink); }
.sidebar .post-date {
    display: block;
    font-size: 0.76rem;
    color: var(--muted);
}

/* ============ Контент записи / страницы ============ */
.entry-header { margin-bottom: 20px; }
.entry-title { margin-bottom: 10px; }
.entry-meta {
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-size: 0.84rem;
    color: var(--muted);
}
.entry-thumb {
    margin: 0 0 24px;
    border-radius: var(--radius);
    overflow: hidden;
}
.entry-thumb img { width: 100%; display: block; }
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: 10px; display: block; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }

.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: 9px 12px; text-align: left; }
.entry-content th { background: var(--cream); }

/* ============ Пагинация ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 38px;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-size: 0.92rem;
}
.pagination a.page-numbers:hover {
    background: var(--cream);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* ============ Тематические секции главной ============ */
.home-section { padding: 46px 0; }
.home-section + .home-section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 26px; }
.section-head h2 { margin-bottom: 8px; }
.section-head .lede { color: var(--muted); max-width: 60ch; }

/* блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 44px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img,
.split-media svg {
    width: 100%;
    display: block;
    border-radius: var(--radius);
}
.split-text p:last-child { margin-bottom: 0; }

/* блок: сетка рубрик */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
}
.feature .feature-icon {
    width: 46px;
    height: 46px;
    display: block;
    margin-bottom: 14px;
}
.feature h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.96rem; margin: 0; }

/* блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    position: relative;
    background: var(--cream);
    border-radius: var(--radius);
    padding: 30px 24px 26px;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* блок: FAQ */
.faq { max-width: 800px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 4px 22px;
    margin-bottom: 12px;
}
.faq summary {
    cursor: pointer;
    padding: 16px 0;
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-right: 30px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 14px;
    font-size: 1.4rem;
    color: var(--accent);
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 0.98rem;
}

.home-latest .section-head { text-align: center; }
.home-latest .section-head .lede { margin-inline: auto; }
.latest-more {
    text-align: center;
    margin-top: 34px;
}
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 13px 30px;
    border-radius: 30px;
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.98rem;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }

/* ============ Поиск ============ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--ink);
}
.search-form button {
    padding: 11px 20px;
    border: none;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    cursor: pointer;
}
.search-form button:hover { background: var(--accent-dark); }

/* ============ Комментарии ============ */
.comments-area { margin-top: 44px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { margin-bottom: 22px; }
.comment-body {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.comment-author { font-weight: 600; font-family: "Trebuchet MS", sans-serif; }
.comment-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; }
.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(--line);
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 14px;
    background: var(--surface);
    color: var(--ink);
}
.comment-form input[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 28px;
    font-family: "Trebuchet MS", sans-serif;
    cursor: pointer;
}
.comment-form input[type="submit"]:hover { background: var(--accent-dark); }

/* ============ 404 ============ */
.error-404 { text-align: center; padding: 30px 0 50px; }
.error-404 .big { font-size: 5rem; color: var(--accent); margin: 0; line-height: 1; font-family: "Trebuchet MS", sans-serif; }
.error-404 .search-form { max-width: 460px; margin: 26px auto 0; }

/* ============ Подвал ============ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 46px 0 34px;
}
.footer-col .widget-title,
.footer-col h2, .footer-col h3 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 14px;
}
.footer-col, .footer-col p { color: var(--footer-ink); font-size: 0.95rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: var(--footer-muted); }
.footer-col a:hover { color: #fff; }
.footer-contacts a { color: var(--footer-ink); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 18px 0;
    font-size: 0.85rem;
    color: var(--footer-muted);
    text-align: center;
}

/* ============ Cookie-баннер ============ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 14px 40px rgba(44, 37, 33, 0.18);
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    max-width: 760px;
    margin-inline: auto;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; color: var(--muted); }
.cookie-banner button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 11px 26px;
    cursor: pointer;
    font-family: "Trebuchet MS", sans-serif;
    font-size: 0.92rem;
}
.cookie-banner button:hover { background: var(--accent-dark); }

/* ============ Адаптив ============ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 36px; }
    .layout-single .content-area,
    .content-narrow { width: 100%; }
    .split { grid-template-columns: 1fr; gap: 26px; }
    .split.reverse .split-media { order: 0; }
    .footer-cols { grid-template-columns: repeat(2, 1fr); gap: 28px; }
    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.5rem; }
}

@media (max-width: 600px) {
    body { font-size: 17px; }
    .nav-toggle { display: block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .footer-cols { grid-template-columns: 1fr; }
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
}
