/*
 * Лента новостей и страница записи.
 */

.cm-news-page {
	background: #fff;
}

.cm-news-page .cm-section {
	padding-top: 20px;
}

.cm-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 18px;
	color: var(--cm-text);
	font-size: 13px;
	line-height: 1.4;
}

.cm-crumbs a {
	color: var(--cm-text);
	text-decoration: none;
}

.cm-crumbs a:hover,
.cm-crumbs a:focus-visible {
	color: var(--cm-orange);
}

.cm-crumbs__sep {
	color: var(--cm-muted);
}

.cm-feed-head {
	margin-bottom: clamp(20px, 3vw, 32px);
}

.cm-feed-head__title,
.cm-post__title {
	margin: 0;
	color: var(--cm-black);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.cm-feed-head__title {
	font-size: clamp(32px, 4vw, 44px);
}

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

/* Колонка статьи сжимается уже самой картинки, иначе страница едет вбок. */
.cm-news-layout__main {
	min-width: 0;
}

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

.cm-feed__item {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--cm-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 1px 0 rgb(0 0 0 / 3%);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.cm-feed__item:hover,
.cm-feed__item:focus-within {
	border-color: transparent;
	box-shadow: var(--cm-shadow);
}

.cm-feed__media {
	display: block;
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--cm-bg-soft);
}

.cm-feed__media img,
.cm-feed__placeholder {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cm-feed__placeholder {
	min-height: 180px;
	background:
		linear-gradient(180deg, rgb(255 101 1 / 8%), transparent 42%),
		var(--cm-bg-soft);
}

.cm-feed__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	padding: 16px 16px 18px;
}

.cm-feed__date,
.cm-post__meta {
	color: var(--cm-text);
	font-size: 13px;
	line-height: 1.4;
}

.cm-feed__title {
	margin: 0;
	font-size: clamp(18px, 2vw, 22px);
	font-weight: 800;
	line-height: 1.3;
}

.cm-feed__title a {
	color: var(--cm-black);
	text-decoration: none;
}

.cm-feed__item:hover .cm-feed__title a,
.cm-feed__title a:focus-visible {
	color: var(--cm-orange);
}

.cm-feed__excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--cm-text);
	font-size: 15px;
	line-height: 1.55;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
}

.cm-feed__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	color: var(--cm-orange);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.cm-feed__more .cm-icon {
	width: 16px;
	height: 16px;
}

.cm-feed__partner,
.cm-post__partner {
	margin: 0;
	color: #8a919a;
	font-size: 12px;
	line-height: 1.3;
}

.cm-feed__empty {
	margin: 0;
	color: var(--cm-text);
	font-size: 16px;
}

.cm-pages {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: clamp(24px, 4vw, 40px);
}

.cm-pages a,
.cm-pages__current,
.cm-pages__gap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--cm-line);
	border-radius: 999px;
	background: #fff;
	color: var(--cm-title);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.cm-pages a:hover,
.cm-pages a:focus-visible {
	border-color: var(--cm-orange);
	color: var(--cm-orange);
}

.cm-pages__current {
	border-color: var(--cm-orange);
	background: var(--cm-orange);
	color: #fff;
}

.cm-pages__gap {
	border-color: transparent;
	background: transparent;
}

.cm-post {
	max-width: 820px;
	margin-inline: auto;
}

.cm-news-layout .cm-post {
	max-width: none;
	margin-inline: 0;
}

.cm-post__cat {
	display: inline-block;
	margin-bottom: 12px;
	color: var(--cm-orange);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
}

.cm-post__title {
	font-size: clamp(28px, 4vw, 40px);
}

.cm-post__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 14px;
	margin: 14px 0 0;
}

.cm-post__dates {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
}

.cm-post__meta time,
.cm-post__read {
	color: var(--cm-dark-grey);
}

.cm-post__read {
	margin-left: auto;
}

.cm-post__partner {
	margin: 10px 0 0;
}

.cm-post__hero {
	margin: 22px 0 0;
}

.cm-post__hero img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 16px;
}

.cm-post__content {
	min-width: 0;
	max-width: 100%;
	margin-top: 28px;
	color: #444;
	font-size: 17px;
	line-height: 1.7;
}

.cm-post__content > *:first-child {
	margin-top: 0;
}

.cm-post__content h1,
.cm-post__content h2,
.cm-post__content h3 {
	margin: 1.5em 0 0.5em;
	color: var(--cm-black);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

.cm-post__content h1 {
	font-size: clamp(26px, 3vw, 34px);
}

.cm-post__content h2 {
	font-size: 28px;
}

.cm-post__content h3 {
	font-size: 22px;
}

.cm-post__content p,
.cm-post__content ul,
.cm-post__content ol {
	margin: 0 0 1em;
}

.cm-post__content a {
	color: var(--cm-orange);
}

.cm-post__content img,
.cm-post__content video,
.cm-post__content iframe {
	max-width: 100%;
	height: auto;
}

.cm-post__content img {
	display: block;
	margin: 1.2em 0;
	border-radius: 12px;
}

/* Подпись WordPress пишет style="width: 1210px". Обычный max-width это не перебивает. */
.cm-post__content :where(.wp-caption, figure, .wp-block-image, .wp-block-embed) {
	box-sizing: border-box;
	width: auto !important;
	max-width: 100% !important;
}

.cm-post__content .wp-caption img,
.cm-post__content figure img {
	width: 100%;
	margin-bottom: 0.6em;
}

.cm-post__content ul,
.cm-post__content ol {
	padding-left: 1.2em;
}

.cm-news-follow {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 28px 0 0;
	min-width: 0;
	max-width: 100%;
}

.cm-news-follow__btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 0;
	max-width: 100%;
	padding: 10px 16px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
}

.cm-news-follow__icon {
	display: inline-flex;
	flex: 0 0 auto;
}

.cm-news-follow__icon svg {
	display: block;
}

.cm-news-follow__btn--google {
	border: 1px solid #dadce0;
	background: #fff;
	color: #202124;
}

.cm-news-follow__btn--google:hover,
.cm-news-follow__btn--google:focus-visible {
	border-color: #bdc1c6;
	background: #f8f9fa;
	color: #202124;
}

.cm-news-follow__btn--dzen {
	border: 1px solid var(--cm-orange);
	background: var(--cm-orange);
	color: #fff;
}

.cm-news-follow__btn--dzen:hover,
.cm-news-follow__btn--dzen:focus-visible {
	border-color: #e55a00;
	background: #e55a00;
	color: #fff;
}

.cm-post__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
}

.cm-news-follow + .cm-post__tags {
	margin-top: 16px;
}

.cm-post__tags a {
	display: inline-flex;
	padding: 7px 12px;
	border-radius: 999px;
	background: var(--cm-bg-soft);
	color: var(--cm-title);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}

.cm-post__tags a:hover,
.cm-post__tags a:focus-visible {
	background: var(--cm-orange-soft);
	color: var(--cm-orange);
}

.cm-news-related {
	margin-top: 36px;
}

.cm-news-related__title {
	margin: 0 0 16px;
	color: var(--cm-black);
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.cm-news-related__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.cm-post__pager {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	gap: 16px 20px;
	align-items: stretch;
	margin-top: 36px;
	padding-top: 24px;
	border-top: 1px solid var(--cm-line);
}

.cm-post__jump {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	color: var(--cm-black);
	text-decoration: none;
}

.cm-post__jump span {
	color: var(--cm-orange);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cm-post__jump strong {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.cm-post__jump--older {
	text-align: right;
}

.cm-post__jump:hover strong,
.cm-post__jump:focus-visible strong {
	color: var(--cm-orange);
}

.cm-post__back {
	align-self: center;
	color: var(--cm-dark-grey);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.cm-post__back:hover,
.cm-post__back:focus-visible {
	color: var(--cm-orange);
}

.cm-news-side .cmby-ad-zone {
	margin: 0 0 28px;
}

.cm-news-side .cmby-ad-container,
.cm-news-side img {
	max-width: 100%;
	height: auto;
}

.cm-ad-slot {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	aspect-ratio: 1 / 1.6;
	padding: 16px;
	border-radius: 12px;
	background:
		linear-gradient(180deg, rgb(255 101 1 / 18%), rgb(255 101 1 / 4%) 42%),
		var(--cm-bg-soft);
	color: var(--cm-dark-grey);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
}

.cm-news-side__title {
	margin: 0 0 14px;
	color: var(--cm-black);
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.cm-news-side__list {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cm-news-side__list li {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
}

.cm-news-side__thumb img {
	display: block;
	width: 72px;
	height: 60px;
	object-fit: cover;
	border-radius: 8px;
}

.cm-news-side__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.cm-news-side__link {
	color: var(--cm-black);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
}

.cm-news-side__link:hover,
.cm-news-side__link:focus-visible {
	color: var(--cm-orange);
}

.cm-news-side__info time,
.cm-news-side__partner {
	color: var(--cm-text);
	font-size: 12px;
	line-height: 1.3;
}

@media (max-width: 1100px) {
	.cm-feed {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.cm-news-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.cm-post__pager {
		grid-template-columns: 1fr;
	}

	.cm-post__jump--older {
		text-align: left;
	}

	.cm-post__back {
		order: -1;
		justify-self: start;
	}
}

@media (max-width: 700px) {
	.cm-feed,
	.cm-news-related__grid {
		grid-template-columns: 1fr;
	}

	.cm-news-follow__btn {
		width: 100%;
	}

	.cm-post__content {
		font-size: 16px;
	}

	.cm-post__content h1 {
		font-size: 26px;
	}

	.cm-post__content h2 {
		font-size: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cm-feed__item {
		transition: none;
	}
}
