/*
 * Верхняя категория может быть длинной, но не должна заходить под кнопку
 * «Разбор». Текст вынесен в отдельный flex-элемент и масштабируется по длине.
 */
/* gap здесь единственный, кто действует на плашку: typography-boost.css его
   не переопределяет. А вот max-width и padding-inline ниже — мёртвые: тот
   файл подключён позже и перебивает их. Не подбирай их здесь, ничего не
   изменится (см. комментарий там же). */
.short-kinescope-frame .video-details-tag {
  justify-content: flex-start;
  gap: 4px;
  min-height: 30px;
  max-width: calc(100% - 130px);
  padding-inline: 11px;
  font-size: 8.1px;
}

.short-kinescope-frame .video-details-button {
  min-height: 30px;
  padding: 6px 7px 6px 11px;
  font-size: 8.2px;
}

.short-kinescope-frame .video-details-button-icon {
  flex-basis: 19px;
  width: 19px;
  height: 19px;
  font-size: 14px;
}

.short-kinescope-frame .video-details-tag::before {
  flex-basis: 6px;
  width: 6px;
  height: 6px;
}

.short-kinescope-frame .video-details-tag-label {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * Идентификатор ролика (#536) внутри той же плашки, что и тег.
 * flex: 0 0 auto — принципиально: ширину плашки мы намеренно НЕ увеличивали
 * (иначе на узкой карточке она поехала бы на кнопку «РАЗБОР»), поэтому при
 * нехватке места сжимается и обрезается многоточием название категории, а
 * номер остаётся целым — он короткий и нужен именно чтобы его прочитали.
 */
.short-kinescope-frame .video-details-tag-code {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.52);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.short-kinescope-frame .video-details-tag.is-long {
  gap: 5px;
  font-size: 7.2px;
  letter-spacing: 0.025em;
}

.short-kinescope-frame .video-details-tag.is-extra-long {
  gap: 4px;
  padding-inline: 9px;
  font-size: 6.3px;
  letter-spacing: 0.012em;
}

.short-kinescope-frame .video-details-tag.is-extra-long::before {
  flex-basis: 5px;
  width: 5px;
  height: 5px;
}

@media (max-width: 640px) {
  .short-kinescope-frame .video-details-tag {
    max-width: calc(100% - 127px);
  }
}

/*
 * Аудит — сильный CTA, но не второй главный экран.
 * Основная фраза спокойнее, а «БЕСПЛАТНО» сохраняет акцентную роль.
 */
section#contacts > div {
  max-width: 940px;
}

section#contacts h2 {
  max-width: 880px;
  margin-right: auto;
  /* Тот же промежуток, что у бейджа/абзаца в этой секции и у всей цепочки
     хиро (см. css/typography-boost.css) — 28px на ПК, 18px на мобильном. */
  margin-bottom: 28px;
  margin-left: auto;
  font-size: clamp(30px, 3.3vw, 42px);
  font-weight: 450;
  line-height: 1.14;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

section#contacts h2 > span {
  font-size: 1.025em;
  font-weight: 650;
  letter-spacing: -0.045em;
}

section#contacts h2 > span::before {
  bottom: 4px !important;
  height: 7px !important;
  opacity: 0.9;
}

section#contacts p {
  max-width: 680px;
  font-size: clamp(12px, 1.05vw, 14px);
  line-height: 1.65;
}

@media (max-width: 640px) {
  section#contacts h2 {
    max-width: 18.5em;
    margin-bottom: 18px;
    font-size: clamp(24px, 7.1vw, 30px);
    line-height: 1.16;
    letter-spacing: -0.028em;
  }

  section#contacts h2 > span {
    letter-spacing: -0.038em;
  }

  section#contacts h2 > span::before {
    bottom: 3px !important;
    height: 6px !important;
  }
}

/*
 * Вся типографика раскрытого «Разбора» использует то же семейство и близкое
 * фирменное начертание, что и надпись на кнопке «РАЗБОР».
 */
.short-kinescope-frame .video-details-panel,
.short-kinescope-frame .video-details-head h3,
.short-kinescope-frame .video-details-section h4,
.short-kinescope-frame .video-details-panel li,
.short-kinescope-frame .video-details-panel li span {
  font-family: "Unbounded WAKUDO", Unbounded, Arial, sans-serif !important;
  font-synthesis: none;
}

.short-kinescope-frame .video-details-panel.has-groups .video-details-section li {
  font-weight: 600 !important;
  font-size: 9.35px !important;
  letter-spacing: 0.008em;
  line-height: 1.32;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

/*
 * Панель всегда остаётся внутри карточки. Если текста больше доступной высоты,
 * прокручивается только содержимое, а заголовок и кнопка закрытия остаются на месте.
 */
.short-kinescope-frame .video-details-panel.has-groups {
  overflow: hidden;
}

.short-kinescope-frame .video-details-panel.has-groups .video-details-content {
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.5) transparent;
}

.short-kinescope-frame .video-details-panel.has-groups .video-details-content::-webkit-scrollbar {
  width: 4px;
}

.short-kinescope-frame .video-details-panel.has-groups .video-details-content::-webkit-scrollbar-track {
  background: transparent;
}

.short-kinescope-frame .video-details-panel.has-groups .video-details-content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.5);
}

.short-kinescope-frame .video-details-panel.has-groups .video-details-section li > span:last-child {
  display: block;
  min-width: 0;
  line-height: 1.44;
}

/* Свободный, но безопасный по высоте ритм между уровнями описания. */
.short-kinescope-frame .video-details-panel.has-groups .video-details-head {
  padding-bottom: 11px;
}

.short-kinescope-frame .video-details-panel.has-groups .video-details-content {
  gap: 12px;
  margin-top: 10px;
  padding: 5px 5px 9px 0;
}

.short-kinescope-frame .video-details-section h4 {
  margin-bottom: 6px;
}

.short-kinescope-frame .video-details-panel.has-groups .video-details-section ul {
  gap: 5.5px;
}

.short-kinescope-frame .video-details-panel.has-groups .video-details-section li {
  gap: 8px;
}

@media (max-width: 640px) {
  .short-kinescope-frame .video-details-panel.has-groups .video-details-head {
    padding-bottom: 10px;
  }

  .short-kinescope-frame .video-details-panel.has-groups .video-details-content {
    gap: 11px;
    margin-top: 9px;
    padding: 5px 4px 8px 0;
  }

  .short-kinescope-frame .video-details-section h4 {
    margin-bottom: 5px;
  }

  .short-kinescope-frame .video-details-panel.has-groups .video-details-section ul {
    gap: 4.5px;
  }

  .short-kinescope-frame .video-details-panel.has-groups .video-details-section li {
    font-size: 8.85px !important;
    line-height: 1.28;
  }

  .short-kinescope-frame .video-details-panel.has-groups .video-details-section li > span:last-child {
    line-height: 1.42;
  }
}

/*
 * Настройка расстояния между новой подписью и фиолетовыми кнопками.
 * Меняйте только эти два значения: например, 10px, 16px или 24px.
 */
:root {
  --wakudo-hero-label-buttons-gap: 10px;
  --wakudo-audit-label-buttons-gap: 10px;
}

.social-labeled-action {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  justify-content: center;
}

.social-labeled-action--hero {
  gap: var(--wakudo-hero-label-buttons-gap);
}

.social-labeled-action--audit {
  gap: var(--wakudo-audit-label-buttons-gap);
}

.social-action-label {
  flex: 0 1 auto;
  color: rgba(255, 255, 255, 0.96);
  font-size: 13px;
  font-weight: 480;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-align: right;
  white-space: nowrap;
}

.social-action-label--hero {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 430;
}

.social-action-label--audit {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 430;
}

.social-labeled-action .social-action-group {
  flex: 0 0 auto;
}

.social-labeled-action--audit .social-action-group {
  margin-top: 0;
}

.hero-btns {
  gap: 12px !important;
  flex-wrap: wrap;
}

.hero-btns .social-labeled-action--hero .social-icon-btn,
section#contacts .social-labeled-action--audit .social-icon-btn {
  width: 52px !important;
  height: 52px !important;
}

.hero-btns .hero-btn-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.96);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.hero-btns .hero-btn-link::after {
  content: "→";
  display: inline-block;
  font-size: 15px;
  font-weight: 480;
  line-height: 1;
  transition: transform 180ms ease;
}

.hero-btns .hero-btn-link:hover {
  border-color: rgba(168, 85, 247, 0.72);
  background: rgba(168, 85, 247, 0.11);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 26px rgba(92, 30, 150, 0.18);
  transform: translateY(-1px);
}

.hero-btns .hero-btn-link:hover::after {
  transform: translateX(3px);
}

.hero-btns .hero-btn-link:focus-visible {
  outline: 2px solid rgba(192, 132, 252, 0.9);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-btns .hero-btn-link,
  .hero-btns .hero-btn-link::after {
    transition: none;
  }
}

@media (max-width: 640px) {
  :root {
    --wakudo-hero-label-buttons-gap: 9px;
    --wakudo-audit-label-buttons-gap: 10px;
  }

  .social-action-label {
    font-size: 12px;
  }

  .hero-btns .social-labeled-action--hero .social-icon-btn {
    width: 48px !important;
    height: 48px !important;
  }

  .hero-btns .hero-btn-link {
    min-height: 40px;
    padding: 9px 14px;
  }

  /*
   * На узком экране обе части главного CTA получают собственную строку.
   * Так кнопка не зависит от случайного переноса flex-контейнера и всегда
   * остаётся точно по центру относительно заголовка.
   */
  .hero-premium-center .hero-btns {
    display: grid !important;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center !important;
    gap: 16px !important;
  }

  .hero-premium-center .social-labeled-action--hero,
  .hero-premium-center .hero-btn-link {
    justify-self: center;
    align-self: center;
    margin: 0 !important;
  }

  .hero-premium-center .social-labeled-action--hero {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .hero-premium-center .social-action-label--hero {
    width: 100%;
    text-align: center;
  }

  .hero-premium-center .social-labeled-action--hero .social-action-group {
    margin: 0 !important;
  }

  .hero-premium-center .hero-btn-link {
    width: auto;
    max-width: calc(100vw - 48px);
    gap: 6px;
    padding-inline: 10px;
    box-sizing: border-box;
    font-size: 12px !important;
    transform: none !important;
  }

  .hero-premium-center .hero-btn-link::after {
    font-size: 14px;
  }

  /*
   * Раскладка подписи и иконок у аудита на мобильном теперь полностью
   * задаётся в layout-overrides.css (грузится позже этого файла и
   * специально держит подпись и иконки в одну строку, как у хиро — см.
   * комментарий там). Раньше здесь была отдельная, более старая версия
   * (подпись отдельной строкой над кнопками, шириной 230px, по центру) —
   * она не была удалена, когда появилась строчная раскладка, и её ширина/
   * центрирование продолжали просачиваться через каскад на сам текст
   * подписи, раздувая видимый зазор между текстом и иконками. Убрано.
   */
}
