/* VK TikTok-like video grid and modal */

.vk-videos {
  position: relative;
  z-index: 2;
  padding-top: 26px;
}

.vk-clips-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.vk-clip-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  appearance: none;
  text-align: left;
}

.vk-clip-card__preview {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 28px;
  background: #000;
  box-shadow: 0 14px 34px rgba(88, 53, 24, .08);
}

.vk-clip-card__preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .35s ease;
}

.vk-clip-card:hover .vk-clip-card__preview img {
  transform: scale(1.04);
}

.vk-clip-card__preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
  pointer-events: none;
}

.vk-clip-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  z-index: 4;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,.78);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

.vk-clip-card__play::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 18px;
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 17px solid #ff5a08;
}

.vk-clip-card__views {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 5;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* полностью убираем названия под видео */
.vk-clip-card h3,
.clip--vk h3,
.vk-clips-grid h3 {
  display: none !important;
}

.is-vk-reels-open,
.is-vk-reels-open body {
  overflow: hidden;
}

.vk-reels-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 8, 4, .78);
  backdrop-filter: blur(8px);
}

.vk-reels-modal.is-open {
  display: flex;
}

.vk-reels-modal__backdrop {
  position: absolute;
  inset: 0;
}

.vk-reels-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(430px, calc(100vw - 32px));
  height: min(86vh, 820px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vk-reels-modal__phone {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: #000;
  box-shadow: 0 30px 90px rgba(0,0,0,.42);
}

.vk-reels-modal__phone iframe,
.vk-reels-modal__phone video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.vk-reels-modal__close,
.vk-reels-modal__nav {
  position: absolute;
  z-index: 6;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: #2c2018;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,.2);
}

.vk-reels-modal__close {
  top: -18px;
  right: -18px;
}

.vk-reels-modal__nav {
  right: -68px;
}

.vk-reels-modal__nav--prev {
  top: calc(50% - 58px);
}

.vk-reels-modal__nav--next {
  top: calc(50% + 10px);
}

.vk-reels-modal__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 26px;
  color: #fff;
  background: #000;
}

.vk-reels-modal__empty img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .72;
}

.vk-reels-modal__empty::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 46%;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0));
}

.vk-reels-modal__empty p,
.vk-reels-modal__empty a {
  position: relative;
  z-index: 2;
}

.vk-reels-modal__empty p {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.vk-reels-modal__empty a {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  padding: 0 18px;
  border-radius: 999px;
  background: #ff5a08;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .vk-clips-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .vk-clips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .vk-reels-modal__dialog {
    width: 100vw;
    height: 100vh;
  }

  .vk-reels-modal__phone {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .vk-reels-modal__close {
    top: 16px;
    right: 16px;
  }

  .vk-reels-modal__nav {
    right: 16px;
    background: rgba(255,255,255,.82);
  }

  .vk-reels-modal__nav--prev {
    top: auto;
    bottom: 86px;
  }

  .vk-reels-modal__nav--next {
    top: auto;
    bottom: 26px;
  }
}

@media (max-width: 480px) {
  .vk-clips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
