/* ============================================================
   Lostgant — основная таблица стилей
   ============================================================ */

/* ---------- Токены ---------- */
:root {
	/* Нейтральная основа (zinc), светлая */
	--bg: #ffffff;
	--page: #eceef2;
	--surface: #fafafa;
	--surface-2: #f4f4f5;
	--text: #18181b;
	--muted: #71717a;
	--border: #e4e4e7;
	/* Акцент по умолчанию — сдержанный зелёный */
	--accent: #16a34a;
	--accent-hover: #15803d;
	--accent-2: #22c55e;
	--accent-contrast: #ffffff;
	--success: #16a34a;
	--danger: #dc2626;
	--shadow-sm: 0 1px 2px rgba(9, 9, 11, .06);
	--shadow: 0 8px 24px -12px rgba(9, 9, 11, .18);
	--shadow-lg: 0 24px 48px -24px rgba(9, 9, 11, .3);
	--radius: 10px;
	--radius-sm: 7px;
	--radius-lg: 16px;
	--container: 1120px;
	--container-narrow: 760px;
	--font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--header-h: 64px;
}

[data-theme="dark"] {
	/* Графитовый тёмный */
	--bg: #09090b;
	--page: #030304;
	--surface: #18181b;
	--surface-2: #202023;
	--text: #f4f4f5;
	--muted: #a1a1aa;
	--border: #27272a;
	--accent: #4ade80;
	--accent-hover: #86efac;
	--accent-2: #22c55e;
	--accent-contrast: #052e16;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
	--shadow: 0 8px 24px -12px rgba(0, 0, 0, .7);
	--shadow-lg: 0 24px 48px -24px rgba(0, 0, 0, .85);
}

/* --- Варианты акцента --- */
[data-accent="green"] {
	--accent: #16a34a;
	--accent-hover: #15803d;
	--accent-2: #22c55e;
	--accent-contrast: #ffffff;
}
[data-accent="mono"] {
	--accent: #18181b;
	--accent-hover: #3f3f46;
	--accent-2: #71717a;
	--accent-contrast: #ffffff;
}
[data-accent="amber"] {
	--accent: #d97706;
	--accent-hover: #b45309;
	--accent-2: #f59e0b;
	--accent-contrast: #ffffff;
}
[data-accent="violet"] {
	--accent: #7c3aed;
	--accent-hover: #6d28d9;
	--accent-2: #8b5cf6;
	--accent-contrast: #ffffff;
}
[data-accent="teal"] {
	--accent: #0d9488;
	--accent-hover: #0f766e;
	--accent-2: #14b8a6;
	--accent-contrast: #ffffff;
}
[data-accent="rose"] {
	--accent: #e11d48;
	--accent-hover: #be123c;
	--accent-2: #f43f5e;
	--accent-contrast: #ffffff;
}
[data-accent="orange"] {
	--accent: #ea580c;
	--accent-hover: #c2410c;
	--accent-2: #f97316;
	--accent-contrast: #ffffff;
}
[data-accent="lime"] {
	--accent: #65a30d;
	--accent-hover: #4d7c0f;
	--accent-2: #84cc16;
	--accent-contrast: #ffffff;
}

[data-theme="dark"][data-accent="green"] {
	--accent: #4ade80;
	--accent-hover: #86efac;
	--accent-2: #22c55e;
	--accent-contrast: #052e16;
}
[data-theme="dark"][data-accent="mono"] {
	--accent: #fafafa;
	--accent-hover: #e4e4e7;
	--accent-2: #a1a1aa;
	--accent-contrast: #09090b;
}
[data-theme="dark"][data-accent="amber"] {
	--accent: #fbbf24;
	--accent-hover: #fcd34d;
	--accent-2: #f59e0b;
	--accent-contrast: #1c1917;
}
[data-theme="dark"][data-accent="violet"] {
	--accent: #a78bfa;
	--accent-hover: #c4b5fd;
	--accent-2: #8b5cf6;
	--accent-contrast: #09090b;
}
[data-theme="dark"][data-accent="teal"] {
	--accent: #2dd4bf;
	--accent-hover: #5eead4;
	--accent-2: #14b8a6;
	--accent-contrast: #042f2e;
}
[data-theme="dark"][data-accent="rose"] {
	--accent: #fb7185;
	--accent-hover: #fda4af;
	--accent-2: #f43f5e;
	--accent-contrast: #4c0519;
}
[data-theme="dark"][data-accent="orange"] {
	--accent: #fb923c;
	--accent-hover: #fdba74;
	--accent-2: #f97316;
	--accent-contrast: #431407;
}
[data-theme="dark"][data-accent="lime"] {
	--accent: #a3e635;
	--accent-hover: #bef264;
	--accent-2: #84cc16;
	--accent-contrast: #1a2e05;
}

/* --- Режим без скруглений --- */
[data-radius="none"],
[data-radius="none"] *,
[data-radius="none"] *::before,
[data-radius="none"] *::after { border-radius: 0 !important; }

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
	margin: 0;
	background: var(--page);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; transition: color .2s ease, background-color .2s ease; }
a:hover, a:focus, a:active { color: var(--accent-hover); text-decoration: none; }

h1, h2, h3, h4 {
	margin: 0 0 .5em;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--text);
}
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + .7vw, 1.45rem); }

p { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.15em; padding-left: 1.4em; }
li { margin-bottom: .35em; }

code, pre, kbd { font-family: var(--font-mono); font-size: .92em; }
code {
	background: var(--surface-2);
	padding: .15em .4em;
	border-radius: 6px;
}
pre {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 1rem 1.15rem;
	overflow: auto;
	line-height: 1.6;
}
pre code { background: none; padding: 0; }

blockquote {
	margin: 1.5em 0;
	padding: .4em 0 .4em 1.25em;
	border-left: 4px solid var(--accent);
	color: var(--muted);
	font-style: italic;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
th, td { text-align: left; padding: .65em .8em; border-bottom: 1px solid var(--border); }
th { font-weight: 600; background: var(--surface); }

::selection { background: var(--accent); color: var(--accent-contrast); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Утилиты ---------- */
.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 1.75rem);
}
.container--narrow { max-width: var(--container-narrow); }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link {
	position: absolute;
	top: -100px;
	left: 1rem;
	z-index: 1000;
	background: var(--accent);
	color: var(--accent-contrast);
	padding: .6rem 1rem;
	border-radius: var(--radius-sm);
	transition: top .15s ease;
}
.skip-link:focus { top: 1rem; color: var(--accent-contrast); }

/* ---------- Шапка ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid var(--border);
}
.site-header__inner {
	min-height: var(--header-h);
	display: flex;
	align-items: center;
	gap: 1rem;
}
.site-branding { flex: 0 0 auto; }
.site-title {
	font-size: 1.2rem;
	font-weight: 800;
	letter-spacing: -.02em;
	color: var(--text);
}
.site-title:hover { color: var(--accent); }
.custom-logo { max-height: 40px; width: auto; }

.site-nav { margin-left: auto; }
.site-nav .menu {
	display: flex;
	align-items: center;
	gap: .25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.site-nav .menu-item a {
	display: block;
	padding: .5rem .8rem;
	border-radius: 10px;
	color: var(--text);
	font-weight: 500;
	font-size: .95rem;
}
.site-nav .menu-item a:hover { background: var(--surface-2); color: var(--accent); }
.site-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	padding: .4rem;
	list-style: none;
	margin: .35rem 0 0;
	display: none;
}
.site-nav .menu-item-has-children { position: relative; }
.site-nav .menu-item-has-children:hover .sub-menu,
.site-nav .menu-item-has-children:focus-within .sub-menu { display: block; }

.header-actions { display: flex; align-items: center; gap: .3rem; }
.icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px; height: 40px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--text);
	border-radius: 10px;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.icon-button:hover { background: var(--surface-2); }
.nav-toggle { display: none; }

/* переключатель темы */
.theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: inline-flex; }
.nav-toggle__close { display: none; }
.nav-open .nav-toggle__open { display: none; }
.nav-open .nav-toggle__close { display: inline-flex; }

/* ---------- Кнопки ---------- */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	padding: .7rem 1.15rem;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	font-weight: 600;
	font-size: .95rem;
	line-height: 1;
	cursor: pointer;
	transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.button:active { transform: translateY(1px); }
.button--primary { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow-sm); }
.button--primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.button--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.button--ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Бейджи ---------- */
.badge {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	padding: .22rem .6rem;
	border-radius: 999px;
	font-size: .78rem;
	font-weight: 600;
	line-height: 1.5;
}
.badge--category { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.badge--price { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.badge--version { background: var(--surface-2); color: var(--muted); }
.badge--topic {
	padding: .16rem .55rem;
	border: 1px solid var(--border);
	background: transparent;
	color: var(--muted);
	font-size: .72rem;
	font-weight: 500;
	line-height: 1.5;
}
.badge--topic:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.engage--topics { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.card-news-hero__meta .badge--category,
.card-news-item__meta .badge--category { padding: .16rem .55rem; font-size: .72rem; }

/* ---------- Hero ---------- */
.hero {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 2rem;
	align-items: center;
	padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem);
}
.hero__eyebrow {
	margin: 0 0 .6rem;
	font-size: .85rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--accent);
}
.hero__title { margin-bottom: 1rem; }
.hero__intro { font-size: 1.12rem; color: var(--muted); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.hero__feature {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	padding: 1.4rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: linear-gradient(160deg, var(--surface), var(--bg));
	box-shadow: var(--shadow);
	transition: transform .18s ease, box-shadow .18s ease;
}
.hero__feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.hero__feature-label { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); }
.hero__feature-title { font-size: 1.25rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.hero__feature-meta { font-size: .85rem; color: var(--muted); }

/* ---------- Секции ---------- */
.section { padding: clamp(1.75rem, 4vw, 2.75rem) 0; }
.section + .section { border-top: 1px solid var(--border); }
.section__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}
.section__title { margin: 0 0 .25rem; }
.section__description { margin: 0; color: var(--muted); font-size: .95rem; }
.section__link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; white-space: nowrap; }
.section__empty { color: var(--muted); }

/* ---------- Сетки ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid--posts { grid-template-columns: repeat(3, 1fr); }
.grid--products { grid-template-columns: repeat(2, 1fr); }

/* ---------- Карточки ---------- */
.card {
	display: flex;
	flex-direction: column;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

.card__media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--surface-2);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__media-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--muted);
	background: linear-gradient(135deg, var(--surface), var(--surface-2));
}

.card__body { display: flex; flex-direction: column; gap: .6rem; padding: 1.15rem 1.25rem 1.35rem; flex: 1; }
.card__badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.card__title { margin: 0; font-size: 1.2rem; line-height: 1.35; }
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--accent); }
.card__excerpt { color: var(--muted); font-size: .95rem; flex: 1; }
.card__excerpt p { margin: 0; }
.card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
	font-size: .82rem;
	color: var(--muted);
	padding-top: .35rem;
	border-top: 1px solid var(--border);
	margin-top: .35rem;
}

/* ---------- Продукты ---------- */
.product-head { display: flex; gap: 1rem; align-items: flex-start; }
.product-head__media {
	flex: 0 0 72px;
	width: 72px; height: 72px;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--surface-2);
	border: 1px solid var(--border);
}
.product-head__media img { width: 100%; height: 100%; object-fit: cover; }
.product-head__placeholder {
	display: flex; align-items: center; justify-content: center;
	height: 100%; color: var(--accent);
}
.product-head__text { min-width: 0; }
.product-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }

.platform-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.platform {
	font-size: .78rem;
	color: var(--muted);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: .2rem .6rem;
	margin: 0;
}
.platform-list--inline { margin-bottom: 1rem; }

.product-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: .5rem; }
.product-actions--header { margin-top: 1.25rem; }

/* ---------- CTA ---------- */
.cta { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.cta__inner {
	text-align: center;
	padding: clamp(2rem, 5vw, 3.25rem);
	border-radius: var(--radius-lg);
	background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--bg)), color-mix(in srgb, var(--accent-2) 12%, var(--bg)));
	border: 1px solid var(--border);
}
.cta__title { margin-bottom: .5rem; }
.cta__text { color: var(--muted); margin-bottom: 1.5rem; }

/* ---------- Заголовок страницы/архива ---------- */
.page-header { padding: clamp(2rem, 5vw, 3.25rem) 0 1.5rem; }
.page-header__title { margin: 0 0 .4rem; }
.page-header__description { color: var(--muted); max-width: 60ch; margin: 0; }
.page-header__query { color: var(--accent); }
.page-header__search { margin-top: 1rem; max-width: 460px; }

/* ---------- Одиночная запись ---------- */
.single { padding-bottom: 2rem; }
.single__header { padding: clamp(1.75rem, 4vw, 2.75rem) 0 1rem; }
.single__title { margin-top: .5rem; }
.single__lead { color: var(--muted); font-size: 1.1rem; }
.contact-note { color: var(--muted); font-size: .95rem; margin: .35rem 0 0; }
.contact-note a { font-weight: 600; }
.single__media { margin: 0 0 1.75rem; border-radius: var(--radius); overflow: hidden; }
.single__media img { width: 100%; }

.entry-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--muted); font-size: .9rem; }
.entry-meta .sep { opacity: .5; }

.entry-content { font-size: 1.06rem; }
.entry-content > * { margin-bottom: 1.25rem; }
.entry-content h2 { margin-top: 2rem; }
.entry-content h3 { margin-top: 1.5rem; }
.entry-content img, .entry-content .wp-block-image { border-radius: var(--radius-sm); }
.entry-content figcaption, .wp-element-caption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: .5rem; }
.entry-content a { text-decoration: none; transition: color .2s ease; }
.entry-content a:hover { color: var(--accent-hover); }
.entry-content .post-source { display: none; }

.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { margin-inline: auto; display: block; }
.alignwide { margin-inline: clamp(-4rem, -6vw, 0rem); max-width: 100vw; width: auto; }
.alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; width: 100vw; }

.tag-list, .entry-content ul.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 2rem 0; }
.tag-list li { margin: 0; }
.tag-list a {
	display: inline-block;
	padding: .22rem .7rem;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--muted);
	font-size: .8rem;
	text-decoration: none;
}
.tag-list a:hover { background: var(--accent); color: var(--accent-contrast); }

/* навигация по записям */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.5rem 0 .5rem; }
.post-nav__item {
	display: flex; flex-direction: column; align-items: stretch;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	overflow: hidden;
	transition: border-color .2s ease, background-color .2s ease;
}
.post-nav__item:hover { border-color: var(--accent); background: var(--surface-2); }
.post-nav__media { flex: none; width: 100%; aspect-ratio: 16 / 10; position: relative; overflow: hidden; background: var(--surface-2); }
.post-nav__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-nav__placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--muted); }
.post-nav__placeholder svg { width: 24px; height: 24px; }
.post-nav__body { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; flex: 1 1 auto; min-width: 0; padding: .9rem 1rem 1rem; text-align: left; }
.post-nav__label { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.post-nav__arrow { display: inline-flex; }
.post-nav__arrow svg { width: 13px; height: 13px; }
.post-nav__item--prev .post-nav__arrow { transform: rotate(180deg); }
.post-nav__title {
	font-size: .92rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--text);
	overflow-wrap: anywhere;
	max-height: 4.05em;
	overflow: hidden;
}

/* ---------- Пагинация ---------- */
.pagination { margin: 2.5rem 0 1rem; }
.pagination__list { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination__item {
	min-width: 42px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 .6rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text);
	background: var(--bg);
}
.pagination__item:hover { border-color: var(--accent); color: var(--accent); }
.pagination__item.current { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* ---------- Контакты ---------- */
.contact-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	list-style: none;
	padding: 0;
	margin: 2rem 0;
}
.contact-card {
	display: flex; flex-direction: column; gap: .3rem;
	padding: 1rem 1.15rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	margin: 0;
}
.contact-card__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.contact-card__value { font-weight: 600; word-break: break-word; }

.contact-form-wrap { margin-top: 2.5rem; }

.studio-actions { margin-top: 2rem; }
.studio-actions .button svg { width: 16px; height: 16px; }
.contact-form__title { margin-bottom: 1rem; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-field { display: flex; flex-direction: column; gap: .35rem; }
.form-field label { font-weight: 600; font-size: .9rem; }
.form-field input, .form-field textarea, .contact-form input, .contact-form textarea {
	width: 100%;
	padding: .65rem .8rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-size: .95rem;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.form-field input:focus, .form-field textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.form-field--honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: .95rem; }
.notice--success { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 35%, transparent); }
.notice--error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }

/* ---------- 404 / пустые ---------- */
.error-404, .no-results { text-align: center; padding: clamp(3rem, 8vw, 6rem) 0; }
.error-404__code { font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; line-height: 1; margin: 0; color: color-mix(in srgb, var(--accent) 30%, transparent); }
.error-404__text, .no-results__text { color: var(--muted); margin-bottom: 1.5rem; }
.error-404__search, .no-results__search { max-width: 420px; margin: 0 auto 1.5rem; }

/* ---------- Формы/поиск ---------- */
.search-form { display: flex; gap: .5rem; }
.search-form input[type="search"] {
	flex: 1;
	padding: .65rem .9rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg);
	color: var(--text);
	font: inherit;
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.search-form .search-submit {
	border: 0;
	background: var(--accent);
	color: var(--accent-contrast);
	padding: .65rem 1rem;
	border-radius: var(--radius-sm);
	font-weight: 600;
	cursor: pointer;
}

/* ---------- Комментарии ---------- */
.single__engagement { margin-top: .35rem; }
.single__engagement .engage-bar { margin-top: 0; padding-top: .6rem; }
.comments-area { margin: 1.1rem 0 2rem; border-top: 1px solid var(--border); padding-top: .9rem; }
.comments-title { font-size: 1.25rem; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; margin: .75rem 0 0; }

.comment-item {
	display: flex;
	gap: .85rem;
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--border);
}
.comment-item__avatar { flex: 0 0 auto; }
.comment-item__avatar img { border-radius: 50%; display: block; }
.comment-item__body { min-width: 0; flex: 1 1 auto; }
.comment-item__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .3rem .6rem;
	margin-bottom: .3rem;
}
.comment-item__author { font-weight: 600; color: var(--text); }
.comment-item__author a { color: var(--text); }
.comment-item__date { font-size: .8rem; color: var(--muted); }
.comment-item__text { font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
.comment-item__text > :first-child { margin-top: 0; }
.comment-item__text > :last-child { margin-bottom: 0; }
.comment-item__text p { margin: 0 0 .6rem; }
.comment-item__text code {
	font-size: .85em;
	padding: .1rem .35rem;
	border-radius: 5px;
	background: var(--surface-2);
	overflow-wrap: anywhere;
}
.comment-item__text pre {
	overflow-x: auto;
	padding: .8rem 1rem;
	border-radius: var(--radius-sm);
	background: var(--surface-2);
}
.comment-item__foot {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: .55rem;
	font-size: .84rem;
}
.comment-item__reply a, .comment-item__edit a { color: var(--muted); font-weight: 500; }
.comment-item__reply a:hover, .comment-item__edit a:hover { color: var(--accent); }

.comment-like {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .22rem .5rem;
	border: 1px solid transparent;
	border-radius: 999px;
	background: none;
	color: var(--muted);
	font: inherit;
	font-size: .84rem;
	cursor: pointer;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
.comment-like svg { width: 16px; height: 16px; }
.comment-like:hover { color: var(--accent); background: var(--surface-2); }
.comment-like.is-active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.comment-like.is-active svg { fill: currentColor; }

.comment-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.comment-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.comment-form input, .comment-form textarea {
	width: 100%; padding: .65rem .8rem;
	border: 1px solid var(--border); border-radius: var(--radius-sm);
	background: var(--bg); color: var(--text); font: inherit;
}
.comment-notes { font-size: .85rem; color: var(--muted); }

/* ---------- Подвал ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); margin-top: 0; }
.site-footer__simple {
	padding: 2rem 1.5rem;
	text-align: center;
	font-size: .85rem;
	color: var(--muted);
}
.copyright { margin: 0; }

.widget { margin-bottom: 1.5rem; }
.widget-title { font-size: 1rem; }

/* ---------- Адаптив ---------- */
@media (max-width: 980px) {
	.hero { grid-template-columns: 1fr; }
	.grid--posts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
	.grid--posts, .grid--products { grid-template-columns: 1fr; }
	.nav-toggle { display: inline-flex; }

	.site-nav {
		position: fixed;
		inset: var(--header-h) 0 auto 0;
		background: var(--bg);
		border-bottom: 1px solid var(--border);
		padding: .75rem 1.25rem 1.25rem;
		transform: translateY(-120%);
		transition: transform .22s ease;
		max-height: calc(100vh - var(--header-h));
		overflow: auto;
	}
	.nav-open .site-nav { transform: translateY(0); }
	.site-nav .menu { flex-direction: column; align-items: stretch; gap: .15rem; }
	.site-nav .menu-item a { padding: .7rem .8rem; }
	.site-nav .sub-menu { position: static; display: block; border: 0; box-shadow: none; padding-left: 1rem; margin: 0; }

	.form-row { grid-template-columns: 1fr; }
	.post-nav { grid-template-columns: 1fr; }
	.section__header { flex-direction: column; align-items: flex-start; }
}

/* ---------- Появление ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.js .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Комьюнити-каркас
   ============================================================ */

/* ---------- Раскладка ---------- */
.app {
	display: grid;
	grid-template-columns: 264px minmax(0, 1fr) 312px;
	gap: clamp(1rem, 2vw, 1.75rem);
	max-width: 1280px;
	margin-inline: auto;
	padding: clamp(1rem, 2vw, 1.5rem) clamp(1rem, 2.5vw, 2rem) 3rem;
	align-items: start;
}

.app__sidebar {
	position: sticky;
	top: calc(var(--header-h) + 1.5rem);
	min-height: calc(100vh - var(--header-h) - 3rem);
	max-height: calc(100vh - var(--header-h) - 3rem);
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding: .4rem 0 1rem;
	overflow-y: auto;
}

.app__center {
	min-width: 0;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 1.5rem clamp(1.1rem, 2vw, 1.75rem) 2rem;
}

.app__aside {
	position: sticky;
	top: calc(var(--header-h) + 1.5rem);
	max-height: calc(100vh - var(--header-h) - 3rem);
	overflow-y: auto;
	overflow-x: hidden;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 1.25rem;
}

.app-overlay {
	position: fixed;
	inset: 0;
	z-index: 250;
	background: rgba(9, 9, 11, .6);
	backdrop-filter: blur(2px);
}

/* ---------- Верхняя шапка ---------- */
.topbar {
	position: sticky;
	top: 0;
	z-index: 200;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid var(--border);
}
.topbar__inner {
	max-width: 1280px;
	margin-inline: auto;
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: var(--header-h);
	padding-inline: clamp(1rem, 2.5vw, 2rem);
}
.topbar__brand { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .05rem; min-width: 0; line-height: 1.1; }
.topbar__logo { font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em; color: var(--text); }
.topbar__tagline { font-size: .74rem; font-weight: 400; color: var(--muted); line-height: 1.25; }

.topbar__nav { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; }
.topbar__link { color: var(--text); font-weight: 500; font-size: .95rem; white-space: nowrap; }
.topbar__link:hover { color: var(--accent); }
.topbar__link--accent { color: var(--accent); font-weight: 700; }
.topbar__theme { margin-left: .25rem; }

/* ---------- Выпадающий выбор темы ---------- */
.theme-menu { position: relative; }
.theme-menu__panel {
	position: absolute;
	top: calc(100% + .6rem);
	right: 0;
	z-index: 300;
	width: 236px;
	max-height: calc(100vh - var(--header-h) - 2rem);
	overflow-y: auto;
	padding: .7rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
}
.theme-menu__heading {
	margin: .2rem .35rem .5rem;
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}
.theme-menu__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-bottom: .65rem; }
.theme-menu__list { display: grid; gap: .1rem; }
.theme-option {
	display: flex;
	align-items: center;
	gap: .55rem;
	width: 100%;
	padding: .5rem .6rem;
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	color: var(--text);
	font: inherit;
	font-size: .9rem;
	text-align: left;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.theme-option:hover { background: var(--surface-2); }
.theme-option.is-active { border-color: var(--border); background: var(--surface-2); }
.theme-option.is-active::after {
	content: "";
	width: .5rem;
	height: .5rem;
	margin-left: auto;
	border-radius: 50%;
	background: var(--accent);
}
.swatch {
	width: 16px;
	height: 16px;
	flex: none;
	border-radius: 5px;
	border: 1px solid rgba(0, 0, 0, .18);
}
.swatch--green { background: #16a34a; }
.swatch--mono { background: linear-gradient(135deg, #18181b 50%, #fafafa 50%); }
.swatch--amber { background: #d97706; }
.swatch--violet { background: #7c3aed; }
.swatch--teal { background: #0d9488; }
.swatch--rose { background: #e11d48; }
.swatch--orange { background: #ea580c; }
.swatch--lime { background: #65a30d; }

/* Переключатель настроек (скругления) */
.theme-toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	margin: .1rem .35rem 0;
	padding-top: .65rem;
	border-top: 1px solid var(--border);
	color: var(--text);
	font-size: .9rem;
}
.theme-switch {
	position: relative;
	flex: none;
	width: 40px;
	height: 22px;
	padding: 0;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 999px;
	cursor: pointer;
	transition: background .2s ease, border-color .2s ease;
}
.theme-switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--muted);
	transition: transform .2s ease, background .2s ease;
}
.theme-switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.theme-switch[aria-checked="true"]::after { background: var(--accent-contrast); transform: translateX(18px); }

/* ---------- Бренд в сайдбаре ---------- */
.app__brand-link { display: inline-flex; align-items: center; gap: .6rem; }
.app__brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px; height: 36px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	font-weight: 800;
	font-size: 1.05rem;
}
.app__brand-text { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--text); }

.app__compose { width: 100%; }
.app__compose svg { width: 18px; height: 18px; }

/* ---------- Меню сайдбара ---------- */
.app-nav { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.app-nav__heading {
	margin: 1.25rem 0 .4rem;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--muted);
}
.app-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.app-nav__item a {
	display: flex;
	align-items: center;
	gap: .7rem;
	padding: .55rem .7rem;
	border-radius: 10px;
	color: var(--text);
	font-weight: 500;
	font-size: .95rem;
}
.app-nav__item a:hover { background: var(--surface-2); color: var(--accent); }
.app-nav__item.is-active a { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }
.app-nav__icon { display: inline-flex; color: var(--muted); }
.app-nav__item.is-active .app-nav__icon,
.app-nav__item a:hover .app-nav__icon { color: currentColor; }
.app-nav__icon svg { width: 19px; height: 19px; }
.app-nav__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); margin-inline: 6px; }
.app-nav__item.is-active .app-nav__dot { background: var(--accent); }
.app-nav__divider { height: 1px; margin: .7rem .7rem; background: color-mix(in srgb, var(--muted) 55%, transparent); list-style: none; }

/* ---------- Ссылки в низу меню ---------- */
.app__sidebar-links { display: flex; flex-direction: column; gap: .05rem; margin-top: auto; padding-top: 1rem; }
.app__sidebar-link {
	display: flex;
	align-items: center;
	padding: .26rem .7rem;
	border-radius: 10px;
	color: var(--muted);
	font-size: .86rem;
	line-height: 1.4;
}
.app__sidebar-link:hover { background: var(--surface-2); color: var(--accent); }
.app__sidebar-link--disabled { cursor: default; opacity: .45; }
.app__sidebar-link--disabled:hover { background: transparent; color: var(--muted); }
.app-social { display: flex; gap: .5rem; margin: .4rem .7rem; }
.app-social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .3rem;
	flex: 1;
	min-width: 34px;
	padding: .35rem .55rem;
	border: 1px solid color-mix(in srgb, var(--muted) 55%, transparent);
	border-radius: var(--radius-sm);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--text);
}
.app-social__link svg { width: 16px; height: 16px; }
.app-social__link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Низ сайдбара ---------- */
.app__sidebar-foot { display: none; flex-direction: column; gap: .6rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.app-user { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.app-user img { border-radius: 50%; }
.app-user__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.app-user__name { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-user__role { font-size: .78rem; color: var(--muted); }
.app__logout { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .88rem; }
.app__logout:hover { color: var(--danger); }
.app__logout svg { width: 17px; height: 17px; }
.app__auth { display: flex; flex-direction: column; gap: .45rem; }
.app__auth-btn { width: 100%; }
.app__login-link { text-align: center; font-size: .9rem; color: var(--muted); }
.app__login-link:hover { color: var(--accent); }

/* ---------- Лента ---------- */
.feed { max-width: 720px; display: flex; flex-direction: column; gap: 1.25rem; }
.app__center .feed { max-width: none; }
.feed__header { padding-top: .5rem; }
.feed__title { margin: 0 0 .25rem; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.feed__description { color: var(--muted); margin: 0; }
.feed__query { color: var(--accent); }
.feed__search { margin-top: 1rem; max-width: 480px; }
.feed__list { display: flex; flex-direction: column; gap: 1.25rem; }

/* ---------- Карточка ленты ---------- */
.card-feed {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.15rem 1.3rem 1rem;
	transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card-feed:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: var(--shadow); }
.card-feed__head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.card-feed__head img { border-radius: 50%; flex: 0 0 auto; }
.card-feed__byline { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.card-feed__author { font-weight: 600; font-size: .92rem; }
.card-feed__date { font-size: .8rem; color: var(--muted); }
.card-feed__head .badge { margin-left: auto; flex: 0 0 auto; }
.card-feed__media {
	display: block;
	margin: .25rem 0 .9rem;
	border-radius: var(--radius-sm);
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--surface-2);
}
.card-feed__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card-feed:hover .card-feed__media img { transform: scale(1.03); }
.card-feed__title { margin: 0 0 .4rem; font-size: 1.28rem; line-height: 1.35; }
.card-feed__title a { color: var(--text); }
.card-feed__title a:hover { color: var(--accent); }
.card-feed__excerpt { color: var(--muted); font-size: .96rem; }
.card-feed__excerpt p { margin: 0; }

/* ---------- Витрина новостей ---------- */
.card-news-hero {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	margin-bottom: 1.5rem;
	transition: border-color .18s ease, box-shadow .18s ease;
}
.card-news-hero:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: var(--shadow); }
.card-news-hero__media { display: block; aspect-ratio: 21 / 9; overflow: hidden; background: var(--surface-2); }
.card-news-hero__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card-news-hero:hover .card-news-hero__media img { transform: scale(1.03); }
.card-news-hero__body { padding: 1.25rem 1.4rem 1.1rem; }
.card-news-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .4rem .5rem;
	margin-bottom: .7rem;
	padding-bottom: .7rem;
	border-bottom: 1px solid var(--border);
}
.card-news-hero__meta .engage--topics { display: contents; }
.card-news-hero__date { margin-left: auto; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.card-news-hero__title { margin: 0 0 .5rem; font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.25; letter-spacing: -.01em; }
.card-news-hero__title a { color: var(--text); }
.card-news-hero__title a:hover { color: var(--accent); }
.card-news-hero__excerpt { color: var(--muted); font-size: 1rem; margin-bottom: .35rem; }
.card-news-hero__excerpt p { margin: 0; }

.news-list { display: flex; flex-direction: column; gap: .25rem; }
.card-news-item {
	display: grid;
	grid-template-columns: 210px 1fr;
	gap: 1.1rem;
	padding: 1rem;
	border-top: 1px solid var(--border);
	transition: background .15s ease;
}
.card-news-item:hover { background: var(--surface); }
.card-news-item__media { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.card-news-item__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card-news-item:hover .card-news-item__media img { transform: scale(1.03); }
.card-news-item__body { min-width: 0; display: flex; flex-direction: column; }
.card-news-item__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .35rem .45rem;
	margin-bottom: .45rem;
}
.card-news-item__meta .engage--topics { display: contents; }
.card-news-item__date { margin-left: auto; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.card-news-item__title { margin: 0 0 .35rem; font-size: 1.15rem; line-height: 1.35; }
.card-news-item__title a { color: var(--text); }
.card-news-item__title a:hover { color: var(--accent); }
.card-news-item__excerpt { color: var(--muted); font-size: .92rem; margin-bottom: .5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-news-item__excerpt p { margin: 0; }
.card-news-item .engage-bar { margin-top: auto; padding-top: .35rem; }
.card-news-item .engage { padding: .22rem .4rem; }
.engage-bar--split { flex-direction: column; align-items: stretch; gap: .1rem; }
.engage-bar__top { display: flex; align-items: center; width: 100%; }
.engage-bar__main { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem; }
.engage-bar--split .engage--date { padding: 0; }

@media (max-width: 640px) {
	.card-news-item { grid-template-columns: 1fr; gap: .6rem; }
	.card-news-item__media { aspect-ratio: 16 / 9; }
}

/* ---------- Метрики ---------- */
.engage-bar {
	display: flex;
	align-items: center;
	gap: .35rem;
	margin-top: .9rem;
	padding-top: .75rem;
	border-top: 1px solid var(--border);
	font-size: .85rem;
	color: var(--muted);
}
.engage {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .35rem .55rem;
	border: 0;
	background: transparent;
	color: inherit;
	border-radius: 9px;
	font: inherit;
	font-size: .85rem;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.engage:hover { background: var(--surface-2); color: var(--text); }
.engage svg { width: 17px; height: 17px; flex: 0 0 auto; }
.engage__count { font-variant-numeric: tabular-nums; }
.engage--like.is-active { color: var(--danger); }
.engage--like.is-active svg { fill: currentColor; }
.engage--bookmark.is-active { color: var(--accent); }
.engage--bookmark.is-active svg { fill: currentColor; }
.engage--share.is-active { color: var(--success); }
.engage--date { color: var(--muted); font-size: .8rem; white-space: nowrap; cursor: default; }
.engage--date:hover { background: transparent; color: var(--muted); }
.engage-bar__spacer { flex: 1; }
.engage-bar__stat { display: inline-flex; align-items: center; gap: .35rem; }
.engage-bar__stat svg { width: 17px; height: 17px; }

/* ---------- Одиночная запись: автор ---------- */
.single__byline { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; }
.single__byline img { border-radius: 50%; }
.single__byline-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; color: var(--muted); font-size: .9rem; }
.single__author { font-weight: 600; color: var(--text); }

/* ---------- Мини-комментарии ---------- */
.mini-comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
.mini-comment { display: flex; gap: .6rem; padding: .7rem 0; border-bottom: 1px solid var(--border); list-style: none; }
.mini-comment:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-comment:first-child { padding-top: 0; }
.mini-comment__avatar { flex: 0 0 auto; display: block; }
.mini-comment__avatar img,
.mini-comment img { width: 36px !important; height: 36px !important; min-width: 36px; border-radius: 50% !important; object-fit: cover; aspect-ratio: 1 / 1; display: block; }
.mini-comment__body { min-width: 0; flex: 1 1 auto; }
.mini-comment__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .5rem; }
.mini-comment__author { font-weight: 600; color: var(--text); font-size: .88rem; }
.mini-comment__date { font-size: .76rem; color: var(--muted); }
.mini-comment__text { display: block; font-size: .88rem; line-height: 1.5; color: var(--text); margin: .2rem 0 0; overflow-wrap: anywhere; transition: color .2s ease; }
.mini-comment__text:hover { color: var(--accent-hover); }
.mini-comment__post { display: block; font-size: .78rem; color: var(--muted); margin: .25rem 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s ease; }
.mini-comment__post:hover { color: var(--accent-hover); }
.mini-comment__meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .78rem; color: var(--muted); }
.mini-comments__empty, .widget-empty { color: var(--muted); font-size: .9rem; }

/* ---------- Список разделов ---------- */
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
.side-list__item a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
	padding: .45rem .55rem;
	border-radius: 8px;
	color: var(--text);
	font-size: .92rem;
}
.side-list__item a:hover { background: var(--surface-2); color: var(--accent); }
.side-list__count { font-size: .78rem; color: var(--muted); }

/* ---------- Присоединиться ---------- */
.widget--join { border-radius: var(--radius); }
.widget-join__text { font-size: .9rem; color: var(--muted); margin: 0 0 .8rem; }

/* ---------- Формы входа/регистрации ---------- */
.auth-card {
	max-width: 440px;
	margin: 1rem auto;
	padding: 1.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--bg);
	box-shadow: var(--shadow);
}
.auth-card__title { margin: 0 0 .35rem; }
.auth-card__lead { color: var(--muted); font-size: .95rem; }
.auth-card__foot { margin: 1.25rem 0 0; font-size: .92rem; color: var(--muted); text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.button--block { width: 100%; }

.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.15rem 0; color: var(--muted); font-size: .85rem; }
.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.button--vk { background: #0077ff; border-color: #0077ff; color: #fff; }
.button--vk:hover { background: #0068e0; border-color: #0068e0; color: #fff; }
.button--vk svg { width: 20px; height: 20px; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field__label { font-weight: 600; font-size: .9rem; }
.field__hint { font-size: .8rem; color: var(--muted); }
.field--check { flex-direction: row; align-items: center; gap: .5rem; font-size: .9rem; }
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="password"],
.field textarea,
.contact-form input,
.contact-form textarea {
	width: 100%;
	padding: .65rem .8rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-size: .95rem;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Личный кабинет ---------- */
.account { max-width: 640px; }
.account__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.account__head img { border-radius: 50%; }
.account__name { margin: 0; font-size: 1.4rem; }
.account__meta { color: var(--muted); font-size: .9rem; }
.account__tabs { display: flex; flex-wrap: wrap; gap: .35rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.account__tab { padding: .55rem .9rem; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.account__tab:hover { color: var(--text); }
.account__tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.account__form { gap: 1rem; }
.account__subtitle { font-size: 1.05rem; margin: 1.25rem 0 0; }
.account__empty { color: var(--muted); padding: 2rem 0; text-align: center; }

/* ---------- Адаптив каркаса ---------- */
@media (max-width: 1080px) {
	.app { grid-template-columns: 264px minmax(0, 1fr); }
	.app__aside { display: none; }
}

@media (max-width: 760px) {
	.topbar__nav { display: none; }
	.topbar__theme { margin-left: auto; }
	.topbar__tagline { font-size: .7rem; }
	.theme-menu__panel { width: min(236px, calc(100vw - 2rem)); }
	.app__sidebar-foot--mobile { display: flex; }

	.app { display: block; padding-inline: 1rem; }

	.app__sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		width: min(300px, 84vw);
		height: 100vh;
		height: 100dvh;
		max-height: none;
		z-index: 300;
		background: var(--bg);
		border-right: 1px solid var(--border);
		padding: 1rem 1.1rem;
		overflow-y: hidden;
		gap: .8rem;
		transform: translateX(-100%);
		transition: transform .24s ease;
	}
	.nav-open .app__sidebar { transform: none; }
	.app__sidebar .app-nav { gap: .2rem; }
	.app__sidebar .app-nav__item a { padding: .42rem .6rem; font-size: .92rem; }
	.app__sidebar .app-nav__divider { margin: .5rem .6rem; }
	.app__sidebar-links { padding-top: .6rem; }
	.app__sidebar-link { padding: .2rem .6rem; font-size: .84rem; }
	.app-social { margin: .3rem .6rem; }

	.app__center { padding-top: 1.25rem; }
	.feed { max-width: none; }
}

@media (min-width: 761px) {
	.app-overlay { display: none; }
}

/* ---------- Печать ---------- */
@media print {
	.site-header, .site-footer, .post-nav, .pagination, .comments-area, .cta,
	.app__sidebar, .app__aside, .topbar, .engage-bar, .ad-slot { display: none; }
	body { color: #000; background: #fff; }
	.app { display: block; }
}

/* ---------- Каталог продуктов ---------- */
.feed--catalog .feed__header--catalog { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.feed__heading { min-width: 0; }
.catalog-view { display: inline-flex; gap: .25rem; padding: .2rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.catalog-view__btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; transition: color .2s, background .2s; }
.catalog-view__btn:hover { color: var(--text); }
.catalog-view__btn[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.catalog { display: flex; flex-direction: column; gap: 2rem; }
.catalog--single { gap: 0; }
.catalog__group-title { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; margin: 0 0 .9rem; }
.catalog__group-title svg { color: var(--muted); }
.catalog__grid { display: grid; gap: 1rem; }
.catalog[data-view="2"] .catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog[data-view="3"] .catalog__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.catalog[data-view="list"] .catalog__grid { grid-template-columns: 1fr; }

.product-tile { display: flex; gap: 1rem; padding: 1.1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: border-color .2s, transform .2s, box-shadow .2s; }
.catalog[data-view="2"] .product-tile,
.catalog[data-view="3"] .product-tile { flex-direction: column; }
.product-tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.product-tile__icon { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 16px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.catalog[data-view="2"] .product-tile__icon,
.catalog[data-view="3"] .product-tile__icon { width: 76px; height: 76px; border-radius: 18px; }
.product-tile__icon img { width: 100%; height: 100%; object-fit: cover; }
.product-tile__placeholder { color: var(--muted); }
.product-tile__placeholder svg { width: 28px; height: 28px; }
.product-tile__body { display: flex; flex-direction: column; gap: .5rem; min-width: 0; flex: 1 1 auto; }
.product-tile__title { font-size: 1.08rem; margin: 0; }
.product-tile__title a { color: var(--text); }
.product-tile__title a:hover { color: var(--accent); }
.product-tile__meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .6rem; font-size: .78rem; color: var(--muted); }
.product-tile__platform { display: inline-flex; align-items: center; gap: .25rem; }
.product-tile__platform svg { width: 15px; height: 15px; }
.product-tile__excerpt { margin: 0; font-size: .88rem; color: var(--muted); line-height: 1.5; }
.product-tile__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .4rem; }

.button--sm { padding: .4rem .7rem; font-size: .82rem; }
.button--sm svg { width: 15px; height: 15px; }

/* Страница продукта */
.product-single__head { display: flex; gap: 1.4rem; align-items: flex-start; margin-bottom: 1.75rem; }
.product-single__icon { flex: 0 0 auto; width: 104px; height: 104px; border-radius: 24px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.product-single__icon img { width: 100%; height: 100%; object-fit: cover; }
.product-single__placeholder svg { width: 40px; height: 40px; }
.product-single__intro { min-width: 0; }
.product-single__platform { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--muted); }
.product-single__platform svg { width: 16px; height: 16px; }
.product-single__excerpt { margin: .7rem 0 0; color: var(--muted); font-size: .98rem; }

.product-section { margin-top: 2.5rem; }
.product-section__title { font-size: 1.15rem; margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }

.product-screens__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.product-screens__item { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.product-screens__item img { display: block; width: 100%; height: auto; transition: transform .25s ease, opacity .2s ease; }
.product-screens__item:hover img { transform: scale(1.02); }
.product-screens__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sitemap { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.6rem 2rem; }
.sitemap__section { min-width: 0; }
.sitemap__heading { margin: 0 0 .6rem; padding-bottom: .4rem; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
.sitemap__list { display: flex; flex-direction: column; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.sitemap__list a { color: var(--muted); font-size: .9rem; transition: color .2s ease; }
.sitemap__list a:hover { color: var(--accent); }
.sitemap__feed { margin-top: 2rem; font-size: .88rem; color: var(--muted); }
.sitemap__feed a { color: var(--accent); }

/* ---------- Реклама РСЯ ---------- */
.ad-slot { margin: 1.5rem 0; }
.ad-slot__label { display: block; margin-bottom: .4rem; text-align: center; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: .7; }
.ad-slot--feed { margin: 1rem 0; }
.widget--ads { margin-top: 1.5rem; }
.widget--ads .ad-slot { margin: 0; }
.ad-slot--mobile { display: none; }

.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: clamp(1rem, 4vw, 3rem); background: rgba(9, 9, 11, .92); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; }
.lightbox__img { max-width: min(100%, 1200px); max-height: calc(100vh - 6rem); width: auto; height: auto; object-fit: contain; border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0, 0, 0, .6); background: var(--surface-2); }
.lightbox__btn { position: fixed; z-index: 1001; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; background: rgba(24, 24, 27, .72); color: #f4f4f5; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, transform .2s ease; }
.lightbox__btn:hover { background: rgba(63, 63, 70, .92); border-color: rgba(255, 255, 255, .38); }
.lightbox__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lightbox__btn svg { width: 22px; height: 22px; }
.lightbox__btn--close { top: clamp(1rem, 3vw, 1.75rem); right: clamp(1rem, 3vw, 1.75rem); }
.lightbox__btn--prev { left: clamp(1rem, 3vw, 2rem); top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: clamp(1rem, 3vw, 2rem); top: 50%; transform: translateY(-50%); }
.lightbox__btn--prev svg { transform: rotate(180deg); }
.lightbox__counter { position: fixed; bottom: clamp(1rem, 3vw, 1.75rem); left: 50%; transform: translateX(-50%); z-index: 1001; padding: .3rem .8rem; border-radius: 999px; background: rgba(24, 24, 27, .72); color: #f4f4f5; font-size: .82rem; letter-spacing: .02em; }
body.lightbox-open { overflow: hidden; }

@media (max-width: 640px) {
	.lightbox__btn { width: 42px; height: 42px; }
	.lightbox__img { max-height: calc(100vh - 9rem); }
}

.updates-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.updates-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.updates-item:last-child { border-bottom: 0; padding-bottom: 0; }
.updates-item__head { display: flex; align-items: center; gap: .7rem; margin-bottom: .35rem; }
.updates-item__version { font-weight: 600; color: var(--accent); font-size: .95rem; }
.updates-item__date { font-size: .8rem; color: var(--muted); }
.updates-item__note { font-size: .92rem; color: var(--text); }
.updates-item__note p { margin: .3rem 0; }
.product-updates__empty { color: var(--muted); }

@media (max-width: 980px) {
	.catalog[data-view="3"] .catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
	.catalog[data-view="2"] .catalog__grid,
	.catalog[data-view="3"] .catalog__grid { grid-template-columns: 1fr; }
	.product-single__head { flex-direction: column; gap: 1rem; }

	.ad-slot--mobile { display: block; position: fixed; inset: auto 0 0; z-index: 150; margin: 0; padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
	.ad-slot--mobile .ad-slot__label { display: none; }
	.site-footer { padding-bottom: 4.5rem; }
}
