/* ForaEnergy — основная таблица стилей */
:root {
	--accent: #1b52a7;
	--accent-ink: #fff;
	--spark: #f5a524;
	--bg: #f4f6fa;
	--surface: #fff;
	--surface-2: #eef2f8;
	--text: #18202e;
	--muted: #5d6879;
	--line: #dde3ec;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--link: var(--accent);
}
:root[data-theme="light"] { color-scheme: light; }
/* Тёмная тема: выбрана кнопкой… */
:root[data-theme="dark"] {
	--bg: #0d131d;
	--surface: #151d2a;
	--surface-2: #1c2636;
	--text: #e5eaf2;
	--muted: #9aa6b8;
	--line: #273245;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
	--link: color-mix(in srgb, var(--accent) 45%, #fff);
	color-scheme: dark;
}
:root[data-theme="dark"] img { opacity: .94; }
/* …или по настройке системы, если посетитель ничего не выбирал */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0d131d;
		--surface: #151d2a;
		--surface-2: #1c2636;
		--text: #e5eaf2;
		--muted: #9aa6b8;
		--line: #273245;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
		--link: color-mix(in srgb, var(--accent) 45%, #fff);
		color-scheme: dark;
	}
	:root:not([data-theme="light"]) img { opacity: .94; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.6 var(--font);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
.icon { flex: none; vertical-align: -3px; }
:focus-visible { outline: 3px solid var(--spark); outline-offset: 2px; border-radius: 4px; }

.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; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- Шапка ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand { margin-right: auto; min-width: 0; }
.site-title { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.site-title a { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark {
	display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
	background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
	color: var(--spark);
}
.brand-mark .icon { width: 22px; height: 22px; fill: var(--spark); }
.site-desc { margin: 2px 0 0 48px; color: var(--muted); font-size: .875rem; }
.custom-logo { max-height: 48px; width: auto; display: block; }

.header-search { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 14px; width: min(320px, 40vw); }
.header-search input { flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: inherit; font-size: .95rem; padding: 8px 0; outline: none; }
.header-search button { border: 0; background: none; color: var(--muted); padding: 6px 8px; cursor: pointer; border-radius: 999px; }
.header-search button:hover { color: var(--accent); }
.header-search:focus-within { border-color: var(--accent); }

.menu-toggle { display: none; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.menu-toggle .icon-close, .nav-open .menu-toggle .icon-menu { display: none; }
.nav-open .menu-toggle .icon-close { display: inline; }

.site-nav { background: var(--accent); }
.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.site-nav li { position: relative; }
.site-nav a { display: block; padding: 12px 14px; color: var(--accent-ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current-menu-ancestor > a, .site-nav .current-post-ancestor > a { background: rgba(255, 255, 255, .14); }
.site-nav .menu-item-has-children > a::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; vertical-align: 1px; }
.site-nav .sub-menu {
	list-style: none; margin: 0; padding: 6px; position: absolute; left: 0; top: 100%; z-index: 50;
	min-width: 300px; max-height: 70vh; overflow: auto;
	background: var(--surface); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(4px); transition: .15s;
}
.site-nav .sub-menu a { color: var(--text); padding: 8px 12px; border-radius: 8px; font-weight: 400; }
.site-nav .sub-menu a:hover { background: var(--surface-2); }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu, .site-nav li.open > .sub-menu { opacity: 1; visibility: visible; transform: none; }

/* ---------- Сетка ---------- */
.site-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; padding-top: 28px; padding-bottom: 48px; align-items: start; }
.content { min-width: 0; }

.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--link); }

.archive-head { margin-bottom: 22px; }
.archive-head h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -.01em; }
.archive-desc { color: var(--muted); }
.subcats { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.subcats a { display: inline-block; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: .9rem; color: var(--text); }
.subcats a:hover { border-color: var(--accent); color: var(--link); }
.subcats small { color: var(--muted); margin-left: 4px; }

/* ---------- Карточки ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-img { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card--noimg { border-top: 4px solid var(--accent); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { margin: 0; font-size: 1.12rem; line-height: 1.35; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--link); }
.card-excerpt { margin: 0; color: var(--muted); font-size: .94rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.entry-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .84rem; }
.entry-meta > * { display: inline-flex; align-items: center; gap: 5px; }
.entry-meta .icon { width: 15px; height: 15px; }
.entry-meta a { color: inherit; text-decoration: none; }
.entry-meta a:hover { color: var(--link); }

/* ---------- Пагинация ---------- */
.pagination { margin-top: 32px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.page-numbers { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 500; }
.page-numbers:hover { border-color: var(--accent); color: var(--link); }
.page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.page-numbers.dots { border: 0; background: none; }

/* ---------- Запись ---------- */
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 44px); }
.entry-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.entry-title { margin: 0 0 12px; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.2; letter-spacing: -.015em; }

.prose { font-size: 1.075rem; line-height: 1.75; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose dl, .prose blockquote, .prose .table-wrap, .prose figure { margin: 0 0 1.1em; }
.prose h2, .prose h3, .prose h4, .prose h5 { line-height: 1.3; margin: 1.8em 0 .6em; letter-spacing: -.01em; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4, .prose h5 { font-size: 1.08rem; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .25em 0; }
.prose sub, .prose sup { font-size: .72em; line-height: 0; }
.prose dd { margin-left: 1.2em; }
.prose blockquote { border-left: 4px solid var(--accent); background: var(--surface-2); padding: 12px 18px; border-radius: 0 10px 10px 0; color: var(--text); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose code, .prose pre { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border-radius: 6px; }
.prose code { padding: .1em .35em; }
.prose pre { padding: 14px; overflow: auto; }
.prose img { border-radius: 8px; }
.prose a img { display: inline-block; }

/* таблицы: на телефоне прокручиваются, не ломая страницу */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .93rem; line-height: 1.45; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; vertical-align: top; text-align: left; }
.prose tr:first-child td, .prose th { background: var(--surface-2); font-weight: 600; }
.prose table tr > :first-child { border-left: 0; }
.prose table tr > :last-child { border-right: 0; }
.prose table tr:first-child > * { border-top: 0; }
.prose table tr:last-child > * { border-bottom: 0; }

/* выравнивание и подписи классического редактора */
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 6px; line-height: 1.4; }
.entry-content::after { content: ""; display: table; clear: both; }
.prose .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.prose .gallery-item { margin: 0; }
.prose iframe { border: 0; border-radius: 8px; }

.entry-tags { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.entry-tags a { padding: 4px 10px; background: var(--surface-2); border-radius: 999px; font-size: .85rem; text-decoration: none; color: var(--muted); }
.page-links { margin-top: 20px; display: flex; gap: 8px; align-items: center; }

.ad { margin: 18px auto; text-align: center; max-width: 100%; overflow: hidden; }

/* навигация между записями */
.post-navigation { margin-top: 22px; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; justify-content: stretch; }
.post-navigation a { display: block; height: 100%; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.post-navigation a:hover { border-color: var(--accent); }
.post-navigation .nav-next { text-align: right; grid-column: 2; }
.nav-label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.nav-title { font-weight: 600; line-height: 1.35; }

/* похожие записи */
.related { margin-top: 32px; }
.related h2, .comments-title, #reply-title { font-size: 1.3rem; margin: 0 0 14px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.related-item { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); }
.related-item:hover { border-color: var(--accent); }
.related-img { display: block; overflow: hidden; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--accent) 18%, var(--surface-2))); }
.related-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-title { display: block; padding: 10px 12px; font-size: .92rem; font-weight: 600; line-height: 1.35; }

/* комментарии */
.comments { margin-top: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 32px); }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 0; }
.comment-list .children { margin-left: clamp(16px, 4vw, 46px); padding-left: clamp(10px, 2vw, 16px); border-left: 2px solid var(--line); }
.fe-comment > .comment-body { display: flex; gap: 12px; padding: 14px 0; }
.comment-list > .fe-comment + .fe-comment > .comment-body, .children > .fe-comment > .comment-body { border-top: 1px solid var(--line); }
.comment-list > .fe-comment:first-child > .comment-body { padding-top: 4px; }
.fe-avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: #fff; background: hsl(var(--h, 215) 55% 48%); letter-spacing: .02em; user-select: none; }
.fe-comment-main { flex: 1; min-width: 0; }
.fe-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.fe-comment-name { font-weight: 700; }
.fe-badge { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--link); }
.fe-comment-date { font-size: .8rem; color: var(--muted); text-decoration: none; }
.fe-comment-date:hover { color: var(--link); }
.fe-comment-text { margin-top: 4px; overflow-wrap: anywhere; }
.fe-comment-text p { margin: 0 0 .6em; }
.fe-comment-text p:last-child { margin-bottom: 0; }
.fe-comment-actions { display: flex; gap: 14px; margin-top: 6px; font-size: .85rem; }
.fe-comment-actions a { color: var(--muted); text-decoration: none; font-weight: 600; }
.fe-comment-actions a:hover { color: var(--link); }
.fe-comment-pending { margin: 4px 0 6px; padding: 6px 10px; font-size: .85rem; border-radius: 8px; background: color-mix(in srgb, var(--spark) 16%, transparent); color: var(--text); }
.fe-comment.is-pending > .comment-body .fe-comment-text { opacity: .8; }
.fe-comment.is-new { opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
.fe-comment.is-new.is-shown { opacity: 1; transform: none; }
.fe-comment.is-new > .comment-body { animation: fe-flash 2.4s ease .3s; border-radius: 10px; }
@keyframes fe-flash { 0%, 40% { background: color-mix(in srgb, var(--accent) 10%, transparent); } 100% { background: transparent; } }
.fe-no-comments { color: var(--muted); margin: 0 0 8px; }
.comments .comment-navigation .nav-links { display: flex; justify-content: space-between; margin: 12px 0; }

.comment-respond { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.comment-list .comment-respond { margin: 4px 0 14px 52px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
#reply-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
#reply-title small a { font-size: .85rem; font-weight: 600; color: var(--muted); }
.fe-cform { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.fe-cform > * { grid-column: 1 / -1; margin: 0 0 12px; }
.fe-cform > .comment-form-author { grid-column: 1; }
.fe-cform > .comment-form-email { grid-column: 2; }
.fe-cform .comment-notes { font-size: .85rem; color: var(--muted); }
.comment-form label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 5px; }
.comment-form .required { color: #d14343; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form textarea {
	width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: inherit; font: inherit;
	transition: border-color .15s, box-shadow .15s;
}
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 8px; font-size: .85rem; color: var(--muted); }
.comment-form-cookies-consent label { display: inline; font-weight: 400; margin: 0; }
.fe-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.comment-form .submit { position: relative; display: inline-flex; align-items: center; gap: 8px; transition: filter .15s, opacity .15s; }
.comment-form .submit:hover { filter: brightness(1.08); }
.comment-form .submit:disabled { opacity: .7; cursor: progress; }
.fe-cform.is-busy .submit::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: fe-spin .7s linear infinite; }
@keyframes fe-spin { to { transform: rotate(360deg); } }
.fe-cform-msg { padding: 10px 14px; border-radius: 10px; font-size: .92rem; animation: fe-fade .3s ease; }
.fe-cform-msg.is-ok { background: color-mix(in srgb, #1f8a4c 14%, transparent); }
.fe-cform-msg.is-error { background: color-mix(in srgb, #d14343 14%, transparent); }
@keyframes fe-fade { from { opacity: 0; transform: translateY(-4px); } }
@media (max-width: 600px) {
	.fe-cform { grid-template-columns: 1fr; }
	.fe-cform > .comment-form-author, .fe-cform > .comment-form-email { grid-column: 1; }
	.comment-list .comment-respond { margin-left: 0; }
	.fe-avatar { flex-basis: 34px; width: 34px; height: 34px; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { .fe-comment.is-new, .fe-cform-msg { transition: none; animation: none; } .fe-comment.is-new { opacity: 1; transform: none; } }

/* формы и кнопки */
.search-form { display: flex; gap: 8px; margin: 16px 0; }
.search-form input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; font: inherit; }
button, .button, input[type=submit] { cursor: pointer; }
.search-form button, .form-submit input, .comment-form .submit {
	padding: 10px 18px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
}

/* ---------- Сайдбар ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 16px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; font-size: .94rem; }
.widget-title { margin: 0 0 12px; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.widget ul, .widget ol { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; border-bottom: 1px dashed var(--line); line-height: 1.4; font-size: .92rem; font-weight: 400; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--text); text-decoration: none; }
.widget li a:hover { color: var(--link); }
.widget_categories .children { padding-left: 14px; margin-top: 6px; }

.popular-list { counter-reset: pop; }
.popular-list li { counter-increment: pop; display: grid; grid-template-columns: 1.5em 1fr; column-gap: 6px; }
.popular-list li::before { content: counter(pop) "."; grid-row: span 2; color: var(--muted); font-variant-numeric: tabular-nums; }
.popular-count { font-size: .8rem; color: var(--muted); margin-top: 1px; }

.fe-phrase { margin: 0; padding: 2px 0 0 14px; border-left: 3px solid var(--spark); }
.fe-phrase-text { margin: 0; font-size: .92rem; line-height: 1.5; font-style: italic; white-space: pre-line; color: var(--text); min-height: 1.5em; }

.partners { font-size: .88rem; color: var(--muted); }
.partners a { word-break: break-word; }

/* ---------- 404 / пусто ---------- */
.error-404 .big-404 { font-size: clamp(4rem, 12vw, 7rem); font-weight: 900; margin: 0; line-height: 1; color: var(--accent); letter-spacing: -.04em; }
.error-404 h1 { margin: .2em 0 .4em; }
.list-404 { padding-left: 1.2em; }
.empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }

/* ---------- Подвал ---------- */
.site-footer { background: #0f1a2c; color: #b7c2d3; font-size: .92rem; }
.footer-inner { padding-top: 28px; padding-bottom: 28px; }
.site-footer a { color: #fff; }
.footer-menu { list-style: none; margin: 0 0 18px; padding: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px 22px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer-menu a { text-decoration: none; color: #dbe3ef; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; }
.footer-row p { margin: 0; }
.copy a { text-decoration: none; font-weight: 600; }
.site-age b { color: var(--spark); font-variant-numeric: tabular-nums; }
.ym-badge { margin-left: auto; line-height: 0; }
.footer-note { margin: 16px 0 0; font-size: .8rem; color: #7f8ca2; }

.to-top {
	position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
	background: var(--accent); color: #fff !important; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; z-index: 40;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
	.site-body { grid-template-columns: minmax(0, 1fr); }
	.sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
}
@media (max-width: 760px) {
	.header-inner { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; min-height: 0; }
	.site-title { font-size: 1.25rem; }
	.site-desc { display: none; }
	.menu-toggle { display: inline-flex; }
	.header-search { order: 3; width: 100%; }
	.site-nav { display: none; }
	.nav-open .site-nav { display: block; }
	.site-nav .wrap { padding: 0; }
	.site-nav .menu { flex-direction: column; padding: 6px 0; }
	.site-nav a { padding: 12px 20px; }
	.site-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; display: none; min-width: 0; max-height: none; border: 0; border-radius: 0; box-shadow: none; background: rgba(0, 0, 0, .14); padding: 4px 0; }
	.site-nav .sub-menu a { color: #fff; padding-left: 36px; }
	.site-nav li.open > .sub-menu, .site-nav li:focus-within > .sub-menu { display: block; }
	.site-body { padding-top: 18px; gap: 24px; }
	.wrap { padding: 0 14px; }
	.cards { grid-template-columns: 1fr; gap: 16px; }
	.entry { border-radius: 0; margin: 0 -14px; border-left: 0; border-right: 0; }
	.prose { font-size: 1.02rem; }
	.alignleft, .alignright { float: none; margin: 0 auto 1em; display: block; }
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { grid-column: auto; }
	.ym-badge { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
	.site-header, .sidebar, .site-footer, .ad, .related, .comments, .post-navigation, .to-top { display: none !important; }
	.site-body { display: block; }
	.entry { border: 0; padding: 0; }
}

/* =====================================================================
   Главная: слайдер + 4 блока
   ===================================================================== */
.hero-wrap { padding-top: 28px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 22px; }
.hero--noside, .hero--noslider { grid-template-columns: minmax(0, 1fr); }

.slider { position: relative; border-radius: var(--radius); overflow: hidden; background: #0f1a2c; box-shadow: var(--shadow); aspect-ratio: 16 / 9; min-height: 300px; }
.slider-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.slider-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; position: relative; }
.slide-link { position: absolute; inset: 0; display: block; color: #fff; text-decoration: none; }
.slide-img, .slide-img img { position: absolute; inset: 0; width: 100%; height: 100%; }
.slide-img img { object-fit: cover; transition: transform 6s ease; }
.slide:hover .slide-img img { transform: scale(1.04); }
.slide--noimg .slide-img { display: grid; place-items: center; background: radial-gradient(120% 120% at 80% 10%, color-mix(in srgb, var(--accent) 80%, #fff 0%), #0f1a2c 70%); }
.slide--noimg .slide-img .icon { width: 120px; height: 120px; color: var(--spark); fill: var(--spark); opacity: .25; }
.slide-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 28px 46px; background: linear-gradient(to top, rgba(8, 14, 26, .92), rgba(8, 14, 26, .55) 60%, transparent); display: flex; flex-direction: column; gap: 8px; }
.slide-cat { align-self: flex-start; background: var(--spark); color: #1a1203; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 6px; }
.slide-title { font-size: clamp(1.2rem, 2.4vw, 1.75rem); font-weight: 800; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
.slide-meta { font-size: .85rem; opacity: .85; display: flex; align-items: center; gap: 6px; }
.slide-meta .meta-views { display: inline-flex; align-items: center; gap: 4px; }
.slide-meta .icon { width: 15px; height: 15px; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s, background .2s; }
.slider:hover .slider-btn, .slider-btn:focus-visible { opacity: 1; }
.slider-btn:hover { background: rgba(255, 255, 255, .3); }
.slider-btn .icon { width: 22px; height: 22px; }
.slider-prev { left: 12px; }
.slider-next { right: 12px; }
.slider-dots { position: absolute; left: 28px; bottom: 18px; display: flex; gap: 6px; }
.slider-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .25s, background .25s; }
.slider-dots button[aria-selected="true"] { width: 26px; background: var(--spark); }

.hero-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hero-side-title { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; flex: 1; }
.mini { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s, box-shadow .2s; min-height: 0; }
.mini:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.mini-img { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; flex: none; }
.mini-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini--noimg .mini-img { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); }
.mini--noimg .mini-img .icon { width: 34px; height: 34px; color: var(--spark); fill: var(--spark); opacity: .8; }
.mini-title { padding: 9px 11px 11px; font-size: .86rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 1000px) {
	.hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
	.hero-wrap { padding-top: 16px; }
	.slider { aspect-ratio: 4 / 3; min-height: 0; margin: 0 -14px; border-radius: 0; }
	.slide-body { padding: 50px 18px 40px; }
	.slider-dots { left: 18px; bottom: 14px; }
	.slider-btn { display: none; }
	.hero-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* =====================================================================
   Рубрики в колонке
   ===================================================================== */
.widget_categories li.cat-item { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; }
.widget_categories li.cat-item > a { flex: 1 1 0; min-width: 0; }
.cat-count { flex: none; display: inline-block; min-width: 1.9em; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .74rem; line-height: 1.6; text-align: center; vertical-align: 1px; }
.cat-toggle { flex: none; margin: -3px -4px -3px 0; width: 26px; height: 26px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: background .2s, color .2s; }
.cat-toggle:hover { background: var(--surface-2); color: var(--accent); }
.cat-toggle svg { transition: transform .25s; }
.is-open > .cat-toggle svg { transform: rotate(180deg); }
.widget_categories .children { flex: 0 0 100%; display: none; margin: 6px 0 0; padding-left: 12px; border-left: 2px solid var(--line); }
.widget_categories .is-open > .children { display: block; animation: fe-reveal .25s ease; }
.widget_categories .children li { font-size: .88rem; padding: 4px 0; }
.widget_categories .current-cat > a { color: var(--link); font-weight: 600; }
.cats-collapsible:not(.cats-open) .cat-extra { display: none; }
.cats-open .cat-extra { animation: fe-reveal .3s ease both; }
.cats-more { margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; background: none; color: var(--link); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: background .2s, border-color .2s; }
.cats-more:hover { background: var(--surface-2); border-color: var(--accent); }
.cats-more span { color: var(--muted); font-weight: 400; }
.cats-more svg { transition: transform .25s; }
.cats-open .cats-more svg { transform: rotate(180deg); }
@keyframes fe-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Просмотр картинок
   ===================================================================== */
.prose a.lb-link { cursor: zoom-in; }
.lb-lock, .lb-lock body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 9999; background: rgba(6, 10, 18, .94); display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; -webkit-tap-highlight-color: transparent; }
.lb.is-open { opacity: 1; visibility: visible; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 56px 72px 8px; position: relative; }
.lb-img { max-width: calc(100vw - 150px); max-height: calc(100vh - 124px); max-height: calc(100dvh - 124px); width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); opacity: 0; transform: scale(.97); transition: opacity .25s, transform .25s; background: #fff; }
.lb-img.is-in { opacity: 1; transform: none; }
.lb-spin { position: absolute; width: 38px; height: 38px; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--spark); border-radius: 50%; animation: fe-spin .8s linear infinite; display: none; }
.lb.is-loading .lb-spin { display: block; }
@keyframes fe-spin { to { transform: rotate(360deg); } }
.lb-bar { display: flex; align-items: baseline; justify-content: center; gap: 16px; padding: 10px 20px 18px; color: #dbe3ef; font-size: .92rem; text-align: center; min-height: 48px; }
.lb-count { color: #8d9ab0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-btn { position: absolute; border: 0; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; display: grid; place-items: center; border-radius: 50%; transition: background .2s; }
.lb-btn:hover { background: rgba(255, 255, 255, .22); }
.lb-close { top: 12px; right: 14px; width: 42px; height: 42px; font-size: 30px; line-height: 1; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb.is-single .lb-prev, .lb.is-single .lb-next { display: none; }
@media (max-width: 760px) {
	.lb-stage { padding: 54px 8px 4px; }
	.lb-img { max-width: calc(100vw - 16px); max-height: calc(100dvh - 190px); }
	.lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; width: 44px; height: 44px; }
	.lb-bar { padding-left: 64px; padding-right: 64px; }
}

/* Флажок входа в подвале */
.login-flag { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; border-radius: 6px; color: #6f7d94 !important; vertical-align: -5px; transition: color .2s, background .2s; }
.login-flag:hover { color: var(--spark) !important; background: rgba(255, 255, 255, .08); }
.login-flag .icon { width: 14px; height: 14px; }

/* =====================================================================
   Главная: строки по рубрикам
   ===================================================================== */
.section-title { margin: 0 0 14px; font-size: 1.3rem; line-height: 1.25; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 5px; height: 1.1em; border-radius: 3px; background: var(--spark); flex: none; }
.section-title a { color: var(--text); text-decoration: none; }
.section-title a:hover { color: var(--link); }
.cat-row { margin-bottom: 34px; }
.cat-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cat-row-head .section-title { margin-bottom: 14px; }
.cat-row-all { display: inline-flex; align-items: center; gap: 2px; font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.cat-row-all .icon { width: 16px; height: 16px; transition: transform .2s; }
.cat-row-all:hover .icon { transform: translateX(3px); }
.cards--row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cards--row .card-title { font-size: 1.02rem; }
.cards--row .card-excerpt { -webkit-line-clamp: 3; font-size: .9rem; }
@media (max-width: 760px) {
	.cards--row { grid-template-columns: 1fr; }
}

/* =====================================================================
   Кнопки редактирования и редактор на сайте (видят только редакторы)
   ===================================================================== */
.edit-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.edit-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text) !important; font: inherit; font-size: .88rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.edit-btn:hover { border-color: var(--accent); color: var(--link) !important; }
.edit-btn--main { background: var(--accent); border-color: var(--accent); color: #fff !important; }
.edit-btn--main:hover { filter: brightness(1.1); color: #fff !important; }
.edit-btn[disabled] { opacity: .6; cursor: progress; }
.fe-editor { margin: 4px 0 10px; }
.fe-editor-label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.fe-editor-title { width: 100%; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 1.3rem; font-weight: 700; }
.fe-editor .wp-editor-wrap { color: #1d2327; }
.fe-editor .wp-editor-container { border-radius: 0 0 8px 8px; }
.fe-editor textarea.wp-editor-area { font: 14px/1.6 ui-monospace, Menlo, Consolas, monospace; color: #1d2327; background: #fff; }
.fe-editor .wp-media-buttons .button { margin-bottom: 6px; }
.fe-editor-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 0; background: var(--surface); border-top: 1px solid var(--line); }
.fe-editor-status { font-size: .9rem; color: var(--muted); }
.fe-editor-status.is-ok { color: #1f8a4c; font-weight: 600; }
.fe-editor-status.is-err { color: #c0392b; font-weight: 600; }
.fe-editor-hint { margin-left: auto; font-size: .78rem; color: var(--muted); }
.fe-editor.is-busy .fe-save { opacity: .6; pointer-events: none; }
.entry.is-editing .ad { display: none; }
@media print { .edit-bar { display: none !important; } }

/* =====================================================================
   Кнопки в шапке: тема, добавить запись
   ===================================================================== */
.header-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.tool-btn:hover { border-color: var(--accent); color: var(--link); }
.tool-btn--add { background: var(--accent); border-color: var(--accent); color: #fff; }
.tool-btn--add:hover { color: #fff; filter: brightness(1.1); }
.tool-btn .icon-sun { display: none; }
:root[data-theme="dark"] .tool-btn .icon-sun { display: inline; }
:root[data-theme="dark"] .tool-btn .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .tool-btn .icon-sun { display: inline; }
	:root:not([data-theme="light"]) .tool-btn .icon-moon { display: none; }
}
@media (max-width: 1100px) { .tool-btn--add .tool-label { display: none; } .tool-btn--add { padding: 0; } }
@media (max-width: 760px) {
	.header-tools { margin-left: auto; }
	.tool-btn { height: 38px; min-width: 38px; }
	.menu-toggle { height: 38px; }
	/* кнопки редактирования на телефоне — крупнее и на всю ширину */
	.edit-bar { display: grid; grid-template-columns: 1fr 1fr; }
	.edit-btn { justify-content: center; padding: 10px 12px; font-size: .9rem; }
	.fe-editor-hint { display: none; }
}

/* Окно «Новая запись» */
.fe-modal-lock, .fe-modal-lock body { overflow: hidden; }
.fe-modal { position: fixed; inset: 0; z-index: 99990; background: rgba(6, 10, 18, .6); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; }
.fe-modal-box { width: min(920px, 100%); background: var(--surface); border-radius: 14px; padding: 20px 22px 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.fe-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fe-modal-head h2 { margin: 0; font-size: 1.3rem; }
.fe-modal-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.fe-editor-select { width: 100%; margin-bottom: 14px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.fe-modal .fe-editor-actions { background: var(--surface); }
.fe-modal.is-busy .fe-editor-actions .edit-btn { opacity: .6; pointer-events: none; }
@media (max-width: 760px) {
	.fe-modal { padding: 0; }
	.fe-modal-box { border-radius: 0; min-height: 100%; padding: 14px 14px 4px; }
}

/* Изображение записи в редакторе */
.fe-thumb { margin: 0 0 14px; }
.fe-thumb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fe-thumb-preview img { display: block; width: 160px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.fe-thumb-hint { margin: 6px 0 0; font-size: .8rem; color: var(--muted); }
@media (max-width: 760px) {
	.header-inner { flex-wrap: wrap; }
	.brand { flex: 1 1 0; min-width: 0; margin-right: 0; }
	.site-title a span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.menu-toggle { width: 38px; padding: 0; justify-content: center; }
	.menu-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 380px) {
	.brand-mark { width: 32px; height: 32px; }
	.site-title { font-size: 1.1rem; }
}
