/*
|--------------------------------------------------------------------------
| Базовые переменные
|--------------------------------------------------------------------------
*/

:root {
	--adminbar-height: 0px;
	--header-height: 64px;

	--page-bg: #f3f5f7;
	--card-bg: #ffffff;
	--text: #202938;
	--muted: #697586;
	--border: #d9e0e7;
	--primary: #1769aa;
	--primary-hover: #0f4f82;
	--dark: #17212b;

	--sidebar-width: 270px;
	--gap: 20px;
	--radius: 8px;
}

body.admin-bar {
	--adminbar-height: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		--adminbar-height: 46px;
	}
}

/*
|--------------------------------------------------------------------------
| Базовые стили
|--------------------------------------------------------------------------
*/

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--page-bg);
	color: var(--text);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	line-height: 1.55;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--primary);
	text-decoration: none;
}

a:hover,
a:focus {
	color: var(--primary-hover);
	text-decoration: underline;
}

/*
|--------------------------------------------------------------------------
| Фиксированная верхняя панель
|--------------------------------------------------------------------------
*/

.site-header {
	position: fixed;
	top: var(--adminbar-height);
	right: 0;
	left: 0;
	z-index: 99990;
	min-height: var(--header-height);
	background: var(--dark);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.header-row {
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: var(--header-height);
	padding: 8px 24px;
}

.brand {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 10px;
	max-width: 260px;
	min-width: 0;
}

.brand-logo {
	display: flex;
	align-items: center;
}

.brand-logo .custom-logo {
	display: block;
	width: auto;
	max-width: 44px;
	max-height: 44px;
}

.brand-title {
	overflow: hidden;
	color: #ffffff;
	font-size: 18px;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brand-title:hover,
.brand-title:focus {
	color: #ffffff;
	text-decoration: none;
}

/*
|--------------------------------------------------------------------------
| Верхнее и нижнее меню
|--------------------------------------------------------------------------
*/

.top-menu,
.bottom-menu {
	overflow-x: auto;
	min-width: 0;
	-webkit-overflow-scrolling: touch;
}

.top-menu {
	flex: 1 1 auto;
}

.top-menu ul,
.bottom-menu ul {
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
	white-space: nowrap;
}

.top-menu li,
.bottom-menu li {
	flex: 0 0 auto;
}

.top-menu a {
	display: block;
	padding: 8px 10px;
	color: #dce6ee;
	font-size: 14px;
	font-weight: 600;
	border-radius: 5px;
}

.top-menu a:hover,
.top-menu a:focus,
.top-menu .current-menu-item > a,
.top-menu .current_page_item > a {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.14);
	text-decoration: none;
}

/*
|--------------------------------------------------------------------------
| Главная сетка: сайдбар + контент
|--------------------------------------------------------------------------
*/

.site-shell {
	min-height: 100vh;
	padding: calc(var(--adminbar-height) + var(--header-height) + 24px) 24px 30px;
}

.site-grid {
	display: grid;
	grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
	align-items: start;
	gap: var(--gap);
	width: 100%;
	max-width: 1500px;
	margin: 0 auto;
}

.sidebar {
	position: sticky;
	top: calc(var(--adminbar-height) + var(--header-height) + 20px);
}

.content {
	min-width: 0;
}

/*
|--------------------------------------------------------------------------
| Карточки: записи, страницы, результаты агрегатора
|--------------------------------------------------------------------------
*/

.content-card,
.post-card,
.page-card,
.not-found-card,
.comments-area {
	margin-bottom: var(--gap);
	padding: 24px;
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.page-title,
.entry-title {
	margin: 0 0 14px;
	color: var(--text);
	font-size: 30px;
	line-height: 1.2;
}

.entry-title a {
	color: inherit;
}

.entry-title a:hover,
.entry-title a:focus {
	color: var(--primary);
	text-decoration: none;
}

.entry-meta {
	margin-bottom: 16px;
	color: var(--muted);
	font-size: 13px;
}

.entry-content,
.entry-summary {
	overflow-wrap: break-word;
}

.entry-content > :first-child,
.entry-summary > :first-child {
	margin-top: 0;
}

.entry-content > :last-child,
.entry-summary > :last-child {
	margin-bottom: 0;
}

.entry-content table {
	display: block;
	overflow-x: auto;
	max-width: 100%;
	border-collapse: collapse;
}

.entry-content th,
.entry-content td {
	padding: 9px;
	border: 1px solid var(--border);
	text-align: left;
}

.entry-content iframe,
.entry-content video {
	max-width: 100%;
}

.entry-content pre {
	overflow-x: auto;
	padding: 16px;
	color: #eef4f8;
	border-radius: 6px;
	background: #17212b;
}

/*
|--------------------------------------------------------------------------
| Сайдбар и виджеты WordPress
|--------------------------------------------------------------------------
*/

.widget {
	margin-bottom: var(--gap);
	padding: 18px;
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.widget-title {
	margin: 0 0 12px;
	font-size: 17px;
	line-height: 1.3;
}

.widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.widget li {
	padding: 7px 0;
	border-bottom: 1px solid #edf0f3;
}

.widget li:last-child {
	border-bottom: 0;
}

/*
|--------------------------------------------------------------------------
| Формы
|--------------------------------------------------------------------------
*/

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
	width: 100%;
	max-width: 100%;
	padding: 9px 10px;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 5px;
	background: #ffffff;
}

textarea {
	min-height: 130px;
}

button,
input[type="submit"] {
	padding: 9px 14px;
	cursor: pointer;
	color: #ffffff;
	border: 0;
	border-radius: 5px;
	background: var(--primary);
}

button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
	background: var(--primary-hover);
}

/*
|--------------------------------------------------------------------------
| Пагинация
|--------------------------------------------------------------------------
*/

.navigation {
	margin: 20px 0;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	min-height: 36px;
	padding: 6px 10px;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 5px;
	background: #ffffff;
}

.page-numbers.current,
.page-numbers:hover,
.page-numbers:focus {
	color: #ffffff;
	border-color: var(--primary);
	background: var(--primary);
	text-decoration: none;
}

/*
|--------------------------------------------------------------------------
| Подвал
|--------------------------------------------------------------------------
*/

.site-footer {
	padding: 22px 24px;
	color: #b7c3cf;
	background: var(--dark);
}

.footer-row {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	max-width: 1500px;
	margin: 0 auto;
}

.bottom-menu a {
	display: block;
	padding: 5px 8px;
	color: #dce6ee;
	font-size: 14px;
}

.bottom-menu a:hover,
.bottom-menu a:focus,
.bottom-menu .current-menu-item > a,
.bottom-menu .current_page_item > a {
	color: #ffffff;
	text-decoration: underline;
}

.copyright {
	font-size: 13px;
}

/*
|--------------------------------------------------------------------------
| Планшеты и телефоны
|--------------------------------------------------------------------------
*/

@media screen and (max-width: 850px) {
	.site-shell {
		padding-right: 16px;
		padding-left: 16px;
	}

	.site-grid {
		grid-template-columns: 1fr;
	}

	.content {
		order: 1;
	}

	.sidebar {
		position: static;
		order: 2;
	}

	.site-footer {
		padding-right: 16px;
		padding-left: 16px;
	}
}

@media screen and (max-width: 600px) {
	:root {
		--header-height: 58px;
	}

	.header-row {
		gap: 10px;
		padding-right: 14px;
		padding-left: 14px;
	}

	.brand {
		max-width: 145px;
	}

	.brand-logo .custom-logo {
		max-width: 34px;
		max-height: 34px;
	}

	.brand-title {
		font-size: 15px;
	}

	.top-menu a {
		padding: 7px 8px;
		font-size: 13px;
	}

	.content-card,
	.post-card,
	.page-card,
	.not-found-card,
	.comments-area {
		padding: 18px;
	}

	.page-title,
	.entry-title {
		font-size: 25px;
	}
}

/*
|--------------------------------------------------------------------------
| Цвета из Customizer
|--------------------------------------------------------------------------
*/

:root {
	--header-bg: #17212b;
	--header-text: #ffffff;
	--header-link: #dce6ee;
	--header-active-bg: #1769aa;
	--header-active-text: #ffffff;

	--widget-bg: #ffffff;
	--widget-title: #202938;

	--footer-bg: #17212b;
	--footer-text: #b7c3cf;
	--footer-link: #dce6ee;
}

/*
|--------------------------------------------------------------------------
| Описание в шапке
|--------------------------------------------------------------------------
*/

.header-description {
	overflow: hidden;
	flex: 0 1 310px;
	color: var(--header-text);
	font-size: 13px;
	opacity: 0.78;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/*
|--------------------------------------------------------------------------
| Шапка и верхнее меню
|--------------------------------------------------------------------------
*/

.site-header {
	background: var(--header-bg);
}

.brand-title {
	color: var(--header-text);
}

.brand-title:hover,
.brand-title:focus {
	color: var(--header-text);
}

.top-menu a {
	color: var(--header-link);
}

.top-menu a:hover,
.top-menu a:focus {
	color: var(--header-active-text);
	background: var(--header-active-bg);
}

.top-menu .current-menu-item > a,
.top-menu .current_page_item > a,
.top-menu .current-menu-ancestor > a {
	color: var(--header-active-text);
	background: var(--header-active-bg);
}

/*
|--------------------------------------------------------------------------
| Основной контент
|--------------------------------------------------------------------------
*/

body {
	background: var(--page-bg);
	color: var(--text);
}

a {
	color: var(--primary);
}

.content-card,
.post-card,
.page-card,
.not-found-card,
.comments-area {
	background: var(--card-bg);
}

.page-title,
.entry-title {
	color: var(--text);
}

/*
|--------------------------------------------------------------------------
| Виджеты
|--------------------------------------------------------------------------
*/

.widget {
	background: var(--widget-bg);
}

.widget-title {
	color: var(--widget-title);
}

/*
|--------------------------------------------------------------------------
| Подвал и нижнее меню
|--------------------------------------------------------------------------
*/

.site-footer {
	color: var(--footer-text);
	background: var(--footer-bg);
}

.bottom-menu a {
	color: var(--footer-link);
}

.bottom-menu a:hover,
.bottom-menu a:focus,
.bottom-menu .current-menu-item > a,
.bottom-menu .current_page_item > a,
.bottom-menu .current-menu-ancestor > a {
	color: var(--header-active-text);
	text-decoration: underline;
}

/*
|--------------------------------------------------------------------------
| Мобильный вид
|--------------------------------------------------------------------------
*/

@media screen and (max-width: 850px) {
	.header-description {
		display: none;
	}
}