/*
Theme Name: Jurist16 Blog
Description: Тема юридического блога в оформлении главной jurist16.ru: тёмно-синий фон, золотой акцент, «стеклянные» карточки. Лента статей, боковая колонка, поддержка бегущей строки и калькуляторов из плагина «Юрист16 — инструменты».
Version: 2.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: jurist16-blog
*/

/* =========================================================
   ТОКЕНЫ

   Два слоя:
   1) --j-*      — бренд: те же имена и значения, что в плагине главной
                   (j16-landing/assets/css/front.css), чтобы сайты читались
                   как одна система.
   2) семантические (--bg, --surface, --accent, --line …) — их имена
                   сохранены от прежней версии темы намеренно: на них
                   завязаны калькуляторы (plugins/jurist16-tools/assets/
                   calc395.css строит из них свои --c-*) и бегущая строка.
                   Меняются значения, не имена, — плагин перекрашивается сам.
   ========================================================= */

:root {
	/* ---- бренд: одинаков в обеих темах ---- */
	--j-accent: #E8C377;
	--j-accent-rgb: 232, 195, 119;
	--j-accent-2: #FF8562;

	--j-font-body: 'Manrope', system-ui, sans-serif;
	--j-font-head: 'Manrope', system-ui, sans-serif;
	--j-font-accent: 'Cuprum', system-ui, sans-serif;

	--j-max: 1280px;
	--j-body: 17px;
	--j-caps: 13px;
	--j-menu: 17px;
	--j-btn: 15px;
	--j-phone: 19px;
	--j-h1: 64px;
	--j-h2: 40px;
	--j-h3: 26px;

	/* ---- шапка: тёмная в обеих темах, это продолжение главной ---- */
	--j-head-bg: #05111c;
	--j-head-main: rgba(7, 21, 34, .82);
	--j-head-stuck: rgba(7, 21, 34, .97);

	/* ---- тёмная тема = оформление jurist16.ru ---- */
	--bg: #071522;
	--bg-2: #091a2a;
	--surface: #102033;
	--surface-2: #16293e;
	--text: #FFFFFF;
	--text-2: rgba(255, 255, 255, .78);
	--muted: rgba(255, 255, 255, .55);
	--line: rgba(255, 255, 255, .11);
	--line-2: rgba(255, 255, 255, .07);
	--accent: #E8C377;
	--accent-ink: #10202f;
	--accent-soft: #241f14;
	--accent-txt: #E8C377;
	--navy-1: #04101a;
	--navy-2: #0d2338;
	--ok: #6cc79c;
	--ok-soft: #14291f;
	--warn: #e6b84a;
	--warn-soft: #2b2312;

	--radius: 22px;
	--radius-sm: 14px;
	--shadow: 0 2px 4px rgba(0, 0, 0, .22), 0 12px 30px rgba(0, 0, 0, .26);

	/* «Стекло» карточек: поверхность, фаска и тень наведения */
	--glass: linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .027));
	--glass-blur: blur(18px);
	--bevel: inset 0 1px 0 rgba(255, 255, 255, .07);
	--shadow-h: 0 3px 6px rgba(0, 0, 0, .28), 0 28px 60px rgba(0, 0, 0, .45), 0 12px 44px rgba(var(--j-accent-rgb), .12);
	--glow: 1;
}

/*
 * Светлая тема — запасной вариант на тех же токенах: бумажный фон,
 * чернила корпоративного тёмно-синего. «Стекло» на светлом не читается,
 * поэтому поверхности становятся плотными. Золото раздвоено: --accent
 * остаётся насыщенным для заливок (на нём тёмные чернила, контраст 8,6:1),
 * --accent-txt притушён до контрастного на белом (5,9:1).
 */
:root[data-theme="light"] {
	--bg: #F2F0EA;
	--bg-2: #ECE8E0;
	--surface: #FFFFFF;
	--surface-2: #F7F4EE;
	--text: #0C1A29;
	--text-2: rgba(12, 26, 41, .76);
	--muted: rgba(12, 26, 41, .54);
	--line: rgba(12, 26, 41, .13);
	--line-2: rgba(12, 26, 41, .08);
	--accent: #C9A44C;
	--accent-ink: #10202f;
	--accent-soft: #F5EBD5;
	--accent-txt: #8A6520;
	--ok: #23845a;
	--ok-soft: #dcf1e6;
	--warn: #9a6a00;
	--warn-soft: #f6ecd2;

	--shadow: 0 1px 2px rgba(12, 26, 41, .06), 0 10px 26px rgba(12, 26, 41, .08);
	--glass: linear-gradient(145deg, #FFFFFF, #FBF9F5);
	--glass-blur: none;
	--bevel: inset 0 1px 0 rgba(255, 255, 255, .9);
	--shadow-h: 0 2px 4px rgba(12, 26, 41, .08), 0 22px 48px rgba(12, 26, 41, .14), 0 10px 34px rgba(var(--j-accent-rgb), .28);
	--glow: .35;
}

/* =============================================================== БАЗА */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--j-font-body);
	font-size: var(--j-body);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Сброс с нулевой специфичностью — чтобы отступы ниже не приходилось продавливать */
:where(body) :where(p, ul, ol, h1, h2, h3, h4) { margin: 0; padding: 0; }
:where(body) :where(ul, ol) { list-style: none; }

.wrap {
	width: 100%;
	max-width: var(--j-max);
	margin: 0 auto;
	padding: 0 24px;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
.skip-link:focus {
	clip-path: none;
	height: auto;
	width: auto;
	left: 8px;
	top: 8px;
	z-index: 100000;
	background: var(--accent);
	color: var(--accent-ink);
	padding: 10px 14px;
	border-radius: 8px;
}

::selection { background: rgba(var(--j-accent-rgb), .3); color: var(--text); }

:where(a, button, input, summary):focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ======================================================= ТИПОГРАФИКА */

/* Крупный заголовок первого экрана. Вторая строка золотая — приём с главной */
.hero-title {
	display: flex;
	flex-direction: column;
	align-items: center;
	font-family: var(--j-font-head);
	font-size: clamp(34px, 5.4vw, var(--j-h1));
	font-weight: 700;
	line-height: 1;
	letter-spacing: -.04em;
	margin: 0 0 18px;
}
.hero-title i { font-style: normal; color: var(--accent); }

.feed-head h2,
.related h2 {
	font-family: var(--j-font-head);
	font-size: clamp(26px, 3.4vw, var(--j-h2));
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -.035em;
}

/* Золотая капсула рубрики */
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	width: max-content;
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) - 2px);
	font-weight: 500;
	letter-spacing: .16em;
	text-transform: uppercase;
	line-height: 1.2;
	color: var(--accent-txt);
	background: rgba(var(--j-accent-rgb), .1);
	border: 1px solid rgba(var(--j-accent-rgb), .3);
	border-radius: 100px;
	padding: 7px 15px;
	transition: border-color .2s ease, background-color .2s ease;
}
a.chip:hover { border-color: rgba(var(--j-accent-rgb), .6); background: rgba(var(--j-accent-rgb), .18); }

/* Галочка в кружке */
.tick {
	width: 20px;
	height: 20px;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	line-height: 1;
	color: var(--accent-txt);
	background: linear-gradient(160deg, rgba(var(--j-accent-rgb), .2), rgba(var(--j-accent-rgb), .06));
	border: 1px solid rgba(var(--j-accent-rgb), .34);
	border-radius: 50%;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

/* =========================================================== КНОПКИ */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-family: var(--j-font-body);
	font-size: var(--j-btn);
	font-weight: 700;
	line-height: 1;
	padding: 16px 26px;
	border: 1px solid transparent;
	border-radius: 12px;
	text-align: center;
	background: var(--accent);
	color: var(--accent-ink);
	box-shadow: 0 6px 22px rgba(var(--j-accent-rgb), .18);
	transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn:hover {
	background: #f3d693;
	transform: translateY(-2px);
	box-shadow: 0 10px 30px rgba(var(--j-accent-rgb), .3);
}
.btn--sm { padding: 13px 20px; font-size: calc(var(--j-btn) - 1.5px); }
.btn--ghost {
	background: rgba(255, 255, 255, .06);
	border-color: rgba(255, 255, 255, .18);
	color: #fff;
	box-shadow: none;
}
.btn--ghost:hover { background: rgba(255, 255, 255, .13); box-shadow: none; }

/* Свечение по краю: угол и близость курсора задаёт assets/theme.js */
.j16-glow { position: relative; overflow: hidden; }
.j16-glow .glow-light {
	position: absolute;
	inset: -1px;
	border-radius: inherit;
	padding: 1px;
	background: conic-gradient(from var(--angle, 0deg), transparent 0deg, rgba(255, 255, 255, .95) 22deg, transparent 60deg);
	opacity: calc(var(--edge, 0) / 100);
	transition: opacity .2s ease;
	pointer-events: none;
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
}

/* ================================================== БЕГУЩАЯ СТРОКА */
/*
 * Разметку и механику прокрутки задаёт плагин (ticker.css + ticker.js) —
 * трогаем только цвета и шрифты. Строка остаётся тёмной в обеих темах:
 * это продолжение шапки, поэтому цвета заданы явно, а не через токены.
 */
.j16-ticker {
	background: var(--navy-1);
	color: rgba(255, 255, 255, .8);
	font-family: var(--j-font-body);
	font-size: calc(var(--j-caps) + 1px);
	border-bottom: 1px solid rgba(var(--j-accent-rgb), .16);
}
.j16-ticker .ticker-label {
	gap: 9px;
	padding: 0 16px;
	background: var(--j-accent);
	color: #10202f;
	font-family: var(--j-font-accent);
	font-size: var(--j-caps);
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
}
.j16-ticker .ticker-label::before { width: 6px; height: 6px; }
.j16-ticker .t-item::before { color: var(--j-accent); }
.j16-ticker .t-item b {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-body) - 2px);
	color: var(--j-accent);
}
.j16-ticker .t-item small { color: rgba(255, 255, 255, .55); }
.j16-ticker .t-pause { border-left-color: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .7); }
.j16-ticker .t-pause:hover { background: rgba(var(--j-accent-rgb), .1); color: var(--j-accent); }

/* ============================================================ ШАПКА */

/*
 * Шапка «прилипает» к верху, как фиксированная на главной. Sticky, а не
 * fixed: блог длинный, и полоса не должна съедать высоту первого экрана.
 * color задан явно — полоса тёмная в обеих темах, а в светлой body
 * получает тёмные чернила, которые иначе унаследовались бы сюда.
 */
.site-header {
	position: sticky;
	top: 0;
	/* не даёт отрицательному margin верхней строки «протечь» наружу шапки — иначе при прилипании над меню оставался зазор */
	display: flow-root;
	z-index: 90;
	color: #fff;
}

/* Верхняя строка с контактами */
.head-top {
	background: var(--j-head-bg);
	border-bottom: 1px solid rgba(255, 255, 255, .067);
	transition: margin-top .3s ease, opacity .3s ease;
}
.head-top-in {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: 38px;
}
.topline { display: flex; align-items: center; gap: 30px; min-width: 0; }
.topline__i {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: var(--j-caps);
	line-height: 1;
	color: rgba(255, 255, 255, .72);
	white-space: nowrap;
}
.topline__i::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--j-accent);
	opacity: .7;
	flex: none;
}
.topline__mail { transition: color .2s ease; }
.topline__mail:hover { color: var(--j-accent); }

/* Основная строка */
.head-main {
	background: var(--j-head-main);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid transparent;
	transition: background-color .3s ease, border-color .3s ease;
}
/* Класс ставит theme.js при прокрутке */
.site-header.is-stuck .head-main {
	background: var(--j-head-stuck);
	border-bottom-color: rgba(255, 255, 255, .08);
}
.site-header.is-stuck .head-top { margin-top: -40px; opacity: 0; }

.bar {
	display: flex;
	align-items: center;
	gap: 28px;
	height: 80px;
	position: relative;
}

/* ---- Логотип: золотой щит + «ЮРИСТ ГАЛИУЛЛИН И.И.» ---- */
.logo { display: flex; align-items: center; gap: 12px; flex: none; min-width: 0; }
.logo-mark { width: 34px; height: 34px; color: var(--j-accent); flex: none; }
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo .custom-logo { max-height: 46px; width: auto; }
.logo-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.logo-name {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) * 1.54);
	font-weight: 600;
	letter-spacing: .04em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
}
.logo-name i { font-style: normal; color: var(--j-accent); margin-left: 6px; }
.logo-sub {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) - 4px);
	letter-spacing: .16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .5);
	line-height: 1.3;
}

/* ---- Меню ---- */
.site-nav { margin-left: auto; }
.site-nav .menu { display: flex; align-items: center; gap: 28px; }
.site-nav li { position: relative; }
.site-nav > .menu > li > a {
	position: relative;
	display: block;
	font-family: var(--j-font-accent);
	font-size: var(--j-menu);
	font-weight: 500;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .84);
	padding: 6px 0;
	white-space: nowrap;
	transition: color .2s ease;
}
/* Подчёркивание растёт слева направо — приём с главной */
.site-nav > .menu > li > a::after {
	content: "";
	position: absolute;
	left: 0; right: 100%; bottom: 0;
	height: 1px;
	background: var(--j-accent);
	transition: right .25s ease;
}
.site-nav > .menu > li > a:hover,
.site-nav > .menu > .current-menu-item > a,
.site-nav > .menu > .current-menu-ancestor > a,
.site-nav > .menu > .current-menu-parent > a { color: var(--j-accent); }
.site-nav > .menu > li > a:hover::after,
.site-nav > .menu > .current-menu-item > a::after,
.site-nav > .menu > .current-menu-ancestor > a::after,
.site-nav > .menu > .current-menu-parent > a::after { right: 0; }

/*
 * Стрелка у пункта с подменю.
 * Селектор обязан повторять `.site-nav > .menu > li > a` — иначе `display: block`
 * оттуда перебивает flex по специфичности, ссылка остаётся блочной, order на
 * стрелку не действует и она встаёт перед текстом вместо того, чтобы идти после.
 */
.site-nav > .menu > li.menu-item-has-children > a { display: flex; align-items: center; gap: 7px; }
.site-nav > .menu > li.menu-item-has-children > a::before {
	content: "";
	order: 2;
	width: 6px; height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform .2s ease;
}
.site-nav > .menu > li.menu-item-has-children:hover > a::before,
.site-nav > .menu > li.menu-item-has-children:focus-within > a::before { transform: translateY(1px) rotate(-135deg); }

.site-nav .sub-menu {
	position: absolute;
	top: calc(100% + 14px);
	left: -18px;
	min-width: 260px;
	padding: 10px;
	background: rgba(9, 24, 39, .97);
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: var(--radius-sm);
	backdrop-filter: blur(14px);
	box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
	display: none;
	z-index: 40;
}
/*
 * Мостик над разрывом в 14 px между пунктом и списком. Без него курсор,
 * идущий вниз, пересекает полосу, где нет ни пункта, ни списка: li теряет
 * :hover, и список закрывается раньше, чем до него доводят мышь.
 * Мостик висит на самом списке, а не на пункте — тогда он повторяет его
 * ширину (курсор может идти и по диагонали) и существует только пока
 * список открыт, не создавая лишней зоны наведения под меню.
 */
.site-nav .sub-menu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 14px;
}
.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu { display: block; }
.site-nav .sub-menu a {
	display: block;
	padding: 11px 14px;
	border-radius: 9px;
	font-size: calc(var(--j-body) - 2px);
	color: rgba(255, 255, 255, .8);
	white-space: nowrap;
	transition: background-color .2s ease, color .2s ease;
}
.site-nav .sub-menu a:hover,
.site-nav .sub-menu .current-menu-item > a { background: rgba(var(--j-accent-rgb), .12); color: var(--j-accent); }

/*
 * Телефон и кнопка внутри выпадающего меню. На широких экранах они стоят
 * в строке шапки, поэтому здесь скрыты; показываются вместе с бургером.
 */
.nav-extra { display: none; }

/* ---- Правая группа ---- */
.head-right { display: flex; align-items: center; gap: 16px; flex: none; }
.head-phone { display: flex; flex-direction: column; gap: 3px; text-align: right; }
.head-phone-l {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) - 3px);
	letter-spacing: .14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .45);
	line-height: 1;
}
.head-phone-n {
	font-family: var(--j-font-accent);
	font-size: var(--j-phone);
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	transition: color .2s ease;
}
.head-phone:hover .head-phone-n { color: var(--j-accent); }

.menu-toggle {
	display: none;
	width: 46px; height: 46px;
	flex: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	background: rgba(255, 255, 255, .07);
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 10px;
	color: #fff;
}
.menu-toggle span {
	display: block;
	width: 18px; height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Тумблер темы: кружок едет под активный значок ---- */
.theme-toggle {
	position: relative;
	flex: none;
	width: 66px; height: 34px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 999px;
	background: rgba(255, 255, 255, .08);
	display: grid;
	grid-template-columns: 1fr 1fr;
	place-items: center;
	transition: background-color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .15); border-color: rgba(var(--j-accent-rgb), .45); }
.tt-knob {
	position: absolute;
	top: 3px; left: 3px;
	width: 26px; height: 26px;
	border-radius: 50%;
	background: var(--j-accent);
	box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
	transition: transform .3s cubic-bezier(.4, 1.4, .6, 1);
}
.theme-toggle svg {
	position: relative;
	z-index: 1;
	width: 16px; height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: color .3s ease, opacity .3s ease;
}
.theme-toggle .ic-moon { fill: currentColor; stroke: none; }
/* светлая: кружок слева, солнце активно */
.theme-toggle .ic-sun { color: #10202f; opacity: 1; }
.theme-toggle .ic-moon { color: #fff; opacity: .5; }
/* тёмная: кружок справа, луна активна */
:root[data-theme="dark"] .tt-knob { transform: translateX(32px); }
:root[data-theme="dark"] .theme-toggle .ic-sun { color: #fff; opacity: .5; }
:root[data-theme="dark"] .theme-toggle .ic-moon { color: #10202f; opacity: 1; }
.theme-toggle:hover .ic-sun, .theme-toggle:hover .ic-moon { opacity: 1; }

/* ===================================================== ПЕРВЫЙ ЭКРАН */

/* Тёмная подложка первого экрана — держится в обеих темах */
.top {
	position: relative;
	background:
		radial-gradient(circle at 12% 0%, rgba(var(--j-accent-rgb), calc(.1 * var(--glow))), transparent 42%),
		radial-gradient(circle at 88% 100%, rgba(34, 91, 137, calc(.22 * var(--glow))), transparent 46%),
		linear-gradient(180deg, #071522 0%, #0a1c2e 60%, #071522 100%);
	color: #fff;
	border-bottom: 1px solid rgba(255, 255, 255, .07);
	/* Запас снизу держит ряд чипов рубрик целиком внутри тёмной подложки */
	padding-bottom: 88px;
}

.hero { text-align: center; padding-top: 52px; }

.crumbs {
	font-family: var(--j-font-accent);
	font-size: var(--j-caps);
	letter-spacing: .14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .5);
	margin-bottom: 22px;
}
.crumbs a { transition: color .2s ease; }
.crumbs a:hover { color: var(--j-accent); }

/* На странице статьи заголовок первого экрана — это <p>, а не <h1> */
p.hero-title { font-size: clamp(26px, 3.6vw, 42px); }

.hero-sub {
	color: rgba(255, 255, 255, .72);
	font-size: calc(var(--j-body) + 2px);
	max-width: 620px;
	margin: 0 auto 32px;
}
.hero-sub .br-m { display: none; }

/*
 * Только form.search, не просто .search: на странице результатов WordPress
 * добавляет <body> класс «search», и голый селектор накрывал бы сам body —
 * он получал display:flex и max-width:660px, шапка с контентом вставали
 * в строку, а .search input и .search .btn цепляли все поля и кнопки
 * страницы, включая калькуляторы.
 */
form.search {
	display: flex;
	max-width: 660px;
	margin: 0 auto;
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 14px;
	overflow: hidden;
	backdrop-filter: blur(10px);
	transition: border-color .2s ease, box-shadow .2s ease;
}
form.search:focus-within {
	border-color: rgba(var(--j-accent-rgb), .55);
	box-shadow: 0 0 0 4px rgba(var(--j-accent-rgb), .12);
}
form.search input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: none;
	outline: none;
	color: #fff;
	padding: 16px 20px;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}
form.search input::placeholder { color: rgba(255, 255, 255, .5); text-overflow: ellipsis; }
form.search .btn { border-radius: 0; padding: 0 30px; box-shadow: none; }
form.search .btn:hover { transform: none; }

/* ============================================================ ЛЕНТА */

main.wrap { padding-top: 46px; padding-bottom: 80px; }

/*
 * Фильтр по рубрикам заезжает на тёмную подложку первого экрана.
 * Отрицательный отступ должен поднимать ряд выше его собственной высоты (48 px),
 * иначе низ чипов свисает на светлый фон страницы: 46 px отступа main сверху
 * + (-112) поднимают верх ряда на 66 px, низ остаётся на 18 px внутри подложки.
 */
.cats {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
	margin: -112px 0 58px;
	position: relative;
	z-index: 2;
}
.cats a {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) + 1px);
	font-weight: 500;
	letter-spacing: .12em;
	text-transform: uppercase;
	padding: 12px 22px;
	border-radius: 999px;
	color: rgba(255, 255, 255, .78);
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .14);
	backdrop-filter: blur(10px);
	transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.cats a:hover {
	color: var(--j-accent);
	border-color: rgba(var(--j-accent-rgb), .45);
	transform: translateY(-2px);
}
.cats a.on {
	color: #10202f;
	background: var(--j-accent);
	border-color: var(--j-accent);
	box-shadow: 0 6px 22px rgba(var(--j-accent-rgb), .22);
}

/* ---- Блок «С чего начать — Что вам навязали?» ---- */
.start {
	display: grid;
	grid-template-columns: minmax(0, .85fr) minmax(0, 2fr);
	gap: 32px;
	align-items: center;
	position: relative;
	z-index: 1;
	margin: 0 0 32px;
	padding: 30px 34px;
	background: var(--glass);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	backdrop-filter: var(--glass-blur);
	-webkit-backdrop-filter: var(--glass-blur);
	box-shadow: var(--bevel), var(--shadow);
}
.start-kicker {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
	font-family: var(--j-font-accent);
	font-size: var(--j-caps);
	font-weight: 500;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--muted);
}
.start-kicker::before {
	content: "";
	width: 34px;
	height: 1px;
	flex: none;
	background: var(--accent);
}
.start h2 {
	font-family: var(--j-font-head);
	font-size: clamp(22px, 2.6vw, 30px);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -.03em;
	margin-bottom: 12px;
}
.start-sub { color: var(--muted); font-size: calc(var(--j-body) - 2px); line-height: 1.5; }

.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.start-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 56px;
	padding: 13px 18px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface-2);
	font-size: calc(var(--j-body) - 2px);
	font-weight: 500;
	line-height: 1.3;
	transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}
.start-item:hover {
	border-color: rgba(var(--j-accent-rgb), .55);
	background: var(--accent-soft);
	transform: translateY(-2px);
}
.start-item svg {
	width: 18px; height: 18px;
	flex: none;
	fill: none;
	stroke: var(--accent);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform .2s ease;
}
.start-item:hover svg { transform: translateX(3px); }
.start-item.is-chat svg { stroke: #25d366; }

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 32px;
	align-items: start;
}

.feed {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}
/* Заголовок ленты, пустой результат и пагинация — во всю ширину сетки */
.feed-head,
.feed .empty,
.feed .navigation { grid-column: 1 / -1; }

.feed-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}
.feed-head span {
	font-family: var(--j-font-accent);
	font-size: var(--j-caps);
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ---- Карточка статьи ---- */
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 20px;
	background: var(--glass);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	backdrop-filter: var(--glass-blur);
	-webkit-backdrop-filter: var(--glass-blur);
	box-shadow: var(--bevel), var(--shadow);
	overflow: hidden;
	transition: border-color .28s ease, transform .28s cubic-bezier(.22, .61, .36, 1), box-shadow .28s ease;
}
.card:hover {
	border-color: rgba(var(--j-accent-rgb), .42);
	transform: translateY(-7px);
	box-shadow: var(--bevel), var(--shadow-h);
}

/*
 * Обложка. object-position каждой картинке проставляет j16_thumb_style()
 * инлайном — здесь его не задаём, иначе спорили бы с выбранной в админке
 * главной областью (инлайн всё равно сильнее).
 */
.card .ico {
	position: relative;
	aspect-ratio: 16 / 10;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--bg-2);
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
}
.card .ico img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s cubic-bezier(.22, .61, .36, 1);
}
.card:hover .ico img { transform: scale(1.05); }
/* Статья без обложки: вместо снимка — значок из набора темы */
.card .ico svg { width: 56px; height: 56px; color: rgba(var(--j-accent-rgb), .5); }
/* Низ снимка растворяется в карточке, чтобы кадр не спорил с заголовком */
.card .ico::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 45%;
	background: linear-gradient(180deg, transparent, rgba(7, 21, 34, .55));
	pointer-events: none;
}
:root[data-theme="light"] .card .ico::after { background: linear-gradient(180deg, transparent, rgba(12, 26, 41, .26)); }

.card .body { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.card .post-title {
	font-family: var(--j-font-head);
	font-size: calc(var(--j-h3) - 5px);
	font-weight: 700;
	line-height: 1.16;
	letter-spacing: -.025em;
}
.card .post-title a { transition: color .2s ease; }
.card:hover .post-title a { color: var(--accent-txt); }
.card .excerpt {
	color: var(--text-2);
	font-size: calc(var(--j-body) - 2px);
	line-height: 1.6;
}

/* Строка даты, времени чтения и просмотров */
.meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	font-family: var(--j-font-accent);
	font-size: var(--j-caps);
	letter-spacing: .08em;
	color: var(--muted);
}
.card .meta { margin-top: auto; padding-top: 4px; }
.meta > * { display: inline-flex; align-items: center; gap: 7px; }
.meta-icon {
	width: 14px;
	height: 14px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	color: rgba(var(--j-accent-rgb), .75);
}

/* Первая карточка — во всю ширину ленты, снимок слева */
.card.big {
	grid-column: 1 / -1;
	flex-direction: row;
	gap: 28px;
	padding: 24px;
}
.card.big .ico { width: 46%; aspect-ratio: 4 / 3; }
.card.big .post-title { font-size: calc(var(--j-h3) + 4px); }
.card.big .excerpt { font-size: calc(var(--j-body) - 1px); }

.empty {
	padding: 40px;
	text-align: center;
	color: var(--muted);
	background: var(--glass);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

/* ---- Пагинация ---- */
.navigation.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
}
.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	height: 46px;
	padding: 0 14px;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--surface-2);
	font-family: var(--j-font-accent);
	font-size: var(--j-menu);
	color: var(--text-2);
	transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
a.page-numbers:hover { border-color: rgba(var(--j-accent-rgb), .5); color: var(--accent-txt); transform: translateY(-2px); }
.page-numbers.current {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
	font-weight: 600;
}
.page-numbers.dots { border-color: transparent; background: none; }
.screen-reader-text + .nav-links { margin-top: 0; }

/* =================================================== БОКОВАЯ КОЛОНКА */

.side {
	display: flex;
	flex-direction: column;
	gap: 18px;
	position: sticky;
	top: 100px;
}

.box {
	background: var(--glass);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	backdrop-filter: var(--glass-blur);
	-webkit-backdrop-filter: var(--glass-blur);
	box-shadow: var(--bevel), var(--shadow);
	overflow: hidden;
}
.box > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) + 1px);
	font-weight: 500;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--accent-txt);
	cursor: pointer;
	list-style: none;
	transition: background-color .2s ease;
}
.box > summary::-webkit-details-marker { display: none; }
.box > summary:hover { background: rgba(var(--j-accent-rgb), .07); }
.box > summary::after {
	content: "";
	width: 7px; height: 7px;
	flex: none;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform .25s ease;
}
.box[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.box .inner { padding: 2px 22px 22px; }

/* Популярное */
.top-list { display: flex; flex-direction: column; }
.top-list li + li { border-top: 1px solid var(--line-2); }
.top-list a {
	display: block;
	padding: 13px 0 4px;
	font-size: calc(var(--j-body) - 3px);
	line-height: 1.45;
	color: var(--text-2);
	transition: color .2s ease;
}
.top-list a:hover { color: var(--accent-txt); }
.top-list small {
	display: block;
	padding-bottom: 12px;
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) - 1px);
	letter-spacing: .1em;
	color: var(--muted);
}

/* Блоки с кнопкой */
.box .cta p { color: var(--text-2); font-size: calc(var(--j-body) - 2px); margin-bottom: 14px; }
.box .cta .btn { width: 100%; }

/* Калькуляторы */
.calcs { display: flex; flex-direction: column; gap: 18px; }
.calc-item + .calc-item { padding-top: 18px; border-top: 1px solid var(--line-2); }
.calc-item h4 {
	font-family: var(--j-font-head);
	font-size: calc(var(--j-body) - 1px);
	font-weight: 700;
	letter-spacing: -.01em;
	margin-bottom: 6px;
}
.calc-item p { color: var(--muted); font-size: calc(var(--j-body) - 4px); line-height: 1.5; margin-bottom: 12px; }
.calc-item .btn { width: 100%; }

/* Статистика блога */
.stat-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 0;
	font-size: calc(var(--j-body) - 3px);
	color: var(--text-2);
}
.stat-row + .stat-row { border-top: 1px solid var(--line-2); }
.stat-row b {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-body) + 3px);
	font-weight: 600;
	color: var(--accent-txt);
}

/* =========================================================== СТАТЬЯ */

.article { max-width: 960px; margin: 0 auto; }

.back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 18px;
	font-family: var(--j-font-accent);
	font-size: var(--j-caps);
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--muted);
	transition: color .2s ease, gap .2s ease;
}
.back:hover { color: var(--accent-txt); gap: 14px; }
.article > br { display: none; }

.article > h1 {
	font-family: var(--j-font-head);
	font-size: clamp(30px, 4.4vw, 48px);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -.035em;
	margin: 16px 0 14px;
}
.article .lead {
	color: var(--text-2);
	font-size: calc(var(--j-body) + 2px);
	line-height: 1.6;
	margin-bottom: 16px;
}
.article > .meta { padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }

.entry-content { font-size: calc(var(--j-body) + 1px); line-height: 1.75; color: var(--text-2); }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 {
	font-family: var(--j-font-head);
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 700;
	letter-spacing: -.03em;
	line-height: 1.15;
	color: var(--text);
	margin-top: 1.8em;
}
.entry-content h3 {
	font-family: var(--j-font-head);
	font-size: clamp(20px, 2.2vw, 24px);
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--text);
	margin-top: 1.5em;
}
.entry-content a { color: var(--accent-txt); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-thickness: 2px; }
.entry-content strong { color: var(--text); }
.entry-content ul, .entry-content ol { display: flex; flex-direction: column; gap: .6em; padding-left: 0; }
.entry-content ul li { position: relative; padding-left: 19px; }
.entry-content ul li::before {
	content: "";
	position: absolute; left: 0; top: .62em;
	width: 7px; height: 7px;
	flex: none;
	border-radius: 50%;
	background: var(--accent);
}
.entry-content ol { counter-reset: n; }
.entry-content ol li { position: relative; padding-left: 2em; counter-increment: n; }
.entry-content ol li::before {
	content: counter(n) ".";
	position: absolute; left: 0; top: 0;
	flex: none;
	font-family: var(--j-font-accent);
	font-weight: 600;
	color: var(--accent-txt);
	min-width: 1.4em;
}
.entry-content blockquote {
	padding: 20px 24px;
	border-left: 2px solid var(--accent);
	background: var(--surface-2);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	color: var(--text);
}
.entry-content img, .entry-content figure img { border-radius: var(--radius-sm); }
.entry-content figcaption { font-size: calc(var(--j-body) - 4px); color: var(--muted); margin-top: 8px; text-align: center; }
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: calc(var(--j-body) - 2px);
}
.entry-content th, .entry-content td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; }
.entry-content th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); }

/* Примечание под статьёй */
.article .note {
	margin-top: 26px;
	padding: 18px 22px;
	background: var(--warn-soft);
	border: 1px solid rgba(var(--j-accent-rgb), .25);
	border-radius: var(--radius-sm);
	font-size: calc(var(--j-body) - 3px);
	line-height: 1.55;
	color: var(--text-2);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags a {
	padding: 7px 14px;
	border: 1px solid var(--line);
	border-radius: 100px;
	font-size: calc(var(--j-body) - 4px);
	color: var(--muted);
	transition: border-color .2s ease, color .2s ease;
}
.tags a:hover { border-color: var(--accent); color: var(--accent-txt); }

/* ---- Блок автора ---- */
.author-box {
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
	margin-top: 44px;
	padding: 26px 30px;
	background: var(--glass);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	backdrop-filter: var(--glass-blur);
	-webkit-backdrop-filter: var(--glass-blur);
	box-shadow: var(--bevel), var(--shadow);
}
.author-photo {
	width: 92px;
	height: 92px;
	flex: none;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(var(--j-accent-rgb), .4);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.author-info { flex: 1; min-width: 180px; }
.author-label {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) - 2px);
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 8px;
}
.author-name {
	font-family: var(--j-font-head);
	font-size: calc(var(--j-body) + 4px);
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.2;
	color: var(--text);
}
.author-surname { color: var(--accent-txt); }
.author-text { color: var(--text-2); font-size: calc(var(--j-body) - 2px); margin-top: 5px; }
.author-cta { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: none; }
.author-cta .btn {
	font-family: var(--j-font-accent);
	font-size: var(--j-menu);
	letter-spacing: .1em;
}
.author-cta-note {
	font-size: calc(var(--j-caps) - 1px);
	color: var(--muted);
	text-align: center;
}

/* ---- Читайте также ---- */
.related { max-width: 960px; margin: 56px auto 0; }
.related h2 { margin-bottom: 24px; }
.related .feed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.related .card { padding: 16px; }
.related .card .post-title { font-size: calc(var(--j-body) + 1px); }
.related .card .excerpt { display: none; }

/* =========================================================== ПОДВАЛ */

.site {
	border-top: 1px solid var(--line);
	background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .18));
	padding: 64px 0 26px;
}
:root[data-theme="light"] .site { background: linear-gradient(180deg, transparent, rgba(12, 26, 41, .05)); }

.foot-top {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1.3fr;
	gap: 44px;
	padding-bottom: 42px;
}
.foot-brand { display: flex; flex-direction: column; gap: 6px; }
.foot-brand .logo-name { font-size: calc(var(--j-caps) * 1.77); color: var(--text); }
.foot-brand .logo-sub { color: var(--muted); }
.foot-about {
	color: var(--muted);
	font-size: calc(var(--j-body) - 2px);
	line-height: 1.6;
	margin-top: 18px;
}
.foot-label {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) - 1px);
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 26px 0 14px;
}
.foot-col .foot-label { margin-top: 0; }
.foot-phone {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-phone) * 1.37);
	font-weight: 600;
	color: var(--accent-txt);
	line-height: 1.1;
}
.foot-msgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.msg {
	font-size: calc(var(--j-body) - 4px);
	padding: 9px 17px;
	border: 1px solid var(--line);
	border-radius: 100px;
	color: var(--text-2);
	transition: border-color .2s ease, color .2s ease;
}
.msg:hover { border-color: var(--accent); color: var(--accent-txt); }

/* Меню в подвале выводит wp_nav_menu — стилизуем его список */
.foot-col .menu,
.foot-links { display: flex; flex-direction: column; gap: 12px; }
.foot-col .menu a,
.foot-links a {
	color: var(--muted);
	font-size: calc(var(--j-body) - 2px);
	transition: color .2s ease;
}
.foot-col .menu a:hover,
.foot-links a:hover { color: var(--accent-txt); }

.contact { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }
.contact__k {
	font-family: var(--j-font-accent);
	font-size: calc(var(--j-caps) - 3px);
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--muted);
}
.contact a, .contact__v {
	font-size: calc(var(--j-body) - 1.5px);
	line-height: 1.5;
	color: var(--text-2);
}
.contact a { transition: color .2s ease; }
.contact a:hover { color: var(--accent-txt); }

.foot-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: calc(var(--j-body) - 3.5px);
	line-height: 1.45;
	color: var(--muted);
	margin-top: 12px;
}

.foot-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-top: 24px;
	padding-bottom: 16px;
	border-top: 1px solid var(--line-2);
}
.foot-bottom > span { font-size: calc(var(--j-body) - 3.5px); color: var(--muted); }
.foot-bottom .menu { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-bottom .menu a {
	font-size: calc(var(--j-body) - 4px);
	color: var(--muted);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color .2s ease;
}
.foot-bottom .menu a:hover { color: var(--accent-txt); }

.disclaimer {
	font-size: calc(var(--j-body) - 5px);
	line-height: 1.7;
	color: var(--muted);
	opacity: .8;
	padding-bottom: 16px;
}

/* ================================================== КНОПКА «НАВЕРХ» */

.to-top {
	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: 80;
	width: 50px; height: 50px;
	display: grid;
	place-items: center;
	border: 1px solid rgba(var(--j-accent-rgb), .3);
	border-radius: 50%;
	background: linear-gradient(160deg, rgba(var(--j-accent-rgb), .22), rgba(var(--j-accent-rgb), .08));
	color: var(--accent-txt);
	backdrop-filter: blur(10px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 24px rgba(0, 0, 0, .34);
	opacity: 0;
	transform: translateY(10px);
	transition: opacity .3s ease, transform .3s ease, border-color .2s ease;
}
.to-top.show { opacity: 1; transform: none; }
.to-top:hover { border-color: rgba(var(--j-accent-rgb), .7); transform: translateY(-3px); }
.to-top svg {
	width: 20px; height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ========================================================== АДАПТИВ */

@media (max-width: 1240px) {
	/*
	 * Шапка перестаёт помещаться заметно раньше, чем включается бургер:
	 * логотип, меню, тумблер, телефон и кнопка вместе требуют ~1240 px.
	 * Разгружаем её по шагам, иначе строка уходит в горизонтальную прокрутку.
	 */
	.head-top .topline--right .topline__i:not(.topline__mail) { display: none; }
	.site-nav .menu { gap: 20px; }
	.head-right { gap: 12px; }
}

@media (max-width: 1120px) {
	.head-phone { display: none; }
	.related .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.side { position: static; }
	.foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}

@media (max-width: 1000px) {
	.start { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 26px; }
}

@media (max-width: 1000px) {
	/*
	 * Кнопка «Заказать звонок» (152 px) — последнее, что перестаёт помещаться
	 * рядом с логотипом и меню, а бургер включается только на 860 px.
	 * В промежутке убираем её из строки: на телефоне она появится
	 * в выпадающем меню (.nav-extra).
	 */
	.head-btn { display: none; }
}

@media (max-width: 960px) {
	.head-top .topline .topline__i + .topline__i { display: none; }
}

@media (max-width: 860px) {
	.menu-toggle { display: flex; }
	.bar { gap: 14px; }
	/*
	 * Правая группа прижимается к краю: без margin-left:auto .bar раскладывает
	 * элементы от левого края и справа остаётся пустое место, из-за которого
	 * бургер висит в стороне от кромки. Бургер идёт последним в разметке,
	 * поэтому оказывается у самого края, а тумблер темы — чуть левее него.
	 */
	.head-right { margin-left: auto; gap: 18px; }

	.site-nav {
		display: none;
		position: absolute;
		top: 80px;
		left: 0; right: 0;
		margin-left: 0;
		padding: 10px 24px 22px;
		/* Непрозрачный фон: сквозь полупрозрачный просвечивал заголовок первого экрана */
		background: #091a29;
		border-top: 1px solid var(--line);
		box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
		z-index: 40;
	}
	.bar.open .site-nav { display: block; }
	.site-nav .menu { flex-direction: column; align-items: stretch; gap: 0; }
	.site-nav > .menu > li > a { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
	.site-nav > .menu > li > a::after { display: none; }
	.site-nav > .menu > li.menu-item-has-children > a { justify-content: space-between; }

	/* Подменю — аккордеон: раскрывает .sub-open от theme.js, не :hover */
	.site-nav .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 0 6px 14px;
		background: none;
		border: 0;
		box-shadow: none;
		backdrop-filter: none;
	}
	/* Список стоит вплотную под пунктом — разрыва нет, мостик не нужен */
	.site-nav .sub-menu::before { display: none; }
	.site-nav li:not(.sub-open) > .sub-menu { display: none; }
	.site-nav li.sub-open > .sub-menu { display: block; }
	.site-nav > .menu > li.menu-item-has-children:hover > a::before,
	.site-nav > .menu > li.menu-item-has-children:focus-within > a::before { transform: translateY(-2px) rotate(45deg); }
	.site-nav > .menu > li.menu-item-has-children.sub-open > a::before { transform: translateY(1px) rotate(-135deg); }
	.site-nav .sub-menu a { white-space: normal; }

	/* Телефон и «Заказать звонок» внутри меню — как в мобильной навигации главной */
	.nav-extra {
		display: flex;
		flex-direction: column;
		gap: 14px;
		margin-top: 20px;
	}
	.nav-phone {
		font-family: var(--j-font-accent);
		font-size: calc(var(--j-phone) + 2px);
		font-weight: 600;
		color: var(--j-accent);
	}

	.feed, .related .feed { grid-template-columns: minmax(0, 1fr); }
	.card.big { flex-direction: column; gap: 14px; }
	.card.big .ico { width: 100%; aspect-ratio: 16 / 10; }

	/*
	 * Здесь чипы рубрик уже не помещаются в одну строку, и вторая строка
	 * вышла бы за тёмную подложку первого экрана — на светлом фоне белый
	 * текст на полупрозрачном белом не читался бы. Опускаем их на фон
	 * страницы и перекрашиваем по текущей теме.
	 */
	/*
	 * Чипы больше не заезжают на подложку, поэтому её нижний запас не нужен:
	 * иначе между поиском и чипами набегает под 120 px пустоты.
	 */
	.top { padding-bottom: 28px; }
	.cats { margin: 0 0 36px; }
	.cats a {
		color: var(--text-2);
		background: var(--surface-2);
		border-color: var(--line);
		backdrop-filter: none;
	}
	.cats a:hover { color: var(--accent-txt); }
	.cats a.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
	.author-box { justify-content: center; text-align: center; }
	.author-info { flex-basis: 100%; }
}

@media (max-width: 700px) {
	.head-top { display: none; }
	.foot-top { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
	.wrap { padding: 0 16px; }
	.hero { padding-top: 34px; }
	.hero-sub .br-m { display: inline; }

	/*
	 * «ЮРИСТ ГАЛИУЛЛИН И.И.» в одну строку не помещается рядом с тумблером
	 * и бургером: уменьшаем знак и кегль, а логотипу разрешаем сжиматься —
	 * на совсем узких экранах название обрежется многоточием, но строка
	 * шапки не уедет в горизонтальную прокрутку.
	 */
	.logo-sub { display: none; }
	.logo { flex: 0 1 auto; min-width: 0; gap: 9px; }
	.logo-mark { width: 30px; height: 30px; }
	.logo-txt { min-width: 0; }
	.logo-name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
	form.search input { padding: 15px 14px; }
	form.search .btn { padding: 0 20px; }
	.cats { gap: 8px; }
	.cats a { padding: 10px 16px; font-size: var(--j-caps); }
	.start { padding: 20px; border-radius: 18px; }
	.start-grid { grid-template-columns: minmax(0, 1fr); }
	.card, .article .note { padding: 16px; }
	.author-box { padding: 22px 18px; }
	.to-top { left: 16px; bottom: 16px; width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
}
