/*
Theme Name: dds_generalmillsstore.com
Author: Анна Смирнова
Description: Информационная образовательная платформа по практической кулинарии: пошаговые рецепты, видеоуроки, обзоры оборудования и сообщество учеников.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: cookcraft
*/

/* ============================ Базовое ============================ */
:root {
    --c-bg: #fbf4ea;
    --c-surface: #ffffff;
    --c-text: #2c2117;
    --c-muted: #6b5d4d;
    --c-primary: #c45b29;
    --c-primary-dark: #a4481d;
    --c-accent: #f4e3cf;
    --c-line: #e4d6c2;
    --c-dark: #2c2117;
    --c-dark-soft: #3a2d20;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

p { margin: 0 0 1em; }

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

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

.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--c-primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

.btn {
    display: inline-block;
    background: var(--c-primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: background .2s;
}
.btn:hover { background: var(--c-primary-dark); color: #fff; text-decoration: none; }

/* ============================ Шапка ============================ */
.site-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo-link { display: inline-flex; flex: 0 0 auto; }
.brand-logo-svg { height: 48px; width: auto; }
.brand-logo { max-height: 56px; width: auto; }
.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 520px;
}
.site-title {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--c-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.site-desc {
    font-size: 0.82rem;
    color: var(--c-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.primary-nav .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.primary-nav .menu a {
    display: block;
    padding: 8px 14px;
    color: var(--c-text);
    border-radius: 6px;
    font-weight: 600;
}
.primary-nav .menu a:hover {
    background: var(--c-accent);
    color: var(--c-primary-dark);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--c-text);
    border-radius: 2px;
}

/* ============================ Основной контент ============================ */
.site-main { padding: 32px 0 56px; }

.page-wrap { padding-top: 8px; }

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--c-muted);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--c-primary); }
.breadcrumbs .sep { color: var(--c-muted); margin: 0 4px; }

.page-title { font-size: 2rem; margin-bottom: 24px; }

/* Раскладки */
.layout-single .content-area {
    display: block;
    width: 85%;
    margin-inline: auto;
}
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}
.layout-with-sidebar .content-area { min-width: 0; }

/* ============================ Главная ============================ */
.front-wrap { padding-top: 16px; }
.block { margin-bottom: 64px; }
.block-head {
    font-size: 1.9rem;
    text-align: center;
    margin-bottom: 36px;
}

/* Блок 1: текст + иллюстрация */
.block-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}
.block-split .split-text h2 { font-size: 1.9rem; }
.block-split .split-media img { display: block; width: 100%; border-radius: 16px; }
@media (max-width: 960px) {
    .block-split { grid-template-columns: 1fr; gap: 28px; }
    .block-split .split-media { order: -1; }
}

/* Блок 2: сетка карточек-направлений */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}
.feature {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    padding: 28px 22px;
    text-align: center;
}
.feature-ico { display: block; width: 64px; height: 64px; margin: 0 auto 14px; }
.feature-ico svg { width: 100%; height: 100%; display: block; }
.feature h3 { font-size: 1.15rem; }
.feature p { color: var(--c-muted); font-size: 0.95rem; margin: 0; }
@media (max-width: 960px) { .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-cards { grid-template-columns: 1fr; } }

/* Блок последних записей и списки карточек */
.cards-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}
@media (max-width: 960px) { .cards-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cards-row { grid-template-columns: 1fr; } }

.cards-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 40px;
}

/* Блок 3: шаги */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    counter-reset: step;
}
.step {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    padding: 28px 22px;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--c-muted); font-size: 0.95rem; margin: 0; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr; } }

/* Блок 4: FAQ */
.faq-list {
    max-width: 820px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.faq-item {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 4px 22px;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-family: Georgia, serif;
    font-size: 1.08rem;
    padding: 16px 0;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    float: right;
    color: var(--c-primary);
    font-size: 1.4rem;
    line-height: 1;
}
.faq-item[open] summary::after { content: '–'; }
.faq-item p { color: var(--c-muted); margin: 0 0 16px; }

/* ============================ Карточки записей ============================ */
.card {
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    overflow: hidden;
}
.card-thumb-wrap {
    position: relative;
    overflow: hidden;
}
.card-thumb-wrap a { display: block; }
.card-thumb,
.card-thumb-wrap img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px;
    min-width: 0;
}
.card-meta { font-size: 0.8rem; color: var(--c-muted); margin-bottom: 8px; }
.card-title { font-size: 1.2rem; margin-bottom: 10px; }
.card-title a { color: var(--c-text); }
.card-title a:hover { color: var(--c-primary); text-decoration: none; }
.card-excerpt { color: var(--c-muted); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 600;
    align-self: flex-start;
}

/* В списке блога — горизонтальные карточки на десктопе */
.cards-list .card {
    flex-direction: row;
}
.cards-list .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
}
.cards-list .card-thumb-wrap a {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.cards-list .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
}
@media (max-width: 600px) {
    .cards-list .card { flex-direction: column; }
    .cards-list .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .cards-list .card-thumb-wrap a { position: static; }
    .cards-list .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ============================ Запись / страница ============================ */
.single-title { font-size: 2.1rem; }
.single-meta { color: var(--c-muted); font-size: 0.9rem; margin-bottom: 20px; }
.single-thumb { margin-bottom: 24px; }
.single-thumb img { display: block; width: 100%; border-radius: 14px; }
.single-content { font-size: 1.05rem; }
.single-content img { border-radius: 10px; }
.single-content h2 { font-size: 1.6rem; margin-top: 1.4em; }
.single-content h3 { font-size: 1.3rem; margin-top: 1.2em; }
.single-tags { margin-top: 28px; }
.single-tags a {
    display: inline-block;
    background: var(--c-accent);
    color: var(--c-primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 0 6px 6px 0;
}

/* Таблицы в контенте */
.single-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}
.single-content table,
.single-content th,
.single-content td {
    border: 1px solid var(--c-line);
}
.single-content th,
.single-content td { padding: 10px 14px; text-align: left; }
.single-content th { background: var(--c-accent); }

/* ============================ Сайдбар ============================ */
.sidebar {
    min-width: 0;
}
.sidebar .widget {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 24px;
    color: var(--c-text);
}
.sidebar .widget-title {
    font-size: 1.15rem;
    margin-bottom: 14px;
    color: var(--c-text);
}
.sidebar .widget a { color: var(--c-primary); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--c-line);
    color: var(--c-text);
}
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget .post-date { color: var(--c-muted); font-size: 0.8rem; }

/* ============================ Пагинация ============================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--c-line);
    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-accent);
    color: var(--c-primary-dark);
}
.pager .page-numbers.current {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}
.pager .page-numbers.dots {
    border-color: transparent;
    background: none;
}

/* ============================ Комментарии ============================ */
.comments-area { margin-top: 48px; }
.comments-title { font-size: 1.5rem; margin-bottom: 24px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ol.children { list-style: none; padding-left: 28px; }
.comment-item { margin-bottom: 20px; }
.comment-inner {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 18px 20px;
}
.comment-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.comment-author { font-weight: 700; }
.comment-date { color: var(--c-muted); font-size: 0.82rem; }
.comment-pending { color: var(--c-primary-dark); font-style: italic; }
.comment-respond {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 24px;
    margin-top: 28px;
}
.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-line);
    border-radius: 8px;
    font-family: inherit;
    margin-bottom: 14px;
}
.comment-form .submit,
.form-submit input[type="submit"] {
    background: var(--c-primary);
    color: #fff;
    border: 0;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================ Форма поиска ============================ */
.search-form .search-row {
    display: flex;
    gap: 10px;
    max-width: 520px;
}
.search-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    font-family: inherit;
}
.search-submit {
    background: var(--c-primary);
    color: #fff;
    border: 0;
    padding: 0 22px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.error-404 { text-align: left; }

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

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    background: var(--c-dark);
    color: #f4ece1;
    box-shadow: 0 -2px 16px rgba(0,0,0,.2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; font-size: 0.9rem; color: #f4ece1; }
.cookie-accept {
    background: var(--c-primary);
    color: #fff;
    border: 0;
    padding: 10px 26px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: var(--c-primary-dark); }

/* ============================ Подвал ============================ */
.site-footer {
    background: var(--c-dark);
    color: #e6dccf;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    padding: 48px 0;
}
.footer-col { min-width: 0; }

/* Контраст текста виджетов в тёмном подвале — задаём явно */
.site-footer .widget { color: #d8cbba; }
.site-footer .widget-title { color: #ffffff; }
.site-footer .widget a { color: #f0c9b0; }
.site-footer .widget a:hover { color: #ffffff; }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li {
    padding: 7px 0;
    border-bottom: 1px solid var(--c-dark-soft);
}
.site-footer .widget li:last-child { border-bottom: 0; }
.site-footer .widget .post-date { color: #b0a392; font-size: 0.8rem; }

.footer-bottom {
    background: #221a12;
    padding: 18px 0;
}
.copyright { margin: 0; font-size: 0.85rem; color: #c3b6a4; }

@media (max-width: 960px) {
    .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .footer-cols { grid-template-columns: 1fr; gap: 28px; }
}

/* ============================ Адаптив навигации ============================ */
@media (max-width: 960px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-nav .menu { flex-direction: column; gap: 4px; }
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .layout-single .content-area { width: 100%; }
    .block-split .split-text h2,
    .block-head { font-size: 1.6rem; }
}
