/*
Theme Name: dds_avt-parts.ru
Author: Дмитрий Соколов
Description: Информационная тема для автомобильного эксперт-ресурса: дневники владения, аналитика рынка запчастей, обзоры и рейтинги сервисов.
Version: 1.1
Text Domain: avtex
*/

/* ===== Базовые переменные ===== */
:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --ink: #1b1f24;
    --ink-soft: #51585f;
    --line: #dde1e6;
    --accent: #df7a1c;
    --accent-dark: #bd6310;
    --dark: #1d232b;
    --dark-soft: #2a323c;
    --on-dark: #e7eaee;
    --on-dark-soft: #a7b0ba;
    --radius: 10px;
    --shell: min(92%, 1180px);
}

/* ===== Сброс ===== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

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

p { margin: 0 0 1em; }

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

/* ===== Шапка ===== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-top {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-logo, .brand svg.brand-mark {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    display: block;
}
.brand-text { min-width: 0; }
.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    display: block;
    line-height: 1.3;
}
.brand-name a { color: inherit; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    display: block;
    margin-top: 3px;
}

/* ===== Навигация ===== */
.main-nav {
    background: var(--dark);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--on-dark-soft);
    color: var(--on-dark);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    margin: 10px 0;
}
.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}
.menu li { position: relative; }
.menu a {
    display: block;
    padding: 15px 18px;
    color: var(--on-dark);
    font-weight: 600;
    font-size: 0.96rem;
}
.menu a:hover {
    background: var(--dark-soft);
    color: #fff;
    text-decoration: none;
}
.menu .current-menu-item > a {
    color: var(--accent);
}

/* ===== Каркас страницы ===== */
.site-main { padding: 32px 0 48px; }

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

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

/* ===== Карточки записей ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-thumb-link { display: block; }
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-ph {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--dark) 0%, var(--accent-dark) 130%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.55);
    font-size: 2rem;
}
.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(--accent-dark); }
.card-meta {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-bottom: 10px;
}
.card-excerpt { color: var(--ink-soft); font-size: 0.94rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
}
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 9px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--accent);
}
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* ===== Запись / страница ===== */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
}
.entry-title { font-size: 1.9rem; }
.entry-meta {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 18px;
}
.entry-content { font-size: 1.02rem; }
.entry-content img { border-radius: 8px; display: block; }
.entry-content h2 { margin-top: 1.4em; }
.entry-thumb { margin: 0 0 22px; border-radius: 8px; display: block; width: 100%; }

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

blockquote {
    border-left: 4px solid var(--accent);
    margin: 1.2em 0;
    padding: 6px 0 6px 18px;
    color: var(--ink-soft);
    font-style: italic;
}

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

/* ===== Подвал ===== */
.site-footer {
    background: var(--dark);
    color: var(--on-dark);
    padding: 44px 0 0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
}
.site-footer .widget { margin-bottom: 10px; color: var(--on-dark); }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 14px;
}
.site-footer .widget,
.site-footer .widget p,
.site-footer .widget li { color: var(--on-dark); }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-footer .widget li:last-child { border-bottom: none; }
.site-footer .widget a { color: var(--on-dark); }
.site-footer .widget a:hover { color: var(--accent); }
.site-footer .widget .post-date { color: var(--on-dark-soft); font-size: 0.78rem; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 34px;
    padding: 18px 0;
    font-size: 0.82rem;
    color: var(--on-dark-soft);
    text-align: center;
}

/* ===== Пагинация (type => plain, .page-numbers) ===== */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 34px 0 6px;
}
.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: 6px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
}
.pager a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    text-decoration: none;
}
.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pager .page-numbers.dots {
    border: none;
    background: none;
}

/* ===== Cookie-баннер (правило hidden до основного блока, A11) ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: var(--dark);
    color: var(--on-dark);
    padding: 16px 0;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.18);
}
.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; flex: 1; min-width: 240px; }
.cookie-inner a { color: var(--accent); }

/* ===== Главная ===== */
.section {
    padding: 46px 0;
    border-bottom: 1px solid var(--line);
}
.section:last-of-type { border-bottom: none; }
.section-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 30px;
}
.section-head h2 { font-size: 1.8rem; }
.section-head p { color: var(--ink-soft); }

/* Блок текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img, .split-media svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}
.split-text h2 { font-size: 1.7rem; }
.split-text p { color: var(--ink-soft); }

/* Сетка иконок-карточек */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    min-width: 0;
}
.feature .ico {
    width: 46px;
    height: 46px;
    color: var(--accent);
    margin-bottom: 14px;
    display: block;
}
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

/* Пошаговый блок */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 26px;
    counter-reset: step;
}
.step {
    position: relative;
    padding: 26px 24px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.08rem; }
.step p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

/* CTA */
.cta {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-soft) 100%);
    color: var(--on-dark);
    border-radius: var(--radius);
    padding: 46px 40px;
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: var(--on-dark-soft); max-width: 620px; margin: 0 auto 24px; }

.home-latest .card-grid { margin-top: 6px; }
.home-latest .more-link { text-align: center; margin-top: 30px; }

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

/* ===== Комментарии ===== */
.comments-area { margin-top: 34px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}
.comment-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.78rem; color: var(--ink-soft); }
.comment-await { font-size: 0.82rem; color: var(--accent-dark); }
.comment-respond {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-top: 22px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 12px;
}
.comment-form .submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-weight: 600;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--accent-dark); }

/* ===== 404 ===== */
.notfound {
    text-align: center;
    padding: 40px 0;
}
.notfound .code {
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.notfound .search-form { margin: 24px auto; }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
    .split.reverse .split-media { order: 0; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1, .entry-title { font-size: 1.6rem; }
    .layout-single.wide { width: 100%; }
    .nav-toggle { display: inline-block; }
    .nav-inner { flex-wrap: wrap; }
    .menu {
        flex-direction: column;
        width: 100%;
        display: none;
    }
    .menu.is-open { display: flex; }
    .menu a { padding: 12px 4px; border-top: 1px solid rgba(255,255,255,0.08); }
    .footer-cols { grid-template-columns: 1fr; }
    .entry { padding: 22px 18px; }
    .cta { padding: 34px 22px; }
}
