/* ── events.css — восстановлен (файл отсутствовал) ── */

:root {
  --card: #12151D;
  --card-border: var(--border-default);
  --text-dim: #a7c4d8;
  --text-dimmer: #7391a8;
  --pill-bg: rgba(255,255,255,.05);
}

/* Контейнер /events тянется на всю ширину с отступами 120px,
   чтобы контент шёл по одной линии с шапкой (как на /news). */
.container { max-width: none; padding: 0 120px; }

/* ── HERO ── */
.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  aspect-ratio: 1440/620;
  max-height: 60vh;
  background-color: #0A0C11;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 0 40px;
  margin-bottom: 60px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url('../images/events-hero.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4,10,18,0.15) 0%, rgba(4,10,18,0.35) 50%, rgba(4,10,18,0.6) 100%);
}
.hero h1, .hero p {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 72px;
  line-height: 100%;
  letter-spacing: 0;
  color: #E2E2E5;
  text-transform: none;
  margin-bottom: 20px;
}
.hero p {
  max-width: 680px;
  margin: 0 auto;
  font-family: 'Rubik', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 24px;
  line-height: 100%;
  letter-spacing: 0%;
  color: #E2E2E5;
}
/* На /events в этот же .hero подмешивается calendar.css (нужен для
   вкладки "Календарь") — его правила .hero h1/.hero p грузятся позже
   events.css и перебивают эти. Фиксируем через #heroTitle/#heroSubtitle:
   эти id есть только в этой странице, их специфичность выше классовых
   правил calendar.css независимо от порядка подключения <link>. */
#heroTitle {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 72px;
  line-height: 100%;
  letter-spacing: 0;
  color: #E2E2E5;
  text-transform: none;
  margin: 0 0 20px;
}
#heroSubtitle {
  max-width: none;
  white-space: nowrap;
  margin: 0 auto;
  font-family: 'Rubik', sans-serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 100%;
  letter-spacing: 0;
  color: #E2E2E5;
}

/* ── SECTION LABEL ── */
.section-label {
  display: flex; align-items: center; gap: 14px; margin: 0 0 22px;
}
.section-label span {
  font-family: 'Rubik', sans-serif;
  font-size: 36px; font-weight: 500; line-height: 100%; letter-spacing: 0;
  text-transform: none;
  color: #E2E2E5; white-space: nowrap;
}
.section-label::after { content: none; }

/* ── GAME FILTER (top-right chips) ── */
.game-filter-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Rubik', sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: .3px;
  cursor: pointer;
  transition: color .2s;
}
.game-filter-btn:hover { color: #E2E2E5; }
.game-filter-btn.active.ets2, .game-filter-btn.active.ats { color: var(--accent); }

/* ── CARDS GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
  gap: 20px;
  margin-bottom: 50px;
}
.no-events, .error-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  border: 1px dashed rgba(119,255,237,.18);
  border-radius: var(--radius);
  font-size: 14px;
}
.no-events { color: #9BA1AE; border-style: solid; border-color: var(--border-default); box-sizing: border-box; }
.error-msg { color: #ff9a9a; border-color: rgba(255,120,120,.25); }

/* ── EVENT CARD ──
   Базовые стили карточки вынесены в event-card.css (общий компонент,
   используется также на главной странице). Здесь остаётся только
   специфичное для /events поведение фильтрации. */
.event-card.filter-hidden {
  opacity: 0;
  transform: scale(.94);
  filter: blur(2px);
  pointer-events: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 980px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cards-grid { grid-template-columns: 1fr; }
  .events-topbar { flex-direction: column; align-items: stretch; }
  .game-filter-right { justify-content: center; }
  .section-label span { font-size: 26px; }
}


/* ==========================================================================
   МОБИЛЬНАЯ ОПТИМИЗАЦИЯ /events: конвои + календарь (только ≤720px)
   ========================================================================== */
.cal-agenda { display: none; }

@media (max-width: 720px) {
  .container { padding: 0 16px; }

  .hero {
    aspect-ratio: auto; max-height: none; min-height: 200px;
    padding: 40px 16px; margin-bottom: 24px;
  }
  #heroTitle { font-size: 36px; line-height: 1.1; margin: 0 0 12px; }
  #heroSubtitle {
    font-size: 15px; line-height: 1.4;
    white-space: normal; max-width: 100%;
  }

  /* Переключатель Конвои / Календарь — на всю ширину */
  .events-topbar { margin-bottom: 18px; }
  .events-topbar .view-toggle { width: 100%; height: 48px; box-sizing: border-box; }
  .events-topbar .view-toggle .view-toggle-btn {
    flex: 1; height: 42px; font-size: 15px;
    -webkit-tap-highlight-color: transparent;
  }

  .section-label { margin-bottom: 16px; }
  .section-label span { font-size: 24px; white-space: normal; }

  /* Карточки конвоев */
  .cards-grid { grid-template-columns: 1fr; gap: 14px; margin-bottom: 32px; }
  .event-card .card-banner { height: auto; aspect-ratio: 16/8; }
  .event-card .card-body { padding: 14px 14px 16px; }
  .event-card .card-title { font-size: 18px; min-height: 0; margin-bottom: 12px; }
  .event-card .meta-row { font-size: 14px; }
  .event-card .meta-row .val { white-space: normal; }
  .event-card .card-divider { margin: 14px 0 12px; }
  .event-card .detail-btn { min-height: 46px; font-size: 15px; -webkit-tap-highlight-color: transparent; }
  .no-events, .error-msg { padding: 36px 16px; }

  /* ── КАЛЕНДАРЬ ── */
  #view-calendar .cal-card { margin-bottom: 32px; border-radius: 14px; }
  #view-calendar .cal-toolbar { padding: 10px 8px 10px 4px; gap: 8px; flex-wrap: nowrap; }
  #view-calendar .cal-nav { flex: 1; min-width: 0; gap: 0; justify-content: space-between; }
  #view-calendar .cal-arrow {
    width: 44px; height: 44px; -webkit-tap-highlight-color: transparent;
  }
  #view-calendar .cal-title {
    font-size: 18px; min-width: 0; flex: 1; letter-spacing: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #view-calendar .cal-today-btn { padding: 0 12px; height: 38px; font-size: 13px; }

  #view-calendar .cal-weekdays span {
    padding: 8px 0; font-size: 10px; letter-spacing: .3px;
  }

  /* Ячейка = число + точки-индикаторы событий. Детали — в списке под сеткой. */
  #view-calendar .cal-cell {
    min-height: 54px; padding: 5px 0 4px;
    display: grid;
    grid-template-columns: repeat(3, 6px);
    justify-content: center;
    align-content: start;
    gap: 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  #view-calendar .cal-cell .cal-daynum {
    grid-column: 1 / -1; justify-self: center;
    width: 28px; height: 28px; font-size: 13px;
  }
  #view-calendar .cal-chip {
    width: 6px; height: 6px; min-width: 0; padding: 0; margin: 0;
    border: none; border-radius: 50%;
    background: #038184;
    font-size: 0;
    pointer-events: none;           /* тап обрабатывает вся ячейка */
  }
  #view-calendar .cal-chip .chip-time,
  #view-calendar .cal-chip .chip-name,
  #view-calendar .cal-chip .cal-chip-dot { display: none; }
  #view-calendar .cal-more { display: none; }
  #view-calendar .cal-cell.selected { background: rgba(3,129,132,.16); }
  #view-calendar .cal-cell.selected .cal-daynum { border: 1px solid #038184; }

  /* Список событий выбранного дня */
  .cal-agenda {
    display: block;
    border-top: 1px solid var(--border-default);
    padding: 14px 14px 16px;
    background: rgba(255,255,255,.02);
  }
  .cal-agenda-title {
    font-family: 'Rubik', sans-serif; font-size: 14px; font-weight: 500;
    color: #9BA1AE; margin-bottom: 10px;
  }
  .cal-agenda-empty { font-size: 14px; color: #9BA1AE; line-height: 1.5; }
  .cal-agenda-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 52px; box-sizing: border-box;
    margin-bottom: 8px; padding: 10px 14px;
    background: #1C202B; border: 1px solid var(--border-default);
    border-radius: 12px; color: #E2E2E5; text-align: left;
    font-family: 'Rubik', sans-serif; font-size: 15px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .cal-agenda-item:active { background: #232837; }
  .cal-agenda-item:last-child { margin-bottom: 0; }
  .cal-agenda-time {
    flex-shrink: 0; font-weight: 600; font-size: 14px; color: #038184;
    min-width: 46px;
  }
  .cal-agenda-name { flex: 1; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
}
