/* =========================================================================
   ARCHIVE / SINGLE POSTS
   ========================================================================= */

.posts-archive {
	padding-block: 40px 60px;
	min-height: 50vh;
}

.posts-archive__head {
	margin-bottom: 28px;
}

.posts-archive__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 22px;
	color: var(--toj-text);
}

.posts-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 22px;
}

.posts-grid__item.news-card {
	flex: none; /* сброс flex-basis из слайдера */
	width: 100%;
	margin: 0;
	height: 100%;
}

/* Карточка: фото всегда одинаковой высоты */
.posts-grid .news-card__media {
	height: 200px;
	padding: 10px;
	aspect-ratio: auto;
}

.posts-grid .news-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 12px;
}

.posts-archive__empty {
	padding: 40px 20px;
	text-align: center;
	color: var(--toj-text-muted);
	background: var(--toj-bg-light);
	border-radius: 14px;
}

/* Пагинация */
.posts-pagination {
	margin-top: 36px;
	display: flex;
	justify-content: center;
}

.posts-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.posts-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 10px;
	background: var(--toj-bg-light);
	font-size: 14px;
	font-weight: 600;
	color: var(--toj-text);
	transition: background .2s ease, color .2s ease;
}

.posts-pagination .page-numbers:hover,
.posts-pagination .page-numbers:focus-visible {
	background: var(--toj-blue);
	color: #fff;
}

.posts-pagination .page-numbers.current {
	background: var(--toj-blue);
	color: #fff;
}

/* ---------- Single post ---------- */

.single-post {
	padding-block: 40px 60px;
}

.single-post__article {
	max-width: 820px;
	margin-inline: auto;
}

.single-post__header {
	margin-bottom: 24px;
}

.single-post__title {
	margin: 0 0 12px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(22px, 3vw, 32px);
	line-height: 1.25;
	color: var(--toj-text);
}

.single-post__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	font-size: 14px;
	color: var(--toj-text-muted);
}

.single-post__location {
	color: var(--toj-text);
	font-weight: 500;
}

.single-post__media {
	margin: 0 0 28px;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(31, 39, 51, 0.1);
}

.single-post__img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	max-height: 480px;
}

.single-post__content {
	font-size: 16px;
	line-height: 1.7;
	color: var(--toj-text);
}

.single-post__content p {
	margin: 0 0 1.1em;
}

.single-post__content img {
	border-radius: 12px;
	margin-block: 1em;
}

.single-post__content h2,
.single-post__content h3 {
	font-family: var(--font-display);
	margin: 1.4em 0 0.6em;
}

.single-post__footer {
	margin-top: 36px;
	padding-top: 20px;
	border-top: 1px solid var(--toj-border);
}

.single-post__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--toj-blue);
	transition: color .2s ease;
}

.single-post__back:hover {
	color: var(--toj-blue-darker, #2C4B5F);
}

/* Responsive */
@media (max-width: 1100px) {
	.posts-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 800px) {
	.posts-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}

	.posts-grid .news-card__media {
		height: 160px;
	}
}

@media (max-width: 520px) {
	.posts-archive,
	.single-post {
		padding-block: 28px 40px;
	}

	.posts-grid {
		grid-template-columns: 1fr;
	}

	.posts-grid .news-card__media {
		height: 200px;
	}

	.single-post__img {
		max-height: 280px;
	}
}