/*
Theme Name: dds_sankeo2024.com
Author: Алексей Святов
Description: Информационный гид по созданию комфортного жилья — ремонт, дизайн интерьера и умный дом для квартир, домов и дач.
Version: 1.1
Text Domain: sankeo
*/

:root {
    --cream:   #f6f1e9;
    --paper:   #fbf9f5;
    --wall:    #ece3d6;
    --sage:    #6f7f5f;
    --sage-d:  #56654a;
    --terra:   #c67c54;
    --terra-d: #a9633f;
    --wood:    #bd8d5f;
    --ink:     #2f2a25;
    --muted:   #6f675c;
    --line:    #e0d6c6;
    --dark:    #2b3328;
    --radius:  14px;
    --shell:   1180px;
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a { color: var(--terra-d); text-decoration: none; }
a:hover { text-decoration: underline; }

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

p { margin: 0 0 1em; }

/* контейнер ширины — в одном месте (A12.7) */
.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0; padding: 0; margin: -1px;
}

/* ---------- скрытие через атрибут hidden (A11) — до основных блоков ---------- */
.cookie-banner[hidden] { display: none !important; }
.faq-answer[hidden]    { display: none !important; }

/* ---------- header ---------- */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 320px;
}
.brand-logo { width: 56px; height: 56px; display: block; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-title {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    display: block;
    margin: 0;
}
.brand-title a { color: inherit; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 4px 0 0;
    display: block;
}

.main-nav { flex: 0 1 auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 0;
    padding: 0;
}
.main-nav a {
    color: var(--ink);
    font-weight: 600;
    padding: 6px 2px;
    display: inline-block;
}
.main-nav a:hover { color: var(--terra-d); text-decoration: none; }

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
}

/* ---------- layout ---------- */
.site-main { padding: 36px 0 48px; }

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

.content-area { min-width: 0; }

/* ---------- breadcrumbs ---------- */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 22px;
}
.breadcrumbs a { color: var(--sage-d); }
.breadcrumbs .sep { margin: 0 6px; color: var(--wood); }

/* ---------- cards (A8, A10) ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(135deg, var(--wall), var(--cream));
}
.card-body {
    flex: 1;
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.2rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--terra-d); text-decoration: none; }
.card-meta { font-size: 0.8rem; color: var(--muted); margin: 0 0 10px; }
.card-excerpt { color: var(--ink); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    color: var(--terra-d);
    padding-top: 10px;
}

/* ---------- single / page content ---------- */
.entry-header { margin-bottom: 20px; }
.entry-title { margin: 0 0 8px; }
.entry-meta { font-size: 0.85rem; color: var(--muted); }
.featured-image { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; }
.featured-image img { width: 100%; display: block; }

.entry-content { font-size: 1.02rem; }
.entry-content img { border-radius: 10px; display: block; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--wall); }

/* ---------- pagination (D5, type=plain → .page-numbers) ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 36px 0 8px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font-weight: 600;
}
.pagination a.page-numbers:hover {
    background: var(--wall);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--sage);
    border-color: var(--sage);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* ---------- sidebar / widgets ---------- */
.sidebar { min-width: 0; }
.widget {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--ink);
}
.widget-title {
    font-size: 1.1rem;
    margin: 0 0 14px;
    color: var(--ink);
    border-bottom: 2px solid var(--terra);
    padding-bottom: 8px;
    display: inline-block;
}
.widget a { color: var(--terra-d); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.widget li:last-child { border-bottom: none; }
.widget .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
    background: var(--dark);
    color: #d9d3c6;
    padding: 48px 0 26px;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 34px;
}
.site-footer .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #d9d3c6;
}
.site-footer .widget-title {
    color: #fff;
    border-bottom-color: var(--terra);
}
.site-footer .widget a { color: #e7c9b3; }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget li { border-bottom: 1px dashed rgba(255,255,255,0.14); }
.site-footer .widget .post-date { color: #b3ab9c; }
.site-copyright {
    text-align: center;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.14);
    font-size: 0.85rem;
    color: #b3ab9c;
}

/* ---------- search form ---------- */
.search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.search-form .search-field {
    flex: 1 1 180px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font-size: 1rem;
}
.search-form .search-submit {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: var(--sage);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--sage-d); }

/* ---------- comments ---------- */
.comments-area { margin-top: 44px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 24px; padding: 0; }
.comment-inner {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}
.comment-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-actions { font-size: 0.85rem; margin-top: 8px; }
.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(--line);
    border-radius: 10px;
    background: var(--paper);
    font-size: 1rem;
    margin-bottom: 12px;
}
.comment-form .submit {
    padding: 11px 22px;
    border: none;
    border-radius: 10px;
    background: var(--sage);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* =================================================================
   FRONT PAGE
   ================================================================= */
.front .site-main { padding-top: 0; }
.front-block { padding: 56px 0; }
.front-block:nth-child(even) { background: var(--paper); }
.block-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.block-head h2 { font-size: 1.9rem; }
.block-head p { color: var(--muted); }

/* hero */
.hero {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
    padding: 60px 0;
}
.hero-text h1 { font-size: 2.4rem; margin-bottom: 16px; }
.hero-text p { font-size: 1.1rem; color: var(--muted); margin-bottom: 24px; }
.hero-media img { width: 100%; border-radius: 18px; display: block; }
.btn {
    display: inline-block;
    background: var(--terra);
    color: #fff;
    padding: 13px 26px;
    border-radius: 12px;
    font-weight: 700;
}
.btn:hover { background: var(--terra-d); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--sage-d);
    border: 2px solid var(--sage);
}
.btn-ghost:hover { background: var(--sage); color: #fff; }

/* split: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media img { width: 100%; border-radius: 16px; display: block; }
.split-text h2 { margin-bottom: 14px; }

/* directions grid (иконки) */
.directions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.direction {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    min-width: 0;
}
.front-block:nth-child(even) .direction { background: var(--cream); }
.direction img { width: 72px; height: 72px; margin: 0 auto 14px; display: block; }
.direction h3 { margin-bottom: 8px; }
.direction p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 26px;
    counter-reset: step;
}
.step {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 24px 24px;
    min-width: 0;
}
.front-block:nth-child(even) .step { background: var(--cream); }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -18px;
    left: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sage);
    color: #fff;
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step h3 { margin: 6px 0 8px; font-size: 1.15rem; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* gallery / мозаика */
.gallery-mosaic {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.gallery-mosaic figure {
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.gallery-mosaic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 4 / 3;
}
.gallery-mosaic figure.wide { grid-column: span 2; }

/* latest posts on front */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 26px;
}
.front-cta { text-align: center; margin-top: 36px; }

/* =================================================================
   404
   ================================================================= */
.error-404 { text-align: center; padding: 60px 0; }
.error-404 .code { font-size: 5rem; font-family: Georgia, serif; color: var(--terra); margin: 0; }
.error-404 .search-form { max-width: 420px; margin: 24px auto; }

/* =================================================================
   COOKIE BANNER (D6)
   ================================================================= */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: var(--dark);
    color: #ece6da;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.18);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 760px; }
.cookie-banner a { color: #e7c9b3; }
.cookie-accept {
    border: none;
    background: var(--terra);
    color: #fff;
    padding: 11px 22px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: var(--terra-d); }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .hero-inner,
    .split { grid-template-columns: 1fr; gap: 28px; }
    .split.reverse .split-media { order: 0; }
    .gallery-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-mosaic figure.wide { grid-column: span 2; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li { border-bottom: 1px solid var(--line); }
    .layout-single .content-area { width: 100%; }
    .hero-text h1 { font-size: 1.9rem; }
    .gallery-mosaic { grid-template-columns: 1fr; }
    .gallery-mosaic figure.wide { grid-column: auto; }
    h1 { font-size: 1.7rem; }
}
