/*
Theme Name: dds_malovru.ru
Author: Воронова Кристина
Description: Тема для сайта о рукоделии, моде и кулинарии. Светлый воздушный стиль с пастельными акцентами.
Version: 1.1
Text Domain: dds_malovru
*/

/* ==========================================================================
   Базовые переменные и сброс
   ========================================================================== */
:root {
    --bg: #FEF9F2;
    --text: #2E2A35;
    --accent: #DCAFA0;
    --accent-soft: rgba(220, 175, 160, 0.05);
    --sage: #B7C7B4;
    --border: #EFE4DA;
    --muted: #8A8590;
    --shadow-soft: 0 4px 10px rgba(0, 0, 0, 0.02);
    --shadow-lifted: 0 6px 18px rgba(46, 42, 53, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 3px;
    transition: color 0.2s, text-decoration-color 0.2s;
}
a:hover { color: var(--accent); text-decoration-color: var(--text); }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    margin: 1.6em 0 0.6em;
}
h1 { font-size: 2.1em; }
h2 { font-size: 1.65em; }
h3 { font-size: 1.3em; }
h4 { font-size: 1.1em; }

p { margin: 0 0 1em; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    border: 1px solid var(--border);
}
th, td {
    border: 1px solid var(--border);
    padding: 0.6em 0.8em;
    text-align: left;
}
th { background: var(--accent-soft); font-weight: 600; }

blockquote {
    margin: 1.5em 0;
    padding: 1em 1.4em;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    font-style: italic;
    color: #4a4453;
}

code, pre {
    font-family: 'SF Mono', Consolas, Monaco, monospace;
    font-size: 0.92em;
    background: #f5ede2;
    border-radius: 4px;
}
code { padding: 2px 6px; }
pre {
    padding: 1em;
    overflow-x: auto;
    margin: 1em 0;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.layout {
    display: grid;
    gap: 40px;
    margin: 36px 0 60px;
}
.layout.has-sidebar { grid-template-columns: minmax(0, 67%) minmax(0, 27%); justify-content: space-between; }
.layout.no-sidebar { grid-template-columns: minmax(0, 85%); justify-content: center; }
.layout.front-wide { grid-template-columns: minmax(0, 85%); justify-content: center; }

@media (max-width: 960px) {
    .layout.has-sidebar { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Шапка (sticky)
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(254, 249, 242, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 18px 0;
    position: relative;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand-logo {
    width: 52px;
    height: 52px;
    display: block;
    border-radius: 50%;
    background: var(--accent-soft);
    padding: 6px;
}
.brand-text { line-height: 1.2; }
.brand-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text);
}
.brand-tagline {
    font-size: 0.82em;
    color: var(--muted);
    margin-top: 4px;
}

/* Декоративная вязь */
.header-thread {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 14px;
    pointer-events: none;
    color: var(--sage);
    opacity: 0.55;
}
.header-thread svg { width: 100%; height: 100%; display: block; }

/* Главное меню */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
}
.main-nav a {
    text-decoration: none;
    font-size: 0.96em;
    color: var(--text);
    padding: 6px 2px;
    position: relative;
}
.main-nav a:hover { color: var(--accent); }
.main-nav .current-menu-item > a::after,
.main-nav a:hover::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 24px;
    cursor: pointer;
    color: var(--text);
}

@media (max-width: 768px) {
    .menu-toggle { display: inline-flex; align-items: center; gap: 6px; }
    .main-nav {
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 14px 18px;
        box-shadow: var(--shadow-lifted);
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 12px; }
}

/* ==========================================================================
   Кнопки
   ========================================================================== */
.btn,
button.btn,
input[type="submit"],
.search-submit {
    display: inline-block;
    padding: 10px 24px;
    font-family: inherit;
    font-size: 0.95em;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 40px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn:hover,
button.btn:hover,
input[type="submit"]:hover,
.search-submit:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

/* ==========================================================================
   Хлебные крошки
   ========================================================================== */
.breadcrumbs {
    font-size: 0.88em;
    color: var(--muted);
    margin: 22px 0 0;
}
.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.breadcrumbs a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.breadcrumbs .sep {
    margin: 0 8px;
    color: var(--accent);
}

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

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lifted);
}

.card-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--accent-soft);
}
.card-thumb a { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 10;
    transition: transform 0.4s;
}
.card:hover .card-thumb img { transform: scale(1.04); }

.card-body {
    flex: 1;
    padding: 20px 22px 22px;
    background: var(--accent-soft);
}

.card-cats {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 10px;
}
.card-cats a { color: var(--muted); text-decoration: none; }
.card-cats a:hover { color: var(--accent); }

.card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.18em;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.3;
}
.card-title a { text-decoration: none; }

.card-excerpt {
    font-size: 0.95em;
    color: #4a4453;
    margin-bottom: 14px;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-meta {
    font-size: 0.82em;
    color: var(--muted);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

/* ==========================================================================
   Иконки категорий
   ========================================================================== */
.cat-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    color: var(--accent);
}

/* ==========================================================================
   Главная страница
   ========================================================================== */
.front-hero {
    text-align: center;
    padding: 50px 20px 30px;
}
.front-hero h1 {
    font-size: 2.4em;
    margin: 0 0 14px;
}
.front-hero p {
    font-size: 1.1em;
    color: #555057;
    max-width: 720px;
    margin: 0 auto;
}

.front-section {
    padding: 50px 0;
    border-top: 1px solid var(--border);
}
.front-section.alt { background: linear-gradient(180deg, var(--accent-soft), transparent); }

.front-section h2 {
    text-align: center;
    margin: 0 0 30px;
    font-size: 1.9em;
}
.front-section .section-lead {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 28px;
    color: #555057;
}

.cat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}
.cat-tile {
    display: block;
    padding: 28px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}
.cat-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lifted);
    color: var(--text);
}
.cat-tile-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--accent);
}
.cat-tile-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 4px;
}
.cat-tile-desc { color: var(--muted); font-size: 0.88em; }

/* Шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.step {
    padding: 26px 22px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    position: relative;
}
.step-num {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 50%;
    background: var(--sage);
    color: #fff;
    font-weight: 600;
    margin-bottom: 12px;
}
.step h3 { margin: 0 0 8px; font-size: 1.1em; }
.step p { margin: 0; color: #555057; font-size: 0.95em; }

/* Блок «Кристина советует» */
.kristina-tip {
    margin: 40px 0;
    padding: 28px 30px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background-color: #fff;
    background-image:
        linear-gradient(rgba(220, 175, 160, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220, 175, 160, 0.07) 1px, transparent 1px);
    background-size: 14px 14px;
    position: relative;
}
.kristina-tip::before {
    content: 'Кристина советует';
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 10px;
}
.kristina-tip p { margin: 0; font-style: italic; color: #4a4453; }

/* ==========================================================================
   Свитки-подборки
   ========================================================================== */
.scroll-list { display: flex; flex-direction: column; gap: 22px; }
.scroll-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 26px;
    transition: box-shadow 0.2s;
}
.scroll-item:hover { box-shadow: var(--shadow-lifted); }
.scroll-item h3 { margin: 0 0 8px; }
.scroll-item h3 a { text-decoration: none; }
.scroll-preview {
    color: #4a4453;
    margin-bottom: 8px;
}
.scroll-preview p { margin: 0; }
.scroll-more {
    font-size: 0.88em;
    color: var(--accent);
    text-decoration: none;
}
.scroll-more:hover { text-decoration: underline; }

/* ==========================================================================
   Сайдбар и виджеты
   ========================================================================== */
.sidebar { font-size: 0.96em; }
.widget {
    margin-bottom: 36px;
    padding: 22px 22px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.widget h2,
.widget .widget-title {
    font-size: 1.05em;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}
.widget li:last-child { border-bottom: none; }
.widget a { text-decoration: none; }

/* ==========================================================================
   Single / Page
   ========================================================================== */
.entry-header { margin-bottom: 22px; }
.entry-title { margin: 0 0 10px; font-size: 2em; }
.entry-meta {
    font-size: 0.88em;
    color: var(--muted);
}
.entry-meta a { color: var(--muted); text-decoration: none; }
.entry-meta a:hover { color: var(--accent); }
.entry-thumb {
    margin: 22px 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content {
    font-size: 1.02em;
}
.entry-content img { border-radius: 10px; }
.entry-content h2, .entry-content h3 { color: var(--text); }
.entry-tags {
    margin: 30px 0;
    font-size: 0.88em;
    color: var(--muted);
}
.entry-tags a {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 4px 4px 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.92em;
}
.entry-tags a:hover { color: var(--accent); border-color: var(--accent); }

/* ==========================================================================
   Пагинация
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 22px;
    text-decoration: none;
    color: var(--text);
    background: #fff;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    min-width: 38px;
    text-align: center;
}
.pagination a:hover,
.pagination .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ==========================================================================
   Комментарии
   ========================================================================== */
.comments-area { margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--border); }
.comments-title { margin: 0 0 22px; font-size: 1.5em; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { margin-bottom: 22px; padding: 18px 20px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.comment-list .children { list-style: none; padding-left: 28px; margin-top: 18px; }
.comment-author { font-weight: 600; }
.comment-date { font-size: 0.86em; color: var(--muted); margin-left: 8px; }
.comment-content { margin-top: 10px; }

.comment-respond { margin-top: 30px; }
.comment-respond label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.92em;
    color: var(--muted);
}
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 0.96em;
    color: var(--text);
    margin-bottom: 14px;
}
.comment-respond textarea { min-height: 120px; resize: vertical; }

/* ==========================================================================
   Форма поиска
   ========================================================================== */
.search-form {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #fff;
    font-family: inherit;
    font-size: 0.96em;
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--accent); }

/* ==========================================================================
   404
   ========================================================================== */
.error-404 {
    text-align: center;
    padding: 60px 20px;
}
.error-404 .big {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 6em;
    color: var(--accent);
    line-height: 1;
    margin: 0 0 10px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    margin-top: 60px;
    padding: 50px 0 24px;
    background: linear-gradient(180deg, var(--accent-soft), #f4ebe0);
    border-top: 1px solid var(--border);
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
    margin-bottom: 30px;
}
.footer-col .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}
.footer-col .widget h2,
.footer-col .widget .widget-title {
    border-bottom: none;
    padding-bottom: 4px;
    color: var(--text);
}
.footer-col .widget li { border-color: rgba(46, 42, 53, 0.08); }
.footer-col p { color: #4a4453; }
@media (max-width: 768px) {
    .footer-cols { grid-template-columns: 1fr; gap: 26px; }
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    text-align: center;
    font-size: 0.88em;
    color: var(--muted);
}

/* ==========================================================================
   Cookie-баннер (правило A11 — первое правило ДО основных стилей)
   ========================================================================== */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lifted);
    font-size: 0.92em;
    max-width: 720px;
    margin: 0 auto;
}
.cookie-banner p { margin: 0; flex: 1; }
.cookie-banner .btn { padding: 8px 18px; font-size: 0.9em; flex-shrink: 0; }

@media (max-width: 480px) {
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ==========================================================================
   Утилиты
   ========================================================================== */
.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { display: block; margin: 1em auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.88em; color: var(--muted); text-align: center; margin-top: 6px; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7em; }
    h2 { font-size: 1.4em; }
    .front-hero h1 { font-size: 1.9em; }
    .wrap { padding: 0 16px; }
    .header-inner { padding: 14px 0; }
    .brand-logo { width: 42px; height: 42px; }
    .brand-tagline { display: none; }
    .posts-grid { grid-template-columns: 1fr; gap: 22px; }
    .layout { gap: 28px; margin: 22px 0 40px; }
}
