/*
Theme Name: cx3club
Description: Клуб владельцев Mazda CX-3 — технический справочник: графит, плотные таблицы, карточки неисправностей.
Version: 1.0.0
Author: mazdacx3.ru
Text Domain: cx3club
Requires PHP: 8.0
*/

:root {
	--bg: #eceef0;
	--panel: #ffffff;
	--graphite: #1d2125;
	--graphite-2: #2a2f35;
	--graphite-3: #3a4048;
	--ink: #16191c;
	--text: #262a2f;
	--steel: #5a646e;
	--line: #d3d8dc;
	--line-2: #e6e9ec;
	--lime: #b8d63a;
	--lime-ink: #4a6606;
	--lime-soft: #f0f6da;
	--amber: #b4760d;
	--amber-soft: #fbf1dc;
	--sans: "Fira Sans", "Segoe UI", Roboto, Arial, sans-serif;
	--cond: "Fira Sans Condensed", "Arial Narrow", "Fira Sans", sans-serif;
	--mono: "Fira Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--sans); overflow-x: hidden; font-variant-numeric: tabular-nums; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lime-ink); }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--cond); color: var(--ink); line-height: 1.15; }
.cx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cx-skip { position: absolute; left: -999px; top: 6px; background: var(--lime); color: var(--ink); padding: 6px 12px; z-index: 10; }
.cx-skip:focus { left: 8px; }
.cx-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- Номерная табличка (логотип) ---------- */
.cx-plate { display: inline-flex; align-items: stretch; border: 2px solid var(--ink); border-radius: 5px; background: #fff; overflow: hidden; line-height: 1; flex: none; }
.cx-plate b { padding: 6px 8px 5px; font: 700 19px/1 var(--cond); color: var(--ink); letter-spacing: .02em; }
.cx-plate i { display: flex; align-items: center; padding: 0 6px; border-left: 2px solid var(--ink); font: 500 10px/1 var(--mono); font-style: normal; color: var(--ink); text-transform: uppercase; background: var(--lime); }
.cx-plate--sm b { font-size: 14px; padding: 4px 6px; }
.cx-plate--sm i { font-size: 8px; padding: 0 4px; }

/* ---------- Шапка ---------- */
.cx-top { background: var(--graphite); color: #fff; }
.cx-top__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 12px; padding-bottom: 12px; }
.cx-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.cx-logo__name { font: 600 16px/1.2 var(--cond); letter-spacing: .02em; }
.cx-seek { display: flex; flex: 1 1 100%; min-width: 0; background: var(--graphite-2); border: 1px solid var(--graphite-3); border-radius: 4px; }
.cx-seek input { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; padding: 9px 12px; font: 16px var(--sans); }
.cx-seek input::placeholder { color: #9aa3ad; }
.cx-seek input:focus { outline: 2px solid var(--lime); outline-offset: -2px; }
.cx-seek button { border: 0; background: var(--lime); color: var(--ink); font: 700 18px var(--cond); padding: 0 16px; cursor: pointer; border-radius: 0 3px 3px 0; }
.cx-seek--light { background: #fff; border-color: var(--line); max-width: 520px; margin-top: 12px; }
.cx-seek--light input { color: var(--ink); }
.cx-tabs { background: var(--graphite-2); border-top: 1px solid var(--graphite-3); }
.cx-tabs .cx-wrap { overflow-x: auto; scrollbar-width: none; }
.cx-tabs .cx-wrap::-webkit-scrollbar { display: none; }
.cx-tabs__list { list-style: none; margin: 0; padding: 0; display: flex; white-space: nowrap; }
.cx-tabs__list a { display: block; padding: 11px 12px 9px; color: #d8dde2; text-decoration: none; font: 600 14px/1.2 var(--cond); text-transform: uppercase; letter-spacing: .05em; border-bottom: 3px solid transparent; }
.cx-tabs__list a:hover { color: #fff; }
.cx-tabs__list .current-menu-item > a, .cx-tabs__list .current-post-ancestor > a, .cx-tabs__list .current-menu-parent > a { color: #fff; border-bottom-color: var(--lime); }
.cx-tabs__list li:first-child a { padding-left: 0; }

/* ---------- Главная ---------- */
.cx-hero { background: var(--graphite); color: #d8dde2; padding: 26px 0 30px; border-top: 1px solid var(--graphite-3); }
.cx-hero__grid { display: grid; gap: 22px; }
.cx-kicker { margin: 0 0 6px; font: 500 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lime); }
.cx-hero__h1 { color: #fff; font-size: 32px; margin: 0 0 10px; }
.cx-hero__lead { margin: 0; font-size: 17px; color: #c3cad1; max-width: 560px; }
.cx-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cx-quick__item { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--graphite-3); border-radius: 4px; background: var(--graphite-2); color: #fff; text-decoration: none; transition: border-color .15s; }
.cx-quick__item:hover { border-color: var(--lime); color: #fff; }
.cx-quick__code { align-self: flex-start; margin-bottom: 6px; padding: 2px 6px; border: 1px solid var(--lime); border-radius: 3px; font: 500 12px var(--mono); color: var(--lime); }
.cx-quick__item b { font: 700 17px/1.2 var(--cond); }
.cx-quick__item small { font-size: 13px; color: #9aa3ad; line-height: 1.35; }

.cx-sec { margin-top: 28px; }
.cx-sec__title { font-size: 24px; margin: 0 0 12px; padding-left: 12px; border-left: 4px solid var(--lime); }
.cx-page-title { font-size: 30px; margin: 0 0 14px; }

.cx-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cx-model { display: flex; flex-direction: column; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); text-decoration: none; min-width: 0; }
.cx-model b { font: 700 24px/1 var(--cond); }
.cx-model span { font-size: 13px; color: var(--steel); line-height: 1.3; margin-top: 4px; }
.cx-model small { margin-top: auto; padding-top: 8px; font: 500 12px var(--mono); color: var(--lime-ink); }
.cx-model--main { background: var(--lime-soft); border-color: var(--lime); }
.cx-model:hover { border-color: var(--ink); color: var(--ink); }

/* Гайды «таблица по годам» / «что проверить» */
.cx-guides { display: grid; gap: 12px; }
.cx-guide { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--graphite); border-radius: 4px; color: var(--text); text-decoration: none; }
.cx-guide .cx-kicker { color: var(--lime-ink); margin: 0; }
.cx-guide b { font: 700 20px/1.2 var(--cond); color: var(--ink); }
.cx-guide p { margin: 0; font-size: 15px; color: var(--steel); }
.cx-guide__btn { margin-top: 4px; font: 600 14px var(--cond); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.cx-guide:hover { border-left-color: var(--lime); color: var(--text); }

/* Карточки */
.cx-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cx-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; border-bottom: 3px solid var(--line); transition: border-color .15s; }
.cx-card:hover { border-bottom-color: var(--lime); }
.cx-card__img { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--graphite-2); overflow: hidden; }
.cx-card__img img { width: 100%; height: 100%; object-fit: cover; }
.cx-card__ph { display: flex; align-items: center; justify-content: center; height: 100%; font: 700 22px var(--cond); color: #6d7680; text-transform: uppercase; background: repeating-linear-gradient(135deg, var(--graphite-2) 0 14px, var(--graphite) 14px 28px); }
.cx-card__cat { position: absolute; left: 0; bottom: 0; padding: 4px 10px; background: var(--graphite); color: #fff; font: 600 12px/1.3 var(--cond); text-transform: uppercase; letter-spacing: .05em; }
.cx-card__body { padding: 12px 14px 14px; }
.cx-card__title { margin: 0 0 6px; font-size: 19px; line-height: 1.2; }
.cx-card__title a { color: var(--ink); text-decoration: none; }
.cx-card__title a:hover { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; }
.cx-card__meta { margin: 0; font: 500 12px var(--mono); color: var(--steel); }

/* Справочник-оглавление */
.cx-index { display: grid; gap: 12px; }
.cx-index__box { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.cx-index__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--graphite); color: #fff; text-decoration: none; border-radius: 3px 3px 0 0; font: 700 16px var(--cond); text-transform: uppercase; letter-spacing: .04em; }
.cx-index__head small { font: 500 12px var(--mono); color: var(--lime); }
.cx-index__head:hover { color: var(--lime); }
.cx-rows { list-style: none; margin: 0; padding: 0; }
.cx-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line-2); font-size: 15px; line-height: 1.35; }
.cx-row:first-child { border-top: 0; }
.cx-row:nth-child(even) { background: #f7f8f9; }
.cx-row a { color: var(--ink); text-decoration: none; min-width: 0; }
.cx-row a:hover { color: var(--lime-ink); text-decoration: underline; }
.cx-row__kind { flex: none; font: 500 11px var(--mono); color: var(--steel); text-transform: uppercase; }
.cx-rows--big { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.cx-rows--big .cx-row { font-size: 17px; padding: 12px 14px; }
.cx-empty { background: var(--panel); border: 1px solid var(--line); padding: 16px; border-radius: 4px; }

/* Плашка раздела / статьи */
.cx-band { background: var(--graphite); color: #c3cad1; padding: 22px 0 24px; border-top: 1px solid var(--graphite-3); }
.cx-band__title { color: #fff; font-size: 30px; margin: 0; }
.cx-band__desc { margin-top: 8px; max-width: 720px; font-size: 16px; }
.cx-band__desc p { margin: 0; }
.cx-chip { display: inline-block; margin-bottom: 10px; padding: 3px 8px; border: 1px solid var(--lime); border-radius: 3px; color: var(--lime); font: 600 13px/1.3 var(--cond); text-transform: uppercase; letter-spacing: .05em; text-decoration: none; }
.cx-chip:hover { background: var(--lime); color: var(--ink); }
.cx-facts { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--graphite-3); border-radius: 4px; max-width: 560px; }
.cx-facts li { flex: 1 1 33%; min-width: 0; padding: 8px 12px; border-left: 1px solid var(--graphite-3); font: 500 14px/1.3 var(--sans); color: #fff; }
.cx-facts li:first-child { border-left: 0; }
.cx-facts span { display: block; font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #8f99a3; margin-bottom: 2px; }

/* ---------- Статья ---------- */
.cx-post { display: grid; gap: 20px; margin-top: 18px; }
.cx-post__main { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 18px 16px 20px; }
.cx-cover { margin: -18px -16px 18px; }
.cx-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px 3px 0 0; }
.cx-toc--inline { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 4px; background: #f7f8f9; }
.cx-toc--inline summary { cursor: pointer; padding: 10px 12px; font: 700 15px var(--cond); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.cx-toc ol { margin: 0; padding: 0 12px 10px 34px; font-size: 15px; line-height: 1.4; }
.cx-toc li { padding: 4px 0; }
.cx-toc li::marker { font: 500 12px var(--mono); color: var(--steel); }
.cx-toc a { color: var(--ink); text-decoration: none; }
.cx-toc a:hover { color: var(--lime-ink); text-decoration: underline; }

.cx-doc { min-width: 0; max-width: 760px; }
.cx-doc > *:first-child { margin-top: 0; }
.cx-doc p, .cx-doc ul, .cx-doc ol { margin: 0 0 1em; }
.cx-doc h2 { font-size: 26px; margin: 1.7em 0 .6em; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.cx-doc h3 { font-size: 20px; margin: 1.4em 0 .5em; }
.cx-doc li { margin-bottom: .3em; }
.cx-doc ul li::marker { color: var(--lime-ink); }
.cx-doc ol li::marker { font-weight: 700; color: var(--ink); }
.cx-doc blockquote { margin: 1.3em 0; padding: 12px 16px; background: #f4f5f6; border-left: 4px solid var(--steel); color: var(--ink); }
.cx-doc blockquote p:last-child { margin: 0; }
.cx-doc figure { margin: 1.3em 0; }
.cx-doc figcaption, .cx-doc .wp-element-caption { font-size: 13px; color: var(--steel); margin-top: 6px; }
.cx-doc img { border-radius: 3px; }
.cx-doc code { font: 14px var(--mono); background: #eef0f2; padding: 1px 5px; border-radius: 3px; }

/* Таблицы характеристик */
.cx-tbl { overflow-x: auto; margin: 1.3em 0; border: 1px solid var(--line); border-radius: 4px; -webkit-overflow-scrolling: touch; }
.cx-tbl:focus { outline: 2px solid var(--lime); }
.cx-tbl table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
.cx-tbl th { background: var(--graphite); color: #fff; text-align: left; font: 600 13px/1.3 var(--cond); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; white-space: nowrap; }
.cx-tbl td { padding: 8px 12px; border-top: 1px solid var(--line-2); vertical-align: top; }
.cx-tbl tr:nth-child(even) td { background: #f6f7f8; }
.cx-tbl td:first-child { font-weight: 500; color: var(--ink); }
.cx-doc .wp-block-table { margin: 1.3em 0; }
.cx-doc .wp-block-table .cx-tbl { margin: 0; }

/* Регламент ТО: номера интервалов */
.cx-reg .cx-tbl th:first-child, .cx-reg .cx-tbl td:first-child { position: sticky; left: 0; z-index: 1; }
.cx-reg .cx-tbl td:first-child { background: var(--lime-soft); }

/* Проблема → причина → что делать */
.cx-issue { margin: 1.3em 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.cx-issue__title { margin: 0; padding: 10px 14px; background: var(--graphite); color: #fff; font: 700 17px/1.25 var(--cond); }
.cx-issue__title span { font: 500 12px var(--mono); color: var(--lime); margin-left: 6px; }
.cx-issue__step { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 14px; border-top: 1px solid var(--line-2); }
.cx-issue__step b { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.cx-issue__step p { margin: 0; font-size: 16px; }
.cx-issue__step--1 b { color: var(--steel); }
.cx-issue__step--2 { background: var(--amber-soft); }
.cx-issue__step--2 b { color: var(--amber); }
.cx-issue__step--3 { background: var(--lime-soft); }
.cx-issue__step--3 b { color: var(--lime-ink); }

.cx-warn { margin: 1.3em 0; padding: 12px 14px 12px 16px; border: 1px solid #ecd6a8; border-left: 5px solid var(--amber); background: var(--amber-soft); border-radius: 4px; }
.cx-warn b { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--amber); }
.cx-warn p { margin: 2px 0 0; font-size: 16px; }

.cx-faq h3 { font-size: 18px; padding: 10px 12px; margin: 1em 0 0; background: #f4f5f6; border-left: 4px solid var(--lime); }
.cx-faq h3 + p { padding: 8px 12px 0 16px; }

/* Партнёрский блок */
.cx-deal { display: flex; flex-direction: column; gap: 10px; margin: 1.4em 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 4px; background: #f7f8f9; }
.cx-deal__note { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--steel); }
.cx-deal__title { margin: 2px 0; font: 700 18px/1.25 var(--cond); color: var(--ink); }
.cx-deal__text { margin: 0; font-size: 15px; }
.cx-deal__btn { align-self: flex-start; padding: 9px 16px; background: var(--ink); color: #fff; border-radius: 3px; text-decoration: none; font: 600 15px var(--cond); text-transform: uppercase; letter-spacing: .04em; }
.cx-deal__btn:hover { background: var(--lime); color: var(--ink); }
.cx-slot-title { font: 600 12px var(--mono); text-transform: uppercase; color: var(--steel); }

.cx-club { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--steel); }
.cx-club p { margin: 0; }
.cx-club strong { color: var(--ink); }

/* Правая колонка */
.cx-side { display: grid; gap: 12px; align-content: start; }
.cx-side > .cx-toc { display: none; }
.cx-side__box { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.cx-side__title { margin: 0; padding: 10px 14px; font: 700 14px var(--cond); text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--ink); color: var(--ink); }
.cx-side .cx-toc ol { padding: 8px 12px 10px 34px; }

/* Пагинация */
.pagination { margin-top: 18px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { display: inline-block; min-width: 40px; padding: 8px 10px; text-align: center; border-radius: 3px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font: 600 15px var(--cond); }
.pagination .page-numbers.current { background: var(--graphite); color: var(--lime); border-color: var(--graphite); }

/* ---------- Подвал ---------- */
.cx-foot { margin-top: 40px; background: var(--graphite); color: #9aa3ad; padding: 20px 0 24px; font-size: 13px; line-height: 1.5; }
.cx-foot__row { display: flex; flex-direction: column; gap: 10px; }
.cx-foot__txt { margin: 0; max-width: 620px; }
.cx-foot__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.cx-foot__links a { color: #e2e6ea; }
.cx-foot__links a:hover { color: var(--lime); }

/* ---------- ≥561 ---------- */
@media (min-width: 561px) {
	.cx-seek { flex: 0 1 320px; }
	.cx-seek--light { flex: none; }
	.cx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cx-model b { font-size: 30px; }
	.cx-model { padding: 14px 16px; }
	.cx-post__main { padding: 22px 24px 24px; }
	.cx-cover { margin: -22px -24px 22px; }
	.cx-issue__step { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: baseline; }
	.cx-deal { flex-direction: row; align-items: center; justify-content: space-between; }
	.cx-deal__btn { align-self: center; flex: none; }
	.cx-hero__h1 { font-size: 38px; }
	.cx-band__title { font-size: 36px; }
}

/* ---------- ≥921 ---------- */
@media (min-width: 921px) {
	body { font-size: 17.5px; }
	.cx-top__row { flex-wrap: nowrap; }
	.cx-hero { padding: 40px 0 44px; }
	.cx-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
	.cx-hero__h1 { font-size: 46px; }
	.cx-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.cx-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.cx-guides { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.cx-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cx-band { padding: 30px 0 32px; }
	.cx-band__title { font-size: 42px; max-width: 900px; }
	.cx-post { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 24px; }
	.cx-post__main { padding: 30px 36px 32px; }
	.cx-cover { margin: -30px -36px 28px; }
	.cx-toc--inline { display: none; }
	.cx-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
	.cx-side > .cx-toc { display: block; }
	.cx-foot__row { flex-direction: row; align-items: center; gap: 20px; }
	.cx-foot__links { margin-left: auto; }
}
