/* Раздел «Вебинары» — все стили внутри .spx-events, чтобы не задевать стили сайта */
/* Палитра и шрифты взяты с spix.ru */
:root {
  --spx-bg: #12141a;          /* фон страницы spix.ru */
  --spx-bg-header: #101217;   /* шапка */
  --spx-card: #1e2026;        /* карточки */
  --spx-card-hover: #24272e;
  --spx-line: rgba(255, 255, 255, .08);
  --spx-text: #ffffff;
  --spx-muted: #8c9299;
  --spx-muted-2: #a7b7cb;
  --spx-cyan: #82dff4;        /* градиент заголовков */
  --spx-blue: #0064e1;        /* фирменный синий */
  --spx-blue-hover: #2284ff;
  --spx-btn-from: #277ac7;    /* градиент кнопки «Попробовать» */
  --spx-btn-to: #5fb8e2;
  --spx-radius: 20px;
  --spx-radius-sm: 10px;
  --spx-wrap: 1180px;
}
.spx-events, .spx-events * { box-sizing: border-box; }
.spx-events {
  margin: 0;
  display: flow-root;          /* не даём отступам «выпадать» за пределы раздела */
  background: var(--spx-bg);
  color: var(--spx-text);
  font: 400 16px/1.55 Inter, "Golos Text", system-ui, sans-serif;
}
.spx-events a { color: inherit; }
.spx-events img { max-width: 100%; display: block; }
.spx-events .wrap { max-width: var(--spx-wrap); margin: 0 auto; padding: 0 16px; }
.spx-events main.wrap { padding-bottom: 96px; }  /* отступ до подвала сайта */
@media (min-width: 768px) { .spx-events .wrap { padding: 0 32px; } }
/* --- Шапка-заглушка (на сайте заменяется общим layout) --- */
.site-header { background: var(--spx-bg-header); border-bottom: 1px solid var(--spx-line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-header img { height: 32px; width: auto; }
.site-footer { border-top: 1px solid var(--spx-line); color: var(--spx-muted); font-size: 14px; padding: 32px 0; }
/* --- Кнопки --- */
.spx-events .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 24px; border-radius: 100px; border: 0;
  font: 500 16px/1 "Golos Text", Inter, sans-serif; text-decoration: none; cursor: pointer;
  transition: filter .2s, background .2s;
}
.spx-events .btn--primary { color: #fff; background: linear-gradient(to right, var(--spx-btn-from), var(--spx-btn-to)); }
.spx-events .btn--primary:hover { filter: brightness(1.1); }
.spx-events .btn--ghost { color: #fff; background: rgba(255,255,255,.08); }
.spx-events .btn--ghost:hover { background: rgba(255,255,255,.14); }
.spx-events .btn--sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
/* --- Хлебные крошки --- */
.spx-events .crumbs { font-size: 14px; color: var(--spx-muted); margin: 24px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.spx-events .crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.spx-events .crumbs a { text-decoration: none; }
.spx-events .crumbs a:hover { color: #fff; }
/* --- Заголовки с фирменным градиентом --- */
.spx-events .grad {
  background: radial-gradient(174.55% 98.81% at 27.27% 31.25%, #fff 0, var(--spx-cyan) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.spx-events h1, .spx-events h2, .spx-events h3 { font-family: Inter, sans-serif; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.spx-events h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.12; }
.spx-events h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.2; }
.spx-events h3 { font-size: 18px; line-height: 1.3; }
/* --- Hero раздела --- */
.spx-events .hero { padding: 40px 0 32px; }
.spx-events .hero p { color: var(--spx-muted-2); font-size: 18px; max-width: 640px; margin: 16px 0 0; }
/* Hero на той же сетке, что и карточки: текст — 2 колонки, плашка Telegram — третья */
.spx-events .hero--split { display: grid; grid-template-columns: 1fr; gap: 16px 24px; align-items: center; }
.spx-events .hero--split h1 { grid-column: 1 / -1; }
.spx-events .hero--split .hero__text p { margin-top: 0; }
@media (min-width: 1040px) {
  .spx-events .hero--split { grid-template-columns: repeat(3, 1fr); }
  .spx-events .hero--split .hero__text { grid-column: span 2; }
}
.spx-events .tg-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--spx-radius);
  background: var(--spx-card); box-shadow: 0 0 0 1px var(--spx-line); text-decoration: none;
  transition: box-shadow .2s, transform .2s; width: 100%;
}
.spx-events .tg-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--spx-line), 0 12px 32px rgba(4,15,29,.08); }
.spx-events .tg-card__icon { width: 44px; height: 44px; border-radius: 50%; background: #2aabee; display: grid; place-items: center; flex: none; }
.spx-events .tg-card__icon svg { width: 22px; height: 22px; fill: #fff; margin-left: -2px; }
.spx-events .tg-card__text { display: flex; flex-direction: column; line-height: 1.3; }
.spx-events .tg-card__text b { font-weight: 600; }
.spx-events .tg-card__text span { color: var(--spx-muted); font-size: 14px; }
.spx-events .tg-card__arrow { color: var(--spx-blue); font-size: 20px; margin-left: 6px; transition: transform .2s; }
.spx-events .tg-card:hover .tg-card__arrow { transform: translateX(3px); }
.spx-events .tg-card__arrow { margin-left: auto; }
/* --- Ближайший вебинар и календарь --- */
.spx-events .upcoming { display: grid; gap: 24px; margin-bottom: 64px; }
.spx-events .next {
  display: grid; grid-template-columns: 1fr; border-radius: var(--spx-radius); overflow: hidden;
  background: var(--spx-card); box-shadow: 0 0 0 1px var(--spx-line);
}
@media (min-width: 760px) { .spx-events .next { grid-template-columns: 260px 1fr; } }
.spx-events .next__date {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 28px 32px;
  background: var(--spx-blue); color: #fff;
}
.spx-events .next__label { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; opacity: .85; margin-bottom: 8px; }
.spx-events .next__date b { font: 600 64px/1 Inter, sans-serif; }
.spx-events .next__date > span:not(.next__label):not(.next__time) { font-size: 22px; font-weight: 600; }
.spx-events .next__time { margin-top: 10px; font-size: 15px; opacity: .9; }
.spx-events .next__body { padding: 28px 32px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.spx-events .next__body h2 { font-size: clamp(22px, 2.6vw, 30px); }
.spx-events .next__topic { margin: 0; font-size: 17px; color: var(--spx-muted); }
.spx-events .next__speakers { margin: 0; font-size: 14px; color: var(--spx-muted); }
.spx-events .next__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.spx-events .cal h3 { margin-bottom: 12px; }
.spx-events .cal__list { list-style: none; margin: 0; padding: 0; background: var(--spx-card); border-radius: 15px; box-shadow: 0 0 0 1px var(--spx-line); overflow: hidden; }
.spx-events .cal__list li { display: grid; grid-template-columns: 64px 1fr; gap: 4px 20px; align-items: center; padding: 16px 20px; }
@media (min-width: 760px) { .spx-events .cal__list li { grid-template-columns: 64px 1fr auto auto; } }
.spx-events .cal__list li + li { border-top: 1px solid var(--spx-line); }
.spx-events .cal__date { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 12px; background: rgba(0,100,225,.08); color: var(--spx-blue); line-height: 1.1; }
.spx-events .cal__date b { font-size: 22px; font-weight: 600; }
.spx-events .cal__date span { font-size: 12px; }
.spx-events .cal__body { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.spx-events .cal__body > span:last-child { flex-basis: 100%; color: var(--spx-muted); font-size: 14px; }
.spx-events .cal__time { color: var(--spx-muted); font-size: 14px; white-space: nowrap; }
.spx-events .cal__ics { color: var(--spx-blue); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.spx-events .cal__ics:hover { text-decoration: underline; }
@media (max-width: 759px) { .spx-events .cal__time, .spx-events .cal__ics { grid-column: 2; } }
.spx-events .badge-sample { padding: 2px 8px; border-radius: 100px; font-size: 12px; font-weight: 500; background: #fff3cd; color: #8a5a00; }
.spx-events .records-title { margin-bottom: 24px; }
.spx-events .hero__side { display: grid; gap: 12px; }
.spx-events .tg-card__icon--cal { background: var(--spx-blue); }
.spx-events .tg-card__icon--cal svg { margin-left: 0; width: 20px; height: 20px; }
.spx-events .cal-link { justify-self: start; color: var(--spx-blue); font-weight: 500; text-decoration: none; }
.spx-events .cal-link:hover { text-decoration: underline; }
.spx-events .cal--page .cal__list li { padding: 20px 24px; }
.spx-events .back-link { margin: 32px 0 0; }
.spx-events .back-link a { color: var(--spx-blue); text-decoration: none; font-weight: 500; }
.spx-events .hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
/* --- Сетка карточек --- */
.spx-events .grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .spx-events .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .spx-events .grid { grid-template-columns: repeat(3, 1fr); } }
.spx-events .card {
  position: relative; display: flex; flex-direction: column;
  background: var(--spx-card); border-radius: var(--spx-radius); overflow: hidden;
  transition: background .2s, transform .2s;
}
.spx-events .card:hover { background: var(--spx-card-hover); transform: translateY(-2px); }
.spx-events .card__link::after { content: ""; position: absolute; inset: 0; }
/* вся карточка кликабельна */
.spx-events .card__link { text-decoration: none; }
.spx-events .card__body { padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.spx-events .card__desc { color: var(--spx-muted); font-size: 15px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.spx-events .thumb { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.spx-events .thumb img { width: 100%; height: 100%; object-fit: cover; }
.spx-events .thumb__dur {
  position: absolute; right: 12px; bottom: 12px; padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,.75); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.spx-events .thumb__play {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(to right, var(--spx-btn-from), var(--spx-btn-to));
  display: grid; place-items: center; box-shadow: 0 8px 30px rgba(39,122,199,.45);
  transition: transform .2s;
}
.spx-events .thumb__play svg { width: 24px; height: 24px; margin-left: 4px; fill: #fff; }
.spx-events .card:hover .thumb__play, .spx-events .player:hover .thumb__play { transform: scale(1.08); }
.spx-events .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--spx-muted); font-size: 14px; }
.spx-events .tag {
  display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 13px;
  background: rgba(130,223,244,.1); color: var(--spx-cyan);
}
.spx-events .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.spx-events .badge-live { color: #ff5226; font-weight: 500; }
/* --- Блок подписки --- */
.spx-events .cta {
  margin-top: 64px; padding: 32px; border-radius: var(--spx-radius);
  background: radial-gradient(120% 140% at 0% 0%, rgba(39,122,199,.35), transparent 60%), var(--spx-card);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
}
.spx-events .cta p { margin: 8px 0 0; color: var(--spx-muted-2); max-width: 560px; }
/* --- Страница вебинара --- */
.spx-events .webinar { display: grid; gap: 40px; padding-top: 24px; }
@media (min-width: 1000px) { .spx-events .webinar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.spx-events .player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--spx-radius); overflow: hidden; background: #000; }
.spx-events .player button { all: unset; position: absolute; inset: 0; cursor: pointer; }
.spx-events .player button:focus-visible { outline: 3px solid var(--spx-cyan); outline-offset: -3px; }
.spx-events .player img { width: 100%; height: 100%; object-fit: cover; }
.spx-events .player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.spx-events .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.spx-events .webinar__head { margin-top: 28px; }
.spx-events .webinar__head h1 { font-size: clamp(26px, 4vw, 40px); }
.spx-events .webinar__head .meta { margin-top: 14px; }
.spx-events .lead { font-size: 18px; color: var(--spx-muted-2); margin: 20px 0 0; }
.spx-events .topics { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .spx-events .topics { grid-template-columns: 1fr 1fr; } }
.spx-events .topics li { background: var(--spx-card); border-radius: 15px; padding: 18px 20px; }
.spx-events .topics b { display: block; font-weight: 600; margin-bottom: 4px; }
.spx-events .topics span { color: var(--spx-muted); font-size: 15px; }
.spx-events .section-title { margin-top: 48px; }
.spx-events .chapters { list-style: none; padding: 0; margin: 20px 0 0; background: var(--spx-card); border-radius: 15px; overflow: hidden; }
.spx-events--light .chapters { box-shadow: 0 0 0 1px var(--spx-line); }
.spx-events .chapters li + li { border-top: 1px solid var(--spx-line); }
.spx-events .chapters a { display: flex; gap: 16px; padding: 12px 20px; text-decoration: none; transition: background .2s; }
.spx-events .chapters a:hover { background: rgba(0,100,225,.06); }
.spx-events .chapters time { color: var(--spx-blue); font-weight: 500; font-variant-numeric: tabular-nums; min-width: 48px; }
.spx-events .panel dd small { display: block; color: var(--spx-muted); font-size: 13px; margin-bottom: 4px; }
.spx-events .aside { display: grid; gap: 16px; }
@media (min-width: 1000px) { .spx-events .aside { position: sticky; top: 24px; } }
.spx-events .panel { background: var(--spx-card); border-radius: var(--spx-radius); padding: 24px; }
.spx-events .panel h3 { margin-bottom: 10px; }
.spx-events .panel p { margin: 0 0 16px; color: var(--spx-muted); font-size: 15px; }
.spx-events .panel .btn { width: 100%; }
.spx-events .panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.spx-events .panel dt { color: var(--spx-muted); }
.spx-events .panel dd { margin: 0; }
.spx-events .events-group { scroll-margin-top: 96px; }
.spx-events .events-group__title { margin-bottom: 24px; }
.spx-events .more { margin-top: 72px; }
.spx-events .more h2 { margin-bottom: 24px; }

/* ===== Светлая тема — как на внутренних страницах spix.ru (Блог, Кейсы, Инструкции) =====
   Включается классом spx-events--light рядом с spx-events. */
.spx-events--light {
  --spx-bg: #eef2f6;          /* --spix-ui-soft */
  --spx-bg-header: #ffffff;
  --spx-card: #ffffff;
  --spx-card-hover: #ffffff;
  --spx-line: #d2ddeb;        /* --spix-ui-border */
  --spx-text: #040f1d;        /* --spix-ui-text */
  --spx-muted: #5c636d;       /* --spix-ui-muted */
  --spx-muted-2: #5c636d;
  --spx-cyan: #0064e1;
}
.spx-events--light .grad { background: none; color: var(--spx-text); -webkit-text-fill-color: currentColor; }
.spx-events--light .btn--primary { background: var(--spx-blue); }
.spx-events--light .btn--primary:hover { background: var(--spx-blue-hover); filter: none; }
.spx-events--light .btn--ghost { color: var(--spx-blue); background: transparent; box-shadow: inset 0 0 0 1px var(--spx-blue); }
.spx-events--light .btn--ghost:hover { background: rgba(0,100,225,.06); }
.spx-events--light .crumbs a:hover { color: var(--spx-blue); }
.spx-events--light .card, .spx-events--light .panel, .spx-events--light .topics li { box-shadow: 0 0 0 1px var(--spx-line); }
.spx-events--light .card:hover { box-shadow: 0 0 0 1px var(--spx-line), 0 12px 32px rgba(4,15,29,.08); }
.spx-events--light .card:hover h3 { color: var(--spx-blue); }
.spx-events--light .tag { background: rgba(0,100,225,.08); color: var(--spx-blue); }
.spx-events--light .thumb__dur { color: #fff; }
.spx-events--light .thumb__play { background: var(--spx-blue); box-shadow: 0 8px 24px rgba(0,100,225,.35); }
.spx-events--light .cta { background: radial-gradient(120% 140% at 0% 0%, rgba(0,100,225,.12), transparent 60%), var(--spx-card); box-shadow: 0 0 0 1px var(--spx-line); }

@media (prefers-reduced-motion: reduce) { .spx-events, .spx-events * { transition: none !important; } }
