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

/* ===== Базовые переменные ===== */
:root {
    --maxw: 1180px;
    --ink: #1c2330;
    --ink-soft: #4a5568;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --line: #dde3ec;
    --brand: #c0392b;
    --brand-dark: #962d20;
    --steel: #2b3a52;
    --steel-dark: #1f2a3d;
    --accent: #e8a317;
    --radius: 12px;
    --shadow: 0 6px 24px rgba(28, 35, 48, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "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(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

p { margin: 0 0 1em; }

/* ===== Контейнер ширины (единый источник) ===== */
.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

/* ===== Шапка ===== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    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 svg.brand-logo { width: 54px; height: 54px; flex: 0 0 auto; display: block; }
.brand-text { min-width: 0; }
.brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
    display: block;
    line-height: 1.3;
    max-width: 520px;
}
.brand-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    display: block;
    margin-top: 2px;
    max-width: 520px;
}

/* ===== Навигация ===== */
.main-nav { margin-left: auto; }
.nav-toggle {
    display: none;
    background: var(--steel);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--steel);
    font-weight: 600;
    font-size: 0.96rem;
}
.main-nav a:hover { background: var(--bg); text-decoration: none; }
.main-nav .current-menu-item > a {
    background: var(--steel);
    color: #fff;
}

/* ===== Хлебные крошки ===== */
.breadcrumbs {
    padding: 14px 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
}
.breadcrumbs a { color: var(--steel); }
.breadcrumbs .sep { margin: 0 6px; color: #aab2c0; }

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

.layout-with-sidebar {
    display: flex;
    gap: 36px;
    align-items: flex-start;
}
.layout-with-sidebar .content-area { flex: 1 1 67%; min-width: 0; }
.layout-with-sidebar .sidebar { flex: 0 0 27%; min-width: 0; }

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

@media (max-width: 960px) {
    .layout-with-sidebar { flex-direction: column; }
    .layout-with-sidebar .content-area,
    .layout-with-sidebar .sidebar { flex: none; width: 100%; }
    .layout-single .content-area { width: 100%; }
}

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

/* ===== Карточки записей ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 26px;
}
.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-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.card-title { font-size: 1.18rem; margin: 0 0 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); text-decoration: none; }
.card-meta { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 10px; }
.card-excerpt { color: var(--ink-soft); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 14px;
    font-weight: 600;
    color: var(--brand);
    align-self: flex-start;
}

/* ===== Одиночная запись / страница ===== */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
}
.entry-title { font-size: 2rem; }
.entry-meta { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 20px; }
.entry-thumb {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 22px;
}
.entry-content img { border-radius: 8px; }
.entry-content h2, .entry-content h3 { margin-top: 1.3em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }

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

/* ===== Пагинация ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-block;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--steel);
    font-weight: 600;
    line-height: 1;
}
.pagination a.page-numbers:hover {
    background: var(--steel);
    color: #fff;
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* ===== Главная ===== */
.home-section { margin-bottom: 56px; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 32px; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { color: var(--ink-soft); }

/* hero */
.hero {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    color: #fff;
    margin-bottom: 56px;
    background: var(--steel-dark);
}
.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
    display: block;
}
.hero-inner {
    position: relative;
    padding: 64px 40px;
    max-width: 680px;
}
.hero h1 { color: #fff; font-size: 2.4rem; margin-bottom: 16px; }
.hero p { color: #e3e8f0; font-size: 1.1rem; }
.hero .btn { margin-top: 22px; }
.btn {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    padding: 13px 26px;
    border-radius: 10px;
    font-weight: 700;
}
.btn:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }

/* блок текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.split-text h2 { font-size: 1.8rem; }
@media (max-width: 960px) {
    .split { grid-template-columns: 1fr; }
    .split.reverse .split-media { order: 0; }
}

/* сетка преимуществ/направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 24px;
}
.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    min-width: 0;
}
.feature-card .ico {
    width: 48px;
    height: 48px;
    display: block;
    margin-bottom: 14px;
}
.feature-card h3 { font-size: 1.15rem; }
.feature-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

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

/* статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 24px;
    background: var(--steel);
    border-radius: 18px;
    padding: 40px 32px;
}
.stat { text-align: center; min-width: 0; }
.stat .num { font-size: 2.4rem; font-weight: 800; color: #fff; display: block; }
.stat .lbl { color: #c3cddd; font-size: 0.95rem; }

/* галерея */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 16px;
}
.gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
}

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 22px;
    margin-bottom: 14px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 16px 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; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-soft); margin: 0 0 16px; }

/* цитата */
.quote-block {
    background: var(--brand);
    color: #fff;
    border-radius: 18px;
    padding: 48px 40px;
    text-align: center;
}
.quote-block blockquote {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.5;
    font-weight: 600;
}
.quote-block cite { display: block; margin-top: 18px; font-size: 0.95rem; opacity: 0.85; font-style: normal; }

/* CTA */
.cta {
    background: var(--steel-dark);
    color: #fff;
    border-radius: 18px;
    padding: 48px 40px;
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: #cdd6e4; max-width: 620px; margin: 0 auto 24px; }

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

@media (max-width: 600px) {
    .hero-inner { padding: 44px 24px; }
    .hero h1 { font-size: 1.8rem; }
    body { font-size: 16px; }
    .entry { padding: 22px; }
}

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

/* ===== Комментарии ===== */
.comments-area {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 28px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { margin-bottom: 18px; }
.comment-body {
    background: var(--bg);
    border-radius: 10px;
    padding: 16px 18px;
}
.comment-meta { font-size: 0.85rem; color: var(--ink-soft); 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.98rem;
}
.comment-form p { margin-bottom: 14px; }
.comment-form .submit {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 56px 28px;
}
.error-404 .code { font-size: 5rem; font-weight: 800; color: var(--brand); line-height: 1; }
.error-404 .search-form { max-width: 420px; margin: 24px auto 0; }

/* ===== Подвал ===== */
.site-footer {
    background: var(--steel-dark);
    color: #c8d2e2;
    padding: 48px 0 0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 36px;
}
.footer-col { min-width: 0; }
.footer-col .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 16px;
}
.footer-col, .footer-col p, .footer-col li { color: #c8d2e2; }
.footer-col a { color: #e3a9a0; }
.footer-col a:hover { color: #fff; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 6px 0; }
.footer-col .post-date { display: block; font-size: 0.8rem; color: #8d99ad; }
.site-copyright {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 40px;
    padding: 22px 0;
    text-align: center;
    font-size: 0.88rem;
    color: #8d99ad;
}

/* ===== Cookie-баннер ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: var(--steel-dark);
    color: #e6ecf5;
    padding: 16px 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
}
.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 1 300px; min-width: 0; }
.cookie-inner a { color: var(--accent); }
.cookie-banner button {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-banner button:hover { background: var(--brand-dark); }

/* ===== Мобильная навигация ===== */
@media (max-width: 960px) {
    .nav-toggle { display: block; }
    .main-nav { margin-left: auto; position: relative; }
    .main-nav ul {
        display: none;
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        flex-direction: column;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 8px;
        min-width: 220px;
        box-shadow: var(--shadow);
        z-index: 50;
    }
    .main-nav.is-open ul { display: flex; }
    .main-nav a { color: var(--steel); }
}
