/*
 * Страница фестиваля (#36), общее: первый экран, кнопки разметки плагина, липкая строка разделов, разделы,
 * нижняя панель телефона. Разметку строит блок плагина сайта ev/festival-page; образец — прототип
 * inner-pages-approved-2026-11-11, pages.html?p=festival&v=A (pages.css, stage10.css, music7.css).
 * Стили разделов — в своих файлах festival-<раздел>.css.
 */

/* Высота строки разделов: капсула 40 px и поля 12 px сверху и снизу, линия 1 px. Та же строка — на главной. */
:is(.ev-fest, .ev-front) { --ev-fest-nav-h: 65px; }
/* Якоря останавливаются под шапкой и строкой разделов. */
:is(.ev-fest, .ev-front) [id] { scroll-margin-top: calc(var(--ev-header-h) + 3px + var(--ev-fest-nav-h) + 24px); }

/* Кнопки разметки плагина: тёмная и контурная (оранжевая — по умолчанию из theme.json). */
.wp-element-button.ev-button--ink { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); }
.wp-element-button.ev-button--ink:is(:hover, :focus-visible) { background: var(--wp--preset--color--paper); color: var(--wp--preset--color--ink); }
.wp-element-button.ev-button--outline { background: transparent; color: var(--wp--preset--color--ink); border-color: var(--wp--preset--color--ink); }
.wp-element-button.ev-button--outline:is(:hover, :focus-visible) { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); }

/* ---------- Первый экран: фото на весь экран, снизу светлая вуаль и полосы, на них текст ---------- */

.ev-fest-hero {
	position: relative; isolation: isolate; overflow: hidden;
	display: flex; flex-direction: column; justify-content: flex-end;
	min-height: clamp(640px, calc(100svh - var(--ev-header-h) - 3px), 900px);
	background: #e9c7a8;
}
.ev-fest-hero--no-photo { background: var(--wp--preset--color--sun-soft); }
.ev-fest-hero__media { position: absolute; inset: 0; }
.ev-fest-hero__photo { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100% !important; object-fit: cover; object-position: 55% 30%; }
/* С отдельным фото для компьютера картинка лежит в <picture>: без своей рамки, раскладка та же, что у одной картинки. */
.ev-fest-hero__media > picture { display: contents; }
.ev-fest-hero__media::after {
	content: ""; position: absolute; inset: 0; z-index: -2;
	background:
		linear-gradient(0deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,.8) 28%, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 66%),
		linear-gradient(90deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,0) 55%);
}
.ev-fest-hero > .ev-bands { z-index: -1; }
.ev-fest-hero__body { position: relative; padding: 0 200px 72px 0; }
.ev-fest-hero__body > * { margin-block: 0; }
.ev-fest-hero .ev-crumbs { margin-bottom: 28px; }
.ev-fest-hero__kicker { margin-bottom: 20px !important; font: 500 19px/26px var(--wp--preset--font-family--jost); }
.ev-fest-hero__title {
	margin-bottom: 28px !important;
	font-size: var(--wp--preset--font-size--display); line-height: 1; letter-spacing: -.035em; font-weight: 500;
}
.ev-fest-hero__facts {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 0; margin: 0 0 32px !important; padding: 0; list-style: none;
	font-size: 20px; line-height: 28px;
}
.ev-fest-hero__facts li { padding-right: 20px; margin-right: 20px; border-right: 2px solid rgba(30, 26, 23, .28); }
.ev-fest-hero__facts li:last-child { border: 0; margin: 0; padding: 0; }
.ev-fest-hero__facts b { font: 500 26px/30px var(--wp--preset--font-family--jost); letter-spacing: -.01em; }
.ev-fest-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.ev-fest-hero__next { font-weight: 600; }

/*
 * Прошедший фестиваль без большого фото (настройка archive_video_first): заголовок на белом, как у других страниц,
 * под ним фильмы отчёта по два в ряд (.ev-fest-films — festival-report.css): на 1440 × 900 пара фильмов целиком
 * на первом экране. При нечётном числе фильмов первый — во всю колонку. После каждого ролика идёт <script> с JSON-LD,
 * поэтому фильмы считаются по figure (nth-of-type), а не по всем детям.
 */
.ev-fest-hero--compact { display: block; min-height: 0; padding-block: 48px 72px; background: var(--wp--preset--color--paper); }
.ev-fest-hero--compact .ev-fest-hero__body { padding: 0; }
.ev-fest-hero--compact .ev-fest-hero__title { font-size: var(--wp--preset--font-size--page-title); line-height: 1.02; }
.ev-fest-hero--compact .ev-fest-hero__facts:last-child { margin-bottom: 0 !important; }
.ev-fest-hero__films { margin-top: 40px; }
.ev-fest-hero__films .ev-fest-films { margin-top: 0; }
.ev-fest-hero__films .ev-video:first-of-type:nth-last-of-type(odd) { grid-column: 1 / -1; }
.ev-fest-hero__films .ev-video:first-of-type:nth-last-of-type(odd) .ev-video__caption b { font-size: 26px; line-height: 32px; }

@media (max-width: 1180px) {
	.ev-fest-hero__facts { display: grid; gap: 2px; }
	.ev-fest-hero__facts li { border: 0; margin: 0; padding: 0; }
}
/* Планшет и телефон: фото сверху без вуали, текст ниже на полосах радуги. */
@media (max-width: 860px) {
	.ev-fest-hero { display: block; min-height: 0; background: var(--wp--preset--color--paper); }
	.ev-fest-hero__media { position: relative; inset: auto; width: 100%; aspect-ratio: 4 / 3; max-height: 56svh; }
	.ev-fest-hero__photo { position: static; display: block; }
	.ev-fest-hero__media::after { display: none; }
	.ev-fest-hero__body { padding: 28px 0 64px; }
	.ev-fest-hero__kicker { font-size: 17px; line-height: 24px; margin-bottom: 16px !important; max-width: 20em; }
	.ev-fest-hero__title { font-size: clamp(2.2rem, 1.2rem + 5vw, 3.2rem); margin-bottom: 20px !important; }
	.ev-fest-hero__facts { gap: 4px; font-size: 18px; line-height: 26px; margin-bottom: 28px !important; }
	.ev-fest-hero__facts b { font-size: 24px; }
	.ev-fest-hero__actions .wp-element-button { flex: 1 1 220px; }
	.ev-fest-hero--compact { padding-block: 32px 48px; }
	.ev-fest-hero__films { margin-top: 32px; }
	.ev-fest-hero__films .ev-video:first-of-type:nth-last-of-type(odd) .ev-video__caption b { font-size: 20px; line-height: 26px; }
}
@media (max-width: 560px) {
	.ev-fest-hero__media { aspect-ratio: 3 / 2; }
}

/* ---------- Липкая строка разделов: капсулы-якоря под шапкой ---------- */

.ev-fest-nav {
	position: sticky; z-index: 15;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--ev-header-h) + 3px);
	background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
/* На телефоне капсулы прокручиваются внутри строки, страница вбок не прокручивается. */
.ev-fest-nav__inner { display: flex; gap: 8px; overflow-x: auto; padding-block: 12px; scrollbar-width: none; overscroll-behavior-x: contain; }
.ev-fest-nav__inner::-webkit-scrollbar { display: none; }
/*
 * Капсулы не влезли — край строки, за которым есть ещё капсулы, затухает: справа в начале, с обеих сторон
 * посередине, слева в конце. Затухание следует за прокруткой строки (scroll-driven animation); влезли — строка
 * не прокручивается, анимация не идёт, затухания нет. Браузер без scroll-driven animations строку просто прокручивает.
 */
@property --ev-fest-nav-fade-l { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --ev-fest-nav-fade-r { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes ev-fest-nav-fade {
	from { --ev-fest-nav-fade-l: 0px; --ev-fest-nav-fade-r: 40px; }
	10%, 90% { --ev-fest-nav-fade-l: 40px; --ev-fest-nav-fade-r: 40px; }
	to { --ev-fest-nav-fade-l: 40px; --ev-fest-nav-fade-r: 0px; }
}
@supports (animation-timeline: scroll()) {
	.ev-fest-nav__inner {
		mask-image: linear-gradient(to right, transparent, #000 var(--ev-fest-nav-fade-l), #000 calc(100% - var(--ev-fest-nav-fade-r)), transparent);
		animation: ev-fest-nav-fade linear both; animation-timeline: scroll(self inline);
	}
}
.ev-fest-nav a {
	flex: none; padding: 8px 16px; border: 2px solid var(--wp--preset--color--line); border-radius: 999px;
	color: var(--wp--preset--color--ink); font: 500 16px/20px var(--wp--preset--font-family--jost); text-decoration: none;
	transition: border-color .2s;
}
.ev-fest-nav a:is(:hover, :focus-visible) { border-color: var(--wp--preset--color--ink); }
/* Разделы этой страницы стоят в строке шапки (#84): на компьютере строки нет, якоря останавливаются под шапкой. */
@media (min-width: 961px) {
	.ev-fest-nav--in-header { display: none; }
	:is(.ev-fest, .ev-front):has(> .ev-fest-nav--in-header) { --ev-fest-nav-h: 0px; }
}
/* Строки нет совсем (архивная страница, где включён один отчёт): якоря останавливаются под шапкой. */
.ev-fest:not(:has(> .ev-fest-nav)) { --ev-fest-nav-h: 0px; }

/* ---------- Разделы ---------- */

.ev-fest-sec { position: relative; padding-block: var(--ev-section); }
/* Два белых раздела подряд — один отступ между ними; раздел со своим фоном — класс ev-fest-sec--fill. */
.ev-fest-sec:not(.ev-fest-sec--fill) + .ev-fest-sec:not(.ev-fest-sec--fill) { padding-top: 0; }
.ev-fest-sec__head { display: grid; gap: 16px; max-width: 760px; margin-bottom: 48px; }
.ev-fest-sec__head > * { margin: 0; }
.ev-fest-sec__head p { color: var(--wp--preset--color--ink-2); }
.ev-fest-sec__head strong { color: var(--wp--preset--color--ink); font-weight: 600; }
.ev-fest-sec :is(h2, h3, h4, p, ul, ol) { margin-block: 0; }
.ev-fest-sec :is(ul, ol) { padding: 0; list-style: none; }

/* ---------- Нижняя панель телефона: даты и «Купить билет» ---------- */

.ev-fest-dock { display: none; }
@media (max-width: 860px) {
	.ev-fest-dock {
		position: fixed; z-index: 25; inset: auto 0 0;
		display: flex; align-items: center; justify-content: space-between; gap: 12px;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
		background: var(--wp--preset--color--paper); border-top: 3px solid; border-image: var(--ev-rainbow) 1;
		font-size: 15px; line-height: 20px;
	}
	.ev-fest-dock b { display: block; font: 500 18px/22px var(--wp--preset--font-family--jost); }
	.ev-fest-dock .wp-element-button { flex: none; min-height: 48px; padding: 10px 24px; font-size: 17px; }
	/* Подвал не прячется под панелью. */
	body:has(.ev-fest-dock) .ev-footer { padding-bottom: 124px; }
}
@media (max-width: 360px) {
	.ev-fest-dock span { font-size: 13px; }
	.ev-fest-dock .wp-element-button { padding-inline: 16px; }
}
