/*
  Афиша мероприятий: список /afisha/ и страница мероприятия /afisha/<slug>/.

  Перенос макета дизайнера 29.10 (Полезное/afisha-2026-10-29/iskhodniki/:
  schoolrate_afisha_unified_cards.html и schoolrate_afisha_event_detail.html).
  Размеры, цвета, отступы и скругления - числами из макета.

  Что отличается и почему:
  - классы с приставкой af-: у макета короткие имена (.main, .info, .form,
    .cta, .value), а на сайте такие уже заняты стилями каркаса;
  - переломы макета по ширине окна (850 и 650 px) здесь по ширине самого
    блока - контейнерными запросами: у сайта слева и справа сайдбары, и блок
    уже окна. Пороги пересчитаны на ширину карточки в макете при тех окнах:
    850 - 2 x 22 = 806, 650 - 2 x 12 = 626;
  - шрифт сайта (Onest с весами макета) вместо Arial прототипа.
*/

.af {
	--af-ink: #071737;
	--af-line: #e7eaf0;
	--af-red: #ec1739;
	container-type: inline-size;
	/* до футера 70px, как .wrap макета: 24 у последней карточки + 46 */
	padding-bottom: 46px;
	font-family: 'Onest', sans-serif;
	line-height: normal;
	color: var(--af-ink);
}

.af *,
.af *::before,
.af *::after {
	box-sizing: border-box;
}

.af a {
	color: inherit;
}

/*
  Общие правила сайта, которых макет не знает: `li, p` в style_new.css дают
  вес 300 и интервал 1.38, `h1, h2` - ширину 520px. Сброс до значений макета
  (вес 400, интервал normal, без ширины); :where держит силу одного класса,
  поэтому правила блоков ниже его перекрывают.
*/
.af :where(p, li) {
	font-weight: 400;
	line-height: normal;
}

.af :where(h1, h2, h3) {
	max-width: none;
}

/* ---------- Заголовок страницы ------------------------------------------- */
.af-top {
	margin-bottom: 24px;
}

.af-top__title {
	margin: 0 0 7px;
	font-family: 'Onest', sans-serif;
	font-size: 32px;
	font-weight: 700;
	line-height: normal;
	letter-spacing: -1px;
	color: var(--af-ink);
}

.af-top__lead {
	margin: 0;
	font-size: 14px;
	line-height: normal;
	color: #6f7d91;
}

.af-kroshki {
	margin: 0 0 21px;
	font-size: 12px;
	color: #8090a5;
}

.af-kroshki a {
	text-decoration: none;
}

.af-kroshki ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.af-kroshki li + li::before {
	content: '/ ';
}

/* ---------- Карточка в списке --------------------------------------------- */
.af-event {
	overflow: hidden;
	margin: 0 0 24px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 2px 14px #16213b06;
}

.af-event__main {
	display: grid;
	grid-template-columns: 235px minmax(0, 1fr) 230px;
	min-height: 247px;
}

.af-event__visual {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 25px 20px 22px 28px;
}

.af-tag {
	display: inline-block;
	width: max-content;
	padding: 8px 13px;
	border-radius: 24px;
	background: #008b43;
	font-size: 11px;
	font-weight: 700;
	line-height: normal;
	color: #fff;
	white-space: nowrap;
}

/*
  Перенос метки и плашки - только когда строка не помещается: у макета они
  без переноса, и на планшете «ОЧНО · разговорный клуб» наезжала на текст,
  а на телефоне «Профессиональное развитие» - на колонку с датой.
*/
.af-tag,
.af-event__kategoriya {
	max-width: 100%;
}

@container (max-width: 806px) {
	.af .af-tag,
	.af .af-event__kategoriya {
		white-space: normal;
	}
}

.af-art {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow: hidden;
	height: 132px;
	padding: 21px;
	border-radius: 15px;
}

.af-art::before {
	content: '\2726';
	position: absolute;
	right: -8px;
	bottom: -36px;
	font-size: 105px;
	line-height: normal;
	opacity: .12;
}

.af-art--foto {
	padding: 0;
}

.af-art--foto::before {
	content: none;
}

.af-art--foto img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.af-art__podpis {
	font-size: 11px;
	font-weight: 700;
	line-height: normal;
	letter-spacing: 2px;
	text-transform: uppercase;
	opacity: .7;
}

.af-art__nadpis {
	margin-top: 11px;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -.8px;
}

.af-art--blue {
	background: linear-gradient(135deg, #dceafc, #f4f7ff);
	color: #244884;
}

.af-art--violet {
	background: linear-gradient(135deg, #e7e2fd, #f6edfa);
	color: #4f3586;
}

.af-art--green {
	background: linear-gradient(135deg, #d7f2e5, #f1f9e9);
	color: #156b56;
}

.af-event__info {
	min-width: 0;
	padding: 28px 34px 20px 8px;
}

.af-event__eyebrow {
	display: flex;
	align-items: start;
	justify-content: space-between;
	gap: 12px;
	min-height: 32px;
}

.af-event__organizer {
	font-size: 12px;
	line-height: normal;
	color: #203457;
	text-decoration: underline;
}

.af .af-event__organizer {
	color: #203457;
}

.af-event__forma {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	line-height: normal;
	color: #a2adc0;
	text-transform: uppercase;
}

.af-event__kategoriya {
	padding: 8px 12px;
	border-radius: 20px;
	background: #e7f9ee;
	font-size: 11px;
	font-weight: 700;
	line-height: normal;
	color: #0b9b4c;
	white-space: nowrap;
}

.af-event__title {
	margin: 17px 0 12px;
	font-family: 'Onest', sans-serif;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.45px;
	color: var(--af-ink);
	text-transform: none;
}

.af-event__title a {
	text-decoration: none;
}

.af-event__anons {
	max-width: 690px;
	margin: 0;
	font-size: 13px;
	line-height: 1.47;
	color: #34405a;
}

.af-event__micro {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px 20px;
	margin-top: 24px;
	font-size: 12px;
	line-height: normal;
	color: #7c8ba2;
}

.af-event__micro span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.af-event__micro b {
	font-weight: 500;
	color: #566477;
}

.af-event__data {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 26px 18px;
	border-left: 1px solid var(--af-line);
	text-align: center;
}

.af-den {
	font-size: 50px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: -2px;
	color: #071737;
}

.af-mesyac {
	margin-top: 2px;
	font-size: 14px;
	font-weight: 700;
	line-height: normal;
}

.af-poddatoj {
	margin: 5px 0 23px;
	font-size: 12px;
	line-height: normal;
}

.af-cta {
	display: inline-block;
	padding: 12px 17px;
	border: 0;
	border-radius: 24px;
	background: var(--af-red);
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: normal;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
}

.af a.af-cta,
.af a.af-cta:hover {
	color: #fff;
}

.af-cta:hover {
	background: #cf1030;
}

.af-cta[aria-disabled='true'] {
	opacity: .65;
	cursor: not-allowed;
}

.af-cta[aria-disabled='true']:hover {
	background: var(--af-red);
}

.af-stats {
	display: grid;
	grid-template-columns: 1fr 1.2fr 1fr 1.25fr 1.1fr;
	border-top: 1px solid var(--af-line);
}

.af-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 87px;
	padding: 10px;
	border-right: 1px solid var(--af-line);
	text-align: center;
}

.af-stat:last-child {
	border-right: 0;
}

.af-stat__cap {
	margin-bottom: 7px;
	font-size: 11px;
	line-height: normal;
	color: #8c99ad;
}

.af-stat__value {
	font-size: 15px;
	font-weight: 700;
	line-height: normal;
	overflow-wrap: anywhere;
}

.af-pusto {
	margin: 0;
	font-size: 14px;
	color: #6f7d91;
}

@container (max-width: 806px) {
	.af-event__main {
		grid-template-columns: 180px minmax(0, 1fr) 155px;
	}

	.af-event__visual {
		padding: 20px 13px;
	}

	.af-event__info {
		padding: 22px 16px 20px 8px;
	}

	.af-event__title {
		font-size: 17px;
	}

	.af-event .af-den {
		font-size: 40px;
	}

	.af-event .af-stats {
		grid-template-columns: repeat(3, 1fr);
	}

	.af-event .af-stat:nth-child(3) {
		border-right: 0;
	}

	.af-event .af-stat:nth-child(n + 4) {
		border-top: 1px solid var(--af-line);
	}
}

@container (max-width: 626px) {
	.af-event__main {
		grid-template-columns: 1fr 128px;
	}

	.af-event__visual {
		grid-column: 1 / -1;
		padding: 16px 17px 0;
	}

	.af-event .af-art {
		height: 110px;
	}

	.af-event__info {
		padding: 18px 18px 24px;
	}

	.af-event__data {
		grid-column: 2;
		grid-row: 2;
		padding: 18px 8px;
	}

	.af-event__eyebrow {
		display: block;
	}

	.af-event__kategoriya {
		display: inline-block;
		margin-top: 9px;
	}

	.af-event__title {
		margin-top: 12px;
	}

	.af-event__micro {
		margin-top: 16px;
	}

	.af-event .af-den {
		font-size: 39px;
	}

	.af-event .af-stats {
		grid-template-columns: repeat(2, 1fr);
	}

	.af-event .af-stat:nth-child(3) {
		border-right: 1px solid var(--af-line);
	}

	.af-event .af-stat:nth-child(2n) {
		border-right: 0;
	}

	.af-event .af-stat:nth-child(n + 3) {
		border-top: 1px solid var(--af-line);
	}
}

/* ---------- Страница мероприятия ------------------------------------------ */
.af-stranica {
	overflow: hidden;
	margin-bottom: 24px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 2px 14px #16213b06;
}

.af-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 310px;
	min-height: 335px;
}

.af-hero__left {
	padding: 34px 37px;
}

.af-plashki {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-bottom: 22px;
}

.af-plashka {
	padding: 8px 12px;
	border-radius: 20px;
	background: #eaf7ef;
	font-size: 11px;
	font-weight: 700;
	line-height: normal;
	color: #098a46;
}

.af-plashka--alt {
	background: #f2f4f8;
	color: #64758b;
}

.af-hero__title {
	max-width: 730px;
	margin: 0 0 16px;
	font-family: 'Onest', sans-serif;
	font-size: 35px;
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -1.15px;
	color: var(--af-ink);
	text-transform: none;
}

.af-lead {
	max-width: 750px;
	margin: 0;
	font-size: 15px;
	line-height: 1.7;
	color: #49566c;
}

.af .af-by {
	margin: 24px 0 13px;
	font-size: 13px;
	line-height: normal;
	color: #8190a7;
}

.af-by strong {
	font-weight: 700;
	color: #183459;
}

.af-hero__right {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 28px;
	border-left: 1px solid var(--af-line);
}

.af-hero__right .af-den {
	font-size: 74px;
}

.af-hero__right .af-mesyac {
	font-size: 18px;
}

.af-hero__right .af-poddatoj {
	margin: 0 0 13px;
	color: #6a7990;
}

.af-hero__right .af-cta {
	padding: 15px 25px;
	font-size: 14px;
}

.af-hint {
	font-size: 11px;
	line-height: normal;
	color: #90a0b0;
	text-align: center;
}

.af-proshlo {
	padding: 8px 12px;
	border-radius: 20px;
	background: #f2f4f8;
	font-size: 12px;
	font-weight: 700;
	line-height: normal;
	color: #64758b;
}

.af-stranica .af-stats {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.af-stranica .af-stat {
	min-height: 98px;
}

.af-telo {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 310px;
	gap: 40px;
	padding: 38px 37px;
}

.af-telo h2 {
	margin: 0 0 15px;
	font-family: 'Onest', sans-serif;
	font-size: 23px;
	font-weight: 700;
	line-height: normal;
	letter-spacing: -.4px;
	color: var(--af-ink);
	text-transform: none;
}

.af-telo p,
.af-telo li {
	font-size: 14px;
	line-height: 1.8;
	color: #40506b;
}

.af .af-telo p {
	margin: 14px 0;
}

.af .af-telo ul {
	margin: 16px 0;
	padding-left: 20px;
	list-style: disc;
}

.af-telo section {
	margin-bottom: 32px;
}

.af-telo a:not(.af-cta) {
	color: var(--af-red);
}

.af-sidecard {
	position: sticky;
	top: 20px;
	padding: 25px;
	border: 1px solid #e8ecf2;
	border-radius: 17px;
	background: #f6f8fb;
}

.af-sidecard h3 {
	margin: 0 0 20px;
	font-family: 'Onest', sans-serif;
	font-size: 18px;
	font-weight: 700;
	line-height: normal;
	color: var(--af-ink);
}

.af-side-row {
	margin-bottom: 17px;
}

.af-side-label {
	margin-bottom: 5px;
	font-size: 11px;
	line-height: normal;
	color: #8a99ad;
}

.af-side-value {
	font-size: 14px;
	font-weight: 700;
}

.af-sidecard .af-cta {
	width: 100%;
	margin-top: 12px;
	padding: 14px;
	text-align: center;
}

.af .af-sidecard__primechanie {
	margin: 11px 0;
	font-size: 11px;
	line-height: 1.5;
	color: #8a99ad;
}

.af-poster {
	margin-top: 23px;
	overflow: hidden;
	border: 1px solid #ede8f7;
	border-radius: 16px;
	background: #faf9ff;
}

.af-poster img {
	display: block;
	width: 100%;
	height: auto;
}

.af-pohozhie {
	padding: 31px 37px;
	border-top: 1px solid var(--af-line);
	background: #f8f9fb;
}

.af-pohozhie h2 {
	margin: 0 0 18px;
	font-family: 'Onest', sans-serif;
	font-size: 22px;
	font-weight: 700;
	line-height: normal;
	color: var(--af-ink);
	text-transform: none;
}

.af-pohozhie__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.af-pohozhie__item {
	display: block;
	padding: 19px;
	border: 1px solid var(--af-line);
	border-radius: 14px;
	background: #fff;
	text-decoration: none;
}

.af-pohozhie__item:hover {
	border-color: #d5dae3;
}

.af-pohozhie__date {
	font-size: 12px;
	line-height: normal;
	color: #8a99ad;
}

.af-pohozhie__item strong {
	display: block;
	margin: 10px 0;
	font-size: 15px;
	font-weight: 700;
}

.af-pohozhie__item p {
	margin: 0;
	font-size: 12px;
	color: #687891;
}

@container (max-width: 806px) {
	.af-hero {
		grid-template-columns: minmax(0, 1fr) 220px;
	}

	.af-hero__left {
		padding: 27px;
	}

	.af-hero__title {
		font-size: 27px;
	}

	.af-telo {
		grid-template-columns: minmax(0, 1fr) 250px;
		gap: 20px;
		padding: 28px;
	}
}

@container (max-width: 626px) {
	.af-hero {
		grid-template-columns: 1fr;
	}

	.af-hero__left {
		padding: 23px;
	}

	.af-hero__right {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 12px;
		border-top: 1px solid var(--af-line);
		border-left: 0;
	}

	.af-hero__right .af-den {
		font-size: 50px;
	}

	.af-hero__right .af-poddatoj {
		margin: 0;
	}

	.af-stranica .af-stats {
		grid-template-columns: repeat(2, 1fr);
	}

	.af-stranica .af-stat:nth-child(3) {
		border-right: 1px solid var(--af-line);
	}

	.af-stranica .af-stat:nth-child(2n) {
		border-right: 0;
	}

	.af-stranica .af-stat:nth-child(n + 3) {
		border-top: 1px solid var(--af-line);
	}

	.af-telo {
		display: block;
		padding: 24px;
	}

	.af-sidecard {
		position: static;
	}

	.af-pohozhie {
		padding: 24px;
	}

	.af-pohozhie__grid {
		grid-template-columns: 1fr;
	}
}
