/*
Theme Name: recettes-de-cuisine-francaise.com
Author: Марина Дюваль
Description: Образовательная платформа о французской кулинарии — современная французская классика с элементами деревенского шарма.
Version: 1.1
Text Domain: rdcf
*/

/* ===== Шрифты ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

/* ===== Базовые переменные ===== */
:root {
    --ecru: #FDF9F2;
    --cassis: #2E2522;
    --terre: #C26A4A;
    --moutarde: #D9A13B;
    --olivade: #7A8B61;
    --farine: #EDE5D8;
    --carte: #FBF6EA;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--cassis);
    background-color: var(--ecru);
    background-image: linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.4));
    overflow-x: hidden;
}

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

a { color: var(--terre); }
a:hover { color: var(--moutarde); }

h1, h2, h3, h4 {
    font-family: var(--serif);
    line-height: 1.25;
    color: var(--cassis);
    margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }

/* ===== Контейнер ширины (единственный источник) ===== */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ===== Шапка ===== */
.site-header {
    background: var(--ecru);
    border-bottom: 2px solid var(--farine);
    padding: 22px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    min-width: 0;
}
.brand-logo { display: block; height: 56px; width: auto; }
.brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-mark svg { display: block; }
.brand-name {
    font-family: var(--serif);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--cassis);
    line-height: 1.1;
}
.brand-name span { color: var(--terre); font-style: italic; font-weight: 600; }
.site-identity { min-width: 0; flex: 1; }
.site-title {
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--cassis);
}
.site-title a { color: inherit; text-decoration: none; }
.site-description {
    font-size: 0.82rem;
    color: var(--olivade);
    margin: 0;
    line-height: 1.4;
}

/* ===== Навигация ===== */
.main-nav { margin-top: 16px; }
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid var(--terre);
    border-radius: 14px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--terre);
}
.nav-toggle svg { display: block; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 28px;
}
.main-nav a {
    text-decoration: none;
    color: var(--cassis);
    font-weight: 500;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--terre);
    border-bottom-color: var(--moutarde);
}

/* ===== Волнистый разделитель ===== */
.wave-sep {
    height: 14px;
    margin: 46px 0;
    background-image: radial-gradient(circle at 10px -4px, transparent 12px, var(--moutarde) 13px, transparent 14px);
    background-size: 26px 14px;
    background-repeat: repeat-x;
    opacity: 0.55;
}

/* ===== Хлебные крошки ===== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--olivade);
    margin: 22px 0 8px;
}
.breadcrumbs a { color: var(--terre); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; color: var(--moutarde); }

/* ===== Раскладки ===== */
.site-main { padding: 18px 0 56px; }

.layout-with-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 6%;
    align-items: flex-start;
}
.layout-with-sidebar .content-area { flex: 0 0 67%; min-width: 0; }
.layout-with-sidebar .sidebar { flex: 0 0 27%; min-width: 0; }

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

/* ===== Кнопки ===== */
.btn,
.btn-primary {
    display: inline-block;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 40px;
    padding: 12px 28px;
    cursor: pointer;
    border: 2px solid transparent;
    background: var(--terre);
    color: var(--ecru);
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:hover,
.btn-primary:hover {
    background: #cf7d5f;
    border-color: var(--moutarde);
    box-shadow: 0 4px 12px rgba(46,37,34,0.18);
    color: var(--ecru);
}
.btn-secondary {
    display: inline-block;
    font-weight: 600;
    text-decoration: none;
    border-radius: 40px;
    padding: 11px 26px;
    background: transparent;
    border: 2px solid var(--olivade);
    color: var(--olivade);
    transition: background 0.2s, color 0.2s;
}
.btn-secondary:hover {
    background: var(--olivade);
    color: #fff;
}

/* ===== Карточки записей ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--carte);
    background-image: linear-gradient(180deg, #FCF8EC, #F6EFDE);
    border: 1px solid #E4DBC7;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(46,37,34,0.08);
    position: relative;
    min-width: 0;
}
.card::before {
    content: "";
    display: block;
    height: 6px;
    background: var(--moutarde);
}
.card-thumb {
    display: block;
    overflow: hidden;
}
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: filter 0.3s, transform 0.3s;
}
.card-thumb:hover img {
    filter: sepia(0.35) contrast(1.05);
    transform: scale(1.03);
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 24px;
    min-width: 0;
}
.card-title {
    font-size: 1.2rem;
    margin: 0 0 8px;
}
.card-title a { color: var(--cassis); text-decoration: none; }
.card-title a:hover { color: var(--terre); }
.card-meta {
    font-size: 0.78rem;
    color: var(--olivade);
    margin-bottom: 10px;
}
.card-excerpt { margin-bottom: 16px; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; }
.card-more .btn { padding: 9px 22px; font-size: 0.88rem; }

/* ===== Главная ===== */
.home-section { margin: 12px 0; }
.home-section h2 {
    font-size: 2rem;
    text-align: center;
}
.section-lead {
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    color: #5a4d46;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 30px;
}
.feature-card {
    background: var(--carte);
    border: 1px solid #E4DBC7;
    border-radius: 10px;
    padding: 26px 24px;
    min-width: 0;
}
.feature-card h3 {
    color: var(--terre);
    font-size: 1.25rem;
}
.feature-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    color: var(--terre);
}
.flourish {
    display: block;
    width: 140px;
    height: 22px;
    margin: 6px auto 24px;
    color: var(--terre);
}
.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: center;
    margin-top: 26px;
}
.why-grid > div { min-width: 0; }
.why-diagram {
    background: #F2F4EC;
    border: 1px solid #D7DEC9;
    border-radius: 12px;
    padding: 28px;
}
.why-diagram ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.why-diagram li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed #C5CFB1;
    color: #4d5740;
    font-weight: 500;
}
.why-diagram li:last-child { border-bottom: none; }
.why-diagram .badge {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--olivade);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 26px;
}
.step {
    background: var(--carte);
    border: 1px solid #E4DBC7;
    border-radius: 10px;
    padding: 22px;
    min-width: 0;
}
.step-num {
    font-family: var(--serif);
    font-size: 2rem;
    color: var(--moutarde);
    line-height: 1;
}

/* ===== Контент записи / страницы ===== */
.entry-title { font-size: 2.2rem; }
.entry-meta {
    font-size: 0.85rem;
    color: var(--olivade);
    margin-bottom: 18px;
}
.entry-content { font-size: 1.02rem; }
.entry-content img { border-radius: 8px; }
.entry-content blockquote {
    border-left: 4px solid var(--moutarde);
    background: #FBF2DC;
    margin: 1.4em 0;
    padding: 14px 22px;
    font-style: italic;
}
.entry-content h2 { font-size: 1.6rem; margin-top: 1.4em; }
.entry-content h3 { font-size: 1.3rem; margin-top: 1.2em; }
.entry-thumb { margin-bottom: 22px; }
.entry-thumb img { display: block; width: 100%; border-radius: 10px; }

/* ===== Таблицы ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid #D8CDB6;
}
th, td {
    border: 1px solid #D8CDB6;
    padding: 10px 14px;
    text-align: left;
}
th { background: var(--farine); }

/* ===== Сайдбар ===== */
.sidebar {
    background: var(--carte);
    border: 1px solid #E4DBC7;
    border-radius: 10px;
    padding: 24px 22px;
}
.sidebar .widget { margin-bottom: 28px; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title,
.sidebar .widget h2,
.sidebar .widget h3 {
    font-size: 1.15rem;
    color: var(--cassis);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--moutarde);
}
.sidebar .widget,
.sidebar .widget li,
.sidebar .widget p { color: var(--cassis); }
.sidebar .widget a { color: var(--terre); text-decoration: none; }
.sidebar .widget a:hover { color: var(--moutarde); }
.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .widget li {
    padding: 7px 0;
    border-bottom: 1px dashed #D8CDB6;
    font-size: 0.95rem;
}
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .post-date,
.sidebar .widget .rss-date {
    display: block;
    font-size: 0.78rem;
    color: var(--olivade);
}

/* ===== Поиск ===== */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #D8CDB6;
    border-radius: 40px;
    font-family: var(--sans);
    font-size: 0.95rem;
    background: #fff;
    color: var(--cassis);
}
.search-form button {
    border: none;
    background: var(--terre);
    color: var(--ecru);
    border-radius: 40px;
    padding: 10px 22px;
    font-weight: 600;
    cursor: pointer;
}
.search-form button:hover { background: #cf7d5f; }

/* ===== Пагинация ===== */
.pagination {
    margin: 40px 0 10px;
    display: flex;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.pagination .page-numbers li a,
.pagination .page-numbers li span,
.page-numbers {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 40px;
    border: 1px solid #D8CDB6;
    text-decoration: none;
    color: var(--terre);
    background: var(--carte);
}
.pagination .page-numbers li .current,
.pagination .page-numbers .current {
    background: var(--terre);
    border-color: var(--terre);
    color: var(--ecru);
}

/* ===== Комментарии ===== */
.comments-area { margin-top: 46px; }
.comments-area .comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comments-area .comment-list li { margin-bottom: 18px; }
.comments-area .comment-body {
    background: var(--carte);
    border: 1px solid #E4DBC7;
    border-radius: 10px;
    padding: 16px 20px;
}
.comments-area .children {
    list-style: none;
    margin-left: 28px;
    padding-left: 0;
}
.comment-respond {
    margin-top: 26px;
    background: var(--carte);
    border: 1px solid #E4DBC7;
    border-radius: 10px;
    padding: 22px;
}
.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 #D8CDB6;
    border-radius: 8px;
    font-family: var(--sans);
    background: #fff;
    color: var(--cassis);
}
.comment-form textarea { resize: vertical; }
.comment-form .submit {
    background: var(--terre);
    color: var(--ecru);
    border: none;
    border-radius: 40px;
    padding: 11px 28px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    padding: 30px 0;
}
.error-404 .big {
    font-family: var(--serif);
    font-size: 5rem;
    color: var(--moutarde);
    margin: 0;
}

/* ===== Подвал ===== */
.site-footer {
    background: var(--farine);
    border-top: 2px solid #DBCFB9;
    padding: 48px 0 26px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
}
.footer-cols > div { min-width: 0; }
.footer-cols .widget-title,
.footer-cols .widget h2,
.footer-cols .widget h3 {
    font-family: var(--serif);
    font-size: 1.15rem;
    color: var(--cassis);
    margin: 0 0 14px;
}
.footer-cols .widget,
.footer-cols .widget p,
.footer-cols .widget li { color: #4a3f39; }
.footer-cols .widget a { color: var(--terre); text-decoration: none; }
.footer-cols .widget a:hover { color: var(--olivade); }
.footer-cols .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-cols .widget li {
    padding: 6px 0;
    border-bottom: 1px dashed #D2C6AF;
}
.footer-cols .widget li:last-child { border-bottom: none; }
.footer-signature { font-style: italic; color: var(--terre); }
.site-info {
    text-align: center;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #D2C6AF;
    font-size: 0.85rem;
    color: #6a5d54;
}

/* ===== Кнопка наверх ===== */
.to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--terre);
    color: var(--ecru);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(46,37,34,0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
    z-index: 40;
}
.to-top.visible { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-5px); }
.to-top svg { display: block; }

/* ===== Cookie-баннер ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cassis);
    color: var(--ecru);
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    z-index: 60;
    font-size: 0.9rem;
}
.cookie-banner p { margin: 0; }
.cookie-banner a { color: var(--moutarde); }
.cookie-banner .btn {
    padding: 9px 24px;
    font-size: 0.88rem;
}

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .why-grid { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .layout-with-sidebar { gap: 0; }
    .layout-with-sidebar .content-area,
    .layout-with-sidebar .sidebar { flex: 0 0 100%; }
    .layout-with-sidebar .sidebar { margin-top: 36px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: inline-flex; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 0;
        margin-top: 14px;
    }
    .main-nav ul.open { display: flex; }
    .main-nav li {
        border-bottom: 1px dashed #D8CDB6;
    }
    .main-nav a { display: block; padding: 12px 4px; }
    .layout-single .content-area { width: 100%; }
    .footer-cols { grid-template-columns: 1fr; }
    .home-section h2 { font-size: 1.6rem; }
    .entry-title { font-size: 1.7rem; }
    .btn, .btn-primary, .btn-secondary { display: block; text-align: center; }
    .card-more .btn { display: inline-block; }
    .search-form button { display: block; }
}
