/*
Theme Name: КитайАвто Гид
Theme URI: https://example.com/china-auto-guide
Author: Редакция КитайАвто Гид
Description: Лёгкая редакционная тема для издания о китайских автомобилях в России.
Version: 1.0.8
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: china-auto-guide
*/

:root {
  --cag-bg: #f4f6f8;
  --cag-surface: #ffffff;
  --cag-ink: #111827;
  --cag-muted: #64748b;
  --cag-line: #e2e8f0;
  --cag-red: #d61f2c;
  --cag-red-dark: #a70f1b;
  --cag-navy: #101827;
  --cag-radius: 18px;
  --cag-shadow: 0 16px 40px rgba(15, 23, 42, .08);
  --cag-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--cag-ink);
  background: var(--cag-bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--cag-red); }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }
.container { width: min(calc(100% - 40px), var(--cag-width)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--cag-line); backdrop-filter: blur(14px); }
.header-row { min-height: 76px; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: white; background: var(--cag-red); box-shadow: 0 8px 20px rgba(214,31,44,.26); }
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: grid; line-height: 1.05; }
.brand-name { font-weight: 850; letter-spacing: -.035em; font-size: 20px; }
.brand-tag { margin-top: 5px; color: var(--cag-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.main-nav { margin-left: auto; }
.main-nav ul { margin: 0; padding: 0; display: flex; align-items: center; gap: 22px; list-style: none; }
.main-nav a { font-size: 14px; font-weight: 750; }
.header-search { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--cag-line); border-radius: 50%; }
.header-search:hover { border-color: var(--cag-red); }
.nav-toggle { display: none; margin-left: auto; border: 0; background: transparent; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--cag-ink); }

.hero { overflow: hidden; color: white; background: var(--cag-navy); }
.hero-inner { min-height: 480px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 50px; padding-block: 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--cag-red); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 26px; height: 3px; background: currentColor; border-radius: 3px; }
.hero .eyebrow { color: #ff6370; }
.hero h1 { max-width: 760px; margin: 18px 0 20px; font-size: clamp(42px, 6vw, 74px); line-height: .98; letter-spacing: -.055em; }
.hero p { max-width: 650px; margin: 0; color: #cbd5e1; font-size: 19px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 21px; border-radius: 12px; font-size: 14px; font-weight: 800; transition: .2s ease; }
.button-primary { color: white; background: var(--cag-red); }
.button-primary:hover { color: white; background: var(--cag-red-dark); transform: translateY(-1px); }
.button-secondary { color: white; border: 1px solid rgba(255,255,255,.24); }
.button-secondary:hover { color: white; border-color: rgba(255,255,255,.62); }
.hero-visual { position: relative; min-height: 300px; display: grid; place-items: center; }
.hero-orbit { position: absolute; width: 340px; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.hero-orbit::before, .hero-orbit::after { content: ""; position: absolute; inset: 36px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.hero-orbit::after { inset: 85px; background: rgba(214,31,44,.13); border-color: rgba(255,99,112,.24); }
.car-line { position: relative; z-index: 2; width: min(100%, 410px); color: white; filter: drop-shadow(0 24px 26px rgba(0,0,0,.3)); }

.section { padding-block: 72px; }
.section-compact { padding-block: 44px; }
.section-white { background: var(--cag-surface); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-title { margin: 7px 0 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -.04em; }
.section-link { flex: 0 0 auto; color: var(--cag-red); font-size: 14px; font-weight: 800; }

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.category-card { min-height: 190px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; background: var(--cag-surface); border: 1px solid var(--cag-line); border-radius: var(--cag-radius); transition: .22s ease; }
.category-card:hover { color: var(--cag-ink); border-color: transparent; transform: translateY(-4px); box-shadow: var(--cag-shadow); }
.category-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--cag-red); background: #fff1f2; border-radius: 13px; font-size: 22px; }
.category-card h3 { margin: 26px 0 4px; font-size: 19px; line-height: 1.25; }
.category-card p { margin: 0; color: var(--cag-muted); font-size: 14px; line-height: 1.45; }

.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card { overflow: hidden; background: var(--cag-surface); border: 1px solid var(--cag-line); border-radius: var(--cag-radius); transition: .22s ease; }
.post-card:hover { color: var(--cag-ink); transform: translateY(-4px); box-shadow: var(--cag-shadow); }
.post-card-media { aspect-ratio: 16/10; overflow: hidden; background: linear-gradient(135deg, #172033, #27344b); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover img { transform: scale(1.035); }
.post-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.7); }
.post-placeholder svg { width: 64%; }
.post-card-body { padding: 21px; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; color: var(--cag-muted); font-size: 12px; font-weight: 700; }
.post-category { color: var(--cag-red); text-transform: uppercase; letter-spacing: .07em; }
.post-card h2, .post-card h3 { margin: 0; font-size: 21px; line-height: 1.25; letter-spacing: -.025em; }
.post-excerpt { margin: 11px 0 0; color: var(--cag-muted); font-size: 14px; line-height: 1.55; }

.empty-editorial { grid-column: 1/-1; padding: 38px; text-align: center; background: var(--cag-surface); border: 1px dashed #cbd5e1; border-radius: var(--cag-radius); }
.empty-editorial strong { display: block; margin-bottom: 6px; font-size: 20px; }
.empty-editorial p { margin: 0; color: var(--cag-muted); }

.trust-strip { color: white; background: var(--cag-red); }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.trust-item { padding: 28px; border-right: 1px solid rgba(255,255,255,.2); }
.trust-item:last-child { border-right: 0; }
.trust-item strong { display: block; margin-bottom: 4px; font-size: 17px; }
.trust-item span { color: rgba(255,255,255,.76); font-size: 13px; }

.page-shell { min-height: 65vh; padding-block: 60px 80px; }
.content-layout { display: grid; grid-template-columns: minmax(0, 790px) 280px; gap: 54px; align-items: start; }
.article-header { margin-bottom: 30px; }
.article-header h1, .archive-header h1 { margin: 10px 0 16px; font-size: clamp(36px, 6vw, 62px); line-height: 1.04; letter-spacing: -.05em; }
.archive-header { max-width: 780px; margin-bottom: 34px; }
.archive-description { color: var(--cag-muted); font-size: 18px; }
.article-featured { overflow: hidden; margin: 0 0 34px; border-radius: var(--cag-radius); background: #eef1f5; }
.article-featured img { display: block; width: 100%; height: auto; }
.article-featured figcaption { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 11px 14px 13px; color: #667085; font-size: .78rem; line-height: 1.45; background: #eef1f5; }
.article-featured figcaption span { flex: 1 1 100%; }
.article-featured figcaption a { color: #46556d; text-decoration: underline; text-underline-offset: 2px; }
.article-content { font-size: 18px; }
.article-content > * { max-width: 760px; }
.article-content h2 { margin-top: 46px; font-size: 32px; line-height: 1.15; letter-spacing: -.035em; }
.article-content h3 { margin-top: 32px; font-size: 24px; line-height: 1.25; }
.article-content a { color: var(--cag-red); text-decoration: underline; text-underline-offset: 3px; }
.article-content blockquote { margin: 34px 0; padding: 22px 26px; background: #fff1f2; border-left: 4px solid var(--cag-red); border-radius: 0 12px 12px 0; }
.article-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article-content th, .article-content td { padding: 13px; text-align: left; border: 1px solid var(--cag-line); }
.article-content th { background: #f8fafc; }
.article-note { margin-top: 36px; padding: 20px; color: var(--cag-muted); background: #f8fafc; border: 1px solid var(--cag-line); border-radius: 12px; font-size: 13px; }
.sidebar-card { padding: 22px; background: var(--cag-surface); border: 1px solid var(--cag-line); border-radius: 16px; }
.sidebar-card h3 { margin: 0 0 12px; font-size: 17px; }
.sidebar-card p { margin: 0; color: var(--cag-muted); font-size: 13px; }

.pagination { margin-top: 38px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 12px; background: white; border: 1px solid var(--cag-line); border-radius: 10px; }
.pagination .current { color: white; background: var(--cag-red); border-color: var(--cag-red); }

.site-footer { color: #cbd5e1; background: #0b1220; }
.footer-main { padding-block: 52px; display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 50px; }
.footer-brand .brand-name { color: white; }
.footer-brand p { max-width: 420px; margin: 18px 0 0; color: #94a3b8; font-size: 14px; }
.footer-col h3 { margin: 0 0 14px; color: white; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.footer-col ul { margin: 0; padding: 0; list-style: none; }
.footer-col li { margin: 7px 0; }
.footer-col a { color: #94a3b8; font-size: 14px; }
.footer-bottom { padding-block: 18px; display: flex; justify-content: space-between; gap: 20px; color: #64748b; border-top: 1px solid #1e293b; font-size: 12px; }

.not-found { max-width: 680px; margin: 60px auto; text-align: center; }
.not-found .code { color: var(--cag-red); font-size: 90px; font-weight: 900; letter-spacing: -.08em; }

@media (max-width: 980px) {
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 76px; padding: 20px; background: white; border-bottom: 1px solid var(--cag-line); }
  .main-nav.is-open { display: block; }
  .main-nav ul { align-items: flex-start; flex-direction: column; }
  .nav-toggle { display: block; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .category-grid, .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .container { width: min(calc(100% - 28px), var(--cag-width)); }
  .brand-tag, .header-search { display: none; }
  .hero-inner { min-height: 430px; padding-block: 55px; }
  .hero h1 { font-size: 44px; }
  .section { padding-block: 52px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .category-grid, .posts-grid, .trust-grid, .footer-main { grid-template-columns: 1fr; }
  .trust-item { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.2); }
  .trust-item:last-child { border-bottom: 0; }
  .footer-main { gap: 30px; }
  .footer-bottom { flex-direction: column; }
  .article-content { font-size: 17px; }
  .article-content h2 { font-size: 27px; }
}
