/*
Theme Name: Base
Theme URI: 
Author: 
Author URI: 
Description: Легкая базовая тема WordPress с правильной структурой и адаптивностью
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: base
Tags: blog, one-column, custom-menu, featured-images, threaded-comments, translation-ready
*/

/*--------------------------------------------------------------
# Reset & Base
--------------------------------------------------------------*/
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 16px;
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	line-height: 1.6;
	color: #333;
	background-color: #fff;
}

/*--------------------------------------------------------------
# Typography
--------------------------------------------------------------*/
h1, h2, h3, h4, h5, h6 {
	font-weight: 600;
	line-height: 1.2;
	margin-bottom: 1em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
	margin-bottom: 1.5em;
}

a {
	color: #0073aa;
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: #005177;
}

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

/*--------------------------------------------------------------
# Lists
--------------------------------------------------------------*/
ul, ol {
	margin: 0 0 1.5em 0;
	padding-left: 2em;
}

ul {
	list-style: none;
}

ul li {
	position: relative;
	padding-left: 1.5em;
	margin-bottom: 0.75em;
	line-height: 1.6;
}

ul li::before {
	content: '\f0da';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	position: absolute;
	left: 0;
	color: #0073aa;
	font-size: 0.875rem;
}

ol {
	list-style: decimal;
	counter-reset: item;
}

ol li {
	margin-bottom: 0.75em;
	line-height: 1.6;
	padding-left: 0.5em;
}

ol li::marker {
	color: #0073aa;
	font-weight: 600;
}

ul ul, ol ol, ul ol, ol ul {
	margin-top: 0.75em;
	margin-bottom: 0.75em;
}

/* Вложенные списки */
ul ul li::before {
	content: '\f0d9';
}

ul ul ul li::before {
	content: '\f105';
}

/*--------------------------------------------------------------
# Mark (Highlight)
--------------------------------------------------------------*/
mark {
	background: linear-gradient(120deg, #fff3cd 0%, #ffe69c 100%);
	color: #333;
	padding: 3px 8px;
	border-radius: 4px;
	font-weight: 600;
	box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
	position: relative;
	display: inline-block;
}

/*--------------------------------------------------------------
# Tables
--------------------------------------------------------------*/
table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5em 0;
	background-color: #fff;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

thead {
	background-color: #0073aa;
	color: #fff;
}

thead th {
	padding: 12px 15px;
	text-align: left;
	font-weight: 600;
	font-size: 0.9375rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

tbody tr {
	border-bottom: 1px solid #e5e5e5;
	transition: background-color 0.2s ease;
}

tbody tr:hover {
	background-color: #f8f9fa;
}

tbody tr:last-child {
	border-bottom: none;
}

tbody td {
	padding: 12px 15px;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: #333;
}

tbody th {
	padding: 12px 15px;
	font-weight: 600;
	text-align: left;
	color: #333;
}

tfoot {
	background-color: #f8f9fa;
	border-top: 2px solid #e5e5e5;
}

tfoot td,
tfoot th {
	padding: 12px 15px;
	font-weight: 600;
	color: #333;
}

/* Адаптивность для таблиц */
@media screen and (max-width: 768px) {
	table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	thead th,
	tbody td,
	tbody th,
	tfoot td,
	tfoot th {
		padding: 10px 12px;
		font-size: 0.875rem;
	}
}

/*--------------------------------------------------------------
# Layout
--------------------------------------------------------------*/
.site {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
	border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
}

.site-header {
	width: 100%;
	background-color: #fff;
	border-bottom: 1px solid #e5e5e5;
	margin-bottom: 40px;
}

.site-header-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 24px;
}

.site-branding {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 15px;
	flex: 0 0 auto;
}

.custom-logo-link {
	display: inline-flex;
	justify-content: flex-start;
	margin: 0;
}

.site-title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0;
}

.site-title a {
	color: #333;
}

.site-description {
	font-size: 0.875rem;
	color: #666;
	margin: 0;
}

/*--------------------------------------------------------------
# Navigation
--------------------------------------------------------------*/
.main-navigation {
	margin-top: 0;
	margin-left: auto;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 1 1 auto;
}

.main-navigation ul,
.main-navigation .menu {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	justify-content: flex-end;
	width: 100%;
}

.main-navigation li {
	padding-left: 0;
	margin-bottom: 0;
	line-height: inherit;
}

.main-navigation li::before {
	content: none;
}

.main-navigation a {
	display: inline-block;
	color: #2f2f2f;
	font-weight: 500;
	padding: 8px 12px;
	border-radius: 8px;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.main-navigation a:hover {
	color: #0b5f86;
	background-color: #f3f7fa;
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_parent > a {
	color: #0b5f86;
	background-color: #eaf3f8;
}

.menu-toggle {
	display: none;
	background: #fff;
	border: 1px solid #d8d8d8;
	border-radius: 8px;
	padding: 10px 15px;
	cursor: pointer;
	font-size: 1rem;
	color: #2f2f2f;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.menu-toggle::before {
	content: '\2630';
	display: inline-block;
	margin-right: 8px;
	font-size: 1rem;
	line-height: 1;
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.main-navigation.toggled .menu-toggle {
	background-color: #f3f7fa;
	border-color: #bfd8e6;
	color: #0b5f86;
}

.main-navigation.toggled .menu-toggle::before {
	content: '\2715';
	transform: rotate(90deg);
}

/*--------------------------------------------------------------
# Content
--------------------------------------------------------------*/
.content-area {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 40px;
	margin-bottom: 40px;
}

.site-main {
	min-width: 0;
}

body:not(.singular) .archive-wrapper {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Универсальная сетка карточек */
.posts-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

/* Универсальная карточка */
.posts-grid > .post {
	margin: 0;
	padding: 15px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
	display: flex;
	flex-direction: column;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	flex: 0 0 calc((100% - 60px) / 4);
	max-width: calc((100% - 60px) / 4);
	box-sizing: border-box;
}

.posts-grid > .post:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transform: translateY(-2px);
}

/* То, что ты просил */
.post-thumbnail {
	text-align: center;
	display: flex;
	justify-content: center;
}

.post-thumbnail img {
	width: 330px;
	height: auto;
}

/* На одиночных страницах не фиксируем ширину картинки */


/* Плиточная миниатюра */
.posts-grid > .post .post-thumbnail {
	margin: 0 0 10px;
	border-radius: 6px;
	overflow: hidden;
	height: 150px;
	align-items: center;
}

.posts-grid > .post .post-thumbnail img {
	max-height: 100%;
	object-fit: contain;
	object-position: center;
}

@media screen and (max-width: 1200px) {
	.posts-grid > .post {
		flex: 0 0 calc((100% - 40px) / 3);
		max-width: calc((100% - 40px) / 3);
	}
}

@media screen and (max-width: 768px) {
	.posts-grid > .post {
		flex: 0 0 calc((100% - 20px) / 2);
		max-width: calc((100% - 20px) / 2);
	}
}

@media screen and (max-width: 480px) {
	.posts-grid > .post {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/* Базовые стили для миниатюр */
.post-thumbnail {
	text-align: center;
}

/* Миниатюра на одиночных страницах */
.single .post-thumbnail,
.page .post-thumbnail {
	margin: 0 auto 30px;
	text-align: center;
	max-width: 100%;
	display: block;
}

.single .post-thumbnail img,
.page .post-thumbnail img {
	margin: 0 auto;
	display: block;
}

.single .post:last-child {
	border-bottom: none;
}

.entry-header {
	margin-bottom: 12px;
}

/* Заголовки в плитках (универсальные для всех карточек) */
.posts-grid > .post:not(.type-page) .entry-title,
.posts-grid > article:not(.type-page) .entry-title,
.posts-grid > .post.type-post .entry-title,
.posts-grid > article.type-post .entry-title,
.base-posts-tiles-grid > .post .entry-title,
.base-posts-tiles-grid > article .entry-title,
.related-post-tile-title {
	font-size: 1rem;
	margin-bottom: 8px;
	line-height: 1.3;
	height: 2.6em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: center;
}

.posts-grid > .post:not(.type-page) .entry-title a,
.posts-grid > article:not(.type-page) .entry-title a,
.posts-grid > .post.type-post .entry-title a,
.posts-grid > article.type-post .entry-title a,
.base-posts-tiles-grid > .post .entry-title a,
.base-posts-tiles-grid > article .entry-title a,
.related-post-tile-title a {
	text-align: center;
}

/* Для shortcode внутри entry-content */
.entry-content .base-posts-tiles-grid > .post .entry-title,
.entry-content .base-posts-tiles-grid > article .entry-title,
.post .entry-content .base-posts-tiles-grid > .post .entry-title,
.post .entry-content .base-posts-tiles-grid > article .entry-title {
	font-size: 1rem !important;
	margin-bottom: 8px !important;
	line-height: 1.3 !important;
	height: 2.6em !important;
	display: -webkit-box !important;
	-webkit-line-clamp: 2 !important;
	-webkit-box-orient: vertical !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	text-align: center !important;
}

.entry-content .base-posts-tiles-grid > .post .entry-title a,
.entry-content .base-posts-tiles-grid > article .entry-title a,
.post .entry-content .base-posts-tiles-grid > .post .entry-title a,
.post .entry-content .base-posts-tiles-grid > article .entry-title a {
	text-align: center !important;
}

.related-post-tile-title {
	height: auto;
	margin: 0 0 12px 0;
	font-size: 1.125rem;
	font-weight: 600;
	flex-grow: 1;
}

/* Заголовки на одиночных страницах */
.single .entry-title {
	font-size: 1.75rem;
	margin-bottom: 10px;
}

.entry-title a {
	color: #333;
}

.entry-title a:hover {
	color: #0073aa;
}

.entry-meta {
	font-size: 0.75rem;
	color: #666;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
}

/* Мета-информация в плитках */
.posts-grid > .post:not(.type-page) .entry-meta,
.posts-grid > article:not(.type-page) .entry-meta,
.posts-grid > .post.type-post .entry-meta,
.posts-grid > article.type-post .entry-meta,
.base-posts-tiles-grid > .post .entry-meta,
.base-posts-tiles-grid > article .entry-meta {
	margin-bottom: 8px;
}

.entry-content .base-posts-tiles-grid > .post .entry-meta,
.entry-content .base-posts-tiles-grid > article .entry-meta,
.post .entry-content .base-posts-tiles-grid > .post .entry-meta,
.post .entry-content .base-posts-tiles-grid > article .entry-meta {
	margin-bottom: 8px !important;
}

body.single .entry-meta {
	font-size: 1.125rem;
}

body.single .entry-header .entry-meta {
	margin-bottom: 30px;
}

body.single .entry-title {
	text-align: center;
	margin-bottom: 40px;
}

.entry-meta span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.entry-meta .posted-on::before {
	content: '\f073';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	font-size: 0.75rem;
	color: #0073aa;
}

.entry-meta .byline::before {
	content: '\f007';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	font-size: 0.75rem;
	color: #0073aa;
}

body.single .entry-meta .posted-on::before {
	font-size: 1.125rem;
}

body.single .entry-meta .byline::before {
	font-size: 1.125rem;
}

/* Изображения в плитках (универсальные) */
.posts-grid > .post:not(.type-page) .post-thumbnail,
.posts-grid > article:not(.type-page) .post-thumbnail,
.posts-grid > .post.type-post .post-thumbnail,
.posts-grid > article.type-post .post-thumbnail,
.base-posts-tiles-grid > .post .post-thumbnail,
.base-posts-tiles-grid > article .post-thumbnail,
.related-post-tile-thumbnail {
	margin: 0 auto 10px;
	border-radius: 6px;
	overflow: hidden;
	height: 150px;
	width: 100%;
	max-width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	text-align: center;
}

.posts-grid > .post:not(.type-page) .post-thumbnail a,
.posts-grid > article:not(.type-page) .post-thumbnail a,
.posts-grid > .post.type-post .post-thumbnail a,
.posts-grid > article.type-post .post-thumbnail a,
.base-posts-tiles-grid > .post .post-thumbnail a,
.base-posts-tiles-grid > article .post-thumbnail a,
.related-post-tile-thumbnail {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.posts-grid > .post:not(.type-page) .post-thumbnail img,
.posts-grid > article:not(.type-page) .post-thumbnail img,
.posts-grid > .post.type-post .post-thumbnail img,
.posts-grid > article.type-post .post-thumbnail img,
.base-posts-tiles-grid > .post .post-thumbnail img,
.base-posts-tiles-grid > article .post-thumbnail img,
.related-post-tile-thumbnail img {
	max-width: 100%;
	max-height: 100%;
	width: 330px;
	height: auto;
	object-fit: contain;
	object-position: center;
	display: block;
	margin: 0 auto;
}

.posts-grid > .post:not(.type-page) .post-thumbnail,
.posts-grid > article:not(.type-page) .post-thumbnail,
.posts-grid > .post.type-post .post-thumbnail,
.posts-grid > article.type-post .post-thumbnail,
.base-posts-tiles-grid > .post .post-thumbnail,
.base-posts-tiles-grid > article .post-thumbnail {
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Изображения для shortcode внутри entry-content */
.entry-content .base-posts-tiles-grid > .post .post-thumbnail,
.entry-content .base-posts-tiles-grid > article .post-thumbnail,
.post .entry-content .base-posts-tiles-grid > .post .post-thumbnail,
.post .entry-content .base-posts-tiles-grid > article .post-thumbnail {
	margin-bottom: 10px !important;
	border-radius: 6px !important;
	overflow: hidden !important;
	height: 150px !important;
	width: 100% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	position: relative !important;
}

.entry-content .base-posts-tiles-grid > .post .post-thumbnail a,
.entry-content .base-posts-tiles-grid > article .post-thumbnail a,
.post .entry-content .base-posts-tiles-grid > .post .post-thumbnail a,
.post .entry-content .base-posts-tiles-grid > article .post-thumbnail a {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	height: 100% !important;
}

.entry-content .base-posts-tiles-grid > .post .post-thumbnail img,
.entry-content .base-posts-tiles-grid > article .post-thumbnail img,
.post .entry-content .base-posts-tiles-grid > .post .post-thumbnail img,
.post .entry-content .base-posts-tiles-grid > article .post-thumbnail img {
	max-width: 100% !important;
	max-height: 100% !important;
	width: 330px !important;
	height: auto !important;
	object-fit: contain !important;
	object-position: center !important;
	display: block !important;
	margin: 0 auto !important;
}

.related-post-tile-thumbnail {
	height: 200px;
	margin-bottom: 0;
}

.related-post-tile-thumbnail img {
	width: 100%;
	height: 100%;
}

.entry-content {
	margin-bottom: 12px;
	width: 100%;
	max-width: 100%;
}

/* Убеждаемся что entry-content на одиночных страницах не ограничен */
.single .entry-content,
.page .entry-content {
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

/* Контент в плитках (универсальные) */
.posts-grid > .post:not(.type-page) .entry-content,
.posts-grid > article:not(.type-page) .entry-content,
.posts-grid > .post.type-post .entry-content,
.posts-grid > article.type-post .entry-content,
.base-posts-tiles-grid > .post .entry-content,
.base-posts-tiles-grid > article .entry-content,
.related-post-tile-content {
	margin-bottom: 10px;
	flex-grow: 1;
}

.posts-grid > .post:not(.type-page) .entry-content p,
.posts-grid > article:not(.type-page) .entry-content p,
.posts-grid > .post.type-post .entry-content p,
.posts-grid > article.type-post .entry-content p,
.base-posts-tiles-grid > .post .entry-content p,
.base-posts-tiles-grid > article .entry-content p {
	margin-bottom: 0.5em;
	font-size: 0.875rem;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-align: center;
}

.posts-grid > .post:not(.type-page) .entry-summary,
.posts-grid > article:not(.type-page) .entry-summary,
.posts-grid > .post.type-post .entry-summary,
.posts-grid > article.type-post .entry-summary,
.base-posts-tiles-grid > .post .entry-summary,
.base-posts-tiles-grid > article .entry-summary {
	text-align: center;
}

.entry-content .base-posts-tiles-grid > .post .entry-content,
.entry-content .base-posts-tiles-grid > article .entry-content,
.post .entry-content .base-posts-tiles-grid > .post .entry-content,
.post .entry-content .base-posts-tiles-grid > article .entry-content {
	margin-bottom: 10px !important;
	flex-grow: 1 !important;
}

.entry-content .base-posts-tiles-grid > .post .entry-content p,
.entry-content .base-posts-tiles-grid > article .entry-content p,
.post .entry-content .base-posts-tiles-grid > .post .entry-content p,
.post .entry-content .base-posts-tiles-grid > article .entry-content p {
	margin-bottom: 0.5em !important;
	font-size: 0.875rem !important;
	line-height: 1.4 !important;
	display: -webkit-box !important;
	-webkit-line-clamp: 3 !important;
	-webkit-box-orient: vertical !important;
	overflow: hidden !important;
	text-align: center !important;
}

.related-post-tile-content {
	padding: 20px;
	margin-bottom: 0;
}

/* Специфичные стили для related-post-tile */
.related-post-tile-meta {
	font-size: 0.875rem;
	color: #666;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid #f0f0f0;
	text-align: center;
}

.related-post-tile-date {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.related-post-tile-date::before {
	content: '\f073';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	font-size: 0.75rem;
	color: #999;
}

.entry-content p {
	margin-bottom: 1em;
}

.entry-footer {
	font-size: 0.75rem;
	color: #666;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #e5e5e5;
	text-align: center;
}

/* Footer в плитках (универсальные) */
.posts-grid > .post:not(.type-page) .entry-footer,
.posts-grid > article:not(.type-page) .entry-footer,
.posts-grid > .post.type-post .entry-footer,
.posts-grid > article.type-post .entry-footer,
.base-posts-tiles-grid > .post .entry-footer,
.base-posts-tiles-grid > article .entry-footer {
	margin-top: auto;
}

.entry-content .base-posts-tiles-grid > .post .entry-footer,
.entry-content .base-posts-tiles-grid > article .entry-footer,
.post .entry-content .base-posts-tiles-grid > .post .entry-footer,
.post .entry-content .base-posts-tiles-grid > article .entry-footer {
	margin-top: auto !important;
}

.entry-footer a {
	margin-right: 12px;
}

.entry-footer .cat-links {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-content: center;
}

.entry-footer .cat-links::before {
	content: '\f02e';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	font-size: 0.75rem;
	color: #0073aa;
}

/*--------------------------------------------------------------
# Related Posts Widget
--------------------------------------------------------------*/
.related-posts-grid {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-top: 15px;
}

.related-post-item {
	display: flex;
	flex-direction: row;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	width: 100%;
	gap: 12px;
}

.related-post-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.related-post-thumbnail {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	min-width: 80px;
	height: 80px;
	overflow: hidden;
	position: relative;
	flex-shrink: 0;
}

.related-post-thumbnail img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	object-position: center;
	display: block;
	transition: transform 0.3s ease;
}

.related-post-item:hover .related-post-thumbnail img {
	transform: none;
}

.related-post-content {
	padding: 10px 10px 10px 0;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	min-width: 0;
}

.related-post-title {
	margin: 0 0 8px 0;
	font-size: 0.875rem;
	line-height: 1.3;
	font-weight: 600;
	text-align: center;
}

.related-post-title a {
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-align: center;
}

.related-post-title a:hover {
	color: #0073aa;
}

.related-post-meta {
	font-size: 0.75rem;
	color: #666;
	margin-top: auto;
}

.related-post-date {
	display: flex;
	align-items: center;
	gap: 4px;
}

.related-post-date::before {
	content: '\f073';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
}

/*--------------------------------------------------------------
# Related Posts Section (tiles at bottom of single posts)
--------------------------------------------------------------*/
.related-posts-section {
	margin-top: 60px;
	padding-top: 40px;
	border-top: 1px solid #e5e5e5;
}

.related-posts-title {
	font-size: 2rem;
	font-weight: 600;
	margin-bottom: 30px;
	color: #333;
	text-align: center;
}

/* Специфичные стили для related-posts (уже определены выше в универсальных) */



/*--------------------------------------------------------------
# Sidebar
--------------------------------------------------------------*/
.widget-area {
	min-width: 0;
}

.widget {
	margin-bottom: 40px;
	padding: 20px;
	border-radius: 5px;
}

.widget-title {
	font-size: 1.25rem;
	margin-bottom: 15px;
	font-weight: 600;
}

.widget ul {
	list-style: none;
}

.widget li {
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e5e5e5;
}

.widget li:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

/*--------------------------------------------------------------
# Search Form
--------------------------------------------------------------*/
.search-form {
	display: flex;
	gap: 0;
	align-items: stretch;
}

.search-form label {
	flex: 1;
	display: flex;
	flex-direction: column;
}

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

.search-field {
	width: 100%;
	padding: 8px 15px;
	border: 1px solid #ddd;
	border-right: none;
	border-radius: 10px 0 0 10px;
	font-size: 0.9375rem;
	font-family: inherit;
	line-height: 1.5;
	color: #333;
	background-color: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-field:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: none;
	z-index: 1;
	position: relative;
}

.search-field:focus + .search-submit {
	border-color: #0073aa;
}

.search-field::placeholder {
	color: #999;
}

.search-submit {
	padding: 8px 24px;
	border: 1px solid #ddd;
	border-left: none;
	border-radius: 0 10px 10px 0;
	background-color: #0073aa;
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
	white-space: nowrap;
}

.search-submit:hover {
	background-color: #005177;
	border-color: #005177;
}

.search-submit:active {
	transform: translateY(1px);
}

.search-submit:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

/*--------------------------------------------------------------
# Archive Header
--------------------------------------------------------------*/
.archive-header {
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e5e5e5;
}

.archive-title {
	font-size: 2rem;
	font-weight: 600;
	margin-bottom: 10px;
	color: #333;
}

.archive-title span {
	font-weight: 400;
	color: #666;
}

.archive-description {
	font-size: 1rem;
	color: #666;
	line-height: 1.6;
	margin-top: 10px;
}

/*--------------------------------------------------------------
# Breadcrumbs
--------------------------------------------------------------*/
.breadcrumbs {
	margin-bottom: 25px;
	padding: 0;
	font-size: 0.875rem;
	line-height: 1.5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
}

.breadcrumbs a {
	color: #0073aa;
	text-decoration: none;
	transition: color 0.2s ease;
	display: inline-flex;
	align-items: center;
	padding: 4px 0;
}

.breadcrumbs a:hover {
	color: #005177;
	text-decoration: underline;
}

.breadcrumbs a:not(:last-child)::after {
	content: '\f054';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	margin: 0 10px;
	color: #0073aa;
	font-size: 0.75rem;
	text-decoration: none;
}

.breadcrumbs a:not(:last-child):hover::after {
	text-decoration: none;
}

.breadcrumbs span {
	color: #666;
	font-weight: 400;
	display: inline-flex;
	align-items: center;
	padding: 4px 0;
}

.breadcrumbs > a:first-child::before {
	content: '\f015';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	margin-right: 8px;
	font-size: 0.875rem;
	color: #0073aa;
}

/*--------------------------------------------------------------
# 404 Error Page
--------------------------------------------------------------*/
.error-404 {
	min-height: 60vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
}

.error-404-content {
	max-width: 600px;
	width: 100%;
	text-align: center;
}

.error-header {
	margin-bottom: 30px;
}

.error-title {
	font-size: 8rem;
	font-weight: 700;
	color: #0073aa;
	line-height: 1;
	margin-bottom: 20px;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.error-subtitle {
	font-size: 2rem;
	font-weight: 600;
	color: #333;
	margin-bottom: 0;
}

.error-description {
	margin-bottom: 40px;
	font-size: 1.125rem;
	color: #666;
	line-height: 1.6;
}

.error-actions {
	margin-bottom: 50px;
}

.error-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 30px;
	background-color: #0073aa;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 500;
	transition: background-color 0.2s ease, transform 0.1s ease;
}

.error-button:hover {
	background-color: #005177;
	color: #fff;
	transform: translateY(-2px);
}

.error-button:active {
	transform: translateY(0);
}

.error-button i {
	font-size: 1rem;
}

/*--------------------------------------------------------------
# Gallery Grid
--------------------------------------------------------------*/

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Центрирует картинки в ряду */
  gap: 15px;               /* Отступ между плитками */
}

.gallery-grid a {
  /* Вычисляем ширину: (100% / 4) минус поправка на отступы gap */
  flex: 0 0 calc(25% - 15px); 
  box-sizing: border-box;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Скрываем лишние теги <br>, если вы не можете удалить их из HTML */
.gallery-grid br {
  display: none;
}

/*--------------------------------------------------------------
# Download Button
--------------------------------------------------------------*/
.mwindows {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 15px 30px;
	background-color: #0073aa;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 500;
	transition: background-color 0.2s ease, transform 0.1s ease;
	margin: 20px auto;
	text-align: center;
}

/* Центрирование кнопки */
p .mwindows,
div .mwindows,
.entry-content .mwindows {
	display: flex;
	width: fit-content;
	margin-left: auto;
	margin-right: auto;
}

.mwindows::before {
	content: '\f019';
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	font-size: 1rem;
	color: #fff;
}

.mwindows:hover {
	background-color: #005177;
	color: #fff;
	transform: translateY(-2px);
}

.mwindows:active {
	transform: translateY(0);
}

.mwindows:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.error-search {
	margin-top: 40px;
	padding-top: 40px;
	border-top: 1px solid #e5e5e5;
}

.error-search h3 {
	font-size: 1.25rem;
	font-weight: 600;
	color: #333;
	margin-bottom: 20px;
}

.error-search .search-form {
	justify-content: center;
	max-width: 400px;
	margin: 0 auto;
}

@media screen and (max-width: 768px) {
	.error-title {
		font-size: 5rem;
	}

	.error-subtitle {
		font-size: 1.5rem;
	}

	.error-description {
		font-size: 1rem;
	}
}

/*--------------------------------------------------------------
# No Results / Not Found
--------------------------------------------------------------*/
.no-results {
	padding: 40px 20px;
	text-align: center;
}

.no-results .page-header {
	margin-bottom: 30px;
}

.no-results .page-title {
	font-size: 2rem;
	font-weight: 600;
	color: #333;
	margin-bottom: 20px;
}

.no-results .page-content {
	font-size: 1.125rem;
	color: #666;
	line-height: 1.6;
}

.no-results .page-content p {
	margin-bottom: 30px;
}

.search-form-wrapper {
	max-width: 500px;
	margin: 30px auto 0;
}

/*--------------------------------------------------------------
# Comments
--------------------------------------------------------------*/
.comments-area {
	margin-top: 40px;
	padding-top: 40px;
	border-top: 1px solid #e5e5e5;
}

.comments-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 30px;
	color: #333;
}

.comment-list {
	list-style: none;
	margin: 0 0 30px 0;
	padding: 0;
}

.comment-list .comment {
	margin-bottom: 30px;
	padding-bottom: 30px;
	border-bottom: 1px solid #e5e5e5;
}

.comment-list .comment:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.comment-body {
	display: flex;
	gap: 15px;
}

.comment-author-avatar {
	flex-shrink: 0;
}

.comment-author-avatar img {
	border-radius: 50%;
	width: 50px;
	height: 50px;
}

.comment-content {
	flex-grow: 1;
}

.comment-meta {
	margin-bottom: 10px;
	font-size: 0.875rem;
}

.comment-author {
	font-weight: 600;
	color: #333;
	margin-right: 10px;
}

.comment-metadata {
	color: #666;
}

.comment-metadata a {
	color: #666;
	text-decoration: none;
}

.comment-metadata a:hover {
	color: #0073aa;
}

.comment-text {
	font-size: 0.9375rem;
	line-height: 1.6;
	color: #333;
}

.comment-reply-link {
	display: inline-block;
	margin-top: 10px;
	font-size: 0.875rem;
	color: #0073aa;
	text-decoration: none;
}

.comment-reply-link:hover {
	color: #005177;
	text-decoration: underline;
}

.comment-form {
	margin-top: 30px;
}

.comment-form label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
	color: #333;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 15px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 0.9375rem;
	font-family: inherit;
	line-height: 1.5;
	color: #333;
	background-color: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	margin-bottom: 15px;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.comment-form textarea {
	min-height: 120px;
	resize: vertical;
}

.comment-form .form-submit {
	margin-top: 15px;
}

.comment-form input[type="submit"] {
	padding: 12px 30px;
	border: none;
	border-radius: 6px;
	background-color: #0073aa;
	color: #fff;
	font-size: 1rem;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
}

.comment-form input[type="submit"]:hover {
	background-color: #005177;
}

.comment-form input[type="submit"]:active {
	transform: translateY(1px);
}

.comment-form input[type="submit"]:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

/*--------------------------------------------------------------
# Pagination
--------------------------------------------------------------*/
.pagination {
	display: flex;
	justify-content: center;
	margin: 30px 0 10px;
}

.pagination ul {
	list-style: none;
	display: flex;
	gap: 8px;
	padding: 0;
	margin: 0;
}

.pagination li {
	list-style: none;
	padding: 0;
	margin: 0;
}
.pagination li::before,
.pagination .page-numbers::before {
	content: none;
}

.pagination .page-numbers {
	list-style: none;
	padding: 0;
	margin: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	background: transparent;
	color: #222;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination .page-numbers:hover {
	background-color: #f1f5f9;
	color: #0073aa;
}

.pagination .page-numbers.current {
	background: #0073aa;
	color: #fff;
	font-weight: 600;
}

.pagination .page-numbers:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.25);
}

.pagination .page-numbers.dots {
	background: transparent;
	cursor: default;
	color: #94a3b8;
}

.pagination .page-numbers.dots:hover {
	background: transparent;
	color: #94a3b8;
}

.comments-navigation {
	margin: 30px 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.comments-navigation a {
	color: #0073aa;
	text-decoration: none;
	padding: 8px 15px;
	border: 1px solid #0073aa;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.comments-navigation a:hover {
	background-color: #0073aa;
	color: #fff;
}

.no-comments {
	padding: 20px;
	background-color: #f8f9fa;
	border-radius: 6px;
	color: #666;
	text-align: center;
	margin-bottom: 30px;
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
.site-footer {
	width: 100%;
	background-color: #fff;
	border-top: 1px solid #e5e5e5;
	margin-top: 40px;
	text-align: center;
	font-size: 0.875rem;
	color: #666;
}

.site-footer-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
}

/*--------------------------------------------------------------
# Responsive
--------------------------------------------------------------*/
@media screen and (max-width: 1200px) {
	/* Универсальные стили для всех карточек - 3 колонки */
	.posts-grid > .post:not(.type-page),
	.posts-grid > article:not(.type-page),
	.posts-grid > .post.type-post,
	.posts-grid > article.type-post,
	.base-posts-tiles-grid > .post,
	.base-posts-tiles-grid > article,
	.related-posts-tiles > .related-post-tile {
		flex: 0 0 calc((100% - 40px) / 3);
		max-width: calc((100% - 40px) / 3);
	}
	
	.entry-content .base-posts-tiles-grid > .post,
	.entry-content .base-posts-tiles-grid > article,
	.post .entry-content .base-posts-tiles-grid > .post,
	.post .entry-content .base-posts-tiles-grid > article {
		flex: 0 0 calc((100% - 40px) / 3) !important;
		max-width: calc((100% - 40px) / 3) !important;
	}
}

@media screen and (max-width: 992px) {
	.content-area {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	/* Универсальные стили для всех карточек - 3 колонки */
	.posts-grid > .post:not(.type-page),
	.posts-grid > article:not(.type-page),
	.posts-grid > .post.type-post,
	.posts-grid > article.type-post,
	.base-posts-tiles-grid > .post,
	.base-posts-tiles-grid > article,
	.related-posts-tiles > .related-post-tile {
		flex: 0 0 calc((100% - 40px) / 3);
		max-width: calc((100% - 40px) / 3);
	}
	
	.entry-content .base-posts-tiles-grid > .post,
	.entry-content .base-posts-tiles-grid > article,
	.post .entry-content .base-posts-tiles-grid > .post,
	.post .entry-content .base-posts-tiles-grid > article {
		flex: 0 0 calc((100% - 40px) / 3) !important;
		max-width: calc((100% - 40px) / 3) !important;
	}
}

@media screen and (max-width: 768px) {
	.site {
		padding: 0 15px;
	}

	.site-header-inner {
		padding: 15px;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.site-footer-inner {
		padding: 30px 15px;
	}

	.content-area {
		gap: 20px;
	}

	/* Универсальные стили для всех карточек - 2 колонки */
	.posts-grid > .post:not(.type-page),
	.posts-grid > article:not(.type-page),
	.posts-grid > .post.type-post,
	.posts-grid > article.type-post,
	.base-posts-tiles-grid > .post,
	.base-posts-tiles-grid > article,
	.related-posts-tiles > .related-post-tile {
		flex: 0 0 calc((100% - 20px) / 2);
		max-width: calc((100% - 20px) / 2);
	}
	
	.entry-content .base-posts-tiles-grid > .post,
	.entry-content .base-posts-tiles-grid > article,
	.post .entry-content .base-posts-tiles-grid > .post,
	.post .entry-content .base-posts-tiles-grid > article {
		flex: 0 0 calc((100% - 20px) / 2) !important;
		max-width: calc((100% - 20px) / 2) !important;
	}

	.related-posts-section {
		margin-top: 40px;
		padding-top: 30px;
	}

	.related-posts-title {
		font-size: 1.75rem;
		margin-bottom: 20px;
	}

	.widget-area {
		order: -1;
	}

	.menu-toggle {
		display: block;
	}

	.main-navigation ul,
	.main-navigation .menu {
		display: flex;
		flex-direction: column;
		gap: 6px;
		margin-top: 15px;
		padding: 10px 0 0;
		border-top: 1px solid #ededed;
		justify-content: flex-start;
		max-height: 0;
		opacity: 0;
		transform: translateY(-8px);
		overflow: hidden;
		pointer-events: none;
		transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease;
	}

	.main-navigation a {
		width: 100%;
		padding: 10px 12px;
		border-radius: 8px;
	}

	.main-navigation.toggled ul,
	.main-navigation.toggled .menu {
		max-height: 500px;
		opacity: 1;
		transform: translateY(0);
		pointer-events: auto;
	}

	h1 { font-size: 2rem; }
	h2 { font-size: 1.75rem; }
	h3 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
	.menu-toggle,
	.menu-toggle::before,
	.main-navigation ul,
	.main-navigation .menu {
		transition: none !important;
	}
}

@media screen and (max-width: 480px) {
	/* Универсальные стили для всех карточек - 1 колонка */
	.posts-grid > .post:not(.type-page),
	.posts-grid > article:not(.type-page),
	.posts-grid > .post.type-post,
	.posts-grid > article.type-post,
	.base-posts-tiles-grid > .post,
	.base-posts-tiles-grid > article,
	.related-posts-tiles > .related-post-tile {
		flex: 0 0 100%;
		max-width: 100%;
	}
	
	.entry-content .base-posts-tiles-grid > .post,
	.entry-content .base-posts-tiles-grid > article,
	.post .entry-content .base-posts-tiles-grid > .post,
	.post .entry-content .base-posts-tiles-grid > article {
		flex: 0 0 100% !important;
		max-width: 100% !important;
	}

	.related-posts-title {
		font-size: 1.5rem;
	}

	.related-post-tile-thumbnail {
		height: 180px;
	}

	.related-post-tile-content {
		padding: 15px;
	}
}
