/* ==========================================================================
   Блок «Ближайшие события» на главной — приведение в порядок (03.09.2026)
   Подключается из local/templates/study/components/bitrix/news.list/home_events/template.php

   Структура файла:
   1) общая типографика блока — работает и для сетки из нескольких событий;
   2) всё остальное внутри .news-list__inner--single — только когда событие одно
      (горизонтальная карточка, крупные шрифты, красная кнопка).
   Раскладка при 2+ событиях остаётся исходной: трёхколоночная сетка и белые
   кнопки сайта, меняется только плотность текста.
   ========================================================================== */

/* --- 1. Общая типографика: и сетка, и одиночная карточка ------------------ */

.upcoming-events .news-thumbs__date {
	color: #272727;
	font-size: 14px;
	font-weight: 600;
}

.upcoming-events .news-thumbs__name {
	color: #272727;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	margin-bottom: 12px;
}

.upcoming-events .news-thumbs__desc {
	color: #2f2f2f;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.55;
}

.upcoming-events .news-thumbs__desc p { margin: 0 0 10px; }
.upcoming-events .news-thumbs__desc > *:last-child { margin-bottom: 0; }

.upcoming-events .news-thumbs__desc ul {
	list-style: none;
	margin: 0 0 10px;
	padding: 0;
}

.upcoming-events .news-thumbs__desc ul li {
	position: relative;
	padding-left: 19px;
	margin-bottom: 5px;
	line-height: 1.45;
}

.upcoming-events .news-thumbs__desc ul li::before {
	content: "";
	position: absolute;
	left: 3px;
	top: .6em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #e9423d;
}

.upcoming-events .news-thumbs__button { margin-top: 18px; }

/* картинка кликабельна в любом режиме */
.upcoming-events .news-thumbs__image-link {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 14px;
	overflow: hidden;
	text-decoration: none;
}

.upcoming-events .news-thumbs__image-link img { transition: transform .45s ease; }
.upcoming-events .news-thumbs__image-link:hover img { transform: scale(1.04); }

/* --- 2. Ровно два события: по половине ширины ------------------------------ */

@media (min-width: 768px) {

	.upcoming-events .news-list__inner--pair .news-list__item {
		-ms-flex: 0 0 47.5%;
		flex: 0 0 47.5%;
		margin-right: 5%;
	}

	.upcoming-events .news-list__inner--pair .news-list__item:nth-child(2n) {
		margin-right: 0;
	}

	/* карточка шире — картинку тоже не растягиваем полосой, держим 16:10 */
	.upcoming-events .news-list__inner--pair .news-thumbs__image {
		height: auto;
		aspect-ratio: 16 / 10;
	}

	.upcoming-events .news-list__inner--pair .news-thumbs__image img,
	.upcoming-events .news-list__inner--pair .news-thumbs__image-link {
		height: 100%;
		border-radius: 14px;
	}

	.upcoming-events .news-list__inner--pair .news-thumbs__name { font-size: 20px; }
	.upcoming-events .news-list__inner--pair .news-thumbs__desc { font-size: 15px; }
}

/* --- 3. Одиночное событие ------------------------------------------------- */

.upcoming-events .news-list__inner--single .news-thumbs__date {
	color: #272727;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .01em;
}

.upcoming-events .news-list__inner--single .news-thumbs__name {
	color: #272727;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	margin-bottom: 14px;
}

.upcoming-events .news-list__inner--single .news-thumbs__desc {
	color: #333;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.65;
}

.upcoming-events .news-list__inner--single .news-thumbs__desc p { margin: 0 0 12px; }
.upcoming-events .news-list__inner--single .news-thumbs__desc p:empty { display: none; }
.upcoming-events .news-list__inner--single .news-thumbs__desc > *:last-child { margin-bottom: 0; }

.upcoming-events .news-list__inner--single .news-thumbs__desc ul {
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
}

.upcoming-events .news-list__inner--single .news-thumbs__desc ul li {
	position: relative;
	padding-left: 22px;
	margin-bottom: 7px;
	line-height: 1.5;
}

.upcoming-events .news-list__inner--single .news-thumbs__desc ul li::before {
	content: "";
	position: absolute;
	left: 4px;
	top: .62em;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #e9423d;
}

.upcoming-events .news-list__inner--single .news-thumbs__image img { border-radius: 14px; }

/* --- Кнопки --------------------------------------------------------------- */

.upcoming-events .news-list__inner--single .news-thumbs__button {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 22px;
}

.upcoming-events .news-list__inner--single a.site-btn--event {
	color: #fff;
	background: #e9423d;
	border: 1px solid #e9423d;
	border-radius: 10px;
	padding: 16px 32px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .02em;
	box-shadow: 0 6px 18px rgba(233, 66, 61, .22);
}

.upcoming-events .news-list__inner--single a.site-btn--event:hover {
	color: #fff;
	background: #d3322d;
	border-color: #d3322d;
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(233, 66, 61, .3);
}

.upcoming-events .news-list__inner--single a.site-btn--event-ghost {
	color: #e9423d;
	background: #fff;
	border-color: #e9423d;
	box-shadow: none;
}

.upcoming-events .news-list__inner--single a.site-btn--event-ghost:hover {
	color: #fff;
	background: #e9423d;
}

/* --- Одно событие: горизонтальная карточка во всю ширину ------------------ */

@media (min-width: 992px) {

	.upcoming-events .news-list__inner--single { display: block; }

	.upcoming-events .news-list__inner--single .news-list__item {
		flex: none;
		width: 100%;
		margin: 0 0 20px;
	}

	.upcoming-events .news-list__inner--single .news-thumbs_event {
		display: grid;
		grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
		grid-template-areas:
			"image date"
			"image name"
			"image desc"
			"image button";
		grid-template-rows: auto auto 1fr auto;
		column-gap: 46px;
		align-items: start;
	}

	/* картинку не растягиваем: держим её родные пропорции 16:10, иначе обрезает надписи */
	.upcoming-events .news-list__inner--single .news-thumbs__image {
		grid-area: image;
		align-self: start;
		height: auto;
		aspect-ratio: 16 / 10;
		margin-bottom: 0;
	}

	.upcoming-events .news-list__inner--single .news-thumbs__image-link,
	.upcoming-events .news-list__inner--single .news-thumbs__image img {
		height: 100%;
		border-radius: 18px;
	}

	.upcoming-events .news-list__inner--single .news-thumbs__date { grid-area: date; margin-bottom: 12px; }
	.upcoming-events .news-list__inner--single .news-thumbs__name { grid-area: name; font-size: 28px; margin-bottom: 16px; }
	.upcoming-events .news-list__inner--single .news-thumbs__desc { grid-area: desc; }
	.upcoming-events .news-list__inner--single .news-thumbs__button { grid-area: button; margin-top: 24px; }

}

@media (min-width: 1200px) {
	.upcoming-events .news-list__inner--single .news-thumbs_event {
		grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
	}

	/* даты выставки — в две колонки, чтобы карточка не была длинной */
	.upcoming-events .news-list__inner--single .news-thumbs__desc ul {
		-webkit-columns: 2;
		columns: 2;
		-webkit-column-gap: 36px;
		column-gap: 36px;
	}

	.upcoming-events .news-list__inner--single .news-thumbs__desc ul li {
		-webkit-column-break-inside: avoid;
		break-inside: avoid;
	}
}

@media (min-width: 1280px) {
	.upcoming-events .news-list__inner--single .news-thumbs_event {
		grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
		column-gap: 56px;
	}


}

/* --- Планшет и телефон ---------------------------------------------------- */

@media (max-width: 991px) {
	.upcoming-events .news-list__inner--single .news-thumbs__name { font-size: 20px; }
	.upcoming-events .news-list__inner--single .news-thumbs__desc { font-size: 15px; line-height: 1.6; }
	.upcoming-events .news-list__inner--single .news-thumbs__image { height: 240px; }
}

@media (max-width: 575px) {
	.upcoming-events .news-list__inner--single .news-thumbs__name { font-size: 18px; }
	.upcoming-events .news-list__inner--single .news-thumbs__desc { font-size: 15px; }
	.upcoming-events .news-list__inner--single .news-thumbs__image { height: 200px; }
	.upcoming-events .news-list__inner--single .news-thumbs__button { margin-top: 18px; }
	.upcoming-events .news-list__inner--single a.site-btn--event { width: 100%; padding: 15px 20px; }
}
