/* ============================================================
   Переменные
   ============================================================ */

:root {
	--bg:          #fff;
	--text:        #111;
	--muted:       #657080;
	--line:        #d9dce0;
	--surface:     #f5f5f3;
	--accent:      #f6821f;
	--page-max:    1380px;
	--page-gutter: 24px;
	--header-height: 72px;
	--font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	--ease: 180ms ease;
}

[data-theme="dark"] {
	--bg:      #0f1216;
	--text:    #e8eaed;
	--muted:   #9aa3ae;
	--line:    #2a2f37;
	--surface: #171b21;
	--accent:  #ffa04d;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	color: var(--text);
	background: var(--bg);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	transition: background-color .2s ease, color .2s ease;
}

html,
body {
	max-width: 100%;
	overflow-x: clip;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

.blog-heading h1,
.featured-title,
.post-title,
.single-title,
.post-excerpt,
.featured-excerpt {
	overflow-wrap: break-word;
	word-wrap: break-word;
}

body.menu-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }

button, input { font: inherit; }
button { color: inherit; cursor: pointer; }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border: 0;
}

.content-width,
.page-grid,
.header-grid,
.panel-grid,
.mobile-panel-inner {
	width: calc(100% - 2 * var(--page-gutter));
	max-width: var(--page-max);
	margin-inline: auto;
}


/* ============================================================
   Шапка
   ============================================================ */

.site-header {
	position: relative;
	z-index: 100;
	min-height: var(--header-height);
	border-bottom: 1px solid var(--line);
	background: var(--bg);
}

.header-grid {
	min-height: var(--header-height);
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
}

.site-logo {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -.045em;
}

.desktop-nav { display: none; }

.header-actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.icon-button {
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	background: transparent;
}

.search-trigger svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
}

.mobile-trigger {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}

.mobile-trigger span {
	width: 21px;
	height: 1px;
	background: currentColor;
	transition: transform var(--ease);
}

body.menu-open .mobile-trigger span:first-child {
	transform: translateY(3.5px) rotate(45deg);
}
body.menu-open .mobile-trigger span:last-child {
	transform: translateY(-3.5px) rotate(-45deg);
}

/* Иконка темы */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }

[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============================================================
   Панель категорий (десктоп)
   ============================================================ */

.category-panel {
	position: absolute;
	top: var(--header-height);
	left: 0;
	right: 0;
	z-index: 90;
	background: var(--bg);
	border-bottom: 1px solid var(--line);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
}

.category-panel.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.panel-grid {
	padding: 38px 0 44px;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 48px;
}

.panel-grid > div {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 11px;
}

.menu-label {
	margin-bottom: 8px;
	color: var(--muted);
	font-size: 11px;
	line-height: 1.2;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.panel-grid a:hover,
.mobile-links a:hover,
.footer-column a:hover { color: var(--accent); }

/* ============================================================
   Мобильное меню
   ============================================================ */

.mobile-panel {
	position: fixed;
	inset: var(--header-height) 0 0;
	z-index: 95;
	overflow-y: auto;
	background: var(--bg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
}

body.menu-open .mobile-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.mobile-panel-inner { padding-bottom: 40px; }

.mobile-panel-head {
	min-height: 58px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--line);
}

.mobile-close {
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 30px;
	font-weight: 300;
	line-height: 1;
}

.mobile-section,
.mobile-links { border-bottom: 1px solid var(--line); }

.accordion-trigger {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 0;
	border: 0;
	background: transparent;
	font-size: 21px;
	text-align: left;
}

.accordion-trigger span { transition: transform var(--ease); }
.mobile-section.is-open .accordion-trigger span { transform: rotate(45deg); }

.accordion-content {
	display: grid;
	grid-template-rows: 0fr;
	overflow: hidden;
	transition: grid-template-rows 240ms ease;
}

.accordion-content::before { content: ""; min-height: 0; }
.mobile-section.is-open .accordion-content { grid-template-rows: 1fr; }

.accordion-content a {
	min-height: 0;
	padding: 6px 0;
	color: var(--muted);
}

.accordion-content a:last-child { padding-bottom: 22px; }

.mobile-links a {
	display: block;
	padding: 20px 0;
	font-size: 21px;
}

/* ============================================================
   Заголовок блога
   ============================================================ */

.blog-heading { border-bottom: 1px solid var(--line); }

.heading-cell { padding: 52px 0 46px; }

.blog-heading h1 {
	margin: 0;
	font-size: clamp(52px, 10vw, 100px);
	font-weight: 500;
	line-height: .92;
	letter-spacing: -.065em;
}

.blog-heading p {
	max-width: 600px;
	margin: 18px 0 0;
	color: var(--muted);
	font-size: 17px;
}

/* ============================================================
   Избранная статья
   ============================================================ */

.featured { border-bottom: 1px solid var(--line); }

.featured-post { padding: 28px 0 42px; }

.post-meta {
	margin-bottom: 20px;
	color: #607080;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11px;
	letter-spacing: .055em;
	text-transform: uppercase;
}

[data-theme="dark"] .post-meta { color: var(--muted); }

.featured-layout {
	display: grid;
	gap: 28px;
}

.post-copy { min-width: 0; }

.featured-title {
	display: block;
	max-width: 900px;
	font-size: clamp(34px, 6vw, 60px);
	font-weight: 500;
	line-height: 1.02;
	letter-spacing: -.055em;
}

.featured-title:hover,
.post-title:hover { color: var(--accent); }

.featured-excerpt,
.post-excerpt {
	max-width: 800px;
	margin: 18px 0 25px;
	color: var(--muted);
	font-size: 16px;
	line-height: 1.55;
}

.authors {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0 8px;
	color: var(--text);
	font-size: 12px;
}

.avatar {
	width: 28px;
	height: 28px;
	display: inline-grid;
	place-items: center;
	margin-right: -6px;
	border: 2px solid var(--bg);
	border-radius: 50%;
	background: var(--surface);
	font-size: 10px;
	font-weight: 600;
	overflow: hidden;
}

.avatar .avatar-image {
	width: 24px;
	height: 24px;
	display: block;
	margin: 0;
	border: 0;
	border-radius: 50%;
}

.featured-media {
	display: block;
	aspect-ratio: 16/9;
	overflow: hidden;
	background: var(--surface);
}

.featured-media img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	transition: transform 400ms ease;
}

.featured-media:hover img { transform: scale(1.02); }

.media-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--surface);
}

/* ============================================================
   Сетка статей
   ============================================================ */

/* ============================================================
   Сетка статей
   ============================================================ */

.post-grid {
	display: grid;
	grid-template-columns: 1fr;
}

.post {
	min-width: 0;
	padding: 34px 0 40px;
	border-bottom: 1px solid var(--line);
}

.post-title {
	display: block;
	font-size: clamp(28px, 4vw, 39px);
	font-weight: 500;
	line-height: 1.06;
	letter-spacing: -.045em;
}

.post-excerpt {
	margin-top: 17px;
	margin-bottom: 25px;
	color: var(--muted);
	font-size: 16px;
	line-height: 1.55;
}

.authors {
	margin-top: auto;
}

.load-more-wrap {
	display: flex;
	justify-content: center;
	padding: 42px 0 64px;
}

.load-more {
	min-width: 145px;
	min-height: 45px;
	padding: 0 20px;
	border: 1px solid var(--text);
	background: transparent;
}

.load-more:hover {
	color: var(--bg);
	background: var(--text);
}

.empty-state {
	padding: 60px 0;
	color: var(--muted);
}

/* ============================================================
   Подписка (форма)
   ============================================================ */

.newsletter {
	border-top: 1px solid var(--line);
	background: var(--surface);
}

.newsletter-inner {
	padding-block: 58px;
	display: grid;
	gap: 30px;
}

.newsletter h2 {
	margin: 0;
	font-size: 32px;
	font-weight: 500;
	letter-spacing: -.045em;
}

.newsletter p {
	margin: 8px 0 0;
	color: var(--muted);
}

.newsletter-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.newsletter-form input,
.newsletter-form button {
	min-height: 48px;
	border-radius: 0;
}

.newsletter-form input {
	width: 100%;
	padding: 0 14px;
	border: 1px solid var(--line);
	background: var(--bg);
	color: var(--text);
	outline: 0;
}

.newsletter-form input:focus { border-color: var(--text); }

.newsletter-form button {
	padding: 0 22px;
	border: 1px solid var(--text);
	background: var(--text);
	color: var(--bg);
}

.newsletter-form button:disabled {
	opacity: .55;
	cursor: wait;
}

.subscription-message {
	min-height: 18px;
	margin-top: 3px;
	font-size: 12px;
	color: var(--muted);
}

.subscription-message.is-success { color: #27754a; }
.subscription-message.is-error   { color: #b43c32; }

@media (min-width: 760px) {
	.newsletter-form {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
	}
	.newsletter-form input { flex: 1; min-width: 0; }
	.newsletter-form .subscription-message { flex-basis: 100%; margin-top: 6px; }
}

/* ============================================================
   Подвал
   ============================================================ */

.site-footer {
	padding-block: 56px 20px;
	background: var(--text);
	color: var(--bg);
}

.footer-grid {
	display: grid;
	gap: 45px;
}

.footer-brand {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -.045em;
}

.footer-column {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 9px;
}

.footer-column .menu-label { color: #888; }
.footer-column a { color: #ddd; font-size: 14px; }

.footer-bottom {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin-top: 56px;
	padding-top: 18px;
	border-top: 1px solid #333;
	color: #888;
	font-size: 12px;
}

/* ============================================================
   WordPress-интеграция
   ============================================================ */

.site-logo .custom-logo-link { display: flex; align-items: center; }
.site-logo .custom-logo { display: block; width: auto; max-height: 46px; }
.site-logo img { max-width: 180px; }

.desktop-nav .menu-item { list-style: none; }
.desktop-nav ul {
	display: flex;
	align-items: center;
	gap: 27px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.desktop-nav ul ul { display: none; }
.desktop-nav .menu-item a { color: var(--muted); font-size: 13px; }
.desktop-nav .menu-item a:hover { color: var(--text); }

.mobile-links ul { list-style: none; margin: 0; padding: 0; }
.mobile-links li { margin: 0; }
.mobile-links a { display: block; padding: 20px 0; font-size: 21px; }

.archive-pagination { padding: 40px 0 70px; }
.archive-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.archive-pagination a,
.archive-pagination span {
	padding: 8px 12px;
	border: 1px solid var(--line);
	font-size: 13px;
}
.archive-pagination .current {
	background: var(--text);
	color: var(--bg);
	border-color: var(--text);
}

.single-page { padding-top: 60px; padding-bottom: 80px; }
.single-post { max-width: 940px; margin: 0 auto; }

.single-title {
	margin: 0 0 24px;
	font-size: clamp(44px, 7vw, 76px);
	font-weight: 500;
	line-height: .98;
	letter-spacing: -.06em;
}

.single-image { margin: 50px 0; }
.single-image img { width: 100%; height: auto; display: block; }

.single-content {
	max-width: 760px;
	margin: 50px auto 0;
	font-size: 18px;
	line-height: 1.7;
}

.single-content h2 {
	margin-top: 2em;
	font-size: 34px;
	line-height: 1.1;
	letter-spacing: -.04em;
}

.single-content h3 {
	margin-top: 1.8em;
	font-size: 26px;
	line-height: 1.15;
}

.single-content img { height: auto; }
.single-content a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.single-content blockquote {
	margin: 2em 0;
	padding-left: 24px;
	border-left: 2px solid var(--text);
	color: var(--muted);
}

@media (min-width: 760px) {
	.single-page { padding-top: 80px; }
	.single-content { font-size: 19px; }
}