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

/* ===== Базовые токены ===== */
:root {
    --c-bg: #f5f8f6;
    --c-surface: #ffffff;
    --c-ink: #16241f;
    --c-ink-soft: #4a5a54;
    --c-line: #dde7e2;
    --c-brand: #11806a;
    --c-brand-dark: #0c5d4e;
    --c-accent: #2fbf8f;
    --c-deep: #0e2924;
    --c-deep-soft: #163b34;
    --shell: min(92%, 1180px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--c-ink); margin: 0 0 0.6em; }
h1 { font-size: 2.05rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

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

.btn {
    display: inline-block;
    background: var(--c-brand);
    color: #fff;
    padding: 0.7em 1.5em;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s ease;
}
.btn:hover { background: var(--c-brand-dark); text-decoration: none; }

/* ===== Шапка ===== */
.site-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
}
.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; }
.brand-logo { display: block; max-height: 64px; width: auto; }
.brand-text { min-width: 0; }
.site-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--c-ink);
    line-height: 1.3;
}
.site-title a { color: inherit; }
.site-desc {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--c-ink-soft);
    max-width: 640px;
}

.main-nav { min-width: 0; }
.nav-toggle {
    display: none;
    background: var(--c-brand);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 0.95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 0;
    padding: 0;
}
.main-nav a {
    color: var(--c-ink);
    font-weight: 600;
    padding: 6px 2px;
    display: inline-block;
}
.main-nav a:hover { color: var(--c-brand); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--c-brand); }

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

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

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

/* ===== Хлебные крошки ===== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--c-ink-soft);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--c-brand-dark); }
.breadcrumbs .sep { margin: 0 6px; color: #9bb0a8; }

/* ===== Сайдбар ===== */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    color: var(--c-ink);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    color: var(--c-ink);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--c-accent);
}
.sidebar a { color: var(--c-brand-dark); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 7px 0; border-bottom: 1px solid var(--c-line); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar .post-date { color: var(--c-ink-soft); font-size: 0.8rem; display: block; }

/* ===== Карточки записей ===== */
.cards { display: grid; grid-template-columns: 1fr; gap: 24px; }
.card {
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(14, 41, 36, 0.10); }

.card-thumb-wrap {
    flex: 0 0 auto;
    overflow: hidden;
    background: var(--c-deep-soft);
}
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.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(--c-ink); }
.card-title a:hover { color: var(--c-brand); text-decoration: none; }
.card-meta { font-size: 0.8rem; color: var(--c-ink-soft); margin-bottom: 12px; }
.card-excerpt { color: var(--c-ink-soft); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; padding-top: 14px; }
.card-more a { font-weight: 600; color: var(--c-brand-dark); }

/* ===== Записи в две колонки на широких карточках архива ===== */
@media (min-width: 700px) {
    .cards.cards-wide .card { flex-direction: row; }
    .cards.cards-wide .card-thumb-wrap {
        flex: 0 0 300px;
        position: relative;
    }
    .cards.cards-wide .card-thumb-wrap a {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
    }
    .cards.cards-wide .card-thumb-wrap img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
        display: block;
    }
}

/* ===== Одиночная запись / страница ===== */
.entry {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    padding: 32px;
}
.entry-title { font-size: 2rem; }
.entry-meta { font-size: 0.85rem; color: var(--c-ink-soft); margin-bottom: 20px; }
.entry-thumb { margin: 0 0 24px; }
.entry-thumb img { width: 100%; border-radius: 10px; display: block; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; display: block; }
.entry-content p { background: none; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }

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

.tags-line { margin-top: 22px; font-size: 0.88rem; }
.tags-line a {
    display: inline-block;
    background: #eef4f1;
    padding: 3px 11px;
    border-radius: 20px;
    margin: 3px 4px 3px 0;
}

/* ===== Главная ===== */
.front-block { padding: 52px 0; }
.front-block:nth-child(even) { background: var(--c-surface); }
.front-block .shell { width: 85%; }
.block-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.block-head h2 { font-size: 1.85rem; }
.block-head p { color: var(--c-ink-soft); }

/* текст + иллюстрация */
.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: 14px; display: block; }
.split-text h2 { font-size: 1.85rem; }
.split-text p { color: var(--c-ink-soft); }

/* сетка рубрик */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 240px));
    gap: 24px;
    justify-content: center;
}
.feature {
    background: var(--c-bg);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    padding: 26px 22px;
    text-align: center;
}
.front-block:nth-child(even) .feature { background: var(--c-bg); }
.feature .ico {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    color: var(--c-brand);
}
.feature h3 { font-size: 1.12rem; margin-bottom: 8px; }
.feature p { color: var(--c-ink-soft); font-size: 0.95rem; margin: 0; }

/* шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 250px));
    gap: 26px;
}
.step { position: relative; padding-left: 64px; }
.step .num {
    position: absolute;
    left: 0; top: 0;
    width: 46px; height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-brand);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
}
.step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.step p { color: var(--c-ink-soft); font-size: 0.95rem; margin: 0; }

/* CTA */
.cta {
    background: var(--c-deep);
    color: #eaf5f0;
    border-radius: 18px;
    padding: 48px 40px;
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: #b9d4cb; max-width: 620px; margin: 0 auto 26px; }
.cta .btn { background: var(--c-accent); color: var(--c-deep); }
.cta .btn:hover { background: #4fd0a3; }

/* лента последних записей на главной */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 320px));
    gap: 26px;
    justify-content: center;
}

/* ===== Пагинация ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    background: var(--c-surface);
    color: var(--c-ink);
    font-weight: 600;
}
.pagination a.page-numbers:hover { background: #eef4f1; text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--c-brand);
    border-color: var(--c-brand);
    color: #fff;
}
.pagination .page-numbers.dots { border: 0; background: none; }

/* ===== Комментарии ===== */
.comments-area { margin-top: 40px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 28px; padding: 0; }
.comment-item { margin-bottom: 18px; }
.comment-body {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 18px 20px;
}
.comment-meta { display: flex; gap: 14px; align-items: baseline; margin-bottom: 8px; }
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--c-ink-soft); }
.comment-awaiting { color: #a8632a; font-size: 0.85rem; }
.comment-form-wrap { margin-top: 28px; }
.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(--c-line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    margin-bottom: 14px;
}
.comment-form .submit {
    background: var(--c-brand);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 26px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== Поиск ===== */
.search-form { display: flex; gap: 8px; min-width: 0; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.search-form .search-submit {
    background: var(--c-brand);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    padding: 48px 32px;
}
.error-404 .big { font-size: 4rem; color: var(--c-brand); margin: 0; }
.error-404 .search-form { max-width: 420px; margin: 24px auto 0; }

/* ===== Подвал ===== */
.site-footer {
    background: var(--c-deep);
    color: #cfe3dc;
    padding: 48px 0 26px;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 34px;
}
.site-footer .widget { margin-bottom: 0; color: #cfe3dc; }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.site-footer a { color: #8fe0c2; }
.site-footer a:hover { color: #bff0dd; }
.site-footer p { color: #cfe3dc; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 6px 0; }
.site-footer .post-date { color: #9fbcb3; font-size: 0.8rem; display: block; }
.footer-bottom {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    text-align: center;
    font-size: 0.85rem;
    color: #9fbcb3;
}

/* ===== Cookie-баннер ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--c-deep);
    color: #e7f3ee;
    padding: 16px 0;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; color: #cfe3dc; }
.cookie-banner a { color: #8fe0c2; }
.cookie-accept {
    background: var(--c-accent);
    color: var(--c-deep);
    border: 0;
    border-radius: 8px;
    padding: 10px 22px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 36px; }
    .layout-single .content-area { width: 100%; }
    .split { grid-template-columns: 1fr; gap: 28px; }
    .split.reverse .split-media { order: 0; }
    .front-block .shell { width: 92%; }
}

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

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1, .entry-title { font-size: 1.6rem; }
    .nav-toggle { display: inline-block; }
    .main-nav { width: 100%; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 0;
        margin-top: 12px;
    }
    .main-nav.is-open ul { display: flex; }
    .main-nav li { border-bottom: 1px solid var(--c-line); }
    .header-inner { flex-direction: column; align-items: stretch; }
    .entry { padding: 22px; }
    .cookie-inner { justify-content: center; text-align: center; }
}
