/*
Theme Name: Krylov
Theme URI: https://krylov.eu.org/
Author: Konstantin Krylov
Description: Тема блога Константина Крылова. Наследует цвета прежней темы (графит, серебро, бирюзово-серые ссылки), рассчитана на записи с кодом: подсветка WP-GeSHi, копирование кода, адаптивная вёрстка.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: krylov
*/

/* ==========================================================================
   Токены
   ========================================================================== */

:root {
	--bg: #eceef0;
	--surface: #fff;
	--surface-2: #f5f7f8;
	--line: #e0e4e7;
	--line-strong: #c8ced2;
	--text: #26292b;
	--text-2: #485055;
	--muted: #6b747a;
	--faint: #b9c0c5;

	--accent: #48707a;
	--accent-strong: #33555e;
	--accent-soft: #e6eff1;
	--accent-on-dark: #93bdc7;

	--graphite: #4c4c4c;
	--graphite-2: #3e3e3e;

	--code-bg: #f7f8f9;
	--code-head: #eef1f3;
	--code-line: #dfe4e7;

	--radius: 12px;
	--radius-sm: 8px;
	--shadow: 0 1px 2px rgba(20, 24, 26, .05), 0 8px 24px -14px rgba(20, 24, 26, .22);
	--pad: 32px;

	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
	--mono: "JetBrains Mono", "Cascadia Code", "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
}

/* ==========================================================================
   База
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: 16px;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 16px/1.65 var(--font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img, video, iframe, embed, object { max-width: 100%; }
img, video { height: auto; }
img { border: 0; vertical-align: middle; }

a { color: var(--accent); }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4, h5, h6 {
	color: var(--text);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.015em;
}

button, input, select, textarea { font: inherit; color: inherit; }

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

.sr-only, .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 12px;
	z-index: 100;
	padding: 8px 14px;
	background: #fff;
	color: var(--text);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
}
.skip-link:focus { left: 16px; }

.icon { flex: none; vertical-align: -.15em; }

.container {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 24px;
}

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

/* ==========================================================================
   Шапка
   ========================================================================== */

.site-header {
	position: relative;
	overflow: hidden;
	color: #fff;
	background:
		radial-gradient(ellipse 55% 160% at 82% -10%, rgba(255, 255, 255, .15), transparent 70%),
		radial-gradient(ellipse 30% 120% at 12% 120%, rgba(255, 255, 255, .06), transparent 70%),
		linear-gradient(180deg, #555 0%, var(--graphite) 55%, #444 100%);
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
}

/* диагональ из старой шапки */
.site-header::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 6%;
	width: 58%;
	background: linear-gradient(to top right,
		transparent calc(50% - 1px),
		rgba(255, 255, 255, .2) calc(50% - .5px),
		rgba(255, 255, 255, .2) calc(50% + .5px),
		transparent calc(50% + 1px));
	pointer-events: none;
}

.header-inner {
	position: relative;
	display: flex;
	align-items: center;
	gap: 28px;
	min-height: 72px;
}

.brand { margin: 0; font-size: inherit; line-height: 1; flex: none; }

.brand a {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #fff;
	text-decoration: none;
}

.brand-mark {
	width: 38px;
	height: 38px;
	border-radius: 8px;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 4px 10px -4px rgba(0, 0, 0, .5);
}

.brand-text { display: inline-grid; }

.brand-name {
	font-size: 25px;
	font-weight: 800;
	letter-spacing: .03em;
	line-height: 1;
}

.brand-sub {
	justify-self: end;
	margin-top: 1px;
	margin-right: -2px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	color: var(--accent-on-dark);
}

.header-panel {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-width: 0;
}

.main-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-nav a {
	position: relative;
	display: block;
	padding: 8px 12px;
	border-radius: var(--radius-sm);
	color: rgba(255, 255, 255, .82);
	font-size: .9375rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s, color .15s;
}

.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
	color: #fff;
}

.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after {
	content: "";
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 2px;
	height: 2px;
	border-radius: 2px;
	background: var(--accent-on-dark);
}

.site-header :focus-visible { outline-color: var(--accent-on-dark); }

.site-header .search-form { flex: 0 1 260px; min-width: 180px; }

.site-header .search-field {
	padding-block: 8px;
	background: rgba(255, 255, 255, .09);
	border-color: rgba(255, 255, 255, .18);
	color: #fff;
	font-size: .9375rem;
}

.site-header .search-field::placeholder { color: rgba(255, 255, 255, .58); }

.site-header .search-field:focus {
	background: rgba(255, 255, 255, .15);
	border-color: var(--accent-on-dark);
	box-shadow: 0 0 0 3px rgba(147, 189, 199, .25);
}

.site-header .search-submit { color: rgba(255, 255, 255, .75); }
.site-header .search-submit:hover { color: #fff; background: rgba(255, 255, 255, .1); }

.icon-btn {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.icon-btn .icon { width: 22px; height: 22px; }

.nav-toggle { display: none; margin-left: auto; }
.nav-toggle:hover { background: rgba(255, 255, 255, .1); }
.nav-toggle .i-close,
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

/* ==========================================================================
   Сетка страницы
   ========================================================================== */

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 28px;
	align-items: start;
	padding-top: 28px;
}

.site-main {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.post-feed {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
}

.site-main > *,
.post-feed > * { min-width: 0; }

/* ==========================================================================
   Кнопки и формы
   ========================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }

.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: .8125rem; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--text);
	font-size: 1rem;
	line-height: 1.4;
	transition: border-color .15s, box-shadow .15s, background-color .15s;
}

textarea { min-height: 140px; resize: vertical; line-height: 1.55; }

input:focus, textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(72, 112, 122, .18);
}

.search-form { position: relative; display: flex; }
.search-field { padding-right: 42px !important; }
.search-field::-webkit-search-cancel-button { display: none; }

.search-submit {
	position: absolute;
	top: 50%;
	right: 4px;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}

.search-submit:hover { color: var(--accent); background: var(--accent-soft); }
.search-submit .icon { width: 18px; height: 18px; }

kbd {
	display: inline-block;
	padding: 0 5px;
	border: 1px solid var(--line-strong);
	border-bottom-width: 2px;
	border-radius: 4px;
	background: #fff;
	font: 600 .75rem/1.5 var(--mono);
	color: var(--text-2);
}

/* ==========================================================================
   Записи
   ========================================================================== */

.entry { padding: var(--pad); }

.entry-title {
	margin: 0 0 10px;
	font-size: 1.5rem;
	line-height: 1.28;
	overflow-wrap: break-word;
}

.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { color: var(--accent); }

.entry-single .entry-title { font-size: 2rem; line-height: 1.2; letter-spacing: -.02em; }

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 18px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--line);
	color: var(--muted);
	font-size: .875rem;
}

.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item a { color: var(--muted); text-decoration: none; }
.meta-item a:hover { color: var(--accent); }
.meta-cats a { color: var(--text-2); }

.entry-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 22px;
	padding-top: 16px;
	border-top: 1px dashed var(--line-strong);
	color: var(--muted);
}

.chip {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent-strong);
	font-size: .8125rem;
	line-height: 1.6;
	text-decoration: none;
	transition: background-color .15s, color .15s;
}

.chip:hover { background: var(--accent); color: #fff; }

/* ==========================================================================
   Содержимое записи
   ========================================================================== */

.entry-content {
	overflow-wrap: break-word;
}

.entry-content > :first-child { margin-top: 0; }
.entry-content > :last-child { margin-bottom: 0; }

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content dl,
.entry-content figure { margin: 0 0 1em; }

.entry-content ul,
.entry-content ol { padding-left: 1.5em; }

.entry-content li { margin: .3em 0; }
.entry-content li > ul,
.entry-content li > ol { margin: .3em 0 0; }

.entry-content h2 { font-size: 1.375rem; margin: 1.6em 0 .6em; }
.entry-content h3 { font-size: 1.2rem; margin: 1.5em 0 .5em; }
.entry-content h4,
.entry-content h5,
.entry-content h6 { font-size: 1.05rem; margin: 1.4em 0 .5em; }

.entry-content a,
.comment-body a {
	text-decoration: underline;
	text-decoration-color: rgba(72, 112, 122, .35);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: text-decoration-color .15s, color .15s;
}

.entry-content a:hover { text-decoration-color: currentColor; }

.entry-content a.btn { text-decoration: none; }

.entry-content hr {
	height: 0;
	margin: 2em 0;
	border: 0;
	border-top: 1px solid var(--line);
}

.entry-content blockquote,
.comment-body blockquote {
	margin: 1.25em 0;
	padding: 12px 18px;
	border-left: 3px solid var(--accent);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background: var(--surface-2);
	color: var(--text-2);
}

.entry-content blockquote > :last-child,
.comment-body blockquote > :last-child { margin-bottom: 0; }

/* таблицы */
.table-wrap { margin: 1.25em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9375rem;
}

.entry-content th,
.entry-content td {
	padding: 8px 12px;
	border: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.entry-content th { background: var(--surface-2); font-weight: 600; }

/* изображения и подписи */
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }

.wp-caption { max-width: 100%; margin-bottom: 1em; }
.wp-caption img { display: block; border-radius: var(--radius-sm); }
.wp-caption-text,
.wp-caption .wp-caption-text {
	margin: 6px 0 0;
	color: var(--muted);
	font-size: .8125rem;
	text-align: center;
}

.entry-content img { border-radius: 4px; }

.more-link { margin-top: 4px; }

.page-links {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 1.5em;
	font-size: .875rem;
	color: var(--muted);
}

/* ==========================================================================
   Код
   ========================================================================== */

code, kbd, samp, pre { font-family: var(--mono); }

.entry-content code,
.comment-body code {
	padding: .12em .38em;
	border: 1px solid var(--code-line);
	border-radius: 5px;
	background: var(--code-head);
	color: #2c4f58;
	font-size: .875em;
	overflow-wrap: anywhere;
}

.entry-content pre,
.comment-body pre {
	margin: 1.25em 0;
	padding: 14px 18px;
	border: 1px solid var(--code-line);
	border-radius: var(--radius-sm);
	background: var(--code-bg);
	color: var(--text);
	font-size: 13.5px;
	line-height: 1.6;
	white-space: pre;
	overflow-x: auto;
	tab-size: 4;
	-moz-tab-size: 4;
	overflow-wrap: normal;
}

.entry-content pre code,
.comment-body pre code {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: inherit;
	overflow-wrap: normal;
}

/* рамка, которую скрипт надевает на простые <pre> */
.code-frame {
	margin: 1.25em 0;
	border: 1px solid var(--code-line);
	border-radius: var(--radius-sm);
	background: var(--code-bg);
	overflow: hidden;
}

.code-frame > pre,
.entry-content .code-frame > pre {
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none;
}

.code-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 34px;
	padding: 3px 6px 3px 14px;
	border-bottom: 1px solid var(--code-line);
	background: var(--code-head);
	font-family: var(--font);
}

.code-lang {
	color: var(--muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.code-copy {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: var(--muted);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}

.code-copy:hover { background: #fff; border-color: var(--code-line); color: var(--text); }
.code-copy.is-done { color: var(--accent); }
.code-copy .icon { width: 14px; height: 14px; }

/* ==========================================================================
   Боковая колонка
   ========================================================================== */

.sidebar {
	display: grid;
	gap: 20px;
	align-content: start;
	min-width: 0;
}

.widget { padding: 20px 22px; }

.widget-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
	color: var(--muted);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
}

.widget-title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}

.widget ul { margin: 0; padding: 0; list-style: none; }

.cat-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2px 8px;
}

.cat-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	padding: 5px 8px;
	border-radius: 6px;
	color: var(--text);
	font-size: .9375rem;
	text-decoration: none;
	transition: background-color .15s, color .15s;
}

.cat-list a:hover { background: var(--accent-soft); color: var(--accent-strong); }

.cat-list .count,
.archive-year .count {
	padding: 0 7px;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--muted);
	font-size: .75rem;
	font-variant-numeric: tabular-nums;
	line-height: 1.6;
}

.cat-list a.current { background: var(--accent); color: #fff; }
.cat-list a.current .count { background: rgba(255, 255, 255, .2); color: #fff; }

.tag-cloud { line-height: 1.85; }

.tag-cloud a {
	display: inline-block;
	margin-right: 8px;
	color: var(--accent);
	text-decoration: none;
	white-space: nowrap;
}

.tag-cloud a:hover { color: var(--accent-strong); text-decoration: underline; }

.post-list { margin: 0; padding: 0; list-style: none; }

.post-list li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 9px 0;
	border-top: 1px solid var(--line);
}

.post-list li:first-child { padding-top: 0; border-top: 0; }
.post-list li:last-child { padding-bottom: 0; }

.post-list a {
	color: var(--text);
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	overflow-wrap: break-word;
}

.post-list a:hover { color: var(--accent); }

.post-list time { color: var(--muted); font-size: .75rem; }

.widget-posts .post-list a { font-size: .9375rem; }

/* архив по годам */
.archive-year { border-top: 1px solid var(--line); }
.archive-year:first-child { border-top: 0; }

.archive-year summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 2px;
	cursor: pointer;
	list-style: none;
	font-weight: 600;
	user-select: none;
}

.archive-year summary::-webkit-details-marker { display: none; }

.archive-year summary::after {
	content: "";
	width: 7px;
	height: 7px;
	margin: 0 4px 3px auto;
	border-right: 1.8px solid var(--muted);
	border-bottom: 1.8px solid var(--muted);
	transform: rotate(45deg);
	transition: transform .15s;
}

.archive-year[open] summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.archive-year summary:hover .year { color: var(--accent); }

.archive-months {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 4px;
	padding: 2px 0 8px !important;
}

.archive-months a,
.archive-months span {
	display: block;
	padding: 4px 0;
	border-radius: 6px;
	font-size: .8125rem;
	text-align: center;
	text-decoration: none;
}

.archive-months a { background: var(--accent-soft); color: var(--accent-strong); }
.archive-months a:hover,
.archive-months a.current { background: var(--accent); color: #fff; }
.archive-months .empty span { color: var(--faint); }

.archive-all {
	display: inline-block;
	margin: 0 0 10px;
	font-size: .8125rem;
}

/* ==========================================================================
   Пагинация
   ========================================================================== */

.pagination { margin-top: 8px; }

.wp-pagenavi,
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.wp-pagenavi a,
.wp-pagenavi span,
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font-size: .9375rem;
	font-weight: 500;
	text-decoration: none;
	transition: border-color .15s, color .15s;
}

.wp-pagenavi a:hover,
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }

.wp-pagenavi span.current,
.pagination .page-numbers.current {
	border-color: var(--accent);
	background: var(--accent);
	color: #fff;
}

.wp-pagenavi span.pages,
.wp-pagenavi span.extend,
.pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
	color: var(--muted);
}

.wp-pagenavi span.pages { display: none; }

.wp-pagenavi span.extend,
.pagination .page-numbers.dots { min-width: 20px; padding: 0 2px; }

/* ==========================================================================
   Страница записи
   ========================================================================== */

.breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	margin-bottom: 12px;
	color: var(--muted);
	font-size: .8125rem;
}

.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--faint); }

.post-nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.post-nav-item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 20px;
	text-decoration: none;
	transition: border-color .15s, transform .15s;
}

.post-nav-item:hover { border-color: var(--accent); transform: translateY(-1px); }

.post-nav-item .label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--muted);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.post-nav-item .title {
	color: var(--text);
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: break-word;
}

.post-nav-item:hover .title { color: var(--accent); }
.post-nav-item.next { align-items: flex-end; text-align: right; }

.section-title {
	margin: 0 0 16px;
	font-size: 1.25rem;
	letter-spacing: -.01em;
}

.section-title .count {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 9px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent-strong);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: 0;
	vertical-align: 3px;
}

.related { padding: 24px var(--pad); }

.related .post-list li {
	flex-direction: row;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}

.related .post-list time { flex: none; white-space: nowrap; }

/* ==========================================================================
   Комментарии
   ========================================================================== */

.comments-area { padding: 24px var(--pad); }

.comments-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.comments-head .section-title { margin: 0; }

.comment-list,
.ping-list { margin: 0 0 8px; padding: 0; list-style: none; }

.comment-list > li { padding: 18px 0; border-top: 1px solid var(--line); }
.comment-list > li:first-child { border-top: 0; }

.comment-card {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	gap: 14px;
}

.avatar {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	overflow: hidden;
	border-radius: 50%;
	background: #7b868c;
	color: #fff;
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .02em;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-0 { background: #48707a; }
.avatar-1 { background: #6b7d86; }
.avatar-2 { background: #66755a; }
.avatar-3 { background: #85735f; }
.avatar-4 { background: #56607a; }
.avatar-5 { background: #7d6676; }

.comment-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 10px;
}

.comment-author { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.comment-author a { color: inherit; text-decoration: none; }
.comment-author a:hover { color: var(--accent); }

.badge {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1.6;
	text-transform: uppercase;
}

.comment-date { color: var(--muted); font-size: .8125rem; text-decoration: none; }
.comment-date:hover { color: var(--accent); }

.comment-moderation {
	margin: 6px 0 0;
	color: #8a6a1f;
	font-size: .875rem;
}

.comment-body {
	margin-top: 4px;
	line-height: 1.65;
	overflow-wrap: anywhere;
}

.comment-body p { margin: 0 0 .7em; }
.comment-body > :last-child { margin-bottom: 0; }
.comment-body blockquote { margin: .5em 0 .8em; padding: 8px 14px; font-size: .9375rem; }
.comment-body pre { font-size: 13px; }

.is-author > .comment-card .avatar { box-shadow: 0 0 0 3px var(--accent-soft); }

.comment-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin-top: 8px;
	font-size: .8125rem;
}

.link-btn,
.comment-actions a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--muted);
	font-size: inherit;
	text-decoration: none;
	cursor: pointer;
}

.link-btn:hover,
.comment-actions a:hover { color: var(--accent); }

.link-btn .icon,
.comment-actions .icon { width: 14px; height: 14px; }

.pings-title {
	margin: 18px 0 8px;
	color: var(--muted);
	font-size: .875rem;
	text-transform: uppercase;
	letter-spacing: .08em;
}

.ping-list li { padding: 6px 0; font-size: .875rem; color: var(--muted); }

.comments-closed { margin: 12px 0 0; color: var(--muted); }

.comment-respond {
	margin-top: 12px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

.comment-respond:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.comment-form {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px 16px;
}

.comment-form > * { grid-column: 1 / -1; margin: 0; }
.comment-form > .field-author,
.comment-form > .field-email,
.comment-form > .field-url { grid-column: auto; }

.comment-form label {
	display: block;
	margin-bottom: 6px;
	color: var(--text-2);
	font-size: .8125rem;
	font-weight: 600;
}

.comment-form .hint { color: var(--muted); font-weight: 400; }
.comment-form .req { color: #b4442f; }

.field-consent { display: flex; align-items: center; gap: 8px; }
.field-consent label { margin: 0; font-weight: 400; }

.logged-in-as { color: var(--muted); font-size: .875rem; }

.form-submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
}

.submit-hint { color: var(--muted); font-size: .8125rem; }

.comments-feed { margin: 18px 0 0; font-size: .8125rem; }
.comments-feed a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.comments-feed a:hover { color: var(--accent); }

/* ==========================================================================
   Архивы, поиск, 404
   ========================================================================== */

.archive-header { padding: 24px var(--pad); }

.eyebrow {
	margin: 0 0 4px;
	color: var(--accent);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.archive-title {
	margin: 0;
	font-size: 1.75rem;
	letter-spacing: -.02em;
	overflow-wrap: break-word;
}

.archive-desc { margin-top: 8px; color: var(--text-2); }
.archive-desc p { margin: 0; }
.archive-header .search-form { max-width: 480px; margin-top: 16px; }
.archive-count { margin: 10px 0 0; color: var(--muted); font-size: .875rem; }

.empty-state { padding: 28px var(--pad); }
.empty-state p { color: var(--text-2); }
.empty-state .search-form { max-width: 480px; }

.error-404 { padding: 44px var(--pad); text-align: center; }

.error-404 .error-code {
	position: relative;
	display: inline-block;
	max-width: none;
	margin: 0 0 6px;
	color: #d3d8dc;
	font-size: 6.5rem;
	font-weight: 800;
	letter-spacing: .04em;
	line-height: 1;
}

.error-404 .error-code::after {
	content: "";
	position: absolute;
	inset: 0 -10%;
	background: linear-gradient(to top right, transparent calc(50% - 1px), var(--line-strong) 50%, transparent calc(50% + 1px));
}

.error-404 .entry-title { font-size: 1.75rem; }
.error-404 p { max-width: 560px; margin-inline: auto; color: var(--text-2); }
.error-404 .search-form { max-width: 440px; margin: 22px auto; }

/* ==========================================================================
   Подвал
   ========================================================================== */

.site-footer {
	margin-top: 44px;
	background: linear-gradient(180deg, var(--graphite) 0%, var(--graphite-2) 100%);
	color: rgba(255, 255, 255, .7);
	font-size: .875rem;
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px 32px;
	padding-block: 28px;
}

.copyright { margin: 0; color: #fff; font-weight: 600; }
.tagline { margin: 2px 0 0; font-size: .8125rem; }

.footer-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 20px;
}

.footer-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer a { color: rgba(255, 255, 255, .78); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: var(--accent-on-dark); }

.footer-rss { display: inline-flex; align-items: center; gap: 6px; }

.counters img { display: block; border-radius: 3px; opacity: .85; }
.counters a:hover img { opacity: 1; }

.to-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 20;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--graphite);
	color: #fff;
	box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45);
	opacity: 0;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity .2s, transform .2s, background-color .15s;
}

.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--accent); }
.to-top .icon { width: 20px; height: 20px; }

/* ==========================================================================
   Адаптивность
   ========================================================================== */

@media (max-width: 1040px) {
	.site-header::before { left: 42%; bottom: auto; width: 58%; height: 64px; }
	.header-inner { flex-wrap: wrap; gap: 0 16px; min-height: 64px; }
	.js .nav-toggle { display: grid; }
	.header-panel {
		flex-basis: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 4px 0 16px;
	}
	.js .header-panel:not(.is-open) { display: none; }
	.main-nav ul { flex-direction: column; }
	.main-nav a { padding: 10px 12px; }
	.main-nav .current-menu-item > a,
	.main-nav .current_page_item > a { background: rgba(255, 255, 255, .08); }
	.main-nav .current-menu-item > a::after,
	.main-nav .current_page_item > a::after { display: none; }
	.site-header .search-form { flex: none; width: 100%; }
	.site-header .search-field { padding-block: 10px; font-size: 1rem; }
}

@media (max-width: 1000px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
	:root { --pad: 18px; }
	body { font-size: 15.5px; }
	.container { padding-inline: 16px; }
	.layout { gap: 20px; padding-top: 16px; }
	.site-main, .post-feed, .sidebar { gap: 16px; }
	.sidebar { grid-template-columns: minmax(0, 1fr); }

	.brand-name { font-size: 22px; }
	.brand-mark { width: 34px; height: 34px; }

	.entry-title { font-size: 1.3rem; }
	.entry-single .entry-title { font-size: 1.6rem; }
	.archive-title { font-size: 1.5rem; }
	.entry-meta { gap: 4px 14px; font-size: .8125rem; }

	/* код — во всю ширину карточки */
	.entry-content > pre,
	.entry-content > .code-frame,
	.entry-content > .wp-geshi-highlight-wrap5 {
		margin-inline: calc(var(--pad) * -1);
		border-radius: 0;
		border-left: 0;
		border-right: 0;
	}
	.entry-content > pre { padding-inline: var(--pad); }
	.entry-content > .code-frame .code-head { padding-left: var(--pad); }
	.entry-content > .code-frame > pre { padding-inline: var(--pad); }

	.post-nav { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.post-nav-item.next { align-items: flex-start; text-align: left; }

	.related .post-list li { flex-direction: column; gap: 2px; }

	.comment-form { grid-template-columns: minmax(0, 1fr); }
	.comment-card { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
	.avatar { width: 32px; height: 32px; font-size: .75rem; }
	.submit-hint { display: none; }

	.wp-pagenavi a, .wp-pagenavi span { min-width: 36px; height: 36px; padding: 0 8px; }
	.wp-pagenavi .first, .wp-pagenavi .last, .wp-pagenavi .extend,
	.wp-pagenavi .larger, .wp-pagenavi .smaller { display: none; }

	.footer-inner { flex-direction: column; align-items: flex-start; }
	.to-top { right: 14px; bottom: 14px; }
	.error-404 .error-code { font-size: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Печать
   ========================================================================== */

@media print {
	body { background: #fff; font-size: 12pt; }
	.site-header, .sidebar, .site-footer, .to-top, .comment-respond, .comments-feed,
	.comment-actions, .post-nav, .code-copy, .pagination, .skip-link { display: none !important; }
	.layout { display: block; padding: 0; }
	.card { border: 0; box-shadow: none; padding: 0 !important; }
	.entry-content a { color: inherit; }
	pre, .wp-geshi-highlight { white-space: pre-wrap !important; overflow: visible !important; }
}
