/* ============================================================
   Страницы тренеров и направлений, которые собирает сервер приложения
   (rasp2, модуль site-pages), и текст из редактора админки внутри них.
   Подключается в templates/page.html после main.css; правила — в том же
   слое components, чтобы не перебивать основные стили сайта.
   ============================================================ */

@layer components {
  /* ---------- Шапка направления без фото ---------- */
  .dir-hero--text { grid-template-columns: 1fr; }
  .dir-hero__media video { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }

  /* ---------- Шапка тренера ---------- */
  .person-hero { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(12px, 3vw, 32px) clamp(32px, 5vw, 56px); }
  .person-hero__photo { border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); aspect-ratio: 1; background: var(--surface-2); }
  .person-hero__photo img { width: 100%; height: 100%; object-fit: cover; }
  .person-hero__initials { width: 100%; height: 100%; display: grid; place-items: center; font: 600 clamp(4rem, 3rem + 6vw, 8rem)/1 var(--font-display); color: var(--pink-ink); }
  .person-hero__role { margin-top: 10px; font-weight: 700; color: var(--pink-ink); }
  @media (max-width: 800px) {
    .person-hero { grid-template-columns: 1fr; }
    .person-hero__photo { max-width: 320px; }
  }

  /* ---------- Боковая колонка: тренеры направления ---------- */
  .aside__people { display: grid; gap: 6px; }
  .aside__people a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
  .aside__people a:hover b { color: var(--pink-ink); }
  .aside__people img, .aside__person-initials { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
  .aside__person-initials { display: grid; place-items: center; background: var(--pink-tint); color: var(--pink-ink); font: 600 1.1rem/1 var(--font-display); }
  .aside__people span { display: grid; gap: 2px; min-width: 0; }
  .aside__people b { font-size: 0.92rem; }
  .aside__people small { font-size: 0.8rem; color: var(--ink-2); }

  /* ---------- Карточка тренера на главной ---------- */
  .trainer__name a:hover { color: var(--pink-ink); }
  /* Без фото — первая буква имени на фирменном градиенте карточки. */
  .trainer__avatar--initials { font-size: 2.4rem; }
  .trainer__more { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-weight: 700; font-size: 0.9rem; color: var(--pink-ink); }
  .trainer__more svg { width: 16px; height: 16px; }
  .trainer__more:hover { text-decoration: underline; }

  /* ---------- Текст из редактора ---------- */
  .article h3 { font: 600 1.15rem/1.3 var(--font-display); margin: 18px 0 8px; }
  .article ul:not([class]), .article ol:not([class]) { padding-left: 1.4em; color: var(--ink-2); display: grid; gap: 6px; }
  .article ul:not([class]) { list-style: disc; }
  .article ol:not([class]) { list-style: decimal; }
  .article ul:not([class]) ::marker, .article ol:not([class]) ::marker { color: var(--pink-ink); }
  .article li > p + p { margin-top: 6px; }
  .article p + ul, .article p + ol, .article ul + p, .article ol + p { margin-top: 12px; }
  .article blockquote { padding: 14px 18px; border-left: 3px solid var(--pink-ink); background: var(--pink-tint); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink); font-style: italic; }
  .article blockquote p { color: inherit; }
  .article hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
  .article p a, .article li a { color: var(--pink-ink); text-decoration: underline; text-underline-offset: 3px; }

  .rt-figure img { width: 100%; }
  .rt-figure--narrow { max-width: 420px; justify-self: center; width: 100%; }

  .rt-gallery__grid { display: grid; gap: 2px; background: var(--line); }
  .rt-gallery--2 .rt-gallery__grid { grid-template-columns: repeat(2, 1fr); }
  .rt-gallery--3 .rt-gallery__grid { grid-template-columns: repeat(3, 1fr); }
  .rt-gallery__grid img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
  @media (max-width: 560px) {
    .rt-gallery--3 .rt-gallery__grid { grid-template-columns: repeat(2, 1fr); }
  }

  .rt-video { background: var(--night); }
  .rt-video video { width: 100%; height: auto; background: var(--night); }
  .rt-video--portrait { max-width: 420px; justify-self: center; width: 100%; }

  /* Заглушка необработанного файла — только в предпросмотре админки. */
  .rt-pending__box { display: grid; place-items: center; min-height: 160px; padding: 20px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; }

  /* ---------- Плеер (widget/player.js): цвета студии ---------- */
  .rt-video .plyr, .dir-hero__media .plyr { --plyr-color-main: var(--pink-ink); border-radius: 0; }
}
