/* ------------------------------------------------------------------
   Курганская филармония — мобильная версия
   ------------------------------------------------------------------ */

/* ---------- Дизайн-токены ---------- */
:root {
  --c-bg:        #f6f7fb;
  --c-surface:   #ffffff;
  --c-surface-2: #eef1f8;
  --c-text:      #131628;
  --c-text-muted:#5a6275;
  --c-border:    #e2e6ef;

  --c-brand:     #0b3d91;       /* основной — синий */
  --c-brand-2:   #1f6feb;
  --c-warm:      #b13838;       /* тёплый акцент — burgundy (даты, цена) */
  --c-warm-2:    #d4af37;       /* gold — для бейджей */
  --c-success:   #1f9d55;
  --c-danger:    #c0392b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(13, 21, 49, .06);
  --shadow-md: 0 6px 18px rgba(13, 21, 49, .08);
  --shadow-lg: 0 12px 32px rgba(13, 21, 49, .14);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "PT Serif", Georgia, "Times New Roman", serif;

  --header-h: 56px;
  --tabbar-h: 60px;
  --tap: 44px;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg:        #0a1020;
    --c-surface:   #121a30;
    --c-surface-2: #182242;
    --c-text:      #eef1fa;
    --c-text-muted:#a4adc4;
    --c-border:    #233060;
    --c-brand:     #4f8cff;
    --c-brand-2:   #7fa9ff;
    --c-warm:      #e07a7a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6);
  }
}
[data-theme="dark"] {
  --c-bg:        #0a1020;
  --c-surface:   #121a30;
  --c-surface-2: #182242;
  --c-text:      #eef1fa;
  --c-text-muted:#a4adc4;
  --c-border:    #233060;
  --c-brand:     #4f8cff;
  --c-brand-2:   #7fa9ff;
  --c-warm:      #e07a7a;
}
[data-theme="light"] {
  --c-bg:        #f6f7fb;
  --c-surface:   #ffffff;
  --c-surface-2: #eef1f8;
  --c-text:      #131628;
  --c-text-muted:#5a6275;
  --c-border:    #e2e6ef;
  --c-brand:     #0b3d91;
  --c-brand-2:   #1f6feb;
  --c-warm:      #b13838;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;     /* не ломает position:sticky (в отличие от overflow-x:hidden) */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; margin: 0 0 var(--space-3); letter-spacing: -.005em; }
h1 { font-size: clamp(1.6rem, 4.5vw + .5rem, 2.1rem); }
h2 { font-size: clamp(1.15rem, 2.5vw + .5rem, 1.45rem); }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 var(--space-3); }

a { color: var(--c-brand); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--c-brand-2);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px; left: 8px;
  background: var(--c-brand);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top .2s;
}
.skip-link:focus { top: calc(var(--safe-top) + 8px); }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: var(--tap) 1fr var(--tap);
  align-items: center;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: max(var(--space-2), var(--safe-left));
  padding-right: max(var(--space-2), var(--safe-right));
  gap: var(--space-2);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .header {
    background: color-mix(in srgb, var(--c-surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
  }
}

.header__burger,
.header__theme {
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.header__burger:active,
.header__theme:active { background: var(--c-surface-2); }

.burger-icon, .burger-icon::before, .burger-icon::after {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.burger-icon { position: relative; }
.burger-icon::before, .burger-icon::after { content: ""; position: absolute; left: 0; }
.burger-icon::before { top: -7px; }
.burger-icon::after  { top:  7px; }
[aria-expanded="true"] .burger-icon { background: transparent; }
[aria-expanded="true"] .burger-icon::before { transform: translateY(7px) rotate(45deg); }
[aria-expanded="true"] .burger-icon::after  { transform: translateY(-7px) rotate(-45deg); }

.header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: inherit;
  justify-self: center;
  min-width: 0;
}
.header__brand:hover { text-decoration: none; }
.header__brand-mark {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--c-brand), var(--c-brand-2));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  border-radius: 10px;
  letter-spacing: .5px;
}
.header__brand-text { display: grid; line-height: 1.1; min-width: 0; }
.header__brand-title { font-weight: 700; font-size: 14px; }
.header__brand-subtitle { font-size: 12px; color: var(--c-text-muted); }

/* ---------- Drawer ---------- */
.drawer[hidden] { display: none; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.drawer__backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(10, 16, 32, .5);
  border: 0;
  width: 100%; height: 100%;
  cursor: pointer;
  animation: fadeIn .2s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.drawer__panel {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  z-index: 2;
  width: min(86vw, 340px);
  background: var(--c-surface);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-bottom: var(--safe-bottom);
  animation: slideIn .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--c-border);
}
.drawer__title { font-weight: 700; font-size: 1.05rem; }
.drawer__close {
  width: var(--tap); height: var(--tap);
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--c-text-muted);
}
.drawer__close:active { background: var(--c-surface-2); }

.drawer__body { flex: 1; overflow-y: auto; padding: var(--space-3) 0; }
.drawer__group + .drawer__group { margin-top: var(--space-4); }
.drawer__group-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--c-text-muted);
  margin: 0 0 var(--space-1);
  padding: 0 var(--space-4);
}
.drawer__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.drawer__list a {
  display: block;
  padding: 12px var(--space-4);
  min-height: var(--tap);
  color: var(--c-text);
  font-weight: 500;
  font-size: .95rem;
  border-left: 3px solid transparent;
  transition: background .12s;
}
.drawer__list a[aria-current="page"] {
  background: var(--c-surface-2);
  border-left-color: var(--c-brand);
  color: var(--c-brand);
}
.drawer__list a:active { background: var(--c-surface-2); text-decoration: none; }

.drawer__foot {
  padding: var(--space-4);
  border-top: 1px solid var(--c-border);
  display: grid;
  gap: var(--space-2);
}

/* ---------- Tab bar (нижний primary-nav) ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .tabbar {
    background: color-mix(in srgb, var(--c-surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
  }
}
.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--c-text-muted);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  min-height: var(--tap);
  -webkit-tap-highlight-color: transparent;
  transition: color .12s, transform .12s;
}
.tabbar__item:hover { text-decoration: none; }
.tabbar__item:active { transform: scale(.94); }
.tabbar__item.is-active { color: var(--c-brand); }
.tabbar__icon {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
}
.tabbar__icon svg { width: 24px; height: 24px; }

/* ---------- Main / Sections ---------- */
.main {
  flex: 1;
  /* запас под нижний таб-бар, чтобы контент не залипал */
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--space-4));
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.section { padding: var(--space-5) var(--space-4); }
.section--alt { background: var(--c-surface-2); }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.section__title { margin: 0; }
.section__more {
  font-size: .85rem;
  color: var(--c-brand);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: .2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: var(--space-7) var(--space-4) var(--space-5);
  background:
    radial-gradient(circle at 20% 0%, rgba(31, 111, 235, .14), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(177, 56, 56, .08), transparent 55%),
    var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.hero::after {
  content: "";
  position: absolute;
  left: var(--space-4); right: var(--space-4);
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--c-brand), var(--c-warm));
  opacity: .25;
}
.hero__eyebrow {
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  color: var(--c-warm);
  font-weight: 700;
}
.hero__title {
  font-size: clamp(1.9rem, 6vw + .5rem, 2.6rem);
  margin: 0 0 var(--space-3);
  letter-spacing: -.02em;
}
.hero__lead {
  color: var(--c-text-muted);
  font-size: 1rem;
  margin-bottom: var(--space-5);
  max-width: 38ch;
}
.hero__cta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .12s ease, background .15s, color .15s, box-shadow .15s, border-color .15s;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }

.btn--primary {
  background: var(--c-brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover,
.btn--primary:focus-visible { background: var(--c-brand-2); }

.btn--ghost {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn--ghost:hover,
.btn--ghost:focus-visible { background: var(--c-surface-2); }

.btn--sm { min-height: 36px; padding: 6px 14px; font-size: .85rem; }
.btn--block { width: 100%; }
.btn--icon svg { display: block; }

/* ---------- Сохраняем kassy.ru-кнопку как brand-button ---------- */
button.kassy_ru,
.kassy_ru.btn__detail__link,
.kassy_ru.stylesForBtn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: var(--tap) !important;
  padding: 10px 20px !important;
  border-radius: var(--radius-pill) !important;
  background: var(--c-brand) !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: .9rem !important;
  letter-spacing: .3px !important;
  border: 0 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  box-shadow: var(--shadow-sm) !important;
  text-transform: none !important;
  -webkit-tap-highlight-color: transparent !important;
  transition: background .15s, transform .12s !important;
  white-space: nowrap !important;
}
button.kassy_ru:hover { background: var(--c-brand-2) !important; }
button.kassy_ru:active { transform: scale(.97) !important; }
button.kassy_ru[aria-busy="true"] { opacity: .6 !important; pointer-events: none !important; }

/* ---------- Page head ---------- */
.page-head {
  padding: var(--space-5) var(--space-4) var(--space-4);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.page-head__title { margin: 0 0 var(--space-2); }
.page-head__lead { color: var(--c-text-muted); margin: 0; font-size: .95rem; }

/* ---------- Tabs (sub-filter, не путать с tabbar) ---------- */
.tabs {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-left: calc(-1 * var(--space-4));
  margin-right: calc(-1 * var(--space-4));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--c-surface-2);
  color: var(--c-text);
  font-size: .9rem;
  font-weight: 500;
  border: 1px solid transparent;
  min-height: 36px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.tab:hover { text-decoration: none; }
.tab.is-active {
  background: var(--c-brand);
  color: #fff;
}

/* ---------- Месячный навигатор ---------- */
.months {
  position: sticky;
  top: calc(var(--header-h) + var(--safe-top));
  z-index: 20;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .months {
    background: color-mix(in srgb, var(--c-surface) 92%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
  }
}
.months__scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 10px var(--space-4);
}
.months__scroll::-webkit-scrollbar { display: none; }

.month-pill {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--c-surface-2);
  color: var(--c-text);
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  scroll-snap-align: center;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
}
.month-pill:hover { text-decoration: none; }
.month-pill:active { transform: scale(.96); }
.month-pill.is-active {
  background: var(--c-brand);
  color: #fff;
  border-color: var(--c-brand);
  box-shadow: var(--shadow-sm);
}

/* page-head row для будущих кнопок справа */
.page-head__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* ---------- Жанровые чипы ---------- */
.genre-strip {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.genre-strip__scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 10px var(--space-4);
}
.genre-strip__scroll::-webkit-scrollbar { display: none; }
.genre-pill {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--c-text-muted);
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid var(--c-border);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.genre-pill:active { transform: scale(.96); }
.genre-pill.is-active {
  background: var(--c-warm);
  color: #fff;
  border-color: var(--c-warm);
}

/* ---------- Чипы дней (P1.4) ---------- */
.day-strip {
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}
.day-strip__scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 10px var(--space-4);
}
.day-strip__scroll::-webkit-scrollbar { display: none; }
.day-pill {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--c-border);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  scroll-snap-align: center;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
}
.day-pill:hover { text-decoration: none; }
.day-pill:active { transform: scale(.96); }
.day-pill__label { text-transform: capitalize; }
.day-pill__count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--c-warm);
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
}

/* ---------- Поиск на афише (P1.5) ---------- */
.search-wrap {
  background: var(--c-surface);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--c-border);
}
.search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  min-height: var(--tap);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-brand) 18%, transparent);
}
.search__icon { color: var(--c-text-muted); display: grid; place-items: center; }
.search__input {
  border: 0; background: transparent; outline: 0;
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--c-text);
}
.search__input::placeholder { color: var(--c-text-muted); }
.search__clear {
  border: 0; background: transparent; cursor: pointer;
  color: var(--c-text-muted);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
}
.search__clear:hover { background: var(--c-border); }

/* ---------- День-разделитель (P1.1) ---------- */
.day-list {
  padding: 0;
  margin: 0;
}
.day-group { padding: 0; }
.day-group + .day-group { margin-top: var(--space-3); }

.day-divider {
  position: sticky;
  /* лепимся под шапку + месяцы. day-strip и genre-strip — не sticky, поэтому в стеке только header+months */
  top: calc(var(--header-h) + var(--safe-top) + 56px);
  z-index: 15;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--c-bg) 92%, transparent);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--c-warm);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
}
.day-divider time { display: inline-flex; align-items: center; gap: 6px; }
.day-divider__count {
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: none;
}

/* ---------- Карточки событий (новый формат: media сверху) ---------- */
.events {
  list-style: none;
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: grid;
  gap: var(--space-3);
}
.day-group > .events { padding-top: var(--space-3); }
.event-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .2s, border-color .15s;
}
.event-card[hidden] { display: none; }
.event-card:hover {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--c-brand) 30%, var(--c-border));
  transform: translateY(-2px);
}
.event-card__link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}
.event-card__link:hover { text-decoration: none; }

.event-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--c-surface-2);
  overflow: hidden;
}
.event-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.event-card__img--placeholder {
  background: linear-gradient(135deg, var(--c-surface-2), color-mix(in srgb, var(--c-brand) 8%, var(--c-surface-2)));
}
.event-card__age {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}
@supports (backdrop-filter: blur(4px)) {
  .event-card__age { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
}
.event-card__genre {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: rgba(255, 255, 255, .92);
  color: var(--c-text);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: .3px;
}
[data-theme="dark"] .event-card__genre,
@media (prefers-color-scheme: dark) {
  .event-card__genre { background: rgba(18, 26, 48, .92); color: #eef1fa; }
}

.event-card__body {
  padding: var(--space-3) var(--space-4) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.event-card__meta {
  font-size: 12px;
  color: var(--c-warm);
  font-weight: 600;
  margin: 0;
  letter-spacing: .3px;
  text-transform: capitalize;
}
.event-card__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--c-text);
}
.event-card__desc {
  font-size: .88rem;
  color: var(--c-text-muted);
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}
.event-card__strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: 0 var(--space-4) var(--space-2);
}
.event-card__price {
  font-weight: 700;
  color: var(--c-warm);
  font-size: .92rem;
}
.event-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: 0 var(--space-4) var(--space-4);
}

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--c-surface-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}
.badge--warm {
  background: color-mix(in srgb, var(--c-warm-2) 25%, transparent);
  color: color-mix(in srgb, var(--c-warm-2) 90%, #000);
  border: 1px solid color-mix(in srgb, var(--c-warm-2) 60%, transparent);
}

/* ---------- Event detail ---------- */
.event-detail {
  display: flex;
  flex-direction: column;
}
.event-detail__hero {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--c-surface-2);
  overflow: hidden;
}
.event-detail__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.event-detail__age {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.event-detail__head {
  padding: var(--space-5) var(--space-4) var(--space-3);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.event-detail__when {
  margin: 0 0 var(--space-2);
  font-size: 13px;
  color: var(--c-warm);
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: capitalize;
}
.event-detail__title {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.5rem, 5vw + .3rem, 2rem);
}
.event-detail__price {
  margin: var(--space-3) 0 0;
  font-weight: 700;
  color: var(--c-warm);
}
.event-detail__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4) 0;
}
[data-share][data-copied="1"]::after {
  content: " · скопировано";
  font-size: 12px;
  color: var(--c-success);
}
.event-detail__note {
  margin: var(--space-5) var(--space-4) 0;
  padding: var(--space-4);
  background: var(--c-surface-2);
  border-radius: var(--radius-md);
  font-size: .85rem;
  color: var(--c-text-muted);
}

/* sticky «Купить» снизу + над таб-баром */
.buybar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  z-index: 35;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -8px 24px rgba(13, 21, 49, .08);
}
.buybar__price {
  flex: 1;
  font-weight: 700;
  font-size: .9rem;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.buybar .kassy_ru { flex-shrink: 0; }

/* контент детали — расширяем нижний паддинг с учётом sticky-buybar */
body:has(.buybar) .main {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 80px);
}

/* ---------- News list (списки и детали) ---------- */
.articles {
  list-style: none;
  margin: 0;
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}
.article {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: box-shadow .2s, transform .15s;
}
.article:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.article__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin: 0 0 var(--space-3);
  background: var(--c-surface-2);
}
.article__date {
  display: block;
  font-size: 12px;
  color: var(--c-warm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.article__title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 var(--space-2);
  line-height: 1.3;
}
.article__title a { color: var(--c-text); text-decoration: none; }
.article__title a:hover { color: var(--c-brand); }
.article__text { margin: 0; color: var(--c-text-muted); font-size: .92rem; }

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.news-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: background .15s;
}
.news-item:active { background: var(--c-surface-2); }
.news-item__date {
  display: block;
  font-size: 11px;
  color: var(--c-warm);
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: .3px;
}
.news-item__title {
  font-family: var(--font-sans);
  font-size: .98rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}
.news-item__title a { color: var(--c-text); text-decoration: none; }
.news-item__title a:hover { color: var(--c-brand); }

/* ---------- Prose (контент с upstream) ---------- */
.prose {
  padding: var(--space-4);
  max-width: 760px;
  margin: 0 auto;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  font-size: .98rem;
  line-height: 1.6;
}
.prose * { max-width: 100% !important; }
.prose img {
  border-radius: var(--radius-sm);
  margin: var(--space-3) 0;
  height: auto;
}
.prose table { width: 100%; max-width: 100%; display: block; overflow-x: auto; }
.prose iframe {
  width: 100%;
  max-width: 100%;
  min-height: 240px;
  border: 0;
  border-radius: var(--radius-sm);
  aspect-ratio: 16 / 9;
}
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 var(--space-4); }
.prose li + li { margin-top: 4px; }
.prose a { color: var(--c-brand); text-decoration: underline; text-underline-offset: 2px; }
.prose h2, .prose h3 { margin-top: var(--space-5); }
.prose p + p { margin-top: var(--space-3); }

/* ---------- Empty / errors ---------- */
.empty {
  padding: var(--space-5) var(--space-4);
  text-align: center;
  color: var(--c-text-muted);
}
.empty-state {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  max-width: 360px;
  margin: 0 auto;
}
.empty-state__code {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 700;
  color: var(--c-warm);
  margin: 0;
  line-height: 1;
  letter-spacing: -.04em;
}
.empty-state__title {
  margin: var(--space-3) 0 var(--space-5);
  font-size: 1.2rem;
}
.empty-state__actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Contact / footer ---------- */
.footer {
  padding: var(--space-5) var(--space-4) var(--space-5);
  padding-left: max(var(--space-4), var(--safe-left));
  padding-right: max(var(--space-4), var(--safe-right));
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  text-align: center;
  color: var(--c-text-muted);
  font-size: .85rem;
}
.footer p { margin: 0 0 6px; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.footer svg { width: 16px; height: 16px; }

/* ---------- Адаптив ---------- */
@media (min-width: 600px) {
  .events { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: var(--space-7) var(--space-5) var(--space-6); }
  .section { padding: var(--space-6) var(--space-5); }
}
@media (min-width: 900px) {
  .events { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: var(--space-7) var(--space-6); }
}

/* ---------- Утилиты ---------- */
.body-lock { overflow: hidden; }
