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

:root {
    --ink: #16191f;
    --ink-soft: #2a2f38;
    --paper: #f5f6f8;
    --card-bg: #ffffff;
    --accent: #e4242f;
    --accent-d: #b8121c;
    --steel: #1d2a3a;
    --steel-soft: #25364b;
    --line: #e0e3e9;
    --muted: #6a7280;
    --muted-light: #9aa3b0;
    --radius: 12px;
    --shell: min(92%, 1180px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    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); text-decoration: none; }
a:hover { color: var(--accent-d); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 0.5em; font-weight: 700; }
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;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--card-bg);
    border-bottom: 3px solid var(--accent);
}
.site-header .shell {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-logo, .brand-mark { flex: 0 0 auto; display: block; }
.brand-mark { width: 52px; height: 52px; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 800;
    font-size: 1.18rem;
    color: var(--ink);
    line-height: 1.2;
    max-width: 640px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-name:hover { color: var(--accent); text-decoration: none; }
.brand-desc {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 3px;
    max-width: 640px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    background: var(--steel);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    cursor: pointer;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    color: var(--ink-soft);
    font-weight: 600;
    border-radius: 8px;
    font-size: 0.97rem;
}
.main-nav a:hover { background: var(--paper); color: var(--accent); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--accent); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    width: var(--shell);
    margin: 18px auto 0;
    font-size: 0.86rem;
    color: var(--muted);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 7px; color: var(--muted-light); }
.breadcrumbs span:last-child { color: var(--ink); }

/* ---------- Layout ---------- */
.site-main { padding: 28px 0 46px; }
.layout-with-sidebar {
    width: var(--shell);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}
.layout-single {
    width: 85%;
    max-width: 1180px;
    margin-inline: auto;
}
.content-area { min-width: 0; }

/* ---------- Sidebar ---------- */
.sidebar { min-width: 0; }
.widget {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 22px;
    color: var(--ink);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}
.sidebar .widget a { color: var(--steel); font-weight: 600; }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar .widget,
.sidebar .widget li { color: var(--ink); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget .post-date,
.sidebar .widget .rss-date,
.sidebar .widget time { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* ---------- Cards ---------- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 24px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover { box-shadow: 0 10px 28px rgba(20, 30, 50, 0.12); transform: translateY(-3px); }
.card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-thumb-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--steel), var(--steel-soft));
    color: rgba(255,255,255,0.5);
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}
.card-cat {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 7px;
}
.card-title { font-size: 1.16rem; margin: 0 0 9px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-meta {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--muted);
}
.card-more { font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ---------- Front page sections ---------- */
.section { padding: 46px 0; }
.section-head { max-width: 760px; margin-bottom: 28px; }
.section-head .kicker {
    display: inline-block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 8px;
}
.section-tinted { background: var(--steel); color: #eef1f6; }
.section-tinted h1, .section-tinted h2, .section-tinted h3 { color: #fff; }
.section-tinted .kicker { color: #ff8b91; }

/* split: text + illustration */
.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 42px;
    align-items: center;
}
.split-media img,
.split-media svg { display: block; width: 100%; border-radius: var(--radius); }
.split.reverse .split-text { order: 2; }
.split.reverse .split-media { order: 1; }

/* feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 22px;
}
.feature {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px;
    min-width: 0;
}
.feature .ico {
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(228, 36, 47, 0.1);
    color: var(--accent);
    border-radius: 10px;
    margin-bottom: 14px;
}
.feature h3 { font-size: 1.1rem; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* faq accordion */
.faq { max-width: 820px; }
.faq details {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}
.faq summary {
    cursor: pointer;
    padding: 17px 20px;
    font-weight: 700;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-body { padding: 0 20px 18px; color: var(--ink-soft); }
.faq .faq-body p { margin: 0; }

/* cta */
.cta {
    background: linear-gradient(120deg, var(--steel), var(--steel-soft));
    color: #fff;
    border-radius: 18px;
    padding: 46px 40px;
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,0.82); max-width: 640px; margin-inline: auto; }
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    padding: 13px 30px;
    border-radius: 30px;
    margin-top: 14px;
}
.btn:hover { background: var(--accent-d); color: #fff; text-decoration: none; }
.btn-ghost {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}
.btn-ghost:hover { background: var(--accent); color: #fff; }

.front-latest { padding: 46px 0; }

/* ---------- Single / page content ---------- */
.entry {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
}
.entry-header { margin-bottom: 18px; }
.entry-title { font-size: 2rem; }
.entry-meta { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.entry-thumb { margin: 0 0 22px; }
.entry-thumb img { display: block; width: 100%; border-radius: var(--radius); }
.entry-content { font-size: 1.02rem; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content blockquote {
    border-left: 4px solid var(--accent);
    margin: 1.2em 0;
    padding: 6px 0 6px 18px;
    color: var(--ink-soft);
    font-style: italic;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    border: 1px solid var(--line);
}
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
th { background: var(--paper); font-weight: 700; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 34px 0 8px;
}
.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(--card-bg);
    color: var(--ink-soft);
    font-weight: 600;
    text-decoration: none;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots { border: 0; background: none; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 30px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { margin-bottom: 18px; }
.comment-body {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.comment-author { font-weight: 700; }
.comment-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.comment-list .children { list-style: none; margin: 16px 0 0 26px; padding: 0; }
.comment-respond {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-top: 24px;
}
.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: inherit;
    margin-top: 4px;
}
.comment-form .form-submit input,
.comment-form .submit {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 12px 26px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
}

/* ---------- Search form ---------- */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}
.search-form .search-submit {
    background: var(--steel);
    color: #fff;
    border: 0;
    padding: 11px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.search-form .search-submit:hover { background: var(--accent); }

/* ---------- 404 ---------- */
.error-404 {
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 50px 30px;
}
.error-404 .big { font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; }
.error-404 .search-form { max-width: 440px; margin: 24px auto 0; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--ink);
    color: #c7ccd4;
    padding: 46px 0 22px;
    margin-top: 30px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 34px;
}
.site-footer .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: #c7ccd4;
}
.site-footer .widget-title { color: #fff; border-bottom-color: rgba(255,255,255,0.18); }
.site-footer .widget a { color: #d9dde4; font-weight: 500; }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget li { border-bottom-color: rgba(255,255,255,0.1); color: #c7ccd4; }
.site-footer .widget .post-date,
.site-footer .widget time { color: var(--muted-light); }
.site-copy {
    text-align: center;
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.85rem;
    color: var(--muted-light);
}

/* ---------- Cookie banner ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: var(--ink);
    color: #e6e9ee;
    padding: 16px 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
}
.cookie-banner .shell {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; flex: 1; min-width: 220px; }
.cookie-banner a { color: #ff9aa0; }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 11px 26px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--accent-d); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 34px; }
    .split { grid-template-columns: 1fr; gap: 26px; }
    .split.reverse .split-text,
    .split.reverse .split-media { order: 0; }
    h1, .entry-title { font-size: 1.7rem; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .brand-name { white-space: normal; }
    .brand-desc { display: none; }
    .nav-toggle { display: block; }
    .main-nav { width: 100%; display: none; }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .layout-single { width: 92%; }
    .entry { padding: 22px 18px; }
    .cta { padding: 34px 22px; }
    .section { padding: 34px 0; }
}
