/*
Theme Name: dds_studio5floor.ru
Author: Алексей Стеклов
Description: Информационная тема о комфортной жизни с современными окнами: уход, энергоэффективность и здоровая атмосфера в доме.
Version: 1.1
Text Domain: s5floor
*/

/* ============================================================
   Переменные и сброс
   ============================================================ */
:root {
    --maxw: 1180px;
    --ink: #1d2b32;
    --muted: #5f7782;
    --bg: #f4f8fa;
    --panel: #ffffff;
    --brand: #2c7a93;
    --brand-dark: #1f5a6e;
    --accent: #e0922e;
    --accent-dark: #c47b1d;
    --line: #dbe5ea;
    --soft: #eaf2f5;
    --footer-bg: #16323d;
    --footer-ink: #cfe0e7;
    --footer-muted: #8fa9b3;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(22, 50, 61, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 {
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 0.6em;
    font-weight: 700;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

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

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

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.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;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-logo,
.brand-mark {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: block;
}

.brand-text { min-width: 0; }

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    line-height: 1.3;
    max-width: 640px;
}

.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 4px 0 0;
    max-width: 640px;
}

/* Навигация */
.main-nav { min-width: 0; }

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.97rem;
}
.main-nav a:hover {
    background: var(--soft);
    color: var(--brand-dark);
    text-decoration: none;
}
.main-nav .current-menu-item > a {
    background: var(--brand);
    color: #fff;
}

/* ============================================================
   Макет
   ============================================================ */
.site-main { padding: 34px 0 48px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 36px;
    align-items: start;
}

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

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

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .layout-single .content-area { width: 100%; }
}

/* ============================================================
   Хлебные крошки
   ============================================================ */
.crumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 22px;
}
.crumbs a { color: var(--brand); }
.crumbs .sep { color: var(--muted); margin: 0 4px; }
.crumbs span { color: var(--ink); }

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(22, 50, 61, 0.14);
}

.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}

.card-title {
    font-size: 1.18rem;
    margin: 0 0 8px;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); text-decoration: none; }

.card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0 0 10px;
}

.card-excerpt {
    color: #41545d;
    font-size: 0.95rem;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-more {
    margin-top: auto;
    padding-top: 14px;
}
.card-more a {
    display: inline-block;
    padding: 8px 16px;
    background: var(--brand);
    color: #fff;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.9rem;
}
.card-more a:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

/* Список записей в одну колонку (архивы) — горизонтальные карточки */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.post-list .card {
    flex-direction: row;
}
.post-list .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}
.post-list .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.post-list .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post-list .card-body { min-width: 0; }

@media (max-width: 600px) {
    .post-list .card { flex-direction: column; }
    .post-list .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .post-list .card-thumb-wrap a { position: static; }
    .post-list .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ============================================================
   Одиночная запись / страница
   ============================================================ */
.entry {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 36px;
}
.entry-title { font-size: 2rem; }
.entry-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 20px;
}
.entry-thumb {
    display: block;
    width: 100%;
    border-radius: 10px;
    margin: 0 0 22px;
    object-fit: cover;
}
.entry-content { font-size: 1.02rem; }
.entry-content img { border-radius: 10px; display: block; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }

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

@media (max-width: 600px) {
    .entry { padding: 22px 20px; }
    .entry-title { font-size: 1.55rem; }
}

/* ============================================================
   Сайдбар и виджеты
   ============================================================ */
.sidebar { min-width: 0; }

.widget {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    color: var(--ink);
}
.widget-title {
    font-size: 1.1rem;
    margin: 0 0 14px;
    color: var(--brand-dark);
    border-bottom: 2px solid var(--soft);
    padding-bottom: 8px;
}
.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget li {
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--brand); }
.widget a:hover { color: var(--brand-dark); }
.widget .post-date {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
}

/* ============================================================
   Главная
   ============================================================ */
.section { padding: 26px 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 28px;
}
.section-head h2 { font-size: 1.75rem; }
.section-head p { color: var(--muted); margin: 0; }

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 38px;
    align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media img {
    width: 100%;
    border-radius: var(--radius);
    display: block;
    box-shadow: var(--shadow);
    object-fit: cover;
}
.split-text h2 { font-size: 1.7rem; }
@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; gap: 22px; }
    .split.reverse .split-media { order: 0; }
}

/* Блок: сетка преимуществ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.feature {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.feature-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    display: block;
}
.feature h3 { font-size: 1.12rem; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Блок: пошаговый */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px 22px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
}
.step h3 { font-size: 1.08rem; margin: 0 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* Блок: акцентная цитата */
.quote-block {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 46px 40px;
    text-align: center;
}
.quote-block p {
    font-size: 1.5rem;
    line-height: 1.4;
    font-weight: 600;
    margin: 0 0 12px;
    max-width: 820px;
    margin-inline: auto;
}
.quote-block cite {
    font-size: 0.95rem;
    font-style: normal;
    opacity: 0.85;
}
@media (max-width: 600px) {
    .quote-block { padding: 32px 22px; }
    .quote-block p { font-size: 1.2rem; }
}

/* Блок: FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 14px 0;
    list-style: none;
    color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    float: right;
    color: var(--brand);
    font-size: 1.3rem;
    line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

/* Последние записи на главной */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 26px;
}

.section-cta { text-align: center; }
.btn {
    display: inline-block;
    padding: 13px 28px;
    border-radius: 11px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn.btn-ghost {
    background: transparent;
    color: var(--brand-dark);
    border: 2px solid var(--brand);
}
.btn.btn-ghost:hover { background: var(--brand); color: #fff; }

/* ============================================================
   Пагинация (type => plain → .page-numbers)
   ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 36px 0 0;
}
.pager .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(--panel);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover {
    background: var(--soft);
    border-color: var(--brand);
    text-decoration: none;
}
.pager .page-numbers.current {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.pager .page-numbers.dots {
    border: none;
    background: none;
}

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    margin-top: 28px;
}
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment-list .children {
    list-style: none;
    margin: 0 0 0 24px;
    padding: 0;
}
.comment-item { margin: 0 0 18px; }
.comment-inner {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
}
.comment-meta {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 6px;
}
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-awaiting { color: var(--accent-dark); font-size: 0.9rem; }
.comment-reply a {
    font-size: 0.85rem;
    font-weight: 600;
}

.comment-form-wrap { margin-top: 24px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 0.95rem;
    font-family: inherit;
    margin-top: 5px;
    background: #fff;
    color: var(--ink);
}
.comment-form p { margin-bottom: 14px; }
.comment-form .submit,
.comment-form input[type="submit"] {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
}
.comment-form input[type="submit"]:hover { background: var(--brand-dark); }

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
}
.search-form .search-submit {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--brand-dark); }

/* ============================================================
   404
   ============================================================ */
.page-404 {
    text-align: center;
    padding: 50px 0;
}
.page-404 .code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--brand);
    line-height: 1;
    margin: 0;
}
.page-404 .search-form {
    max-width: 480px;
    margin: 24px auto 0;
}

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    margin-top: 30px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 46px 0 30px;
}
.footer-cols .widget {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    color: var(--footer-ink);
}
.footer-cols .widget-title {
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.footer-cols .widget a { color: var(--footer-ink); }
.footer-cols .widget a:hover { color: #fff; }
.footer-cols .widget li { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.footer-cols .widget .post-date { color: var(--footer-muted); }
.footer-cols p { color: var(--footer-ink); }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 18px 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--footer-muted);
}

@media (max-width: 760px) {
    .footer-cols { grid-template-columns: 1fr; gap: 26px; padding: 32px 0 22px; }
}

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

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: rgba(22, 50, 61, 0.97);
    color: #fff;
    padding: 16px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-inner p { margin: 0; font-size: 0.9rem; max-width: 760px; min-width: 0; }
.cookie-inner a { color: #ffd79a; }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--accent-dark); }

/* ============================================================
   Адаптив навигации
   ============================================================ */
@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .main-nav { width: 100%; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 4px;
        margin-top: 12px;
    }
    .main-nav.is-open ul { display: flex; }
    .main-nav a { padding: 11px 14px; }
}
