/* ═══ Codenrock Media — тёмная тема (весь сайт) + переключатель ═══ */

/* Переключатель в шапке (обе темы) */
.cnr-theme-toggle{width:38px;height:38px;border-radius:50%;border:1px solid color-mix(in srgb,currentColor 22%,transparent);background:transparent;color:inherit;display:grid;place-items:center;cursor:pointer;flex:0 0 auto;margin:0;padding:0}
.cnr-theme-toggle svg{width:18px;height:18px}
.cnr-theme-toggle:hover{background:color-mix(in srgb,currentColor 8%,transparent)}

/* ── Токены наших медиа-компонентов (.cnrm) в тёмной ── */
html[data-theme="dark"] .cnrm{
  --cbg:#0b0e16;--csurf:#141a27;--craise:#161d2c;--craise2:#1d2536;
  --cink:#e9edf5;--cmut:#a7b0c2;--cfaint:#727c90;--cline:#232b3b;--cline2:#2e3849;
  --cbrand:#5b8cff;--cbrandink:#8fb1ff;--cbrandbg:#152036;
  --cvibe:#a274ff;--cvibeink:#c6a8ff;--cvibebg:#201a3a;
  --cshadow:0 1px 2px rgba(0,0,0,.4);
}
html[data-theme="dark"] .cnrm .thumb,html[data-theme="dark"] .cnrm .thumb.ph{background:linear-gradient(135deg,#1c2340,#141a2c)}
html[data-theme="dark"] .cnrm-rail a.rail-cta{background:#5b8cff;color:#0b0e16}
html[data-theme="dark"] .cnrm-rail a.rail-cta:hover{background:#7aa4ff}

/* ── Токены статьи (.cnr-post) в тёмной ── */
html[data-theme="dark"] .cnr-post{
  --brand:#7b6cff;--brand-ink:#a99dff;--brand-tint:#191a33;
  --ink:#eaf0f8;--body:#c2c9d6;--mut:#8b93a6;--faint:#6c7488;
  --line:#212a3b;--line2:#2d3648;--raise:#141a27;--surf:#121826;
  --cov-a:#23234d;--cov-b:#14162e;--spine:#252d3e;
}
html[data-theme="dark"] .cnr-progress i{background:#7b6cff}
html[data-theme="dark"] .cnr-post .entry-content a{text-decoration-color:rgba(123,108,255,.45)}

/* ── «Хром» темы ── */
html[data-theme="dark"] body{background:#0b0e16;color:#c2c9d6}
html[data-theme="dark"] .site-content,html[data-theme="dark"] .site-content-inner{background:transparent}

/* Шапка */
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-header-inner{background:#0d1220;border-color:#212a3b;box-shadow:none}
html[data-theme="dark"] .site-header a,
html[data-theme="dark"] .top-menu a,
html[data-theme="dark"] .top-menu .menu-item a{color:#c8cfdc}
html[data-theme="dark"] .top-menu a:hover{color:#fff}
html[data-theme="dark"] .humburger span,
html[data-theme="dark"] .humburger::before,
html[data-theme="dark"] .humburger::after{background:#c8cfdc}
html[data-theme="dark"] .search-icon{color:#c8cfdc}
html[data-theme="dark"] .site-logotype img{filter:brightness(0) invert(1)}

/* Подвал */
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .site-footer--style-gray{background:#0d1220;border-color:#212a3b;color:#8b93a6}
html[data-theme="dark"] .site-footer a{color:#aab3c4}
html[data-theme="dark"] .site-footer a:hover{color:#fff}
html[data-theme="dark"] .site-footer .widget-title,
html[data-theme="dark"] .site-footer h1,html[data-theme="dark"] .site-footer h2,
html[data-theme="dark"] .site-footer h3,html[data-theme="dark"] .site-footer h4{color:#e9edf5}
html[data-theme="dark"] .site-logotype--footer img{filter:brightness(0) invert(1)}

/* Сайдбар / виджеты */
html[data-theme="dark"] .widget{background:#141a27;border-color:#232b3b;color:#c2c9d6}
html[data-theme="dark"] .widget-title,
html[data-theme="dark"] .widget h1,html[data-theme="dark"] .widget h2,html[data-theme="dark"] .widget h3{color:#e9edf5}
html[data-theme="dark"] .widget a{color:#c2c9d6}
html[data-theme="dark"] .widget a:hover{color:#8fb1ff}

/* Поля ввода / кнопки форм */
html[data-theme="dark"] input:not([type="submit"]):not([type="button"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{background:#141a27;border-color:#2d3648;color:#e9edf5}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#69728a}

/* Экран поиска */
html[data-theme="dark"] .search-screen{background:rgba(9,11,20,.97)}
html[data-theme="dark"] .search-screen input{background:transparent;color:#e9edf5;border-color:#2d3648}

/* Общий контент вне медиа-компонентов (страницы) */
html[data-theme="dark"] .entry-content{color:#c2c9d6}
html[data-theme="dark"] .entry-content h1,html[data-theme="dark"] .entry-content h2,
html[data-theme="dark"] .entry-content h3,html[data-theme="dark"] .entry-title,
html[data-theme="dark"] .page-title{color:#eaf0f8}
html[data-theme="dark"] hr{border-color:#232b3b}

/* ── Захардкоженные светлые поверхности медиа-компонентов ── */
html[data-theme="dark"] .cnrm-card-shadow,
html[data-theme="dark"] .cnrm-fc,
html[data-theme="dark"] .cnrm-lead,
html[data-theme="dark"] .cnrm-plot,
html[data-theme="dark"] .cnrm-big,
html[data-theme="dark"] .cnrm-data.mid{background:#141a27;border:1px solid #232b3b;box-shadow:0 1px 2px rgba(0,0,0,.4),0 6px 18px rgba(0,0,0,.34)}
html[data-theme="dark"] .cnrm-data.mid .cnrm-tiles .cnrm-tile{background:#1b2231}
html[data-theme="dark"] .cnrm-plot.cnrm-feature{background:#141d30;border-color:#28324a}
html[data-theme="dark"] .cnrm-pin{background:#152036;border-color:#2a3a5c}
html[data-theme="dark"] .cnrm-promo.amber{background:#241d10;color:#e9d9b8}
html[data-theme="dark"] .cnrm-promo.green{background:#122619;color:#c4e6cf}
html[data-theme="dark"] .cnrm-house .btn{background:#e9edf5;color:#12141c}
html[data-theme="dark"] .cnrm-profcard .lvl.hi{background:#123227;color:#7fe0b4}
html[data-theme="dark"] .cnrm-profcard .lvl.mid{background:#33270f;color:#e6bf7a}
html[data-theme="dark"] .cnrm-latest--money .cnrm-latest-label,
html[data-theme="dark"] .cnrm-plot.gr .cnrm-plot-aud,
html[data-theme="dark"] .cnrm-rcard.live .rc-badge{background:#123227;color:#7fe0b4}
html[data-theme="dark"] .cnrm-latest--ru .cnrm-latest-label{background:#331717;color:#f0a3a3}

/* Закреплённое верхнее меню (весь сайт) */
.site-header{position:sticky;top:0;z-index:100}
html[data-theme="dark"] .site-header{box-shadow:0 1px 0 #212a3b}

/* Кластер действий в шапке (кнопка «Стать автором» + тема + поиск — тесно, как в Т—Ж) */
.cnr-hdr-actions{display:flex;align-items:center;gap:14px;flex:0 0 auto;margin-left:28px}
.cnr-hdr-actions .header-search{position:static;top:auto;right:auto;left:auto;display:flex;align-items:center}
.cnr-hdr-actions .search-icon{position:static}
.cnr-author-btn{display:inline-flex;align-items:center;gap:8px;flex:0 0 auto;margin:0;padding:0 22px;height:40px;border-radius:11px;border:1px solid color-mix(in srgb,currentColor 24%,transparent);background:transparent;color:inherit;font-size:14px;font-weight:600;text-decoration:none;font-family:inherit;cursor:pointer;white-space:nowrap}
.cnr-author-btn svg{width:16px;height:16px}
.cnr-author-btn:hover{background:color-mix(in srgb,currentColor 8%,transparent)}
@media(max-width:640px){.cnr-author-btn span{display:none}.cnr-author-btn{padding:0;width:38px;justify-content:center}}
