/*
Theme Name: RHW
Theme URI: https://rhwservice.ru
Author: RHW
Description: Тема для сайта RHW: строгая техническая вёрстка на всю ширину экрана, компактная закреплённая шапка, светлая и тёмная тема с переключателем, адаптация под телефоны и планшеты, оглавление статей и разделы базы знаний, оформление под таблицы RHW Tables. Шрифты встроены в тему.
Version: 2.5.4
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: rhw
*/

/* ================= Шрифты (лежат в теме, без Google) ================= */
@font-face { font-family: "Golos Text"; src: url("assets/fonts/golos-text.woff") format("woff"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("assets/fonts/exo2.woff") format("woff"); font-weight: 700 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("assets/fonts/exo2-italic.woff") format("woff"); font-weight: 700 800; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("assets/fonts/jetbrains-mono.woff") format("woff"); font-weight: 400 500; font-style: normal; font-display: swap; }

/* ================= Цвета и размеры =================
   Светлая тема — по умолчанию. Тёмная переопределяет те же переменные:
   по системной настройке (если посетитель не выбрал сам) и по кнопке. */
:root {
	--rhw-blue: #0098dc;          /* цвет логотипа */
	--rhw-blue-ink: #0a6fa8;      /* ссылки и акценты на светлом фоне */
	--rhw-blue-btn: #0a6fa8;      /* заливка синих кнопок */
	--rhw-red: #e0333a;           /* кнопка «Заказать сборку» */
	--rhw-red-hover: #c6272e;
	--band: #ffffff;              /* шапка и подвал */
	--band-line: #dde4ea;
	--band-fg: #141b22;
	--band-strong: #000000;
	--band-muted: #5b6a78;
	--band-hover-bg: rgba(0, 0, 0, .05);

	--bg: #eef2f5;
	--surface: #ffffff;
	--surface-2: #f3f6f9;
	--line: #d6dee5;
	--line-strong: #aab6c1;
	--fg: #111820;
	--muted: #566573;
	--accent-soft: rgba(10, 111, 168, .10);
	--badge-ring: rgba(0, 0, 0, .14);
	--shadow: 0 8px 24px rgba(16, 24, 32, .14);

	--font-display: "Exo 2", "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

	--gutter-l: max(16px, env(safe-area-inset-left, 0px), 2.5vw);
	--gutter-r: max(16px, env(safe-area-inset-right, 0px), 2.5vw);
	--header-h: 64px;             /* высота шапки — для отступа якорей */
	--col: 780px;                 /* колонка текста статьи */
	--toc-w: 240px;               /* оглавление справа */
	--measure: 78ch;              /* ширина строки текста на широких страницах */
	--radius: 8px;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--rhw-blue-ink: #4cb8f0;
		--band: #0b0f14; --band-line: #223040;
		--band-fg: #e8eef3; --band-strong: #ffffff; --band-muted: #93a3b2; --band-hover-bg: rgba(255, 255, 255, .06);
		--bg: #0e1318; --surface: #151c23; --surface-2: #1b242d;
		--line: #27323d; --line-strong: #41505d;
		--fg: #e5ebf0; --muted: #98a6b3;
		--accent-soft: rgba(76, 184, 240, .13);
		--badge-ring: rgba(255, 255, 255, .22); --shadow: 0 10px 28px rgba(0, 0, 0, .55);
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--rhw-blue-ink: #4cb8f0;
	--band: #0b0f14; --band-line: #223040;
	--band-fg: #e8eef3; --band-strong: #ffffff; --band-muted: #93a3b2; --band-hover-bg: rgba(255, 255, 255, .06);
	--bg: #0e1318; --surface: #151c23; --surface-2: #1b242d;
	--line: #27323d; --line-strong: #41505d;
	--fg: #e5ebf0; --muted: #98a6b3;
	--accent-soft: rgba(76, 184, 240, .13);
	--badge-ring: rgba(255, 255, 255, .22); --shadow: 0 10px 28px rgba(0, 0, 0, .55);
	color-scheme: dark;
}

/* ================= База ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
	margin: 0; background: var(--bg); color: var(--fg);
	font: 400 16px/1.6 var(--font-body);
	-webkit-font-smoothing: antialiased;
	min-height: 100vh; display: flex; flex-direction: column;
}
.site-main { flex: 1 0 auto; }
img, video { max-width: 100%; height: auto; }
a { color: var(--rhw-blue-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--rhw-blue); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 1.6em 0 .5em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus {
	clip: auto; clip-path: none; width: auto; height: auto; z-index: 100;
	left: 12px; top: 12px; padding: 10px 14px; background: var(--surface); color: var(--fg); border-radius: var(--radius);
}

/* ================= Кнопки ================= */
.btn, .wp-block-button__link, .search-submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 42px; padding: 8px 18px; border-radius: 6px; cursor: pointer;
	font: 600 15px/1.2 var(--font-body); text-decoration: none;
	border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg);
	transition: background .15s, border-color .15s, color .15s;
}
.btn:hover, .search-submit:hover { border-color: var(--rhw-blue-ink); text-decoration: none; }
.wp-block-button__link { background: var(--rhw-blue-btn); border-color: var(--rhw-blue-btn); color: #fff; }
.btn--cta {
	background: var(--rhw-red); border-color: var(--rhw-red); color: #fff;
	font-family: var(--font-display); font-style: italic; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-size: 14px;
}
.btn--cta:hover { background: var(--rhw-red-hover); border-color: var(--rhw-red-hover); color: #fff; }
.btn--block { width: 100%; margin-top: 14px; }

/* Квадратные кнопки-иконки в шапке */
.icon-btn {
	flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-width: 40px; height: 40px; padding: 0 10px; border-radius: 6px; cursor: pointer;
	background: transparent; color: var(--band-fg); border: 1px solid var(--band-line);
	font: 500 14px/1 var(--font-body);
}
.icon-btn:hover { border-color: var(--rhw-blue); color: var(--band-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* ================= Шапка ================= */
.site-header {
	position: sticky; top: 0; z-index: 50;
	padding-top: env(safe-area-inset-top, 0px);
	background: var(--band); color: var(--band-fg);
	border-bottom: 3px solid transparent;
	border-image: linear-gradient(90deg, var(--rhw-blue) 0%, var(--rhw-blue) 60%, var(--rhw-red) 100%) 1;
}
.site-header__inner {
	display: flex; align-items: center; gap: 18px; min-height: var(--header-h);
	padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}

.brand { flex: none; display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand__logo { display: block; line-height: 0; }
.brand__img { display: block; height: 34px; width: auto; }
.brand__logo--small .brand__img { height: 36px; }
.brand__tagline {
	display: none; margin: 0; padding-left: 14px; border-left: 1px solid var(--band-line); max-width: 15em;
	font: italic 700 11px/1.25 var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--rhw-blue-ink);
}
@media (min-width: 1680px) { .brand__tagline { display: block; } } /* на меньших экранах место нужнее меню */

/* Панель: на широком экране её содержимое просто стоит в строке шапки */
.site-panel { display: contents; }
.main-nav { order: 1; flex: 1 1 auto; min-width: 0; }
.header-search { order: 2; flex: 0 1 240px; min-width: 150px; }
.header-cta { order: 3; flex: none; }
.theme-toggle { order: 4; }
.site-panel__social { display: none; }
.nav-toggle { order: 5; display: none; }

.main-nav .menu, .main-nav .sub-menu { margin: 0; padding: 0; list-style: none; }
.main-nav .menu a, .main-nav .menu-heading { display: block; color: var(--band-fg); text-decoration: none; }
.menu-desc { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; line-height: 1.35; color: var(--band-muted); }
.sub-toggle { display: none; } /* стрелки-раскрывашки нужны только на узком экране */
.menu-heading { font: 500 11px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--band-muted) !important; cursor: default; }

/* ---- Меню на широком экране: выпадающие списки и панели с колонками ---- */
@media (min-width: 1201px) {
	.main-nav .menu { display: flex; flex-wrap: wrap; gap: 0 2px; }
	.main-nav .menu li { position: relative; }
	.main-nav .menu > li > a, .main-nav .menu > li > .menu-heading {
		padding: 20px 12px 18px; white-space: nowrap; font: 500 15px/1.4 var(--font-body); letter-spacing: 0; text-transform: none;
		border-bottom: 2px solid transparent; margin-bottom: -2px;
	}
	.main-nav .menu > li > a:hover, .main-nav .menu > li.is-open > a, .main-nav .menu > li:focus-within > a { color: var(--band-strong); border-bottom-color: var(--band-muted); }
	.main-nav .menu > .current-menu-item > a, .main-nav .menu > .current_page_item > a,
	.main-nav .menu > .current-menu-ancestor > a, .main-nav .menu > .current-post-ancestor > a, .main-nav .menu > .current-menu-parent > a {
		color: var(--band-strong); border-bottom-color: var(--rhw-blue);
	}
	.main-nav .menu > .menu-item-has-children > a::after {
		content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 7px;
		border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: .6;
	}

	/* Обычный выпадающий список */
	.main-nav .sub-menu {
		position: absolute; left: 0; top: 100%; z-index: 5; min-width: 240px; padding: 6px; display: none;
		background: var(--band); border: 1px solid var(--band-line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow);
	}
	.main-nav .menu > li > .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* мостик, чтобы панель не закрывалась на пути мыши */
	/* Открывает скрипт (класс is-open, с задержкой закрытия) или фокус с клавиатуры.
	   Простое :hover — только если скрипт не загрузился. */
	.main-nav .menu > li:focus-within > .sub-menu, .main-nav .menu > li.is-open > .sub-menu, html:not(.js) .main-nav .menu > li:hover > .sub-menu { display: block; }
	.main-nav .sub-menu a { padding: 9px 12px; border-radius: 4px; font-size: 15px; line-height: 1.35; }
	.main-nav .sub-menu a:hover { background: var(--band-hover-bg); color: var(--band-strong); }
	.main-nav .sub-menu .current-menu-item > a { color: var(--rhw-blue-ink); }
	.main-nav .sub-menu .menu-heading { padding: 10px 12px 4px; }

	/* Панель с колонками на всю ширину шапки */
	.main-nav .menu > li.is-suppressed > .sub-menu { display: none !important; } /* закрыто по Escape */
	.main-nav .menu > li.is-mega { position: static; }
	.main-nav .menu > li.is-mega > .sub-menu {
		left: 0; right: 0; margin-top: 3px; min-width: 0; border-width: 0 0 1px; border-radius: 0;
		columns: 5 220px; column-gap: 20px; /* колонки «газетой»: без пустот между разделами разной высоты */
		max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto;
		padding: 18px var(--gutter-r) 22px var(--gutter-l);
	}
	.main-nav .is-mega > .sub-menu > li { break-inside: avoid; padding-bottom: 6px; }
	.main-nav .is-mega > .sub-menu > li > a { padding: 9px 12px; font-weight: 600; font-size: 15px; }
	.main-nav .is-mega > .sub-menu > li > .menu-heading { padding: 9px 12px 6px; }
	.main-nav .is-mega .sub-menu .sub-menu {
		position: static; display: block; min-width: 0; padding: 0 0 4px; border: 0; box-shadow: none; background: transparent;
	}
	.main-nav .is-mega .sub-menu .sub-menu::before { display: none; }
	.main-nav .is-mega .sub-menu .sub-menu a { padding: 5px 12px; font-size: 14px; font-weight: 400; color: var(--band-muted); }
	.main-nav .is-mega .sub-menu .sub-menu a:hover { color: var(--band-strong); }
	.main-nav .is-mega > .sub-menu > li > .menu-heading + .sub-menu a { color: var(--band-fg); font-size: 15px; }
}

/* Поиск: лупа внутри поля, кнопки «Найти» в шапке нет */
.search-form { display: flex; gap: 6px; margin: 0; }
.search-form label { flex: 1; min-width: 0; position: relative; }
.search-field {
	width: 100%; min-height: 40px; padding: 6px 12px; border-radius: 6px; -webkit-appearance: none; appearance: none;
	font: 400 15px/1.2 var(--font-body); color: var(--fg); background: var(--surface); border: 1px solid var(--line-strong);
}
.search-submit { min-height: 40px; padding: 6px 14px; }
.header-search label::before {
	content: ""; position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; margin-top: -8px; pointer-events: none;
	background: var(--band-muted);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.header-search .search-field { padding-left: 34px; background: var(--band); color: var(--band-fg); border-color: var(--band-line); }
.header-search .search-field::placeholder { color: var(--band-muted); }
.header-search .search-field:focus { border-color: var(--rhw-blue); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.header-search .search-submit { display: none; } /* в форме одно поле — Enter отправляет её и без кнопки */

.header-cta .btn--cta { min-height: 40px; padding: 6px 16px; font-size: 13px; }

/* Переключатель темы: луна в светлой, солнце в тёмной */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
	:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Кнопка «Меню»: три полоски → крестик */
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
	display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s, background .2s;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Средние экраны: поиск уже, отступы меню меньше */
@media (min-width: 1201px) and (max-width: 1500px) {
	.main-nav .menu > li > a, .main-nav .menu > li > .menu-heading { padding-inline: 10px; }
	.header-search { flex-basis: 210px; }
}
@media (min-width: 1201px) and (max-width: 1280px) {
	.site-header__inner { gap: 12px; }
	.main-nav .menu > li > a { padding-inline: 9px; font-size: 14.5px; }
	.header-search { flex-basis: 190px; }
}

/* 2.5.4: в меню 7 пунктов (добавлен «Конфигуратор ПК») — до 1800 px поиск в шапке свёрнут в лупу
   и раскрывается поверх меню при фокусе, чтобы меню всегда стояло в одну строку. */
@media (min-width: 1201px) and (max-width: 1800px) {
	.main-nav .menu { flex-wrap: nowrap; }
	.header-search { flex: 0 0 40px; min-width: 40px; height: 40px; position: relative; z-index: 6; }
	.header-search .search-form, .header-search label { width: 40px; }
	.header-search .search-field { width: 40px; padding: 6px 0 6px 38px; cursor: pointer; color: transparent; transition: width .18s ease; }
	.header-search .search-field::placeholder { color: transparent; }
	.header-search label::before { left: 12px; }
	.header-search { align-self: center; }
	.header-search .search-form { height: 40px; }
	.header-search:focus-within label { position: absolute; right: 0; top: 0; width: 300px; }
	.header-search:focus-within .search-field { width: 300px; padding-right: 12px; cursor: text; color: var(--band-fg); box-shadow: var(--shadow); }
	.header-search:focus-within .search-field::placeholder { color: var(--band-muted); }
}
@media (min-width: 1201px) and (max-width: 1366px) {
	.main-nav .menu > li > a, .main-nav .menu > li > .menu-heading { padding-inline: 8px; font-size: 14.5px; }
}
@media (min-width: 1201px) and (max-width: 1366px) {
	.site-header__inner { gap: 8px; }
	.main-nav .menu > li > a, .main-nav .menu > li > .menu-heading { padding-inline: 6px; font-size: 13.5px; }
	.main-nav .menu > .menu-item-has-children > a::after { margin-left: 3px; }
	.header-cta .btn--cta { padding-inline: 12px; font-size: 12px; }
}

/* Планшеты и телефоны: меню, поиск и кнопка — в выпадающей панели */
@media (max-width: 1200px) {
	:root { --header-h: 58px; }
	.site-header__inner { gap: 8px; }
	.brand { flex: 1 1 auto; }
	.brand__img { height: 30px; }
	.nav-toggle { display: inline-flex; }

	.site-panel {
		display: none; position: absolute; left: 0; right: 0; top: 100%; margin-top: 3px;
		flex-direction: column; gap: 16px;
		max-height: calc(100vh - var(--header-h) - 3px); max-height: calc(100dvh - var(--header-h) - 3px); overflow-y: auto; overscroll-behavior: contain;
		padding: 8px var(--gutter-r) max(20px, env(safe-area-inset-bottom, 0px)) var(--gutter-l);
		background: var(--band); border-bottom: 1px solid var(--band-line); box-shadow: var(--shadow);
	}
	.site-header.is-open .site-panel { display: flex; }
	.main-nav, .header-search, .header-cta { order: 0; flex: none; min-width: 0; }
	.header-search { order: -1; padding-top: 8px; }
	/* Меню списком; подпункты раскрываются кнопкой-стрелкой справа */
	.main-nav .menu li { position: relative; }
	.main-nav .menu a { padding: 13px 52px 13px 2px; border-bottom: 1px solid var(--band-line); font-size: 16px; line-height: 1.35; }
	.main-nav .menu a:hover { background: var(--band-hover-bg); }
	.main-nav .menu .current-menu-item > a, .main-nav .menu .current_page_item > a { box-shadow: inset 3px 0 0 var(--rhw-blue); padding-left: 12px; color: var(--band-strong); }
	.main-nav .sub-menu { display: none; padding-left: 16px; }
	.main-nav li.is-expanded > .sub-menu { display: block; }
	.main-nav .sub-menu a { font-size: 15px; padding-block: 11px; }
	.main-nav .menu-heading { padding: 16px 2px 6px; }
	.main-nav .menu-desc { display: none; }
	.sub-toggle {
		display: flex;
		position: absolute; top: 0; right: 0; width: 46px; height: 46px; padding: 0; border: 0; border-left: 1px solid var(--band-line);
		background: transparent; color: var(--band-fg); cursor: pointer; align-items: center; justify-content: center;
	}
	.sub-toggle::before { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -4px; transition: transform .15s; }
	.sub-toggle[aria-expanded="true"]::before { transform: rotate(-135deg); margin-top: 4px; }
	.sub-menu .sub-toggle { height: 43px; }
	.menu-heading + .sub-toggle { display: none; } /* у заголовка колонки подпункты всегда открыты */
	.main-nav li:has(> .menu-heading) > .sub-menu { display: block; padding-left: 0; }
	.header-cta .btn--cta { width: 100%; min-height: 46px; font-size: 14px; }
	.site-panel__social { display: block; }
	html.rhw-menu-open { overflow: hidden; } /* страница под открытым меню не прокручивается */
}
@media (max-width: 480px) {
	.nav-toggle__label { display: none; }
	.nav-toggle { padding: 0; }
}

.social { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.social a {
	display: inline-block; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--band-line);
	color: var(--band-muted); font-size: 14px; font-weight: 500; text-decoration: none;
}
.social a:hover { color: var(--band-strong); border-color: var(--rhw-blue); }

/* ================= Контент ================= */
.site-main { padding-block: clamp(18px, 2.6vw, 36px) clamp(40px, 5vw, 72px); padding-left: var(--gutter-l); padding-right: var(--gutter-r); min-width: 0; }

/* Хлебные крошки */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0 0 14px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin: 0 8px; opacity: .6; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--rhw-blue-ink); text-decoration: underline; }

/* Статья: колонка удобной ширины по центру, оглавление справа.
   Страница с таблицей (is-wide) — во всю ширину окна. */
.entry-wrap { max-width: var(--col); margin-inline: auto; min-width: 0; }
.entry-wrap.is-wide { max-width: none; margin-inline: 0; }
.entry { min-width: 0; }
.entry-aside { display: none; }
@media (min-width: 1180px) {
	.entry-wrap.has-toc {
		display: grid; grid-template-columns: minmax(0, var(--col)) var(--toc-w); gap: clamp(40px, 4vw, 64px);
		max-width: calc(var(--col) + var(--toc-w) + clamp(40px, 4vw, 64px));
	}
	.entry-wrap.has-toc .entry-aside { display: block; }
	.entry-wrap.has-toc .toc--inline { display: none; }
}

.entry-header { margin-bottom: clamp(16px, 2vw, 26px); max-width: var(--measure); }
.entry-title { margin: 0; font-weight: 800; font-size: clamp(28px, 3.2vw, 44px); letter-spacing: -.01em; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 0 2px; margin: 12px 0 0; font: 500 12px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.entry-meta a { color: inherit; }
.entry-meta__sep { margin: 0 8px; opacity: .6; }
.entry-thumb { margin: 0 0 24px; }
.entry-thumb img { border-radius: var(--radius); max-height: 520px; width: 100%; object-fit: cover; }

.entry-content { font-size: 17px; line-height: 1.7; min-width: 0; }
.entry-content > * { margin-block: 0 1.1em; }
.is-wide .entry-content > :where(p, ul, ol, h1, h2, h3, h4, h5, h6, blockquote, dl, .wp-block-quote, .wp-block-list) { max-width: var(--measure); }
.entry-content h2 { font-size: clamp(23px, 2.2vw, 30px); font-weight: 800; margin-top: 1.9em; }
.entry-content h3 { font-size: clamp(19px, 1.7vw, 23px); font-weight: 700; margin-top: 1.6em; }
.entry-content strong { font-weight: 600; }
.entry-content :where(ul, ol) { padding-left: 1.3em; }
.entry-content li + li { margin-top: .3em; }
.entry-content blockquote, .entry-content .wp-block-quote {
	margin-left: 0; padding: 12px 18px; border-left: 3px solid var(--rhw-blue); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; color: var(--fg);
}
.entry-content blockquote > :last-child { margin-bottom: 0; }
.entry-content :not(pre) > code { font: 500 .88em/1 var(--font-mono); padding: .15em .4em; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.entry-content pre { font: 400 14px/1.55 var(--font-mono); padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); max-width: none; margin-block: 2em; }
.entry-content .rhwt { margin-block: 1.4em 2em; font-size: 14px; line-height: 1.45; }
.entry-content .alignwide, .entry-content .alignfull { max-width: none; }
.entry-content .aligncenter { margin-inline: auto; text-align: center; }
.entry-content .alignleft { float: left; margin: 0 1.5em 1em 0; }
.entry-content .alignright { float: right; margin: 0 0 1em 1.5em; }
.entry-content figcaption, .wp-caption-text { font-size: 14px; color: var(--muted); margin-top: 6px; }
.entry-content .wp-block-image img, .entry-content .wp-block-embed { border-radius: var(--radius); }

/* Оглавление */
.toc__list { margin: 0; padding: 0; list-style: none; }
.toc__item a { display: block; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc__item a:hover { color: var(--fg); }
.toc__item--h3 a { padding-left: 14px; font-size: .93em; }

.toc--side { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding-bottom: 8px; font-size: 14px; }
.toc__title { margin: 0 0 10px; font: 500 11px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.toc--side .toc__list { border-left: 1px solid var(--line); }
.toc--side .toc__item a { padding-block: 5px; padding-left: 14px; margin-left: -1px; border-left: 2px solid transparent; }
.toc--side .toc__item--h3 a { padding-left: 26px; }
.toc--side .toc__item a[aria-current] { color: var(--rhw-blue-ink); border-left-color: var(--rhw-blue); font-weight: 500; }

.toc--inline { margin: 0 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toc--inline summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.toc--inline summary::-webkit-details-marker { display: none; }
.toc--inline summary::after { content: ""; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -4px 4px 0; transition: transform .15s; }
.toc--inline[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.toc--inline .toc__list { padding: 0 16px 12px; }
.toc--inline .toc__item a { padding-block: 7px; border-top: 1px solid var(--line); }

/* Метки и соседние записи */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 0; padding: 0; list-style: none; }
.tags a { display: inline-block; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); text-decoration: none; }
.tags a:hover { border-color: var(--rhw-blue-ink); color: var(--rhw-blue-ink); }

/* Обычные таблицы из редактора. Столбцы по содержимому; если не помещаются (телефон) —
   таблица прокручивается вбок, а не сжимается до слов по буквам. */
.entry-content .wp-block-table { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.entry-content .wp-block-table table { table-layout: auto !important; min-width: min(640px, 100%); }
@media (max-width: 700px) { .entry-content .wp-block-table table { min-width: 640px; } }
.entry-content .wp-block-table :is(th, td) { font-variant-numeric: tabular-nums; }
.entry-content .wp-block-table :is(th, td):first-child { min-width: 11em; }
.entry-content .wp-block-table thead th { font-size: 13px; line-height: 1.3; vertical-align: bottom; }
.entry-content .wp-block-table figcaption { margin-top: 8px; }
.entry-content table:not(.rhwt-table):not(.rhwt-cmptable) { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--surface); }
.entry-content table:not(.rhwt-table):not(.rhwt-cmptable) :is(th, td) { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.entry-content table:not(.rhwt-table):not(.rhwt-cmptable) thead th { background: var(--surface-2); }

/* Таблицы плагина RHW Tables — в цветах темы (светлой и тёмной) */
.rhwt {
	--rhwt-bg-page: var(--surface); --rhwt-surface: var(--surface-2);
	--rhwt-line: var(--line); --rhwt-line-strong: var(--line-strong);
	--rhwt-text: var(--fg); --rhwt-muted: var(--muted);
	--rhwt-accent: var(--rhw-blue-ink); --rhwt-accent-fill: var(--rhw-blue-btn);
	--rhwt-accent-soft: var(--accent-soft); --rhwt-picked: var(--accent-soft);
	--rhwt-badge-ring: var(--badge-ring); --rhwt-shadow: var(--shadow);
	--rhwt-font-data: var(--font-mono); --rhwt-radius: var(--radius);
}
/* Шапка таблицы прилипает под закреплённой шапкой сайта, а не под краем окна */
.rhwt .rhwt-scroll { max-height: calc(100vh - var(--header-h) - 40px); max-height: calc(100dvh - var(--header-h) - 40px); }

/* ================= Лента, рубрики, поиск ================= */
.listing { min-width: 0; }
.listing__header { margin-bottom: clamp(18px, 2vw, 28px); max-width: var(--measure); }
.listing__title { margin: 0; font-weight: 800; font-size: clamp(28px, 3.2vw, 44px); letter-spacing: -.01em; }
.listing__title--small { margin: 0 0 16px; font-size: clamp(22px, 2.2vw, 28px); }
.listing__desc { margin-top: 10px; color: var(--muted); font-size: 16px; }
.listing__desc p { margin: 0 0 .6em; }
.listing__search { margin-top: 16px; max-width: 520px; }

/* Разделы базы знаний */
.sections { margin-bottom: clamp(28px, 3vw, 44px); }
.sections__title { margin: 0 0 12px; font: 500 12px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.sections__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.section-tile {
	display: grid; gap: 4px; height: 100%; padding: 14px 16px; text-decoration: none; color: var(--fg);
	background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--rhw-blue); border-radius: var(--radius);
	transition: border-color .15s, background .15s;
}
.section-tile:hover { border-color: var(--rhw-blue); background: var(--surface-2); text-decoration: none; }
.section-tile__name { font: 700 17px/1.25 var(--font-display); }
.section-tile__count { font: 500 12px/1.3 var(--font-mono); color: var(--muted); }
.section-tile__desc { font-size: 14px; color: var(--muted); line-height: 1.45; }
/* Плитка с подпунктами: название — ссылка на всю плитку, подпункты — свои ссылки поверх */
div.section-tile { position: relative; align-content: start; }
.section-tile__link { color: inherit; text-decoration: none; }
.section-tile__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.section-tile__link:focus-visible { outline: none; }
div.section-tile:focus-within { outline: 2px solid var(--rhw-blue); outline-offset: 2px; }
.section-tile__sub { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.section-tile__sub a {
	display: inline-block; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line);
	font-size: 13px; line-height: 1.5; color: var(--muted); text-decoration: none; background: var(--surface);
}
.section-tile__sub a:hover { border-color: var(--rhw-blue-ink); color: var(--rhw-blue-ink); }
.sections--section .sections__title { margin-top: 8px; }
.sections--section .sections__list + .sections__title { margin-top: 22px; }
.listing__empty { color: var(--muted); }

/* Карточки записей. Ссылка-заголовок растянута на всю карточку, ссылка на рубрику — поверх неё. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.card {
	position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s;
}
.card:hover { border-color: var(--rhw-blue); }
.card:focus-within { outline: 2px solid var(--rhw-blue); outline-offset: 2px; }
.card__thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__body { display: grid; gap: 6px; padding: 14px 16px 18px; align-content: start; }
.card__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; font: 500 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.card__cat { position: relative; z-index: 1; color: var(--rhw-blue-ink); text-decoration: none; }
.card__cat:hover { text-decoration: underline; }
.card__title { margin: 0; font: 700 19px/1.25 var(--font-display); }
.card__link { color: inherit; text-decoration: none; }
.card__link:focus-visible { outline: none; }
.card__link::after { content: ""; position: absolute; inset: 0; }
.card__excerpt { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pagination .page-numbers {
	display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; padding: 0 12px;
	border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; color: var(--fg);
}
.pagination .page-numbers:hover { border-color: var(--rhw-blue-ink); }
.pagination .page-numbers.current { background: var(--rhw-blue-btn); border-color: var(--rhw-blue-btn); color: #fff; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.post-nav a { display: grid; gap: 2px; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); text-decoration: none; font-weight: 600; line-height: 1.35; }
.post-nav a:hover { border-color: var(--rhw-blue); }
.post-nav small { font: 500 11px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.post-nav__next { grid-column: 2; text-align: right; }

/* ================= Подвал ================= */
.site-footer { background: var(--band); color: var(--band-muted); border-top: 3px solid var(--rhw-blue); }
.site-footer__inner {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 32px;
	padding-block: 40px 32px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.site-footer__about { display: grid; gap: 14px; align-content: start; max-width: 42ch; }
.site-footer__about p { margin: 0; font-size: 15px; }
.site-footer__title {
	margin: 0 0 12px; font: italic 700 13px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--rhw-blue-ink);
}
.site-footer .social { display: grid; gap: 8px; }
.site-footer .social a, .footer-menu a { padding: 0; border: 0; border-radius: 0; color: var(--band-fg); font-size: 15px; text-decoration: none; }
.site-footer .social a:hover, .footer-menu a:hover { color: var(--rhw-blue-ink); }
.footer-menu { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-footer__bottom {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
	padding-block: 16px max(16px, env(safe-area-inset-bottom, 0px)); padding-left: var(--gutter-l); padding-right: var(--gutter-r);
	border-top: 1px solid var(--band-line); font-size: 13px;
}
.site-footer__tagline { color: var(--rhw-blue-ink); font: italic 700 13px/1.4 var(--font-display); text-transform: uppercase; letter-spacing: .06em; }

/* ================= Узкие экраны ================= */
@media (max-width: 600px) {
	.entry-content { font-size: 16px; line-height: 1.65; }
	.entry-content .alignleft, .entry-content .alignright { float: none; margin: 0 0 1em; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav__next { grid-column: 1; }
	.card__title { font-size: 18px; }
	/* Разделы на телефоне — компактно, в две колонки */
	.sections__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.section-tile { padding: 10px 12px; }
	.section-tile__name { font-size: 15px; }
	.section-tile__desc { display: none; }
	.sections--section .sections__list, .sections__list:has(.section-tile__sub) { grid-template-columns: 1fr; } /* с описаниями или подразделами — в одну колонку */
	.sections__list:has(.section-tile__sub) .section-tile__desc { display: block; }
	.sections--section .section-tile__desc { display: block; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
@media print {
	.site-header, .site-footer, .entry-aside, .toc, .post-nav { display: none !important; }
	body { background: #fff; color: #000; }
}

/* Подразделы страницы-раздела (например, «Таблицы») */
.sections--pages { margin-top: clamp(24px, 3vw, 36px); }

/* ================= Главная ================= */
.home { display: grid; gap: clamp(28px, 3.4vw, 48px); min-width: 0; }
.home > * { min-width: 0; }
.home .sections { margin-bottom: 0; }
.home-hero { padding: clamp(8px, 2vw, 28px) 0 0; max-width: 900px; }
.home-hero__title { margin: 0; font-weight: 800; font-size: clamp(30px, 4vw, 52px); letter-spacing: -.015em; }
.home-hero__lead { margin: 12px 0 0; font-size: clamp(16px, 1.4vw, 19px); color: var(--muted); max-width: 60ch; }
.home-hero__search { margin-top: 22px; max-width: 680px; }
.home-hero__search .search-field { min-height: 52px; font-size: 17px; padding-inline: 16px; }
.home-hero__search .search-submit { min-height: 52px; padding-inline: 22px; background: var(--rhw-blue-btn); border-color: var(--rhw-blue-btn); color: #fff; }
.home-hero__quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; }
.home-hero__quick-label { margin-right: 4px; font: 500 12px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-decoration: none; }
.home-intro { max-width: var(--measure); }

.home-block__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.home-block__title { margin: 0; font-weight: 800; font-size: clamp(21px, 2vw, 27px); }
.home-block__more { font-weight: 500; font-size: 15px; text-decoration: none; }
.home-block__more:hover { text-decoration: underline; }
.home-split { display: grid; gap: clamp(28px, 3vw, 40px); }
@media (min-width: 1100px) {
	.home-split:not(.home-split--single) { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
}
.home-social .social a { color: var(--fg); border-color: var(--line); background: var(--surface); font-size: 15px; padding: 8px 16px; }

/* Плашки-ссылки (быстрые ссылки, категории товаров) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.chip {
	display: inline-block; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-strong);
	background: var(--surface); color: var(--fg); font-size: 14px; line-height: 1.4; text-decoration: none;
}
.chip:hover { border-color: var(--rhw-blue-ink); color: var(--rhw-blue-ink); }
.chip.is-current { background: var(--rhw-blue-btn); border-color: var(--rhw-blue-btn); color: #fff; }

/* ================= Обзоры: карточки и плеер ================= */
.cards--reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card--wide { grid-column: 1 / -1; }
@media (min-width: 760px) {
	.card--wide { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto; }
	.card--wide .card__thumb { aspect-ratio: auto; min-height: 100%; }
	.card--wide .card__body { padding: 20px 22px; align-content: center; }
	.card--wide .card__title { font-size: clamp(21px, 2vw, 26px); }
}
@media (max-width: 600px) { .cards--reviews { grid-template-columns: 1fr; } }
.card__thumb { position: relative; }
.card__play, .video__play {
	position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
	background: rgba(0, 0, 0, .62); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}
.card__play::after, .video__play::after {
	content: ""; position: absolute; left: 23px; top: 18px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff;
}
.card__badge { padding: 0 6px; border-radius: 3px; background: var(--rhw-red); color: #fff; letter-spacing: .05em; }

.video { position: relative; margin: 0 0 24px; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #0b0f14; }
.video iframe, .video__cover { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__cover { padding: 0; cursor: pointer; background: #0b0f14; color: #fff; }
.video__img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; transition: opacity .15s; }
.video__cover:hover .video__img { opacity: 1; }
.video__cover:hover .video__play { background: var(--rhw-red); }
.video__play { width: 76px; height: 76px; margin: -38px 0 0 -38px; transition: background .15s; }
.video__play::after { left: 30px; top: 24px; border-width: 14px 0 14px 23px; }
.video__on { position: absolute; left: 12px; bottom: 12px; padding: 3px 9px; border-radius: 4px; background: rgba(0, 0, 0, .65); font: 500 12px/1.4 var(--font-mono); letter-spacing: .05em; }
.video--file video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.video__also { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -10px 0 24px; font-size: 14px; color: var(--muted); }
.video__link {
	display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 14px; border-radius: 6px;
	border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font-weight: 600; text-decoration: none;
}
.video__link::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--muted); }
.video__link--youtube::before { background: #ff0033; }
.video__link--vk::before { background: #0077ff; }
.video__link--rutube::before { background: #00a6ff; }
.video__link:hover { border-color: var(--rhw-blue-ink); text-decoration: none; }

/* ================= Новости ================= */
.rows { display: grid; gap: 0; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row__date { font: 500 12px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 2px; }
.row__title { margin: 0; font: 700 18px/1.3 var(--font-display); }
.row__title a { color: var(--fg); text-decoration: none; }
.row__title a:hover { color: var(--rhw-blue-ink); }
.row__excerpt { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.rows--compact .row { padding: 11px 0; }
.rows--compact .row__title { font-size: 16px; }
.rows--compact .row__excerpt { display: none; }
/* Превью новости справа (2.5.2): обложка или первая картинка из текста, 16:9. */
.row--thumb { grid-template-columns: 64px minmax(0, 1fr) 160px; align-items: start; }
.row__thumb { display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2, var(--line)); border: 1px solid var(--line); }
.row__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.row__thumb:hover img { transform: scale(1.04); }
.rows--compact .row--thumb { grid-template-columns: 64px minmax(0, 1fr) 112px; align-items: center; }
@media (max-width: 640px) {
	.row--thumb, .rows--compact .row--thumb { grid-template-columns: 64px minmax(0, 1fr) 88px; gap: 12px; }
}
.source { margin: 24px 0 0; padding: 10px 14px; border-left: 3px solid var(--line-strong); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; font-size: 14px; color: var(--muted); }

/* ================= Магазин ================= */
.cards--products { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.card__thumb--square { aspect-ratio: 1 / 1; background: var(--surface-2); }
.card__noimg { display: block; width: 100%; height: 100%; min-height: 120px; background:
	linear-gradient(135deg, transparent 47%, var(--line) 47%, var(--line) 53%, transparent 53%) center / 28px 28px, var(--surface-2); }
.card__price { margin: 4px 0 0; font: 700 18px/1.2 var(--font-display); color: var(--fg); }
.stock { display: inline-block; padding: 0 7px; border-radius: 3px; font: 500 11px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; vertical-align: middle; }
.stock--in_stock { background: rgba(16, 150, 72, .14); color: #12804a; }
.stock--to_order { background: var(--accent-soft); color: var(--rhw-blue-ink); }
.stock--out { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .stock--in_stock { color: #4fd18b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stock--in_stock { color: #4fd18b; } }

.product { min-width: 0; }
.product__top { display: grid; gap: clamp(20px, 3vw, 44px); align-items: start; }
@media (min-width: 860px) { .product__top { grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); } }
@media (min-width: 1400px) { .product__top { grid-template-columns: minmax(0, 640px) minmax(320px, 520px); } }
.product__gallery { max-width: 640px; }
.product__main { aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.product__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.product__thumb { width: 72px; height: 72px; padding: 0; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); cursor: pointer; }
.product__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product__thumb.is-current, .product__thumb:hover { border-color: var(--rhw-blue); }
.product__info { display: grid; gap: 14px; align-content: start; }
@media (min-width: 860px) { .product__info { position: sticky; top: calc(var(--header-h) + 24px); } }
.product__info .entry-meta { margin: 0; }
.product__title { margin: 0; font-weight: 800; font-size: clamp(26px, 3vw, 38px); }
.product__price { margin: 0; font: 800 clamp(24px, 2.4vw, 30px)/1.2 var(--font-display); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.product__lead { margin: 0; font-size: 17px; color: var(--muted); }
.product__note { margin: 0; font-size: 14px; color: var(--muted); }
.product__desc { margin-top: clamp(28px, 3vw, 44px); max-width: var(--col); }
.product__h { margin: 0 0 12px; font-size: clamp(21px, 2vw, 26px); font-weight: 800; }

.btn--order { background: #0077ff; border-color: #0077ff; color: #fff; font-weight: 700; min-height: 48px; } /* цвет ВКонтакте */
.btn--order:hover { background: #0062d1; border-color: #0062d1; color: #fff; }
.btn--order.btn--block { margin-top: 0; }

/* Полоса «Как заказать» / «Сборка на заказ» */
.order-band {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
	margin-top: clamp(24px, 3vw, 40px); padding: clamp(18px, 2.4vw, 28px) clamp(18px, 2.6vw, 32px);
	background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--rhw-blue); border-radius: var(--radius);
}
.order-band > div { flex: 1 1 420px; max-width: 70ch; }
.order-band p { margin: 0; color: var(--muted); }
.order-band .order-band__title { margin-bottom: 6px; color: var(--fg); font: 800 clamp(19px, 1.8vw, 24px)/1.25 var(--font-display); }
.home .order-band { margin-top: 0; }
.order-band--build { border-left-color: var(--rhw-red); }

/* ================= 2.4.0 ================= */

/* Обзоры на главной (2.4.1): средние карточки — обложка слева (55 %), текст справа.
   Две карточки в ряд на широком экране, на телефоне — обложка сверху. */
.cards--reviews { grid-template-columns: repeat(auto-fill, minmax(min(100%, 600px), 1fr)); }
.card--compact { grid-template-columns: minmax(0, 55%) minmax(0, 1fr); grid-template-rows: auto; }
.card--compact .card__thumb { aspect-ratio: 16 / 9; }
.card--compact .card__body { gap: 8px; padding: 16px 20px; align-content: center; }
.card--compact .card__title { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.25; }
.card--compact .card__excerpt {
	font-size: 14.5px; line-height: 1.5;
	display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 640px) {
	.card--compact { grid-template-columns: 1fr; }
	.card--compact .card__body { padding: 12px 16px 16px; }
	.card--compact .card__excerpt { -webkit-line-clamp: 3; }
}

/* Заголовки блоков главной — ссылки на разделы */
.home-block__title a { color: inherit; text-decoration: none; }
.home-block__title a:hover { color: var(--rhw-blue-ink); }
.home-block__title a::after { content: " →"; font-weight: 600; opacity: 0; transition: opacity .15s; }
.home-block__title a:hover::after, .home-block__title a:focus-visible::after { opacity: 1; }

/* Превью таблицы на главной */
.home-table__scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.home-table__table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.home-table__table th, .home-table__table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.home-table__table tbody tr:last-child > * { border-bottom: 0; }
.home-table__table thead th {
	background: var(--surface-2); color: var(--muted); font: 500 11px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .06em;
}
.home-table__table tbody th { font-weight: 700; color: var(--fg); }
.home-table__table tbody tr:hover > * { background: var(--surface-2); }
.home-table__table .home-table__st { text-align: center; width: 1%; }
.home-table__tdp { opacity: .7; }
.home-table__table .st {
	display: inline-block; min-width: 64px; padding: 2px 6px; border-radius: 4px; text-align: center;
	background: var(--st-bg, var(--surface-2)); color: var(--st-fg, var(--fg)); font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
}
.home-table__table .st--badge { min-width: 0; font-size: 12.5px; letter-spacing: 0; }
.home-table__table .st__short { display: none; }
.home-table__note { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
	.home-table__table .home-table__phases, .home-table__table .home-table__mosfet, .home-table__table .home-table__chipset, .home-table__tdp { display: none; }
	.home-table__table { white-space: normal; font-size: 13px; }
	.home-table__table tbody th { min-width: 8em; }
	.home-table__table .st__full + .st__short { display: inline; }
	.home-table__table .st__full:has(+ .st__short) { display: none; }
	.home-table__table th, .home-table__table td { padding: 7px 8px; }
	.home-table__table .st { min-width: 0; padding: 2px 4px; font-size: 10.5px; }
}

/* Соцсети с иконками */
.social__link { display: inline-flex !important; align-items: center; gap: 8px; }
.social__icon { flex-shrink: 0; display: block; border-radius: 6px; }
.home-social .social a { padding: 7px 14px 7px 8px; }
.site-footer .social { gap: 10px; }

/* Карта сайта */
.sitemap { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 28px 32px; margin-top: 8px; align-items: start; }
.sitemap__section { padding: 16px 18px; border: 1px solid var(--line); border-left: 3px solid var(--rhw-blue); border-radius: var(--radius); background: var(--surface); }
.sitemap__title { margin: 0 0 10px; font: 700 19px/1.25 var(--font-display); }
.sitemap__title a { color: inherit; text-decoration: none; }
.sitemap__title a:hover { color: var(--rhw-blue-ink); }
.sitemap ul { margin: 0; padding: 0; list-style: none; }
.sitemap__list > li { margin: 6px 0; }
.sitemap__list--2, .sitemap__posts { margin: 4px 0 8px 14px !important; padding-left: 10px !important; border-left: 1px solid var(--line); }
.sitemap__posts li { margin: 3px 0; font-size: 14px; }
.sitemap a { color: var(--fg); text-decoration: none; }
.sitemap a:hover { color: var(--rhw-blue-ink); text-decoration: underline; }
.sitemap__heading { display: block; margin-top: 10px; font: 500 11px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

/* Средние экраны (1201–1500 px): поиск в шапке свёрнут в кнопку-лупу и раскрывается
   поверх меню, когда в него переходят (клик или Tab). Иначе длинные названия разделов
   («База компонентов», «Совместимость», «Полезный софт») и кнопка «Заказать компьютер»
   не помещаются в одну строку и меню переносится на вторую. */
@media (min-width: 1201px) and (max-width: 1500px) {
	.header-search { position: relative; flex: 0 0 40px; min-width: 40px; height: 40px; }
	.header-search .search-form { position: absolute; right: 0; top: 0; width: 40px; transition: width .18s ease; z-index: 5; }
	.header-search .search-field { padding-right: 0; cursor: pointer; }
	.header-search .search-field::placeholder { color: transparent; }
	.header-search:focus-within .search-form { width: 280px; }
	.header-search:focus-within .search-field { cursor: text; padding-right: 12px; }
	.header-search:focus-within .search-field::placeholder { color: var(--band-muted); }
}

/* Карта сайта в подвале (2.4.1) */
.footer-map {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 24px 24px; align-items: start;
	padding-block: 28px 32px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
	border-top: 1px solid var(--band-line);
}
.footer-map__title { margin: 0 0 10px; font: italic 700 13px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .08em; }
.footer-map__title a { color: var(--rhw-blue-ink); text-decoration: none; }
.footer-map__title a:hover { text-decoration: underline; }
.footer-map__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.footer-map__list a { color: var(--band-fg); font-size: 14px; text-decoration: none; }
.footer-map__list a:hover { color: var(--rhw-blue-ink); }
.footer-map__heading { margin-top: 4px; font: 500 10.5px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--band-muted); }
@media (max-width: 600px) {
	.footer-map { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
}
.footer-map__list li { line-height: 1.35; }
.footer-map__title { color: var(--rhw-blue-ink); }

/* 2.5.1: подвал — кнопка заказа как в шапке, без полной карты сайта */
.site-footer__cta { margin: 16px 0 0; }
.site-footer__cta .btn--cta { min-height: 40px; padding: 6px 16px; font-size: 13px; } /* как .header-cta */
