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

/* ===================== Переменные ===================== */
:root {
    --cream: #faf5ec;
    --paper: #fffdf8;
    --ink: #2c261f;
    --muted: #736858;
    --rust: #c05a34;
    --rust-dark: #a2461f;
    --olive: #6d7a4f;
    --line: #e7ddcb;
    --line-soft: #efe7d8;
    --footer-bg: #2a2620;
    --footer-panel: #332e26;
    --footer-ink: #eadfcc;
    --footer-muted: #b6a98f;
    --shadow: 0 8px 26px rgba(58, 44, 28, 0.08);
    --radius: 12px;
}

/* ===================== База ===================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 0.6em;
}

p { margin: 0 0 1.1em; }

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

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

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

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

.site-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }

/* ===================== Кнопки ===================== */
.btn {
    display: inline-block;
    padding: 0.72rem 1.5rem;
    background: var(--rust);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.98rem;
    transition: background 0.2s ease;
}
.btn:hover { background: var(--rust-dark); color: #fff; text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--rust-dark);
    border: 1.5px solid var(--rust);
}
.btn-ghost:hover { background: var(--rust); color: #fff; }

/* ===================== Шапка ===================== */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    margin-right: auto;
}
.brand-logo-link { display: inline-flex; flex: none; }
.brand-mark, .brand-logo { display: block; }
.brand-logo { max-height: 56px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-family: Georgia, serif;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
}
.brand-name:hover { color: var(--rust-dark); text-decoration: none; }
.brand-desc {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
    max-width: 46ch;
}

/* ===================== Навигация ===================== */
.primary-nav { min-width: 0; }
.nav-list {
    list-style: none;
    display: flex;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.nav-list a {
    display: block;
    padding: 0.5rem 0.9rem;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.96rem;
    border-radius: 7px;
}
.nav-list a:hover { background: var(--cream); color: var(--rust-dark); text-decoration: none; }
.nav-list .current-menu-item > a { color: var(--rust-dark); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    margin: 0 auto;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.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); }

/* ===================== Секции главной ===================== */
.fs { padding: 3.2rem 0; }
.fs-title {
    font-size: 1.9rem;
    text-align: center;
    margin-bottom: 0.4rem;
}
.fs-lead {
    text-align: center;
    color: var(--muted);
    max-width: 62ch;
    margin: 0 auto 2rem;
}
.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rust-dark);
    font-weight: 700;
    margin-bottom: 0.6rem;
}

/* Блок 1: интро */
.fs-intro { background: var(--paper); border-bottom: 1px solid var(--line); }
.fs-intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.6rem;
    align-items: center;
}
.fs-intro-title { font-size: 2.4rem; margin-bottom: 0.7rem; }
.fs-intro-text p { color: #4a4237; }
.fs-intro-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Блок 2: рубрики */
.rubric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
}
.rubric-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.rubric-ico {
    display: inline-flex;
    color: var(--rust);
    margin-bottom: 0.7rem;
}
.rubric-card h3 { font-size: 1.18rem; margin-bottom: 0.4rem; }
.rubric-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Последние записи */
.fs-latest { background: var(--cream); }
.fs-more { text-align: center; margin-top: 2rem; }
.fs-empty { text-align: center; color: var(--muted); }

/* Блок 3: шаги */
.fs-steps { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    counter-reset: step;
}
.step {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    min-width: 0;
}
.step-num {
    flex: none;
    width: 44px; height: 44px;
    display: grid;
    place-items: center;
    background: var(--rust);
    color: #fff;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
}
.step-body { min-width: 0; }
.step-body h3 { font-size: 1.12rem; margin-bottom: 0.3rem; }
.step-body p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Блок 4: галерея + CTA */
.fs-gallery { background: var(--cream); }
.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.gallery-item {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.fs-cta {
    margin-top: 2.4rem;
    background: #33413a;
    color: #f4efe4;
    border-radius: var(--radius);
    padding: 2.4rem 2.2rem;
    text-align: center;
}
.fs-cta h3 { color: #fff; font-size: 1.5rem; }
.fs-cta p { color: #d8e0d3; max-width: 56ch; margin: 0 auto 1.4rem; }

/* ===================== Раскладка страниц ===================== */
.page-shell { padding: 2.2rem 0 3.2rem; }

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

.page-head { margin-bottom: 1.6rem; }
.page-title { font-size: 2rem; }

/* ===================== Хлебные крошки ===================== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1.4rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--rust-dark); }
.breadcrumbs .sep { margin: 0 0.35rem; color: var(--line); }
.breadcrumbs span:last-child { color: var(--ink); }

/* ===================== Сетка карточек ===================== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.6rem;
}
.layout-with-sidebar .post-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Карточка записи (вертикальная) */
.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-thumb-wrap { display: block; }
.card-thumb-wrap a { display: block; }
.card-thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.4rem;
    min-width: 0;
}
.card-meta {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.card-title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--rust-dark); text-decoration: none; }
.card-excerpt { color: var(--muted); font-size: 0.94rem; flex: 1; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    display: inline-block;
    margin-top: 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--rust-dark);
}

/* ===================== Одиночная запись / страница ===================== */
.single-head, .page-head { margin-bottom: 1.4rem; }
.single-title { font-size: 2.1rem; }
.single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}
.single-meta a { color: var(--rust-dark); }
.single-thumb {
    margin: 0 0 1.8rem;
    border-radius: var(--radius);
    overflow: hidden;
}
.single-thumb img { display: block; width: 100%; height: auto; }

.entry-content { font-size: 1.03rem; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content h2 { font-size: 1.6rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.3rem; margin-top: 1.4em; }
.entry-content img { border-radius: 8px; height: auto; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content blockquote {
    margin: 1.5em 0;
    padding: 1.2rem 1.4rem;
    background: var(--cream);
    border-left: 4px solid var(--rust);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4a4237;
}
.entry-content a { text-decoration: underline; }
.entry-content pre {
    background: #2a2620;
    color: #eadfcc;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    overflow-x: auto;
}
.entry-content code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.9em; }

/* Таблицы */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: 0.95rem;
}
.entry-content table, .entry-content th, .entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { background: var(--cream); font-family: Georgia, serif; }

.single-tags { margin-top: 1.6rem; font-size: 0.9rem; color: var(--muted); }
.tags-label { font-weight: 600; color: var(--ink); }

.page-links { margin-top: 1.2rem; font-size: 0.9rem; }

/* ===================== Пагинация ===================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 2.4rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.7rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.94rem;
}
.pagination a.page-numbers:hover {
    background: var(--cream);
    border-color: var(--rust);
    color: var(--rust-dark);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--rust);
    border-color: var(--rust);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ===================== Сайдбар (светлый фон, тёмный текст) ===================== */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--paper);
    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.15rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--rust);
    color: var(--ink);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.95rem;
}
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--ink); }
.sidebar .widget a:hover { color: var(--rust-dark); }
.sidebar .widget .post-date,
.sidebar .widget .rss-date { color: var(--muted); font-size: 0.82rem; }

/* ===================== Подвал (тёмный фон, светлый текст) ===================== */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: auto; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding: 3rem 0 2.4rem;
}
.footer-col { min-width: 0; }
.site-footer .widget { color: var(--footer-ink); }
.site-footer .widget-title {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.site-footer .widget p { color: var(--footer-ink); font-size: 0.92rem; }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 0.35rem 0; font-size: 0.92rem; }
.site-footer .widget a { color: var(--footer-ink); }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget .post-date { color: var(--footer-muted); font-size: 0.82rem; }

.footer-bottom {
    background: var(--footer-panel);
    padding: 1.1rem 0;
}
.copyright { margin: 0; font-size: 0.86rem; color: var(--footer-muted); text-align: center; }

/* ===================== Формы поиска / комментарии ===================== */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 480px;
    margin: 1.2rem 0;
}
.search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--paper);
    color: var(--ink);
}
.search-submit {
    padding: 0.6rem 1.2rem;
    background: var(--rust);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.search-submit:hover { background: var(--rust-dark); }

.comments-area { margin-top: 2.6rem; }
.comments-title { font-size: 1.5rem; margin-bottom: 1.2rem; }
.comment-list { list-style: none; margin: 0 0 1.6rem; padding: 0; }
.comment-list ol { list-style: none; }
.comment-body {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    margin-bottom: 1rem;
}
.comment-list .children { margin-left: 1.4rem; padding-left: 0; }
.comment-author { font-weight: 600; }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: 0.5rem; }
.comment-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }
.comment-metadata a { color: var(--muted); }

.comment-respond {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
}
.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: 8px;
    font-size: 0.95rem;
    background: var(--cream);
    color: var(--ink);
    margin-top: 0.3rem;
}
.comment-form label { font-size: 0.9rem; font-weight: 600; }
.comment-form p { margin-bottom: 1rem; }
.form-submit .submit {
    padding: 0.7rem 1.6rem;
    background: var(--rust);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.form-submit .submit:hover { background: var(--rust-dark); }

.error-404 { text-align: center; }
.error-404 .search-form { margin: 1.4rem auto; }
.error-home { margin-top: 1.4rem; }

/* ===================== Cookie-баннер ===================== */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: rgba(42, 38, 32, 0.97);
    color: var(--footer-ink);
    padding: 1rem 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.16);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; }
.cookie-accept {
    flex: none;
    padding: 0.6rem 1.6rem;
    background: var(--rust);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.cookie-accept:hover { background: var(--rust-dark); }

/* ===================== Адаптив ===================== */
@media (max-width: 960px) {
    .rubric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fs-intro-grid { grid-template-columns: 1fr; gap: 1.8rem; }
    .fs-intro-media { order: -1; }
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 2.2rem; }
    .layout-single { width: 92%; }
}

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

    .header-inner { gap: 0.8rem; }
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .nav-list { flex-direction: column; gap: 0.2rem; }
    .nav-list a { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line-soft); }

    .fs { padding: 2.4rem 0; }
    .fs-title { font-size: 1.6rem; }
    .fs-intro-title { font-size: 1.9rem; }

    .rubric-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .gallery { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; gap: 1.6rem; padding: 2.2rem 0 1.8rem; }

    .fs-cta { padding: 1.8rem 1.4rem; }
    .step { padding: 1.2rem 1.3rem; }
    .rubric-card { padding: 1.4rem 1.3rem; }

    .layout-single { width: 100%; }
    .post-grid { grid-template-columns: 1fr; }
    .single-title { font-size: 1.7rem; }
    .page-title { font-size: 1.6rem; }

    .cookie-inner { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-accept { width: 100%; }
}
