/* Только главная: первый экран с видео, биография, афиша, награды, медиа.
   Общее для всего сайта — в site-ui.css. */
/* ---------- Экран загрузки ----------
   Как у Askonas Holt: тёмный экран с монограммой, пока нарезка первого экрана
   не загрузится настолько, чтобы идти без остановок. Снимает его new-home.js;
   если скрипт не сработал, экран сам уходит через 6 секунд. */
.nh-loader { display: none; }
.is-loading .nh-loader, .nh-loader.is-leaving {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: var(--ink); color: var(--paper);
}
.is-loading .nh-loader { animation: nh-loader-out 0.6s var(--ease) 6s forwards; }
.nh-loader.is-leaving { opacity: 0; visibility: hidden; transition: opacity 0.8s var(--ease), visibility 0s 0.8s; }
.nh-loader__mark { width: 56px; height: 59px; animation: nh-loader-pulse 1.8s var(--ease) infinite alternate; }
.nh-loader__bar { width: 120px; height: 1px; background: rgba(247, 244, 239, 0.18); overflow: hidden; }
.nh-loader__fill {
  display: block; height: 100%; background: currentColor;
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.4s var(--ease);
}
@keyframes nh-loader-pulse { from { opacity: 0.45; } to { opacity: 1; } }
@keyframes nh-loader-out { to { opacity: 0; visibility: hidden; } }
/* Пока экран загрузки на месте, анимации первого экрана ждут — иначе они проиграются за ним. */
.is-loading .nh-hero__img, .is-loading .nh-hero__kicker, .is-loading .nh-hero__line { animation-play-state: paused; }

/* ---------- Первый экран ---------- */
.nh-hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px;
  overflow: hidden; background: #000; color: #fff;
}
.nh-hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 30%;
  animation: nh-zoom 2.4s var(--ease-out) both;
}
/* Фоновая нарезка: два ролика (16:9 и 9:16), кадр выстроен по Любе. Проявляется, когда пошло воспроизведение. */
.nh-hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 30%; pointer-events: none;
  opacity: 0; transition: opacity 1.2s var(--ease);
}
.nh-hero__video.is-playing { opacity: 1; }
/* В горизонтальной нарезке Люба во всех кадрах левее середины (от 28 до 53 % ширины):
   на экранах уже 16:9 обрезаем больше справа, чем слева. */
@media (min-aspect-ratio: 1501/1000) {
  .nh-hero__img, .nh-hero__video { object-position: 40% 30%; }
}
.nh-hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 45%, rgba(0,0,0,0.35) 100%);
}
.nh-hero__content {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(32px, 6vh, 64px);
}
.nh-hero__kicker {
  margin: 0 0 18px; font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase;
  animation: nh-fade 1s var(--ease) 0.9s both;
}
.nh-hero__title {
  margin: 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(42px, 7vw, 124px); line-height: 0.9; letter-spacing: -0.035em;
  text-transform: uppercase;
}
.nh-hero__line {
  display: block;
  animation: nh-weight 1.6s var(--ease-out) both;
}
.nh-hero__line + .nh-hero__line { animation-delay: 0.18s; }

/* ---------- Концерты ---------- */
.nh-events { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.nh-event { position: relative; border-bottom: 1px solid var(--line); }
/* Под последним видимым концертом линии нет (DESIGN.md, «Списки»): ниже — воздух
   или кнопка «Показать ещё», а не ещё одна черта. */
.nh-event:last-child, .nh-event:has(+ .nh-event[hidden]) { border-bottom: 0; }
.nh-event__row {
  position: relative; width: 100%;
  display: grid; grid-template-columns: 150px minmax(0, 1.5fr) minmax(0, 1fr) 40px; gap: 32px; align-items: baseline;
  padding: 26px 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left;
  transition: padding 0.5s var(--ease);
}
button.nh-event__row { cursor: pointer; }
/* одна белая подложка на строку и детали, шире колонки на поля страницы */
.nh-event::before {
  content: ''; position: absolute; inset: 0 calc(-1 * var(--gutter)); z-index: -1;
  background: #fff; opacity: 0; transition: opacity 0.5s var(--ease);
}
.nh-event.is-open::before { opacity: 1; }
/* Сдвиг и подсветка при наведении — только там, где есть мышь: на телефоне «наведение» залипает после касания. */
@media (hover: hover) {
  .nh-event:has(button.nh-event__row:hover)::before { opacity: 1; }
  button.nh-event__row:hover { padding-left: 12px; }
  button.nh-event__row:hover .nh-event__toggle { border-color: var(--ink); }
}
.nh-event__date { font: 500 var(--row-title)/1.1 var(--text); letter-spacing: -0.02em; }
.nh-event__date small { display: block; margin-top: 8px; font: 400 12px/1 var(--text); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.nh-event__title { font-size: var(--row-title); line-height: 1.2; letter-spacing: -0.02em; }
.nh-event__venue { color: var(--muted); font-size: 15px; }
/* плюс, который поворачивается в крестик */
.nh-event__toggle { position: relative; justify-self: end; align-self: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; transition: transform 0.5s var(--ease), background-color 0.5s var(--ease), border-color 0.5s var(--ease); }
.nh-event__toggle::before, .nh-event__toggle::after { content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 1px; margin-left: -6px; background: currentColor; }
.nh-event__toggle::after { transform: rotate(90deg); }
.nh-event.is-open .nh-event__toggle { transform: rotate(45deg); background: var(--ink); border-color: var(--ink); color: var(--paper); }
/* детали плавно раскрываются по высоте */
.nh-event__details { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.5s var(--ease), opacity 0.4s var(--ease); }
.nh-event.is-open .nh-event__details { grid-template-rows: 1fr; opacity: 1; }
.nh-event__clip { overflow: hidden; }
.nh-event__body {
  display: grid; grid-template-columns: 150px minmax(0, 1.5fr) minmax(0, 1fr) 40px; gap: 32px;
  padding: 4px 0 32px;
}
.nh-event__programme { grid-column: 2; }
.nh-event__programme .nh-eyebrow { margin-bottom: 10px; }
.nh-event__programme .nh-event__text { margin: 0; line-height: 1.6; overflow: hidden; transition: max-height 0.6s var(--ease); }
/* Программа по отделениям: примечание мелко и приглушённо, название отделения — 500
   с отбивкой сверху, произведения под ним пронумерованы серыми цифрами на полях,
   как в программке театра, — иначе отделения сливаются со списком. */
.nh-event__line, .nh-event__part { display: block; }
.nh-event__line_note { color: var(--muted); font-size: 15px; }
.nh-event__part { font-weight: 500; margin: 1.1em 0 0.2em; counter-reset: nh-work; }
.nh-event__line_note + .nh-event__part { margin-top: 0.6em; }
.nh-event__part:first-child { margin-top: 0; }
.nh-event__part ~ .nh-event__line { position: relative; padding-left: 2em; counter-increment: nh-work; }
.nh-event__part ~ .nh-event__line::before {
  content: counter(nh-work) '.'; position: absolute; left: 0;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
/* Длинная программа: девять строк, нижние тают — маской, а не плашкой цвета фона,
   потому что фон у строки меняется (белый при раскрытии и наведении). */
.nh-event__text.is-clamped {
  max-height: calc(1.6em * 9);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 4.8em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 4.8em), transparent);
}
.nh-event__more {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 4px 0;
  background: none; border: 0; color: var(--accent); cursor: pointer;
  font: 400 15px/1.4 var(--text);
}
.nh-event__more[hidden] { display: none; }
.nh-event__more span {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}
.nh-event__more svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.4; transition: transform 0.5s var(--ease); }
.nh-event__more[aria-expanded="true"] svg { transform: rotate(180deg); }
@media (hover: hover) { .nh-event__more:hover span { background-size: 100% 1px; } }
/* Кнопка «Билеты и подробности» прижата к низу блока: колонка тянется на высоту
   соседней (картинки или программы), а кнопка уходит вниз через margin-top: auto —
   место у неё одно и то же, сколько бы ни было текста над ней. */
.nh-event__side { grid-column: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.nh-event__cta { margin-top: auto; }
/* С картинкой спектакля: картинка в средней колонке (не шире 480 px, чтобы не перетягивать
   внимание с программы), под ней мелкая подпись, откуда кадр; программа, исполнители и кнопка —
   справа одной стопкой. Формат 4:3 у всех, кадр по центру, скругление как у видео. */
.nh-event__poster { grid-column: 2; grid-row: 1 / span 2; width: 100%; max-width: 480px; margin: 0; }
.nh-event__frame { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--line); }
.nh-event__frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.nh-event__poster figcaption { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
/* Колонка картинки уже колонки текста: иначе на ноутбуке строка программы вроде
   «Бела Барток — Скрипичный концерт № 1» переносится, а картинка всё равно не шире 480 px. */
.nh-event__body_poster { grid-template-columns: 150px minmax(0, 0.8fr) minmax(0, 1fr) 40px; grid-template-rows: auto 1fr; row-gap: 28px; }
.nh-event__body_poster .nh-event__programme { grid-column: 3; grid-row: 1; }
.nh-event__body_poster .nh-event__side { grid-column: 3; grid-row: 2; }
.nh-event__performers { margin: 0; color: #2e2b28; font-size: 15px; line-height: 1.6; }
.nh-event__cta {
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  padding: 12px 20px; border: 1px solid var(--ink); border-radius: 999px;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
@media (hover: hover) { .nh-event__cta:hover { background: var(--ink); color: var(--paper); } }
.nh-events__empty { padding: 26px 0; color: var(--muted); }

/* ---------- Анимации ---------- */
@keyframes nh-weight {
  0% { opacity: 0; font-weight: 200; letter-spacing: 0.02em; transform: translateY(0.18em); }
  100% { opacity: 1; font-weight: 700; letter-spacing: -0.035em; transform: none; }
}
@keyframes nh-zoom { from { transform: scale(1.12); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .nh-event__row { grid-template-columns: 96px minmax(0, 1fr) 40px; row-gap: 6px; column-gap: 20px; }
  .nh-event__venue { grid-column: 2; grid-row: 2; }
  .nh-event__toggle { grid-column: 3; grid-row: 1 / span 2; }
  .nh-event__body { grid-template-columns: 1fr; gap: 20px; padding-left: 116px; }
  .nh-event__programme, .nh-event__side { grid-column: 1; }
  .nh-event__body_poster { grid-template-rows: none; }
  .nh-event__poster, .nh-event__body_poster .nh-event__programme, .nh-event__body_poster .nh-event__side { grid-column: 1; grid-row: auto; }
}
@media (max-width: 560px) {
  .nh-event__row { grid-template-columns: minmax(0, 1fr) 40px; }
  .nh-event__date, .nh-event__title, .nh-event__venue { grid-column: 1; grid-row: auto; }
  .nh-event__toggle { grid-column: 2; grid-row: 1 / span 3; }
  .nh-event__body { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nh-loader__mark { animation: none; }
}
