/*
Theme Name: dds_pryanikk.ru
Author: Васильев Михаил
Description: Тема «Народная мудрость» — для сайта о народных рецептах, уходе за собой и бытовых хитростях. Тёплая бумажная палитра, рукописные акценты, карточки-заметки.
Version: 1.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: dds_pryanikk
*/

/* ===== Базовые переменные ===== */
:root {
    --paper: #FDFAF6;
    --paper-warm: #F9F3E6;
    --ink: #332211;
    --ink-soft: #5a4634;
    --grass: #5A7D5A;
    --grass-dark: #44623f;
    --clay: #C26A4A;
    --clay-dark: #A0522D;
    --teal: #4A6B6B;
    --teal-dark: #2B4A4A;
    --rule: #E6DED5;
    --rule-soft: #f0e8dd;
}

/* ===== Сброс / основа ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
}

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

a {
    color: var(--teal);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color .2s ease;
}
a:hover { color: var(--teal-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Caveat', 'Marck Script', 'Comic Sans MS', cursive;
    color: var(--ink);
    line-height: 1.25;
    margin: 1.4em 0 0.5em;
    font-weight: 700;
    letter-spacing: 0.2px;
}
h1 { font-size: 2.4rem; transform: rotate(-0.4deg); }
h2 { font-size: 1.9rem; transform: rotate(-0.2deg); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5, h6 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

blockquote {
    margin: 1.4em 0;
    padding: 0.6em 1.2em;
    border-left: 3px solid var(--clay);
    background: var(--paper-warm);
    font-style: italic;
    color: var(--ink-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    border: 1px solid var(--rule);
}
th, td {
    padding: 0.5em 0.8em;
    border: 1px solid var(--rule);
    text-align: left;
}
th { background: var(--paper-warm); font-family: 'Caveat', cursive; font-size: 1.15rem; }

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

code, pre {
    font-family: 'Courier New', monospace;
    background: var(--paper-warm);
    border: 1px dashed var(--rule);
    border-radius: 4px;
}
code { padding: 1px 5px; font-size: 0.92em; }
pre { padding: 0.8em 1em; overflow: auto; }
pre code { border: none; padding: 0; background: none; }

hr { border: none; border-top: 1px dashed var(--rule); margin: 2em 0; }

/* ===== Контейнер ===== */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Лента-совет дня ===== */
.tip-ribbon {
    background: linear-gradient(180deg, #d6b48b 0%, #c19a6b 100%);
    color: #2a1d10;
    text-align: center;
    padding: 6px 24px;
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    letter-spacing: 0.3px;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.1);
}
.tip-ribbon::before { content: "✿ "; opacity: 0.7; }
.tip-ribbon::after { content: " ✿"; opacity: 0.7; }

/* ===== Шапка ===== */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 18px 0;
}
.site-header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
}
.brand-logo-svg { color: var(--grass); }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-family: 'Caveat', cursive;
    font-size: 1.7rem;
    line-height: 1.1;
    color: var(--ink);
    text-decoration: none;
    margin: 0;
}
.brand-tagline {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 2px;
    font-style: italic;
}

.main-nav {
    margin-left: auto;
}
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--rule);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    color: var(--ink);
}
.menu-toggle:hover { border-color: var(--grass); }
.menu-toggle-bars {
    display: inline-block;
    width: 22px;
    height: 14px;
    position: relative;
    vertical-align: middle;
}
.menu-toggle-bars::before,
.menu-toggle-bars::after,
.menu-toggle-bars span {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: var(--ink);
}
.menu-toggle-bars::before { top: 0; }
.menu-toggle-bars span { top: 6px; display: block; }
.menu-toggle-bars::after { bottom: 0; }

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.main-nav a {
    display: inline-block;
    padding: 8px 12px;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color .2s ease, color .2s ease;
}
.main-nav a:hover,
.main-nav .current-menu-item a,
.main-nav .current_page_item a {
    border-bottom-color: var(--grass);
    color: var(--grass-dark);
}

/* ===== Слой сайта ===== */
.site-main { padding: 28px 0 48px; }
.layout {
    display: grid;
    grid-template-columns: 67% 27%;
    gap: 6%;
    align-items: start;
}
.layout.layout-wide {
    grid-template-columns: 85%;
    justify-content: center;
}
.layout.layout-no-sidebar {
    grid-template-columns: 85%;
    justify-content: center;
}

/* ===== Хлебные крошки ===== */
.crumbs {
    font-size: 0.92rem;
    color: var(--ink-soft);
    margin: 0 0 18px;
    padding: 8px 14px;
    background: var(--paper-warm);
    border: 1px solid var(--rule);
    border-radius: 4px;
}
.crumbs a {
    color: var(--teal);
    text-decoration: none;
}
.crumbs a:hover { color: var(--teal-dark); text-decoration: underline; }
.crumbs-sep { margin: 0 6px; color: var(--rule); }
.crumbs-current { color: var(--ink); }

/* ===== Карточки записей (бумажные заметки) ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px 24px;
    margin: 12px 0 24px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 2px 4px 0 rgba(80,60,30,0.06), 5px 9px 14px rgba(80,60,30,0.07);
    transform: rotate(-0.3deg);
    transition: transform .25s ease, box-shadow .25s ease;
    position: relative;
}
.cards .card:nth-child(2n) { transform: rotate(0.4deg); }
.cards .card:nth-child(3n) { transform: rotate(-0.15deg); }
.card:hover {
    transform: translateY(-4px) rotate(0deg);
    box-shadow: 3px 6px 0 rgba(80,60,30,0.08), 6px 14px 22px rgba(80,60,30,0.12);
}
.card::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 35% 35%, #d24a3a 0%, #8a2820 80%);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
    z-index: 2;
}

.card-thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--paper-warm);
}
.card-thumb-link { display: block; }

.card-body {
    flex: 1;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
}
.card-title {
    font-family: 'Caveat', cursive;
    font-size: 1.55rem;
    line-height: 1.2;
    margin: 4px 0 8px;
    transform: none;
}
.card-title a {
    color: var(--ink);
    text-decoration: none;
}
.card-title a:hover { color: var(--grass-dark); }

.card-meta {
    font-size: 0.84rem;
    color: var(--ink-soft);
    margin-bottom: 10px;
}
.card-meta a { color: var(--teal); text-decoration: none; }
.card-meta a:hover { color: var(--teal-dark); text-decoration: underline; }
.card-meta-sep { opacity: 0.5; margin: 0 4px; }

.card-excerpt {
    color: var(--ink);
    font-size: 0.97rem;
    flex: 1;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-readmore {
    display: inline-block;
    margin-top: 10px;
    color: var(--clay);
    text-decoration: none;
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    border-bottom: 1px dashed var(--clay);
    align-self: flex-start;
}
.card-readmore:hover { color: var(--clay-dark); border-bottom-color: var(--clay-dark); }
.card-readmore::after { content: " →"; }

/* ===== Кнопки ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--clay);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.1);
    transition: background .2s ease, transform .1s ease;
}
.btn:hover { background: var(--clay-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-ghost {
    background: transparent;
    color: var(--grass-dark);
    border: 1px solid var(--grass);
    box-shadow: none;
}
.btn-ghost:hover { background: var(--grass); color: #fff; }

/* ===== Секции главной ===== */
.section {
    margin: 38px 0;
    padding: 30px 32px;
    background: var(--paper-warm);
    border: 1px solid var(--rule);
    border-radius: 6px;
    position: relative;
}
.section::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 22px;
    width: 36px;
    height: 16px;
    background: rgba(220, 200, 150, 0.6);
    transform: rotate(-3deg);
    border-radius: 2px;
}
.section-title {
    margin-top: 0;
    color: var(--grass-dark);
}
.section-lead {
    font-size: 1.05rem;
    color: var(--ink-soft);
    margin-bottom: 1.2em;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 1em;
}
.tile {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 18px;
    text-align: left;
}
.tile-icon {
    width: 44px;
    height: 44px;
    color: var(--clay);
    margin-bottom: 8px;
}
.tile-title {
    font-family: 'Caveat', cursive;
    font-size: 1.35rem;
    margin: 0 0 6px;
    color: var(--ink);
}
.tile-text {
    font-size: 0.94rem;
    color: var(--ink-soft);
    margin: 0;
}

.steps {
    counter-reset: step;
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.steps li {
    counter-increment: step;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 18px 18px 18px 56px;
    position: relative;
    margin: 0;
}
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 14px;
    top: 14px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: var(--grass);
    color: #fff;
    border-radius: 50%;
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
}

/* ===== Сайдбар ===== */
.sidebar {
    background: var(--paper-warm);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 20px 22px;
    font-size: 0.97rem;
}
.widget {
    margin-bottom: 24px;
}
.widget:last-child { margin-bottom: 0; }
.widget-title {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    margin: 0 0 10px;
    color: var(--grass-dark);
    border-bottom: 1px dashed var(--rule);
    padding-bottom: 6px;
}
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget li {
    margin: 6px 0;
    padding-left: 16px;
    position: relative;
}
.widget li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--clay);
    font-size: 0.7em;
    top: 2px;
}
.widget a {
    color: var(--ink);
    text-decoration: none;
}
.widget a:hover { color: var(--grass-dark); text-decoration: underline; }

/* ===== Запись / страница ===== */
.entry {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 32px 36px;
    box-shadow: 2px 4px 14px rgba(80,60,30,0.06);
}
.entry-header { margin-bottom: 18px; }
.entry-title {
    margin-top: 0;
    color: var(--ink);
}
.entry-meta {
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-bottom: 14px;
}
.entry-meta a { color: var(--teal); text-decoration: none; }
.entry-meta a:hover { text-decoration: underline; color: var(--teal-dark); }
.entry-thumb {
    margin: 0 0 22px;
    border-radius: 4px;
    overflow: hidden;
}
.entry-thumb img {
    display: block;
    width: 100%;
    height: auto;
}
.entry-content > *:first-child { margin-top: 0; }
.entry-content img { border-radius: 4px; }
.entry-content figure { margin: 1.4em 0; }

/* ===== Пагинация ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 30px 0 10px;
}
.pagination a,
.pagination span {
    display: inline-block;
    min-width: 38px;
    text-align: center;
    padding: 8px 12px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 4px;
    text-decoration: none;
    color: var(--ink);
    font-family: inherit;
}
.pagination a:hover {
    background: var(--paper-warm);
    border-color: var(--grass);
    color: var(--grass-dark);
}
.pagination .current {
    background: var(--grass);
    color: #fff;
    border-color: var(--grass);
}
.pagination .dots {
    background: none;
    border: none;
}

/* ===== Комментарии ===== */
.comments-area {
    margin-top: 36px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 28px 32px;
}
.comments-title {
    margin-top: 0;
    color: var(--grass-dark);
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}
.comment-list li {
    background: var(--paper-warm);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 14px;
}
.comment-list li ul.children {
    list-style: none;
    margin: 14px 0 0;
    padding-left: 24px;
}
.comment-author {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: var(--ink);
}
.comment-meta {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 8px;
}
.comment-reply-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--clay);
    font-size: 0.9rem;
    text-decoration: none;
    border-bottom: 1px dashed var(--clay);
}
.comment-respond { margin-top: 18px; }
.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--paper);
    color: var(--ink);
}
.comment-form-comment textarea:focus,
.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    outline: none;
    border-color: var(--grass);
}
.comment-form p { margin-bottom: 12px; }

/* ===== Поиск ===== */
.search-form {
    display: flex;
    gap: 8px;
    margin: 14px 0;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--paper);
    color: var(--ink);
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--grass);
}
.search-form button {
    background: var(--grass);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 16px;
    cursor: pointer;
    font-family: inherit;
}
.search-form button:hover { background: var(--grass-dark); }

/* ===== 404 ===== */
.not-found {
    text-align: center;
    padding: 36px 24px;
}
.not-found-code {
    font-family: 'Caveat', cursive;
    font-size: 6rem;
    line-height: 1;
    color: var(--clay);
    margin: 0 0 8px;
}

/* ===== Подвал — старая тетрадь ===== */
.site-footer {
    margin-top: 50px;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 31px,
            rgba(190,170,140,0.18) 31px,
            rgba(190,170,140,0.18) 32px
        ),
        var(--paper-warm);
    border-top: 1px solid var(--rule);
    color: var(--ink);
    padding: 36px 0 18px;
    position: relative;
}
.site-footer::before {
    content: "";
    position: absolute;
    top: 0; left: 60px;
    bottom: 0;
    width: 2px;
    background: rgba(180,80,80,0.25);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 24px;
}
.footer-col .widget-title {
    color: var(--grass-dark);
}
.footer-col a { color: var(--ink); }
.footer-col a:hover { color: var(--grass-dark); }
.footer-bottom {
    text-align: center;
    padding-top: 14px;
    border-top: 1px dashed var(--rule);
    font-size: 0.9rem;
    color: var(--ink-soft);
}
.footer-author {
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    color: var(--ink);
    margin-bottom: 4px;
}

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

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-left: 4px solid var(--clay);
    border-radius: 6px;
    padding: 14px 18px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
    font-size: 0.95rem;
}
.cookie-text { flex: 1; min-width: 220px; color: var(--ink); }
.cookie-accept {
    background: var(--grass);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}
.cookie-accept:hover { background: var(--grass-dark); }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout,
    .layout.layout-wide,
    .layout.layout-no-sidebar {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .entry { padding: 24px 22px; }
    .section { padding: 24px 22px; }
}

@media (max-width: 600px) {
    body { font-size: 17px; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.35rem; }

    .container { padding: 0 16px; }

    .menu-toggle { display: inline-flex; align-items: center; gap: 8px; }
    .main-nav { width: 100%; margin-left: 0; margin-top: 12px; }
    .main-nav .nav-list { display: none; flex-direction: column; gap: 0; }
    .main-nav .nav-list[data-open="true"] { display: flex; }
    .main-nav li { width: 100%; border-bottom: 1px solid var(--rule); }
    .main-nav a { display: block; padding: 10px 4px; }

    .site-header-inner { gap: 12px; }
    .brand-name { font-size: 1.4rem; }

    .footer-grid { grid-template-columns: 1fr; }
    .entry { padding: 18px 16px; }
    .section { padding: 18px 16px; }

    .cookie-banner { padding: 12px 14px; flex-direction: column; align-items: stretch; text-align: left; }
    .cookie-accept { width: 100%; }

    .cards { grid-template-columns: 1fr; gap: 20px; }
}

/* ===== Доступность ===== */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
:focus-visible { outline: 2px solid var(--grass); outline-offset: 2px; }
