/*
Theme Name: dds_teploholodok.ru
Author: Степан Котов
Description: Информационная тема о климатической технике: кондиционеры, монтаж, обслуживание.
Version: 1.1
Text Domain: thld
*/

/* ================= Базовые переменные ================= */
:root {
    --bg: #eef4f6;
    --surface: #ffffff;
    --surface-2: #f4f8fa;
    --ink: #16323d;
    --muted: #5c7480;
    --primary: #0e6b82;
    --primary-dark: #0a4d5e;
    --accent: #e07a3c;
    --accent-dark: #c4642b;
    --line: #d7e4e9;
    --footer-bg: #10323d;
    --footer-ink: #cbdde3;
    --footer-head: #ffffff;
    --radius: 12px;
    --shell: min(92%, 1180px);
    --shadow: 0 6px 22px rgba(16, 50, 61, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); }
h1 { font-size: 2rem; margin: 0 0 0.6em; }
h2 { font-size: 1.55rem; margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }

.shell { width: var(--shell); margin-inline: auto; }

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.page-intro { margin-bottom: 22px; }
.page-intro h1 { margin: 0; }
.archive-desc { color: var(--muted); margin-top: 6px; }

/* ================= Шапка ================= */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.brand:hover { text-decoration: none; }
.brand-logo, .brand-mark { flex: 0 0 auto; display: block; }
.brand-mark { width: 52px; height: 52px; }
.brand-text { min-width: 0; }
.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    line-height: 1.25;
}
.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 2px 0 0;
    line-height: 1.35;
}

.header-nav { margin-left: auto; }
.main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.main-menu a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 500;
    font-size: 0.96rem;
}
.main-menu a:hover {
    background: var(--surface-2);
    color: var(--primary-dark);
    text-decoration: none;
}
.current-menu-item > a,
.current_page_item > a {
    background: var(--primary);
    color: #fff;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.95rem;
    color: var(--ink);
    cursor: pointer;
}

/* ================= Хлебные крошки ================= */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 14px 0 0;
}
.breadcrumbs a { color: var(--primary); }
.breadcrumbs .sep { margin: 0 6px; color: #9db3bc; }

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

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

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

/* ================= Одиночная запись / страница ================= */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
    box-shadow: var(--shadow);
}
.entry-title { margin-top: 0; }
.entry-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 18px;
}
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-thumb { margin: 0 0 22px; border-radius: 10px; overflow: hidden; }
.entry-thumb img { display: block; width: 100%; }

/* ================= Карточки записей ================= */
.card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-row { flex-direction: row; }
.card-thumb-wrap {
    flex: 0 0 300px;
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    min-width: 0;
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
}
.card-title { margin: 0 0 8px; font-size: 1.22rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--primary-dark); text-decoration: none; }
.card-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
.card-excerpt { color: #3a4d56; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 10px;
    font-weight: 600;
    color: var(--primary);
}
.card-more:hover { color: var(--accent-dark); }

/* ================= Сайдбар / виджеты ================= */
.sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    color: var(--ink);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
    display: inline-block;
}
.widget a { color: var(--primary); }
.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 .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ================= Пагинация ================= */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 30px;
    justify-content: center;
}
.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: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}
.pagination a.page-numbers:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}
.pagination .page-numbers.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* ================= Главная ================= */
.front-section { padding: 46px 0; }
.front-section + .front-section { border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 26px; }
.section-head .eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-dark);
    font-weight: 700;
    margin-bottom: 8px;
}
.section-head h2 { margin: 0 0 8px; font-size: 1.75rem; }
.section-head p { color: var(--muted); margin: 0; }

/* Hero-интро */
.fs-intro {
    background: linear-gradient(120deg, #0e6b82 0%, #0a4d5e 100%);
    color: #fff;
    padding: 56px 0;
}
.fs-intro .intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 40px;
    align-items: center;
}
.fs-intro h1 { color: #fff; font-size: 2.3rem; margin: 0 0 16px; }
.fs-intro p { color: #d5e8ee; font-size: 1.08rem; margin: 0 0 14px; }
.intro-illus { justify-self: center; width: 100%; }
.intro-illus img { display: block; width: 100%; border-radius: 14px; }
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 9px;
    font-weight: 600;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.55);
    color: #fff;
    margin-left: 10px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

/* Текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 42px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.split-body p { color: #3a4d56; }

/* Сетка тем */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.topic-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    box-shadow: var(--shadow);
}
.topic-card .ic {
    width: 46px; height: 46px;
    display: block;
    margin-bottom: 14px;
}
.topic-card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.topic-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    counter-reset: step;
}
.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px 22px;
    box-shadow: var(--shadow);
    position: relative;
}
.step .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* FAQ */
.faq-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 860px;
}
.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 22px;
    box-shadow: var(--shadow);
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 14px 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    color: var(--accent);
    font-size: 1.4rem;
    line-height: 1;
    flex: 0 0 auto;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 16px; color: #3a4d56; }

/* CTA */
.fs-cta { padding: 40px 0; }
.cta-box {
    background: var(--primary-dark);
    color: #fff;
    border-radius: 16px;
    padding: 38px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    flex-wrap: wrap;
}
.cta-box h2 { color: #fff; margin: 0 0 6px; }
.cta-box p { color: #cfe4ea; margin: 0; }
.cta-text { min-width: 0; }

/* Последние записи на главной */
.fs-latest { background: var(--surface-2); }
.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.latest-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.latest-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.latest-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.latest-body { flex: 1; min-width: 0; padding: 20px 22px; display: flex; flex-direction: column; }
.latest-body h3 { margin: 0 0 8px; font-size: 1.12rem; }
.latest-body h3 a { color: var(--ink); }
.latest-body h3 a:hover { color: var(--primary-dark); text-decoration: none; }
.latest-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }
.latest-excerpt { color: #3a4d56; font-size: 0.95rem; }
.latest-excerpt p { margin: 0 0 0.5em; background: none; }
.latest-more { align-self: flex-start; margin-top: auto; padding-top: 10px; font-weight: 600; }

/* ================= Комментарии ================= */
.comments-area {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 30px;
    margin-top: 26px;
    box-shadow: var(--shadow);
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-list .children { list-style: none; margin: 0; padding-left: 24px; }
.comment-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.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: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 12px;
    background: var(--surface-2);
}
.comment-form .submit,
.comment-form input[type="submit"] {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ================= Форма поиска ================= */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--surface);
}
.search-form button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ================= Таблицы ================= */
.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
}
.entry-content table th,
.entry-content table td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
}
.entry-content table th { background: var(--surface-2); }

/* ================= Подвал ================= */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 46px 0 22px;
    margin-top: 30px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
}
.site-footer .widget {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    color: var(--footer-ink);
}
.site-footer .widget-title {
    color: var(--footer-head);
    border-bottom-color: var(--accent);
}
.site-footer .widget a { color: #ffffff; }
.site-footer .widget a:hover { color: var(--accent); }
.site-footer .widget li { border-bottom-color: rgba(255,255,255,0.12); }
.site-footer .widget .post-date { color: #9fb9c1; }
.site-footer p { color: var(--footer-ink); }
.footer-bottom {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.14);
    font-size: 0.85rem;
    color: #9fb9c1;
}

/* ================= Cookie-баннер ================= */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: rgba(16, 50, 61, 0.97);
    color: #eaf3f6;
    padding: 16px 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-inner p { margin: 0; font-size: 0.9rem; min-width: 0; flex: 1; }
.cookie-inner a { color: #f0b48a; }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: var(--accent-dark); }

/* ================= 404 ================= */
.error-404 {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 34px;
    text-align: center;
    box-shadow: var(--shadow);
}
.error-404 .big { font-size: 3.4rem; color: var(--primary); margin: 0; font-weight: 800; }
.error-404 .search-form { max-width: 440px; margin: 22px auto 0; }

/* ================= Адаптив ================= */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 30px; }
    .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fs-intro .intro-grid { grid-template-columns: 1fr; gap: 28px; }
    .fs-intro h1 { font-size: 1.9rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .header-nav {
        margin-left: 0;
        flex-basis: 100%;
        display: none;
    }
    .header-nav.open { display: block; }
    .main-menu { flex-direction: column; }
    .nav-toggle { display: block; }
    .header-inner { flex-wrap: wrap; }

    .split { grid-template-columns: 1fr; gap: 24px; }
    .split.reverse .split-media { order: 0; }
    .topic-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .latest-grid { grid-template-columns: 1fr; }
    .layout-narrow { width: 92%; }

    .card-row { flex-direction: column; }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .entry { padding: 22px 20px; }
    .cta-box { padding: 26px 22px; flex-direction: column; align-items: flex-start; }
    .fs-intro { padding: 40px 0; }
}
