/*
 * Новости: список /news/ (archive-news.php) и новость (single-news.php). Плашки — news-card.css; стрелка .arr — main.css.
 * Фон страницы — светлее общего: --c-bg = --c-surface на body (список со всеми страницами пагинации и новость), от шапки до
 * подвала, включая блок «Мы в соцсетях»; плашки — var(--c-plaque), скругление var(--r-card), контейнер 1520.
 */
body.post-type-archive-news,
body.single-news {
	--c-bg: var(--c-surface);
}

.news-page,
.news-article,
.news-more {
	color: var(--c-green);
}

/* ---- Список */

/* Две колонки: первая новость первой страницы (wide) — на всю ширину; разделитель года — на всю ширину */
.news-list {
	--news-list-gap: 24px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--news-list-gap);
}

.news-list > .news-card--wide {
	grid-column: 1 / -1;
}

/* Высота плашек от 900 (ниже широкая — по содержимому, малая — своя, news-card.css) */
@media (min-width: 900px) {
	.news-list > .news-card--wide {
		height: clamp(340px, 44vh, 460px);
	}

	.news-list > .news-card--small {
		height: clamp(220px, 28vh, 280px);
	}
}

/* Одна в ряду в конце года (solo) — на обе колонки: фото той же ширины, что у малой в колонке (4:3 по высоте, не шире 52 % от
   половины без зазора), высота та же; текст — на всё остальное, заголовок — до двух строк */
@media (min-width: 900px) {
	.news-list > .news-card--solo {
		grid-column: 1 / -1;
	}

	.news-card--solo .news-card__media {
		width: min((100cqw - var(--news-list-gap)) / 2 * .52, 100cqh * 4 / 3);
	}

	.news-card--solo .news-card__title {
		-webkit-line-clamp: 2;
		line-clamp: 2;
	}
}

/* Год: крупно золотом и тонкая линия до правого края */
.news-year {
	display: flex;
	grid-column: 1 / -1;
	align-items: center;
	gap: 24px;
	margin: 16px 0 0;
	color: var(--c-gold-text);
	font-size: clamp(40px, 3.6vw, 60px);
	font-weight: 500;
	font-variant-numeric: lining-nums;
	line-height: 1;
}

.news-year::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--c-line);
}

/* Первая дописанная плашка получает фокус: кольцо — только при навигации с клавиатуры (как у .model-grid) */
.news-list > .news-card:focus:not(:focus-visible) {
	outline: none;
}

@media (max-width: 899.98px) {
	.news-list {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.news-year {
		gap: 16px;
		margin-top: 12px;
	}
}

/* ---- Новость */

.news-back,
.news-more__all {
	display: inline-flex;
	align-items: center;
	color: var(--c-gold-text);
	font-size: 15px;
	text-decoration: none;
}

.news-back:hover .arr,
.news-back:focus-visible .arr,
.news-more__all:hover .arr,
.news-more__all:focus-visible .arr {
	width: 96px;
}

.news-back:focus-visible,
.news-more__all:focus-visible {
	outline: 2px solid var(--c-gold-text);
	outline-offset: 4px;
}

/* Одна ось: ссылка, дата, h1, фото и текст — в колонке 760 по центру. Контейнер статьи — запрос ширины: из него (100cqw) фото
   берёт ширину для выступа из колонки */
.news-article {
	container-type: inline-size;
}

.news-article__col {
	max-width: 760px;
	margin-inline: auto;
}

/* Дата в строку (число, рядом месяц и год в два ряда — как в малой плашке), под ней h1 на всю ширину колонки */
.news-article__intro {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(16px, 1.6vw, 24px);
	margin: var(--sp-5) 0 var(--sp-6);
}

.news-article__date {
	display: flex;
	align-items: center;
	gap: 10px;
}

.news-article__day {
	font-family: var(--font-display);
	font-size: clamp(52px, 4.4vw, 72px);
	font-weight: 500;
	font-variant-numeric: lining-nums;
	line-height: .8;
}

.news-article__my {
	color: var(--c-sub);
	font-size: 13px;
	line-height: 1.35;
	white-space: nowrap;
}

.news-article__my > span {
	display: block;
}

.news-article__title {
	margin: 0;
	color: inherit;
	font-family: var(--font-display);
	font-size: clamp(32px, 3vw, 48px);
	font-weight: 500;
	line-height: 1.1;
	text-wrap: balance;
}

.news-article__title a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .12em;
}

/* Главное фото — без подложки, скругление у самой картинки. Ширина — не больше натуральной (--w, у SVG её нет), колонки и 70vh × w/h
   (--r): высота не больше 70vh. Остальные — от левого края колонки. wide (натуральная от 1100, inc/news.php) — выступ: зона 1100
   по центру страницы, на узких экранах — ширина контейнера (100cqw); если высота 70vh сжала фото уже колонки — снова от её края */
.news-article__photo {
	margin: 0 0 var(--sp-6);
}

.news-article__photo img {
	display: block;
	width: min(100%, var(--w, 100%), 70vh * var(--r, 1));
	max-width: none;
	height: auto;
	border-radius: var(--r-card);
}

.news-article__photo--wide {
	--zone: min(1100px, 100cqw);
	--col: min(760px, 100cqw);
	--img: min(var(--zone), var(--w), 70vh * var(--r));
	width: var(--zone);
	margin-left: calc((100% - var(--zone)) / 2);
}

/* Товар на белом фоне: multiply на цвете страницы, без скругления — белого прямоугольника не видно. Фон и изоляция у figure:
   смешение — именно с цветом страницы, что бы ни было выше */
.news-article__photo--white {
	background: var(--c-bg);
	isolation: isolate;
}

.news-article__photo--white img {
	border-radius: 0;
	mix-blend-mode: multiply;
}

.news-article__photo--wide img {
	width: var(--img);
	margin-left: calc((var(--zone) - max(var(--img), var(--col))) / 2);
}

/* Текст: колонка 760 по центру, Open Sans 17/1.7 */
.news-content {
	max-width: 760px;
	margin: 0 auto;
	color: var(--c-green);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.7;
	overflow-wrap: break-word;
}

.news-content > :first-child {
	margin-top: 0;
}

.news-content p,
.news-content ul,
.news-content ol,
.news-content figure,
.news-content blockquote,
.news-content table {
	margin: 0 0 1.1em;
}

.news-content h2,
.news-content h3,
.news-content h4 {
	margin: 1.6em 0 .6em;
	color: inherit;
	font-family: var(--font-display);
	font-weight: 500;
	line-height: 1.15;
}

.news-content h2 {
	font-size: 32px;
}

.news-content h3,
.news-content h4 {
	font-size: 26px;
}

.news-content a {
	color: var(--c-gold-text);
	text-decoration: underline;
	text-underline-offset: .15em;
}

.news-content a:hover {
	text-decoration-thickness: 2px;
}

.news-content ul,
.news-content ol {
	padding-left: 1.4em;
}

.news-content li + li {
	margin-top: .35em;
}

/* Картинки: не шире колонки, скругление; одна в абзаце (или одна в ссылке) — на всю ширину колонки, но не шире натуральной
   (--img-w — inc/news.php, migliore_news_content_images). Несколько в ряд (карточки товаров) — своим размером */
.news-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--r-card);
	vertical-align: middle;
}

.news-content :is(p, div, figure) > img:only-child,
.news-content :is(p, div) > a:only-child > img:only-child {
	display: block;
	width: 100%;
	max-width: min(100%, var(--img-w, 100%));
	margin-inline: 0;
}

.news-content figcaption,
.news-content .wp-caption-text {
	margin-top: .5em;
	color: var(--c-sub);
	font-size: 14px;
	line-height: 1.5;
}

.news-content .wp-caption {
	max-width: 100%;
}

.news-content blockquote {
	padding-left: 24px;
	border-left: 2px solid var(--c-gold);
	font-family: var(--font-display);
	font-size: 24px;
	line-height: 1.4;
}

/* Таблицы — прокручиваются в своей ширине; видео — 16:9 */
.news-content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
}

.news-content :is(td, th) {
	padding: 8px 12px;
	border: 1px solid var(--c-line);
}

.news-content :is(iframe, video, embed, object) {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--r-card);
}

/* Ролик YouTube до нажатия (inc/news.php, migliore_news_content_videos; main.js): блок 16:9 на ширину плеера, по центру круглая
   кнопка «воспроизвести», под ней подпись и строка о YouTube. Ссылка — без цвета и подчёркивания ссылок текста. Селекторы частей —
   через a.news-video и span: в новостях на Elementor иначе перебивает типографика колонки (.news-content .elementor :is(span…),
   специфичность 0,3,1) */
.news-content a.news-video {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 16 / 9;
	padding: 16px;
	box-sizing: border-box;
	border-radius: var(--r-card);
	background: var(--c-green);
	color: var(--c-light);
	text-align: center;
	text-decoration: none;
}

.news-content a.news-video span.news-video__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(56px, 8vw, 76px);
	height: clamp(56px, 8vw, 76px);
	border: 1.5px solid var(--c-gold);
	border-radius: 50%;
	color: var(--c-gold);
	transition: border-color .25s, color .25s;
}

.news-content a.news-video span.news-video__btn svg {
	width: 44%;
	height: 44%;
	margin-left: 6%;   /* треугольник оптически по центру круга */
}

.news-content a.news-video span.news-video__say {
	margin-top: 16px;
	color: var(--c-light);
	font-family: var(--font-body);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.news-content a.news-video span.news-video__note {
	margin-top: 6px;
	color: var(--c-gold-light);
	font-family: var(--font-body);
	font-size: 13px;
	line-height: 1.4;
}

.news-content a.news-video:hover .news-video__btn {
	border-color: var(--c-gold-light);
	color: var(--c-gold-light);
}

.news-content a.news-video:focus-visible {
	outline: 2px solid var(--c-gold-text);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.news-content a.news-video span.news-video__btn {
		transition: none;
	}
}

/* Старое форматирование: вшитые шрифт, кегль, цвет, интерлиньяж и фон — к стилю колонки. !important — против атрибута style.
   Выравнивание и отступы из style остаются. Ссылкам — их цвет */
.news-content [style]:not(img, iframe, a),
.news-content font {
	background: none !important;
	color: inherit !important;
	font-family: inherit !important;
	font-size: inherit !important;
	line-height: inherit !important;
}

.news-content a[style] {
	color: var(--c-gold-text) !important;
	font-family: inherit !important;
	font-size: inherit !important;
}

/* Elementor (2 старые новости): раскладку не трогаем, только типографика колонки */
.news-content .elementor :is(p, li, span, div.elementor-text-editor, .elementor-widget-text-editor) {
	color: var(--c-green);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.7;
}

.news-content .elementor .elementor-heading-title {
	color: var(--c-green);
	font-family: var(--font-display);
	font-weight: 500;
}

/* «Другие новости» — во всю ширину контейнера, от статьи — отступ и тонкая линия (как у года в списке), под ней снова отступ */
.news-more {
	margin-top: var(--home-gap);
}

.news-more::before {
	content: "";
	display: block;
	height: 1px;
	margin-bottom: var(--home-gap);
	background: var(--c-line);
}

.news-more__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	margin-bottom: var(--sp-5);
}

@media (min-width: 900px) {
	.news-more__grid > .news-card {
		height: clamp(220px, 28vh, 280px);
	}
}

@media (max-width: 899.98px) {
	.news-more__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}
}
