/* public/assets/events.css */
/* =========================================================
   🎭 EVENTS — Афиша (list + single)
   Использует токены темы из ui.css:
   --surface, --border, --text, --muted, --theme-color
   ========================================================= */

/* =========================================================
   LIST VIEW — Афиша событий
   ========================================================= */

/* ВАЖНО: не трогаем .container — он общий в layout */
.events-list_view{
  padding: 8px 0 18px;
}

.events-list_view h1{
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 25px;
  color: #002b5c;
  border-bottom: 2px solid rgba(229,231,235,.70);
  padding-bottom: 6px;
  text-align: center;
}

/* === Сетка карточек === */
.events-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.event-card{
  background: var(--surface, #fff);
  border: 1px solid rgba(229,231,235,.70);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.event-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* === Постер === */
.event-thumb img{
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.event-card:hover .event-thumb img{
  transform: scale(1.05);
}

/* === Информация === */
.event-info{
  padding: 16px;
  display: block;
}

.event-info h3{
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.3;
  color: var(--text, #111827);
}

.event-info a{
  color: var(--text, #111827);
  text-decoration: none;
  transition: color 0.2s;
}

.event-info a:hover{
  color: var(--theme-color, #0055aa);
}

/* === Место === */
.event-location{
  color: rgba(17,24,39,.72);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* === Сеансы === */
.event-sessions{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.session-time{
  background: rgba(0,136,204,.10);
  color: rgba(17,24,39,.92);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  border: 1px solid rgba(0,136,204,.18);
  transition: filter .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.session-time:hover{
  background: var(--theme-color, #0055aa);
  color: #fff;
  border-color: rgba(0,0,0,.0);
}

/* =========================================================
   MOBILE/RESPONSIVE FIXES (НЕ ТРОГАЕМ ДЕСКТОПНУЮ СЕТКУ)
   Цель: на любых мобилах/ориентациях ничего не "едет".
   ========================================================= */

/* База: предотвращаем переполнения в карточках */
.event-card,
.event-info,
.event-actions-left{
  min-width: 0;
}

/* Заголовок/локация не должны раздувать карточку */
.event-info h3,
.event-location{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Локация: на очень узких можно переносить */
@media (max-width: 420px){
  .event-location{
    white-space: normal;
  }
}

/* Чипы сеансов: всегда переносятся, не вылазят */
.event-sessions{
  overflow: hidden;
}

.session-time{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  text-decoration: none;
  line-height: 1.15;
}

.session-places{
  font-weight: 900;
  font-size: 0.82rem;
  opacity: .95;
  white-space: nowrap;
}

/* =========================================================
   Адаптив переключения desktop/mobile (жёстко как раньше)
   ========================================================= */
@media (max-width: 768px){
  .desktop-only{ display: none !important; }
  .mobile-only{ display: block !important; }

  .events-list_view h1{
    font-size: 1.6rem;
    text-align: left;
    margin-left: 10px;
  }

  .event-info{
    padding: 12px 14px;
  }

  .session-time{
    font-size: 0.8rem;
    padding: 5px 8px;
  }
}

@media (min-width: 769px){
  .mobile-only{ display: none !important; }
}

/* === Стили для слайдера === */
.events-slider{
  width: 100%;
  padding-bottom: 30px;
}

/* ВАЖНО: делаем ширину слайда адаптивной, чтобы на любых мобилах
   карточка не упиралась и не "выползала". */
.events-slider .swiper-slide{
  width: clamp(240px, 86vw, 360px);
  max-width: 360px;
  display: flex;
  justify-content: center;
}

/* На совсем узких (320px) уменьшаем */
@media (max-width: 360px){
  .events-slider .swiper-slide{
    width: 92vw;
    max-width: 92vw;
  }
}

/* Landscape телефоны: чуть шире карточка, меньше паддинги */
@media (max-width: 1024px) and (orientation: landscape){
  .events-slider .swiper-slide{
    width: clamp(320px, 70vw, 520px);
    max-width: 520px;
  }
  .event-info{
    padding: 12px 12px;
  }
}

/* Пагинация */
.swiper-pagination-bullet{
  background: var(--theme-color, #0055aa);
  opacity: 0.35;
}

.swiper-pagination-bullet-active{
  opacity: 1;
  background: #002b5c;
}

/* =========================================================
   SINGLE VIEW — Страница одного события
   ========================================================= */

/* ВАЖНО: не трогаем .container — он общий в layout */
.events-single_view{
  padding: 8px 0 18px;
}

.event-single{
  background: var(--surface, #fff);
  padding: 30px;
  border-radius: 16px;
  border: 1px solid rgba(229,231,235,.70);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-single:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

/* === Заголовок и мета === */
.event-header{
  text-align: center;
  margin-bottom: 20px;
}

.event-header h1{
  font-size: 2rem;
  color: #002b5c;
  margin: 0 0 10px;
  font-weight: 900;
}

.event-meta{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted, #6b7280);
  font-size: 1rem;
}

.event-date,
.event-loc{
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === Изображение === */
.event-img_wrap{
  margin: 20px 0;
  text-align: center;
}

.event-img{
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
  display: inline-block;
}

.event-img:hover{
  transform: scale(1.02);
}

/* === Описание === */
.event-desc{
  background: #fafafa;
  border-radius: 12px;
  padding: 20px 24px;
  color: var(--text, #111827);
  font-size: 1.05rem;
  line-height: 1.7;
  border: 1px solid rgba(229,231,235,.80);
  white-space: pre-line;
}

.event-desc a{
  color: var(--theme-color, #0066cc);
  text-decoration: underline;
  word-break: break-word;
}

.event-desc a:hover{
  filter: brightness(0.95);
}

.event-desc ul,
.event-desc ol{
  margin: 0 0 1em 1.5em;
  padding: 0;
}

.event-desc li{
  margin-bottom: 0.5em;
}

/* === Кнопка назад === */
.event-back{
  text-align: center;
  margin-top: 25px;
}

.btn-back{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme-color, #0055aa);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  transition: filter 0.15s ease, transform 0.12s ease;
}

.btn-back:hover{
  filter: brightness(0.95);
  transform: translateY(-2px);
}

.btn-back:active{
  transform: translateY(-1px);
}

/* === Адаптив === */
@media (max-width: 768px){
  .event-single{
    padding: 18px;
  }

  .event-header h1{
    font-size: 1.6rem;
  }

  .event-meta{
    font-size: 0.9rem;
  }

  .event-desc{
    font-size: 1rem;
    padding: 14px 12px;
  }
}

/* === Купить билет ===*/
.event-buy-row{
  margin-top: 10px;
  display: flex;
}

.event-buy-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  background: var(--theme-color, #0055aa);
  color: #fff;
  line-height: 1;
}

.event-buy-btn:hover{
  filter: brightness(0.97);
}

/* === FIX: выравниваем панель действий по низу карточки (list) === */
.event-card{
  display: flex;
  flex-direction: column;
}

.event-info{
  display: flex;           /* было block */
  flex-direction: column;
  height: 100%;
}

/* контейнер с кнопкой и местами — всегда внизу карточки */
.event-actions-row{
  margin-top: auto;        /* прижать вниз */
  padding-top: 10px;
}

/* кнопка + места в одну строку и не выползают */
.event-actions-left{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
}

.event-buy-btn{
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.event-places-badge{
  flex: 0 0 auto;
  white-space: nowrap;
}

/* чтобы на очень узких экранах не ломалось */
@media (max-width: 420px){
  .event-actions-left{
    gap: 8px;
    flex-wrap: wrap; /* важно: на узких переносим */
  }

  .event-places-badge{
    font-size: 0.85rem;
    padding: 8px 8px;
    width: 100%;
    justify-content: center;
  }

  .event-buy-btn{
    padding: 10px 10px;
    width: 100%;
  }
}

/* места внутри плашки сеанса */
.session-time{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* бейдж мест рядом с кнопкой "Выбрать" */
.event-places-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(229,231,235,.85);
  background: #fff;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

/* =========================================================
   KINOWIDGET MODAL (list + single)
   ========================================================= */
html.kw-modal-open,
html.kw-modal-open body{
  overflow: hidden !important;
}

.kw-modal{
  position: fixed;
  inset: 0;
  z-index: 999999; /* выше всего */
  display: none;
}

.kw-modal.is-open{
  display: block !important;
}

.kw-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
}

.kw-modal__dialog{
  position: absolute;
  inset: 5% 5%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

.kw-modal__close{
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  background: rgba(17,24,39,.92);
  color: #fff;
}

.kw-modal__frame{
  width: 100%;
  height: 100%;
  border: 0;
}

/* мобилка: full-screen */
@media (max-width: 768px){
  .kw-modal__dialog{
    inset: 0;
    border-radius: 0;
  }
}

/* ===== SINGLE: постер слева, инфо справа (глобально) ===== */
.single-layout{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: start;
}

.single-poster-img{
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(229,231,235,.85);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  max-height: 420px;
}

.single-header{ text-align: left !important; margin-bottom: 12px; }
.single-meta{ align-items: flex-start !important; }
.single-desc{ margin-top: 12px; }

.single-sessions{ margin-top: 10px; }
.single-sessions-title{
  font-weight: 900;
  margin-bottom: 8px;
  color: rgba(17,24,39,.92);
}
.single-sessions-empty{
  color: rgba(107,114,128,.95);
  font-weight: 600;
  padding: 8px 0;
}

.single-trailer{ margin-top: 14px; }
.single-trailer-title{ font-weight: 900; margin: 0 0 10px; }
.single-video-wrap{
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(229,231,235,.85);
  background: #000;
}
.single-video{ width: 100%; height: auto; display: block; }

.event-remind-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  background: rgba(17,24,39,.85);
  color: #fff;
  line-height: 1;
}
.event-remind-btn:hover{ filter: brightness(0.97); }

@media (max-width: 768px){
  .single-layout{ grid-template-columns: 1fr; }
  .single-poster-img{ max-height: 55vh; }
}

.event-remind-form{ display: inline; margin: 0; }
.event-remind-form .event-buy-btn{ border: 0; cursor: pointer; }
