/*
 * theme-v2.css — этап A tsk-1218: светлая дизайн-система движка лендингов
 * для всего сайта (статьи, навигаторы, уроки). Печатается ПОСЛЕДНИМ в <head>
 * (wp_head priority 1000, cb-theme-v2.php) и теми же селекторами перекрывает
 * тёмные правила: настройку «Фон» WP, цвета кастомайзера темы Root и
 * «Дополнительные стили» (priority 101). Настройки темы не меняются — откат
 * плагина возвращает тёмный вид как было.
 *
 * Источник истины по токенам — cb-landing/landing.css (tsk-1070). Значения
 * скопированы дословно, чтобы сайт и лендинги жили на одной палитре.
 *
 * Принципы этапа A (аудит 2026-11-11):
 * - фон страницы «бумага», текст «чернила», один зелёный акцент;
 * - шапка/меню/подвал — только перекраска в токены, перекомпоновка — этап C;
 * - тексты и разметка страниц не меняются (стандарт v3 §2).
 */

:root {
  /* Цвет: светлая «бумага», почти чёрные чернила, один фирменный зелёный. */
  --cbl-paper: #FAF8F3;
  --cbl-surface: #FFFFFF;
  --cbl-tint: #E7F3EC;
  --cbl-line: #DCE2DC;
  --cbl-ink: #17211C;       /* 15.6:1 на бумаге */
  --cbl-ink-2: #4B5751;     /* 7.1:1 — второстепенный текст */
  --cbl-muted: #66716B;     /* 4.8:1 — подписи, не меньше 14px */
  --cbl-green: #0B6E4F;     /* 5.9:1 — ссылки, акценты; белый текст на нём 6.3:1 */
  --cbl-green-hover: #095C42;
  --cbl-dark: #111A15;      /* тёмный блок: подвал, как единственный тёмный элемент */
  --cbl-dark-text: #EDF3EF;
  --cbl-dark-muted: #A9B6AF;
  --cbl-dark-green: #5ED3A2;

  /* Шрифты: те же семейства, что у лендингов (локальные копии uploads/cb-fonts). */
  --cbl-font: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --cbl-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* Нативные элементы браузера обратно в светлую схему («Дополнительные стили»
   задали color-scheme: dark). */
:root {
  color-scheme: light;
}

/* ---------- Фон и базовая типографика ---------- */
/* «Фон» WP: body.custom-background печатается в wp_head после нашей очереди,
   но до priority 1000 — равный селектор, наш позже, специфичность хватает. */
body.custom-background {
  background-color: var(--cbl-paper);
}
/* Цвет кастомайзера: body {color:#56bc99} → чернила. */
body {
  color: var(--cbl-ink);
  font-family: var(--cbl-font);
  font-size: 17px;
  line-height: 1.6;
}
body a,
body .spanlink,
body .comment-reply-link,
body .pseudo-link,
body .root-pseudo-link {
  color: var(--cbl-green);
}
body a:hover,
body a:focus,
body a:active,
body .spanlink:hover,
body .comment-reply-link:hover,
body .pseudo-link:hover {
  color: var(--cbl-green-hover);
}

/* Содержимое страницы вместо кастомайзерного #262626 — бумага. */
.site-content {
  background-color: var(--cbl-paper);
}
/* Тело статьи: «Дополнительные стили» давали #E0E0E0 → чернила. */
.entry-content,
.home-text,
.taxonomy-description {
  color: var(--cbl-ink);
}
/* Заголовки в дизайн-системе — чернила, акцент остаётся ссылкам. */
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6,
.home-text h1, .home-text h2, .home-text h3,
.home-text h4, .home-text h5, .home-text h6,
.taxonomy-description h2, .taxonomy-description h3,
h1:not(.site-title), .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
  color: var(--cbl-ink);
  font-family: var(--cbl-font);
}
/* Заголовок записи в лентах: было белым по тёмному → чернила. */
.entry-title a {
  color: var(--cbl-ink);
}
.entry-title a:hover {
  color: var(--cbl-green);
}

/* Ссылки внутри текста: зелёный движка вместо #56BC99. */
.entry-content a,
.home-text a,
.taxonomy-description a {
  color: var(--cbl-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.entry-content a:hover, .entry-content a:focus,
.home-text a:hover, .home-text a:focus,
.taxonomy-description a:hover, .taxonomy-description a:focus {
  color: var(--cbl-green-hover);
  text-decoration-color: var(--cbl-green);
}
/* Светлые секции из «Дополнительных стилей» больше не нужны — везде светло. */
.has-white-background-color a,
.has-very-light-gray-background-color a {
  color: var(--cbl-green);
}

/* ---------- Шапка и меню (только перекраска; компоновка — этап C) ---------- */
.site-header {
  background-color: var(--cbl-surface);
  color: var(--cbl-ink);
}
.site-title, .site-title a {
  color: var(--cbl-ink) !important;
}
.site-description, .site-description a {
  color: var(--cbl-muted) !important;
}
.top-menu ul li a {
  color: var(--cbl-ink-2);
}
.main-navigation,
.footer-navigation,
.main-navigation ul li .sub-menu,
.footer-navigation ul li .sub-menu {
  background-color: var(--cbl-surface);
}
.main-navigation ul li a,
.main-navigation ul li .removed-link,
.footer-navigation ul li a,
.footer-navigation ul li .removed-link {
  color: var(--cbl-ink);
}
.main-navigation ul li a:hover,
.footer-navigation ul li a:hover {
  color: var(--cbl-green);
}

/* ---------- Подвал: единственный тёмный блок страницы (как cbl-dark) ---------- */
.site-footer {
  background-color: var(--cbl-dark);
  color: var(--cbl-dark-text);
}
.site-footer a {
  color: var(--cbl-dark-green);
}
.site-footer a:hover {
  color: var(--cbl-dark-text);
}

/* ---------- Акцент кастомайзера #059669 → зелёный движка ---------- */
/* Кнопки темы, маркеры списков, номера страниц, обводки фокуса. */
.mob-hamburger span, .card-slider__category,
.card-slider-container .swiper-pagination-bullet-active,
.page-separator, .pagination .current,
.pagination a.page-numbers:hover,
.entry-content ul > li:before,
.entry-content ul:not([class]) > li:before,
.entry-content ul.wp-block-list > li:before,
.home-text ul:not([class]) > li:before,
.home-text ul.wp-block-list > li:before,
.taxonomy-description ul:not([class]) > li:before,
.taxonomy-description ul.wp-block-list > li:before,
.btn, .comment-respond .form-submit input,
.contact-form .contact_submit, .page-links__item {
  background-color: var(--cbl-green);
}
.spoiler-box, .entry-content ol li:before,
.entry-content ol:not([class]) li:before,
.entry-content ol.wp-block-list li:before,
.home-text ol:not([class]) li:before,
.home-text ol.wp-block-list li:before,
.taxonomy-description ol:not([class]) li:before,
.taxonomy-description ol.wp-block-list li:before,
.mob-hamburger, .inp:focus, .search-form__text:focus,
.entry-content blockquote:not(.wpremark),
.comment-respond .comment-form-author input:focus,
.comment-respond .comment-form-author textarea:focus,
.comment-respond .comment-form-comment input:focus,
.comment-respond .comment-form-comment textarea:focus,
.comment-respond .comment-form-email input:focus,
.comment-respond .comment-form-email textarea:focus,
.comment-respond .comment-form-url input:focus,
.comment-respond .comment-form-url textarea:focus {
  border-color: var(--cbl-green);
}
.entry-content blockquote:before, .spoiler-box__title:after,
.sidebar-navigation .menu-item-has-children:after {
  color: var(--cbl-green);
}

/* Кнопка «наверх» и кнопки обратной связи из «Дополнительных стилей». */
.scrolltop { background-color: var(--cbl-green); }
.scrolltop:after { color: #ffffff; }
.header-button {
  background-color: var(--cbl-green);
  color: #ffffff;
  border-radius: 10px;
}
.header-button:hover {
  background-color: var(--cbl-green-hover);
}
.sidebar-button {
  background-color: var(--cbl-green);
  color: #ffffff;
  border-radius: 10px;
}
.sidebar-button a { color: #ffffff; }
.sidebar-button:hover { background-color: var(--cbl-green-hover); }

/* Кольцо фокуса — зелёный движка. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cbl-green);
  outline-offset: 2px;
}

/* ---------- Плашки и цитаты: серый #5e5e5e → токены ---------- */
/* Оглавление статьи. */
.table-of-contents {
  background: var(--cbl-surface);
  border: 1px solid var(--cbl-line);
  border-radius: 10px;
}
.table-of-contents__header {
  color: var(--cbl-ink);
}
.table-of-contents a { color: var(--cbl-green); }

/* Цитаты всех типов (warning/check/info/quote и обычные). */
.entry-content blockquote:not(.wpremark),
.home-text blockquote:not(.wpremark),
.taxonomy-description blockquote:not(.wpremark),
.entry-content blockquote:not(.wpremark).is-style-warning,
.entry-content blockquote:not(.wpremark).warning,
.home-text blockquote:not(.wpremark).is-style-warning,
.home-text blockquote:not(.wpremark).warning,
.taxonomy-description blockquote:not(.wpremark).is-style-warning,
.taxonomy-description blockquote:not(.wpremark).warning,
.entry-content blockquote:not(.wpremark).check,
.entry-content blockquote:not(.wpremark).is-style-check,
.home-text blockquote:not(.wpremark).check,
.home-text blockquote:not(.wpremark).is-style-check,
.taxonomy-description blockquote:not(.wpremark).check,
.taxonomy-description blockquote:not(.wpremark).is-style-check,
.entry-content blockquote:not(.wpremark).info,
.entry-content blockquote:not(.wpremark).is-style-info,
.home-text blockquote:not(.wpremark).info,
.home-text blockquote:not(.wpremark).is-style-info,
.taxonomy-description blockquote:not(.wpremark).info,
.taxonomy-description blockquote:not(.wpremark).is-style-info,
.entry-content blockquote:not(.wpremark).is-style-quote,
.entry-content blockquote:not(.wpremark).quote,
.home-text blockquote:not(.wpremark).is-style-quote,
.home-text blockquote:not(.wpremark).quote,
.taxonomy-description blockquote:not(.wpremark).is-style-quote,
.taxonomy-description blockquote:not(.wpremark).quote,
blockquote:not(.wpremark) {
  background: var(--cbl-tint);
  color: var(--cbl-ink);
  border-color: var(--cbl-green);
}
.entry-content blockquote:not(.wpremark):before,
.entry-content blockquote:not(.wpremark).check:before,
.entry-content blockquote:not(.wpremark).is-style-check:before,
.entry-content blockquote:not(.wpremark).info:before,
.entry-content blockquote:not(.wpremark).is-style-info:before,
.entry-content blockquote:not(.wpremark).is-style-quote:before,
.entry-content blockquote:not(.wpremark).quote:before,
.home-text blockquote:not(.wpremark):before,
.taxonomy-description blockquote:not(.wpremark):before {
  color: var(--cbl-green);
}

/* Спойлер. */
.spoiler-box {
  background: var(--cbl-tint);
  color: var(--cbl-ink);
}
.spoiler-box__body {
  background: var(--cbl-tint);
  color: var(--cbl-ink);
}

/* Врезки курсов (cb-callout): в «Дополнительных стилях» стоят !important —
   отвечаем тем же. */
.entry-content .cb-callout,
.home-text .cb-callout,
.taxonomy-description .cb-callout {
  background: var(--cbl-tint) !important;
  color: var(--cbl-ink) !important;
  border-left-color: var(--cbl-green) !important;
}
.entry-content .cb-callout a,
.home-text .cb-callout a,
.taxonomy-description .cb-callout a {
  color: var(--cbl-green);
}
.entry-content .cb-callout a:hover,
.home-text .cb-callout a:hover,
.taxonomy-description .cb-callout a:hover {
  color: var(--cbl-green-hover);
}
.entry-content .cb-callout code,
.home-text .cb-callout code,
.taxonomy-description .cb-callout code {
  color: var(--cbl-ink);
}

/* ---------- Таблицы (tsk-1203 в новой палитре: тёмная шапка остаётся) ---------- */
.entry-content table th,
.home-text table th,
.taxonomy-description table th {
  background: var(--cbl-ink);
  color: #fff;
  border-bottom: 2px solid var(--cbl-green);
}
.entry-content table td,
.home-text table td,
.taxonomy-description table td {
  border-color: var(--cbl-line);
}

/* ---------- Шаблон навигаторов ЕГЭ/ОГЭ vk-* (tsk-1264): возврат к светлым ---------- */
/* Тёмные переопределения из «Дополнительных стилей» перекрываем authored-светлыми. */
:is(.postid-5818,.postid-5750) :is(.vk-legend,.vk-block,.vk-card),
.vk-sec :is(.vk-legend,.vk-block,.vk-card) {
  background: #ffffff;
  border-color: #e8edf3;
  color: inherit;
}
:is(.postid-5818,.postid-5750) :is(.vk-card p,.vk-note,.vk-progress,.vk-mini),
.vk-sec :is(.vk-card p,.vk-note,.vk-progress,.vk-mini) {
  color: #444444;
}
:is(.postid-5818,.postid-5750) .vk-badge {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

/* ---------- Моноширинный для меток и кода ---------- */
code, kbd, pre, samp {
  font-family: var(--cbl-mono);
}
/* Инлайн-код: на тёмном был светлым по тёмному, на бумаге — чернила на тинте. */
.entry-content code:not(pre code),
.home-text code:not(pre code),
.taxonomy-description code:not(pre code) {
  background: var(--cbl-tint);
  color: var(--cbl-ink);
  border-radius: 4px;
  padding: 0 4px;
}
/* Блоки кода (Prism, theme-funky) остаются тёмными — как «терминал» на бумаге,
   в духе единственного тёмного блока дизайн-системы. Прокрутка tsk-1191
   сохраняется. */
