/* Тази вечер — live: the "now" line of today's
 * programme and the stories (/stories). Kept apart from app.css; the
 * scripts are in live.js. Motion only with prefers-reduced-motion:
 * no-preference; colours only through the theme tokens (dark, light and
 * the three worlds keep their accents). */

/* The brand moon: today's phase (sky.go) over the unlit disc. */
.brand-mark .moon-dark { fill: var(--marker); opacity: 0.16; }

/* ---------- the "now" line ----------
   A full-width row between today's events (the list and the grid); its
   height is fixed, so moving it each minute never jolts the page. */
.now-line {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 24px; margin: 4px 0; list-style: none; pointer-events: none;
}
.now-line::after {
  content: ""; flex: 1; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--marker), color-mix(in srgb, var(--marker) 10%, transparent));
  box-shadow: 0 0 8px color-mix(in srgb, var(--marker) 70%, transparent);
}
.now-label {
  flex: none; padding: 2px 9px 1px; border-radius: 999px;
  background: var(--marker); color: var(--marker-ink);
  font: 800 13px/1.5 var(--text); letter-spacing: 0.01em; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 8px color-mix(in srgb, var(--marker) 50%, transparent);
}
.now-label time { font: inherit; }
/* In the grid the line takes half a row gap below it, not a whole row. */
.grid > .now-line { grid-column: 1 / -1; margin: -6px 0 -12px; }
.day-list > .now-line:first-child, .grid > .now-line:first-child { margin-top: 2px; }
.day-list > .now-line + .ev .ev-link { box-shadow: none; }

/* "след 25 мин": on the time of what starts within the hour (live.js). */
.soon {
  position: absolute; z-index: 4; padding: 1px 7px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: 750 11.5px/1.5 var(--text); white-space: nowrap; pointer-events: none;
}
.tile .soon { left: 8px; top: 42px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.35); }
.day-list .soon { left: 0; bottom: 4px; width: 66px; text-align: center; padding-inline: 0; font-size: 10.5px; }
@media (min-width: 640px) { .day-list .soon { width: 76px; font-size: 11.5px; } }
/* (The breathing ring on the next event was removed on 17.10.) */

/* ---------- stories: the home page's button ---------- */
.stories-cta { display: none; }
@media (max-width: 899px) {
  .stories-cta {
    display: inline-flex; align-items: center; gap: 10px; margin: 14px 0 2px;
    min-height: 48px; padding: 4px 14px 4px 4px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--rule);
    color: var(--ink); font-weight: 750; font-size: 16px; text-decoration: none;
  }
  .stories-cta:hover { text-decoration: none; }
}
.stories-ring {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  background: conic-gradient(from 200deg, var(--marker), var(--indigo), var(--marker));
  padding: 2.5px;
}
.stories-ring .icon {
  width: 100%; height: 100%; padding: 9px 8px 9px 10px; border-radius: 999px;
  background: var(--surface); color: var(--ink); fill: currentColor; stroke: none;
}
.stories-n {
  min-width: 26px; padding: 0 7px; border-radius: 999px; text-align: center;
  background: var(--marker); color: var(--marker-ink); font-size: 13.5px; line-height: 24px;
}

/* ---------- /stories: the list (no JavaScript) ---------- */
.stories-page { padding-bottom: 40px; }
.stories-head { padding: 30px 0 8px; }
.stories-head h1 { font: 900 clamp(46px, 8vw, 80px)/0.9 var(--display); letter-spacing: -0.01em; }
.stories-start-row { margin: 14px 0 0; }
.stories-start-row .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.stories-more { margin: 22px 0 0; font-weight: 650; }
.st-bars, .st-top, .st-nav, .st-heart { display: none; }
.st-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 18px; }
@media (min-width: 640px) { .st-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .st-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.st {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-card); background: var(--p-bg); color: var(--p-fg);
}
.st-pic { aspect-ratio: 2 / 3; background: var(--p-ph, var(--p-bg)); overflow: hidden; }
.st-pic img { width: 100%; height: 100%; object-fit: cover; }
.st-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-kind { margin: 0; font-size: 14px; }
.st-kind .tl svg { width: 15px; height: 15px; vertical-align: -2px; }
.st-title { font: 850 30px/1 var(--display); overflow-wrap: anywhere; }
.st-title a { color: inherit; text-decoration: none; }
.st-facts { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 15.5px; color: var(--p-muted); }
.st-time { font: 850 24px/1 var(--display); color: var(--p-fg); font-variant-numeric: tabular-nums; }
.st-price { font-weight: 750; color: var(--p-fg); }
.st-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.st-actions .btn { flex: 1 1 0; }
.st .btn:not(.btn-primary) { background: transparent; color: var(--p-fg); border-color: color-mix(in srgb, var(--p-fg) 30%, transparent); }
.st .btn-primary { background: var(--p-fg); border-color: var(--p-fg); color: var(--p-bg); }
.st .fav { color: var(--p-fg); border: 1.5px solid color-mix(in srgb, var(--p-fg) 30%, transparent); width: 44px; height: 44px; }
.st .fav[aria-pressed="true"] { color: #ff7aa2; }

/* ---------- /stories: full-screen stories (live.js) ----------
   One story a screen; the poster fills it, the text sits on a shade at
   the bottom. On wide screens a phone-shaped column over a dark room. */
.stories.is-on {
  position: fixed; inset: 0; z-index: 100; display: block;
  background: #07070c; color: #fff; overflow: hidden;
  touch-action: none; overscroll-behavior: contain;
}
html.stories-open, html.stories-open body { overflow: hidden; }
.stories.is-on .st-list {
  position: absolute; inset: 0; margin: 0 auto; max-width: 480px; display: block;
}
@media (min-width: 600px) {
  .stories.is-on .st-list { top: 16px; bottom: 16px; max-width: min(480px, calc((100dvh - 32px) * 9 / 16)); border-radius: 18px; overflow: hidden; }
}
.stories.is-on .st {
  position: absolute; inset: 0; border-radius: 0; visibility: hidden;
  background: var(--p-bg); transform: translateX(var(--st-x, 0)); will-change: transform;
}
.stories.is-on .st.is-cur, .stories.is-on .st.is-in { visibility: visible; }
@media (prefers-reduced-motion: no-preference) {
  .stories.is-on .st.is-in { transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1); }
}
.stories.is-on .st-pic { position: absolute; inset: 0; aspect-ratio: auto; }
.stories.is-on .st-pic::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.45), transparent 18%, transparent 45%, rgb(0 0 0 / 0.82) 78%, rgb(0 0 0 / 0.9));
}
.stories.is-on .st-body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; color: #fff;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}
.stories.is-on .st-kind, .stories.is-on .st-kind .tl { color: rgb(255 255 255 / 0.85); }
.stories.is-on .st-title { font-size: clamp(34px, 10vw, 46px); line-height: 0.95; text-wrap: balance; }
.stories.is-on .st-facts { color: rgb(255 255 255 / 0.85); font-size: 16px; }
.stories.is-on .st-time, .stories.is-on .st-price { color: #fff; }
.stories.is-on .st-time { font-size: 30px; }
.stories.is-on .st .btn:not(.btn-primary) { color: #fff; border-color: rgb(255 255 255 / 0.4); background: rgb(0 0 0 / 0.25); }
.stories.is-on .st .btn-primary { background: var(--marker); border-color: var(--marker); color: var(--marker-ink); }
.stories.is-on .st .fav { color: #fff; border-color: rgb(255 255 255 / 0.4); background: rgb(0 0 0 / 0.25); }
.stories.is-on .st .fav[aria-pressed="true"] { color: #ff7aa2; }
.stories.is-on .st-actions .btn { min-height: 50px; font-size: 17px; }

.stories.is-on .st-bars {
  position: absolute; z-index: 3; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); padding: 0 10px; display: flex; gap: 4px;
}
@media (min-width: 600px) { .stories.is-on .st-bars { top: 26px; width: min(480px, calc((100dvh - 32px) * 9 / 16)); padding: 0 12px; } }
.st-bar { flex: 1; height: 3px; border-radius: 3px; background: rgb(255 255 255 / 0.35); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }
.st-bar.is-seen i { transform: scaleX(1); }
.st-bar.is-cur i { animation: st-fill var(--st-ms, 7000ms) linear forwards; }
.stories.is-paused .st-bar.is-cur i { animation-play-state: paused; }
@keyframes st-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* No motion: no auto-advance (live.js), the current bar simply full. */
@media (prefers-reduced-motion: reduce) { .st-bar.is-cur i { animation: none; transform: scaleX(1); } }

.stories.is-on .st-top {
  position: absolute; z-index: 3; top: calc(max(10px, env(safe-area-inset-top)) + 10px); left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); padding: 0 6px 0 14px; display: flex; align-items: center; gap: 4px;
}
@media (min-width: 600px) { .stories.is-on .st-top { top: 36px; width: min(480px, calc((100dvh - 32px) * 9 / 16)); } }
.st-brand { flex: 1; font: 800 17px/1 var(--display); letter-spacing: 0.02em; color: rgb(255 255 255 / 0.92); text-shadow: 0 1px 6px rgb(0 0 0 / 0.5); }
.st-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer;
}
.st-btn .icon { width: 24px; height: 24px; filter: drop-shadow(0 1px 4px rgb(0 0 0 / 0.6)); }
.st-btn:focus-visible, .st-nav:focus-visible, .stories.is-on .st a:focus-visible, .stories.is-on .st .fav:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.st-pause .st-i-play { display: none; }
.st-pause[aria-pressed="true"] .st-i-play { display: inline; fill: currentColor; stroke: none; }
.st-pause[aria-pressed="true"] .st-i-pause { display: none; }

/* Arrows: on wide screens beside the column; on phones taps do it. */
.stories.is-on .st-nav { display: none; }
@media (min-width: 600px) {
  .stories.is-on .st-nav {
    position: absolute; z-index: 3; top: 50%; display: grid; place-items: center;
    width: 52px; height: 52px; margin-top: -26px; padding: 0; border-radius: 999px;
    border: 1px solid rgb(255 255 255 / 0.25); background: rgb(255 255 255 / 0.08); color: #fff; cursor: pointer;
  }
  .stories.is-on .st-nav .icon { width: 26px; height: 26px; }
  .stories.is-on .st-prev { left: calc(50% - min(240px, (100dvh - 32px) * 9 / 32) - 72px); }
  .stories.is-on .st-next { right: calc(50% - min(240px, (100dvh - 32px) * 9 / 32) - 72px); }
  .stories.is-on .st-nav:disabled { opacity: 0.3; cursor: default; }
}

/* Double tap: the heart. */
.stories.is-on .st-heart {
  position: absolute; z-index: 4; top: 42%; left: 50%; display: block; width: 120px; height: 120px; margin: -60px 0 0 -60px;
  color: #ff7aa2; opacity: 0; pointer-events: none;
}
.st-heart .icon { width: 100%; height: 100%; fill: currentColor; stroke: none; filter: drop-shadow(0 6px 24px rgb(0 0 0 / 0.5)); }
.st-heart.is-pop { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .st-heart.is-pop { animation: st-heart 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
  @keyframes st-heart { 0% { opacity: 0; transform: scale(0.4); } 25% { opacity: 1; transform: scale(1.12); } 45% { transform: scale(0.96); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.05) translateY(-14px); } }
}
@media (prefers-reduced-motion: reduce) {
  .st-heart.is-pop { animation: st-heart-still 0.9s step-end forwards; }
  @keyframes st-heart-still { to { opacity: 0; } }
}
/* A tile without a picture: its type label moves below the "след …" tag. */
.is-bill .tile-img:has(> .soon) .bill { padding-top: 72px; }
