/*
Theme Name: dds_eau-energie-vitalite.com
Author: Алексей Громов
Description: Информационный сайт-справочник о водоподготовке и бытовых системах очистки воды для квартиры, дома и дачи, с упором на принципы работы оборудования, подбор решений и эксплуатацию.
Version: 1.1
Text Domain: dds_eau-energie-vitalite.com
*/

/* ================================
   Базовые переменные и сброс
================================ */
:root {
    --color-bg: #FFFFFF;
    --color-surface: #F4F7FA;
    --color-text: #1A2A3A;
    --color-text-muted: #5E8D9F;
    --color-accent: #00A8A0;
    --color-accent-hover: #00928B;
    --color-deep: #1E4A6B;
    --color-deep-hover: #163951;
    --color-sand: #E8DDCB;
    --color-warning: #C97B5D;
    --color-border: #D9E2EA;
    --font-sans: 'Inter', 'Roboto', Arial, sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    --radius: 6px;
    --container: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.18s ease;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    color: var(--color-deep);
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
    font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin: 0 0 1em;
}

code, pre, .sku {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--color-border);
    margin: 1.5em 0;
}

th, td {
    border: 1px solid var(--color-border);
    padding: 0.6em 0.9em;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--color-surface);
    color: var(--color-deep);
    font-weight: 600;
}

tr:nth-child(even) td {
    background: #FAFBFC;
}

blockquote {
    margin: 1.4em 0;
    padding: 0.8em 1.2em;
    background: var(--color-sand);
    border-left: 4px solid var(--color-deep);
    color: var(--color-text);
    border-radius: var(--radius);
}

hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 2em 0;
}

/* ================================
   Контейнер и сетка
================================ */
.wrap {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.layout {
    display: flex;
    gap: 36px;
    margin: 32px auto;
}

.layout-main {
    flex: 0 0 67%;
    min-width: 0;
}

.layout-side {
    flex: 0 0 27%;
    min-width: 0;
}

.layout-full .layout-main {
    flex: 0 0 85%;
    margin: 0 auto;
}

/* ================================
   Шапка
================================ */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 18px 0;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-logo {
    width: 54px;
    height: 54px;
    display: block;
    flex-shrink: 0;
}

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

.brand-name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-deep);
    line-height: 1.25;
    text-decoration: none;
    max-width: 560px;
}

.brand-name:hover {
    color: var(--color-deep-hover);
    text-decoration: none;
}

.brand-tag {
    display: block;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: 3px;
    max-width: 620px;
    line-height: 1.4;
}

.nav-primary {
    margin-left: auto;
}

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

.nav-primary a {
    color: var(--color-deep);
    font-weight: 500;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.nav-primary a:hover,
.nav-primary .current-menu-item > a {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    text-decoration: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 8px 14px;
    color: var(--color-deep);
    cursor: pointer;
    font-size: 0.95rem;
}

/* ================================
   Контент
================================ */
.content {
    padding: 12px 0 48px;
}

.content-post {
    background: var(--color-bg);
}

.content-post h1.entry-title {
    margin-top: 0.3em;
}

.entry-meta {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 6px 0 18px;
}

.entry-content img {
    border-radius: var(--radius);
}

/* ================================
   Хлебные крошки
================================ */
.crumbs {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.crumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.crumbs li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.crumbs li + li::before {
    content: '›';
    color: var(--color-text-muted);
    margin-right: 2px;
}

.crumbs a {
    color: var(--color-deep);
}

.crumbs a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.crumbs .current {
    color: var(--color-text);
}

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
    border-color: var(--color-accent);
}

.card-thumb {
    display: block;
    background: var(--color-surface);
}

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

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

.card-title {
    margin: 0 0 8px;
    font-size: 1.12rem;
    line-height: 1.3;
}

.card-title a {
    color: var(--color-deep);
}

.card-title a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.card-meta {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.card-excerpt {
    color: var(--color-text);
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-more {
    margin-top: auto;
    align-self: flex-start;
}

/* Горизонтальная карточка — на single/page related */
.card-row {
    flex-direction: row;
}

.card-row .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: var(--color-surface);
}

.card-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.card-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ================================
   Кнопки
================================ */
.btn {
    display: inline-block;
    padding: 10px 18px;
    font-size: 0.95rem;
    line-height: 1.2;
    font-family: inherit;
    font-weight: 500;
    color: #fff;
    background: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #006d68;
}

.btn-outline {
    background: transparent;
    color: var(--color-deep);
    border: 1px solid var(--color-deep);
}

.btn-outline:hover {
    background: var(--color-deep);
    color: #fff;
    border-color: var(--color-deep-hover);
}

.btn-deep {
    background: var(--color-deep);
    border-color: var(--color-deep);
}

.btn-deep:hover {
    background: var(--color-deep-hover);
    border-color: var(--color-deep-hover);
}

/* Чипы-фильтры */
.chip {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0, 168, 160, 0.1);
    color: var(--color-deep);
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 2px 4px 2px 0;
    transition: background 0.18s ease;
}

.chip:hover {
    background: rgba(0, 168, 160, 0.2);
    text-decoration: none;
}

/* ================================
   Сайдбар
================================ */
.widget {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 22px;
}

.widget-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: var(--color-deep);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-accent);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--color-border);
}

.widget ul li:last-child {
    border-bottom: 0;
}

.widget ul li a {
    color: var(--color-deep);
}

.widget ul li a:hover {
    color: var(--color-accent);
}

/* ================================
   Подвал
================================ */
.site-footer {
    background: var(--color-deep);
    color: #d9e4ee;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 28px;
}

.footer-grid .widget {
    background: rgba(255, 255, 255, 0.03);
    color: #d9e4ee;
}

.footer-grid .widget-title {
    color: #ffffff;
    border-bottom-color: var(--color-accent);
}

.footer-grid .widget a {
    color: #d9e4ee;
}

.footer-grid .widget a:hover {
    color: var(--color-accent);
}

.footer-grid .widget ul li {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.site-copy {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    color: #b3c3d0;
}

/* ================================
   Главная страница
================================ */
.home-hero {
    padding: 48px 0 36px;
    background: linear-gradient(180deg, var(--color-surface) 0%, #ffffff 100%);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 32px;
}

.home-hero h1 {
    font-size: 2.1rem;
    margin-top: 0;
}

.home-hero .lead {
    font-size: 1.08rem;
    color: var(--color-text-muted);
    max-width: 760px;
}

.section-block {
    padding: 36px 0;
    border-bottom: 1px solid var(--color-border);
}

.section-block:last-child {
    border-bottom: 0;
}

.section-block h2 {
    margin-top: 0;
}

.section-lead {
    color: var(--color-text-muted);
    font-size: 1rem;
    max-width: 760px;
    margin-bottom: 24px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 20px;
}

.feature-cell {
    background: var(--color-surface);
    padding: 22px;
    border-radius: var(--radius);
    border-left: 3px solid var(--color-accent);
}

.feature-cell h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.feature-cell p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text);
}

.steps-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
    counter-reset: step;
}

.step-item {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 18px;
    position: relative;
    counter-increment: step;
}

.step-item::before {
    content: counter(step);
    position: absolute;
    top: -14px;
    left: 16px;
    background: var(--color-deep);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.step-item h4 {
    margin: 8px 0 6px;
    font-size: 1rem;
}

.step-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text);
}

/* Слайдер «Как это работает» */
.how-slider {
    background: var(--color-surface);
    padding: 26px;
    border-radius: var(--radius);
    margin-top: 20px;
}

.how-slider-track {
    position: relative;
    height: 10px;
    background: var(--color-border);
    border-radius: 5px;
    margin: 30px 0 20px;
}

.how-slider-range {
    width: 100%;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    position: relative;
    z-index: 2;
    height: 28px;
}

.how-slider-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--color-accent);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--color-accent);
    cursor: pointer;
}

.how-slider-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: var(--color-accent);
    border-radius: 50%;
    border: 3px solid #fff;
    cursor: pointer;
}

.how-slider-stage {
    margin-top: 18px;
    padding: 16px 18px;
    background: var(--color-bg);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius);
    min-height: 80px;
}

.how-slider-stage h4 {
    margin: 0 0 6px;
    color: var(--color-deep);
}

.how-slider-stage p {
    margin: 0;
    font-size: 0.95rem;
}

.how-slider-visual {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.how-slider-visual .bar {
    flex: 1;
    height: 14px;
    background: var(--color-sand);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.how-slider-visual .bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: var(--color-accent);
    width: var(--fill, 0%);
    transition: width 0.25s ease;
}

/* ================================
   Поиск, пагинация
================================ */
.search-form {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-bg);
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--color-accent);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 30px 0;
    justify-content: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-deep);
    background: var(--color-bg);
    font-size: 0.95rem;
    min-width: 38px;
    text-align: center;
}

.pagination a:hover {
    background: var(--color-surface);
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

.pagination .current {
    background: var(--color-deep);
    color: #fff;
    border-color: var(--color-deep);
}

/* ================================
   Комментарии
================================ */
.comments-area {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.comments-title {
    margin-top: 0;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.comment-list .children {
    list-style: none;
    padding-left: 22px;
    border-left: 2px solid var(--color-border);
}

.comment-body {
    padding: 14px 16px;
    background: var(--color-surface);
    border-radius: var(--radius);
    margin-bottom: 14px;
}

.comment-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.comment-meta .fn {
    color: var(--color-deep);
    font-weight: 600;
    font-style: normal;
}

.comment-respond label {
    display: block;
    margin: 10px 0 4px;
    font-size: 0.9rem;
    color: var(--color-deep);
}

.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--color-bg);
    color: var(--color-text);
}

.comment-respond textarea {
    min-height: 120px;
}

.comment-respond .form-submit input {
    background: var(--color-accent);
    color: #fff;
    border: 1px solid var(--color-accent);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

.comment-respond .form-submit input:hover {
    background: var(--color-accent-hover);
}

/* ================================
   Cookie-баннер
================================ */
.cookie-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    background: var(--color-deep);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    font-size: 0.92rem;
}

.cookie-bar[hidden] {
    display: none;
}

.cookie-bar p {
    margin: 0;
    flex: 1;
}

.cookie-bar a {
    color: #9ce6e2;
    text-decoration: underline;
}

.cookie-bar button {
    background: var(--color-accent);
    color: #fff;
    border: 0;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    flex-shrink: 0;
}

.cookie-bar button:hover {
    background: var(--color-accent-hover);
}

/* ================================
   404
================================ */
.error-404 {
    text-align: center;
    padding: 60px 20px;
}

.error-404 h1 {
    font-size: 4rem;
    margin: 0;
    color: var(--color-deep);
}

.error-404 .back-home {
    margin-top: 20px;
}

/* ================================
   Заголовки страниц-архивов
================================ */
.archive-head {
    padding: 26px 0 8px;
}

.archive-head h1 {
    margin: 0 0 6px;
}

.archive-head .archive-desc {
    color: var(--color-text-muted);
    margin: 0;
}

/* ================================
   Адаптив
================================ */
@media (max-width: 960px) {
    .layout {
        flex-direction: column;
        gap: 24px;
    }
    .layout-main,
    .layout-side,
    .layout-full .layout-main {
        flex: 0 0 100%;
    }
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .steps-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.35rem; }
}

@media (max-width: 600px) {
    .wrap {
        padding: 0 16px;
    }
    .header-row {
        flex-wrap: wrap;
    }
    .menu-toggle {
        display: inline-block;
        margin-left: auto;
    }
    .nav-primary {
        order: 10;
        width: 100%;
        margin-top: 12px;
        display: none;
    }
    .nav-primary.is-open {
        display: block;
    }
    .nav-primary ul {
        flex-direction: column;
        gap: 6px;
    }
    .nav-primary ul li {
        border-bottom: 1px solid var(--color-border);
        padding: 6px 0;
    }
    .feature-grid,
    .steps-row,
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .home-hero {
        padding: 32px 0 24px;
    }
    .home-hero h1 {
        font-size: 1.55rem;
    }
    .brand {
        flex: 1;
        min-width: 0;
    }
    .brand-name {
        font-size: 0.9rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .brand-tag {
        display: none;
    }
    .card-row {
        flex-direction: column;
    }
    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-row .card-thumb-wrap a {
        position: static;
    }
    .card-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .cookie-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}
