/* Мероприятия: хаб /events/ (сетка карточек, как у Adsterra) и страницы
   отдельных событий. Хиро-блок — копия top-section из career.css: у сайта
   конвенция самодостаточных страничных css. */

/* Секции страницы чёрные, но схлопывающиеся отступы заголовков выглядывали
   за их границы — и наружу проступал белый фон body тонкими полосами. */
body {
  background: #000;
}

.top-section {
  /* Зазор от фиксированного меню до заголовка — 36px, как на главной;
     снизу до чёрной кромки столько же (значения выверены замером). */
  padding: 112px 10px 132px;
  /* Фирменный синий фон шапки; чёрная часть страницы наезжает на него
     скруглённой кромкой (::before у .events-section). */
  background-color: #313ffe;
  position: relative;
  overflow: hidden;
}

.top-section .top-section__title {
  font-family: var(--third-family);
  /* Как .h1 главной — заголовки страниц одного размера. */
  font-size: 64px;
  line-height: 114%;
  letter-spacing: -0.04em;
  text-align: center;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

/* Классический амперсанд из Inter вместо фирменного глифа Craftwork. */
.top-section .top-section__title .amp {
  font-family: var(--second-family);
  font-weight: 600;
  font-size: 0.92em;
}

.top-section .top-section__suptitle {
  font-family: var(--second-family);
  font-size: 20px;
  line-height: 140%;
  letter-spacing: -0.04em;
  text-align: center;
  color: #f4f5fd;
  margin-bottom: 0;
  position: relative;
  z-index: 2;
}

/* ---------- Хаб ---------- */

.events-section {
  background: #000;
  /* Нижний отступ с запасом — карточки не должны прилипать к футеру. */
  padding: 0 16px 160px;
  position: relative;
}

/* Скруглённое «ухо» — чёрная секция закрывает низ синей шапки, как на
   остальных страницах сайта. */
.events-section::before {
  content: '';
  position: absolute;
  left: 0;
  top: -96px;
  width: 100%;
  height: 96px;
  border-radius: 96px 96px 0 0;
  background: #000;
}

.events-section .container {
  max-width: 1100px;
  /* Поверх чёрной кромки: первый заголовок поднимается в зону дуги. */
  position: relative;
  /* flow-root запирает отрицательный margin заголовка внутри контейнера —
     иначе он схлопывается наружу и утаскивает вверх всю секцию с дугой. */
  display: flow-root;
}

/* «Ближайшие мероприятия» — 36px от верха чёрной дуги, как заголовок
   страницы от меню: дуга 96px, поэтому поднимаем на 60px (96 − 36). */
.events-section .container > .events-section__title:first-child {
  margin-top: -60px;
}

.events-section__title {
  font-family: var(--third-family);
  font-size: 40px;
  line-height: 114%;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 12px;
  text-align: center;
}

/* Разделительная линия идёт ПЕРЕД заголовком архива: линия → заголовок
   по центру → первый год. */
.events-section__title--past {
  margin-top: 64px;
  padding-top: 56px;
  border-top: 1px solid #2e2e3c;
}

.events-section__note {
  font-family: var(--second-family);
  font-size: 16px;
  line-height: 150%;
  color: #9b9baf;
  margin: 0 auto 32px;
  max-width: 640px;
  text-align: center;
}

.events-section__note a {
  color: #e6f355;
}

/* Год — крупная метка с линией во всю ширину: раньше годы сливались
   в сплошную ленту карточек. */
.events-year {
  font-family: var(--third-family);
  font-size: 44px;
  color: #e6f355;
  margin: 72px 0 24px;
  padding-top: 40px;
  border-top: 1px solid #2e2e3c;
}

/* У первого года архива своей линии нет — она уже стоит над заголовком
   «Где мы были». */
.events-section__note + .events-year {
  border-top: none;
  padding-top: 0;
  margin-top: 40px;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Когда сетка идёт сразу за заголовком секции (без подписи под ним) —
   даём воздуха, иначе карточки прилипают к тексту. Отступ равен отступу
   до разделительной линии ниже — блок висит ровно посередине. */
.events-section__title + .events-grid {
  margin-top: 64px;
}

.event-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #2e2e3c;
  border-radius: 24px;
  overflow: hidden;
  transition: border-color 0.2s ease-in, transform 0.2s ease-in;
}

.event-card:hover {
  border-color: #6e6e84;
  transform: translateY(-2px);
}

.event-card--up {
  border-color: #e6f355;
}

/* Обложка. Пока у события нет фото — фирменная плашка с названием.
   Классы фонов переиспользует и хиро страницы события. */
.event-card__cover,
.event-hero__cover {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  min-height: 150px;
  font-family: var(--third-family);
  font-size: 24px;
  line-height: 120%;
  letter-spacing: -0.03em;
}

.event-card__cover--blue {
  background: linear-gradient(135deg, #313ffe 0%, #1b23a8 100%);
  color: #fff;
}

.event-card__cover--yellow {
  background: linear-gradient(135deg, #e6f355 0%, #b8c62e 100%);
  color: #232332;
}

.event-card__cover--dark {
  background: linear-gradient(135deg, #1c1c28 0%, #0b0b12 100%);
  color: #e6f355;
}

/* Пропорция 1.91:1 — стандарт og-баннеров: почти все афиши конференций
   встают в кадр целиком, без обрезки дат по краям. */
.event-card__cover-img {
  width: 100%;
  aspect-ratio: 1.91;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Постеры с текстом и датами по краям обрезать нельзя — показываем целиком,
   а пустоту вокруг заполняет размытая копия той же афиши. */
.event-card__coverbox {
  position: relative;
  aspect-ratio: 1.91;
  overflow: hidden;
}

.event-card__coverbox-blur {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(28px) brightness(0.55);
  transform: scale(1.25);
}

.event-card__cover-img--contain {
  object-fit: contain;
}

.event-card__coverbox .event-card__cover-img {
  position: relative;
  height: 100%;
  aspect-ratio: auto;
}

.event-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 22px;
  flex: 1;
  /* Тёмно-серая подложка тела карточки — отделяет текст от чёрного фона. */
  background: #161616;
}

.event-card__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.event-chip {
  font-family: var(--font-family);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid #2e2e3c;
  color: #cfcfe0;
}

.event-chip--up {
  background: #e6f355;
  border-color: #e6f355;
  color: #232332;
}

.event-card__name {
  font-family: var(--second-family);
  font-weight: 600;
  font-size: 18px;
  line-height: 130%;
  letter-spacing: -0.02em;
  color: #fff;
}

.event-card__dates {
  font-family: var(--second-family);
  font-size: 14px;
  line-height: 145%;
  color: #9b9baf;
}

.event-card__more {
  margin-top: auto;
  font-family: var(--second-family);
  font-weight: 600;
  font-size: 14px;
  color: #e6f355;
}

/* ---------- Страница события ---------- */

.event-hero {
  background: #000;
  /* Верхний отступ больше высоты фиксированного меню (~86px) — иначе
     хлебные крошки прячутся под ним. */
  padding: 122px 16px 0;
}

.event-hero .container,
.event-info .container {
  max-width: 820px;
}

/* Возврат к списку: одиночный пилл «Мероприятия» в стиле крошек блога. */
.breadcrumbs {
  margin-bottom: 24px;
}

.breadcrumbs .breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 32px;
  padding: 4px 12px 4px 9px;
  background: rgba(164, 195, 255, 0.25);
  font-family: var(--second-family);
  font-weight: 600;
  font-size: 14px;
  line-height: 143%;
  letter-spacing: -0.02em;
  color: #568fff;
  transition: background 0.2s ease-in;
}

.breadcrumbs .breadcrumbs__item:hover {
  background: rgba(164, 195, 255, 0.4);
}

/* Пометка у ссылок на сайты, переписанные под следующий выпуск. */
.event-facts__stale {
  color: #6e6e84;
  font-size: 13px;
  margin-left: 10px;
  white-space: nowrap;
}

.event-hero__cover {
  border-radius: 24px;
  min-height: 220px;
  font-size: 34px;
}

.event-hero__cover-img {
  width: 100%;
  border-radius: 24px;
  object-fit: cover;
  max-height: 380px;
}

.event-hero__coverbox {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  height: 320px;
}

.event-hero__coverbox .event-hero__cover-img {
  position: relative;
  height: 100%;
  border-radius: 0;
}

.event-hero__cover-img--contain {
  object-fit: contain;
}

.event-hero__title {
  font-family: var(--third-family);
  font-size: 44px;
  line-height: 114%;
  letter-spacing: -0.04em;
  color: #fff;
  margin: 32px 0 8px;
}

.event-info {
  background: #000;
  padding: 24px 16px 96px;
}

.event-facts {
  display: flex;
  flex-direction: column;
  row-gap: 10px;
  border: 1px solid #2e2e3c;
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 32px;
}

.event-facts__row {
  display: flex;
  gap: 16px;
  font-family: var(--second-family);
  font-size: 15px;
  line-height: 150%;
}

.event-facts__row dt {
  color: #9b9baf;
  min-width: 150px;
  flex-shrink: 0;
}

.event-facts__row dd {
  color: #fff;
}

.event-facts__row a {
  color: #e6f355;
  word-break: break-all;
}

.event-body {
  font-family: var(--second-family);
  font-size: 16px;
  line-height: 165%;
  color: #cfcfe0;
}

.event-body p {
  margin-bottom: 16px;
}

.event-body a {
  color: #e6f355;
}

/* ---------- Мобильные ---------- */

@media (max-width: 767px) {
  .top-section {
    /* Те же 36px с обеих сторон; кромка на мобильных 56px. */
    padding: 112px 10px 92px;
  }

  .events-section::before {
    top: -56px;
    height: 56px;
    border-radius: 56px 56px 0 0;
  }

  /* Мобильная дуга 56px → подъём 20px (56 − 36). */
  .events-section .container > .events-section__title:first-child {
    margin-top: -20px;
  }

  .top-section .top-section__title {
    font-size: 44px;
  }

  .top-section .top-section__suptitle {
    font-size: 16px;
  }

  .events-section__title {
    font-size: 30px;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  .event-hero__title {
    font-size: 30px;
  }

  .event-facts__row {
    flex-direction: column;
    gap: 2px;
  }
}
