/* Видеоинтервью (js/stories-ui.js): лента роликов на странице результатов (листается стрелками), полоска обложек на главной и флагмане,
   модалка VK-плеера, график дохода (.sdc — тот же на странице истории). Подробные истории — отдельные страницы stories/<slug>.html.
   Liquid Bento: тёмный холст + графит. */

/* ---------- Ссылки на полную историю: слайдер и тайлы результатов ---------- */
.story__read { display: inline-block; margin-top: 14px; font-size: 15.5px; line-height: 20px; font-weight: 600; letter-spacing: -.01em; color: #fff; text-decoration: none; transition: color .2s; }
.story__read:hover { color: var(--lime-2); }
.story__read:focus-visible { outline-offset: 4px; }

/* Голосовое и «Читать историю» — столбиком: в ряд на 1536 не влезало «18:42» у Али, а на 1280 и уже переносилось у всех */
.story-tile__foot { position: relative; margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.story-tile__foot .story-tile__play { margin-top: 0; padding-top: 0; }
.story-tile__read { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 14px; line-height: 18px; font-weight: 600; letter-spacing: -.007em; color: #fff; text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s; }
.story-tile__read:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .36); }

/* ---------- Модалка VK-плеера: на весь экран, прокрутка внутри, страница под ней не едет ---------- */
html:has(dialog.vd[open]) { overflow: hidden; scrollbar-gutter: stable; }
.vd { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0; background: transparent; overflow-y: auto; overscroll-behavior: contain; }
.vd::backdrop { background: rgba(5, 5, 6, .74); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@keyframes sd-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- График дохода (страница истории и место для будущих врезок): столбцы SVG, суммы над ними, подписи под ними; выбранный период — внизу с комментарием ученика ---------- */
.sdc { margin-top: 14px; padding: 22px 22px 18px; border-radius: 20px; background: var(--graphite); color: #fff; box-shadow: 0 16px 32px -14px rgba(0, 0, 0, .45); }
.sdc__plot { position: relative; height: 200px; }
.sdc__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sdc__grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; stroke-dasharray: 3 5; }
.sdc__bar { fill: rgba(255, 255, 255, .2); transition: fill .2s; }
.sdc__bar.is-peak { fill: var(--lime); }
.sdc__bar.is-ghost { fill: rgba(255, 255, 255, .28); }
.sdc__bar.is-sel:not(.is-peak) { fill: rgba(255, 255, 255, .56); }
.sdc__cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.sdc__col { position: relative; padding: 0; border: 0; border-radius: 10px; background: none; color: inherit; cursor: pointer; }
.sdc__col:hover { background: rgba(255, 255, 255, .04); }
.sdc__val { position: absolute; left: 0; right: 0; text-align: center; font: 500 12px/14px var(--mono); color: rgba(255, 255, 255, .72); white-space: nowrap; pointer-events: none; }
.sdc__val.is-peak { color: var(--lime); }
.sdc__col[aria-pressed="true"] .sdc__val { color: #fff; font-weight: 600; }
.sdc__col[aria-pressed="true"] .sdc__val.is-peak { color: var(--lime); }
.sdc__axis { margin-top: 10px; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); font-size: 12px; line-height: 15px; color: rgba(255, 255, 255, .52); text-align: center; }
.sdc__axis span { padding: 0 3px; overflow-wrap: break-word; transition: color .2s; }
.sdc__axis span.is-sel { color: #fff; }
.sdc.is-compact .sdc__axis { display: flex; justify-content: space-between; gap: 12px; }
.sdc.is-compact .sdc__axis span { display: none; padding: 0; }
.sdc.is-compact .sdc__axis span:first-child, .sdc.is-compact .sdc__axis span:last-child { display: block; }
.sdc.is-compact .sdc__axis span:last-child { text-align: right; }
.sdc__note { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 15px; line-height: 23px; min-height: 61px; }
.sdc__when { display: block; margin-bottom: 2px; font-size: 13px; line-height: 18px; font-weight: 600; color: rgba(255, 255, 255, .56); }
.sdc__sum { margin-right: 10px; font: 600 15px/23px var(--mono); color: var(--lime); white-space: nowrap; }
.sdc__txt .sdc__sum { margin-right: 0; }
.sdc__txt { color: rgba(255, 255, 255, .86); }

/* ---------- Видео VK ---------- */
.vd { color: #fff; }
.vd[open] { display: grid; place-items: center; }
.vd__panel { width: min(1120px, 100%, calc((100vh - 190px) * 16 / 9)); width: min(1120px, 100%, calc((100dvh - 190px) * 16 / 9)); min-width: min(100%, 300px); }
.vd[open] .vd__panel { animation: sd-in .35s var(--spring); }
.vd__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.vd__name { min-width: 0; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.015em; }
.vd__name span { margin-left: 6px; font: 500 14px/20px var(--mono); color: rgba(255, 255, 255, .6); white-space: nowrap; }
.vd__x { flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s; }
.vd__x:hover { background: rgba(255, 255, 255, .22); }
.vd__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #000 center / cover no-repeat; box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .12); }
.vd__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vd__cap { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.vd__title { min-width: 0; flex: 1 1 320px; font-size: 16px; line-height: 23px; color: rgba(255, 255, 255, .78); }
.vd__vk { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--lime-2); text-decoration: none; white-space: nowrap; }
.vd__vk:hover { text-decoration: underline; }

/* ---------- Карточка ролика: обложка-кнопка + подпись ---------- */
.vcard { position: relative; min-width: 0; list-style: none; display: flex; flex-direction: column; align-items: flex-start; }
.vcard__cover { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--graphite); cursor: pointer; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 14px 30px -14px rgba(0, 0, 0, .7); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.vcard__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .3s; }
.vcard__cover:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .24), var(--shadow-hover); }
.vcard__cover:hover img { transform: scale(1.04); }
.vcard__cover:focus-visible { outline-offset: 4px; border-radius: 16px; }
/* Кнопка — в левом нижнем углу: по центру обложек VK крупный текст, его не закрываем */
.vcard__play { position: absolute; left: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .45); background: rgba(19, 20, 23, .6); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .25s, color .25s, transform .35s var(--spring), border-color .25s; }
.vcard__play svg { margin-left: 3px; }
.vcard__cover:hover .vcard__play { background: var(--lime-2); color: #000; border-color: transparent; transform: scale(1.08); }
.vcard__dur { position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, .74); font: 500 12px/18px var(--mono); color: #fff; }
.vcard__name { margin-top: 14px; font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.012em; }
.vcard__title { margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--muted-2); }
.vcard__story { margin-top: 8px; font-size: 14px; line-height: 18px; font-weight: 600; color: var(--lime-2); text-decoration: none; }
.vcard__story:hover { text-decoration: underline; }

/* ---------- Раздел «Видеоинтервью» на странице результатов: заголовок группы + лента со стрелками ---------- */
.vgroup { margin-top: 44px; }
.vgroup + .vgroup { margin-top: 56px; }
.vgroup__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.vgroup__title { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.018em; }
.vrail__nav { flex: none; display: flex; gap: 6px; }
.vrail__nav[hidden] { display: none; }
.vrail__btn { width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s, opacity .2s, transform .3s var(--spring); }
.vrail__btn:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.vrail__btn:active:not(:disabled) { transform: scale(.94); }
.vrail__btn:disabled { opacity: .3; cursor: default; }
.vrail__btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
/* Лента: горизонтальный скролл со снапом, справа затухание mask-image (снимается в конце, is-end) */
.vrail { margin: 20px 0 0; padding: 6px 32px 10px 0; list-style: none; display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline-end: 12%; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.vrail::-webkit-scrollbar { display: none; }
.vrail.is-end { -webkit-mask-image: none; mask-image: none; }
.vrail .vcard { flex: none; width: 300px; scroll-snap-align: start; }

/* ---------- Полоска «Видеоинтервью» в блоке результатов (главная, флагман) ---------- */
.vstrip { margin-top: 24px; }
.vstrip__tile { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: center; gap: 32px; }
.vstrip__tile::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 110px 100%, rgba(115, 214, 255, .16), rgba(115, 214, 255, .08) 120px, rgba(115, 214, 255, 0) 260px); pointer-events: none; }
.vstrip__copy { position: relative; }
.vstrip__title { margin-top: 8px; font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.015em; }
.vstrip__text { margin-top: 12px; max-width: 300px; font-size: 15px; line-height: 21px; color: rgba(255, 255, 255, .72); }
.vstrip__all { display: inline-block; margin-top: 20px; font-size: 14px; line-height: 18px; font-weight: 600; color: var(--lime); text-decoration: none; }
.vstrip__all:hover { text-decoration: underline; }
/* На тач-экранах строчные ссылки получают зону нажатия ≥ 44 px (паддинг + отрицательные поля — раскладка не сдвигается) */
@media (max-width: 767px), (pointer: coarse) {
  .story__read { padding: 12px 0; margin: 2px 0 -12px; }
  .vstrip__all { padding: 13px 0; margin: 7px 0 -13px; }
}
/* Лента со всеми роликами: горизонтальный скролл со снапом и стрелками (.vrail, js/stories-ui.js), карточки компактнее, чем на results */
.vstrip__list { position: relative; margin: 0; padding: 4px 24px 8px 0; gap: 16px; }
.vstrip__list .vcard { width: clamp(220px, 20vw, 280px); }
.vstrip__nav { margin-top: 22px; }
.vstrip .vcard__cover { border-radius: 14px; }
.vstrip .vcard__play { left: 8px; bottom: 8px; width: 36px; height: 36px; }
.vstrip .vcard__play svg { width: 16px; height: 16px; margin-left: 2px; }
.vstrip .vcard__dur { right: 8px; bottom: 8px; font-size: 11px; line-height: 16px; padding: 1px 6px; }
.vstrip .vcard__name { margin-top: 10px; font-size: 15px; line-height: 20px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1279px) {
  .vstrip__tile { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 1023px) {
  .vstrip__tile { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .vstrip__text { max-width: 520px; }
}
@media (max-width: 719px) {
  .vrail .vcard { width: min(74vw, 300px); }
  .vd { padding: 16px 12px; }
  .vd__frame { border-radius: 14px; }
  .vd__name { font-size: 17px; line-height: 22px; }
  .vd__name span { display: block; margin: 2px 0 0; font-size: 13px; }
  .vd__title { font-size: 15px; line-height: 21px; }
  .sdc { padding: 18px 14px 14px; }
  .sdc__plot { height: 160px; }
  .sdc__val { font-size: 10.5px; }
  .sdc__axis { font-size: 11px; }
}
@media (max-width: 639px) {
  .vgroup { margin-top: 32px; }
  .vgroup + .vgroup { margin-top: 40px; }
  .vgroup__title { font-size: 20px; line-height: 26px; }
  .vrail { gap: 14px; }
  .vstrip__tile { padding: 22px; }
  .vstrip__title { font-size: 24px; line-height: 30px; }
  .vstrip__list { gap: 12px; padding-right: 12px; }
  .vstrip__list .vcard { width: min(62vw, 240px); }
  .vstrip__nav { margin-top: 14px; }
  .vstrip .vcard__cover { border-radius: 12px; }
  .vstrip .vcard__play { left: 6px; bottom: 6px; width: 28px; height: 28px; }
  .vstrip .vcard__play svg { width: 12px; height: 12px; }
  .vstrip .vcard__dur { right: 5px; bottom: 5px; padding: 0 5px; font-size: 10.5px; border-radius: 6px; }
  .story-tile__foot { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .vd[open] .vd__panel { animation: none; }
  .vcard__cover, .vcard__cover img { transition: none; }
  .vcard__cover:hover, .vcard__cover:hover img { transform: none; }
}
