/**
 * Feed media from Yandex Object Storage must paint the card immediately.
 * Do not force a new photo aspect-ratio (desktop .card-img height stays from custom.css).
 * Video wrap in custom.css is 3:4 + #F2F2F2 — cover it with a storage JPEG still,
 * or keep the <video> visible so the first frame can paint.
 * Scoped to .cotinder-storage-media only.
 */
html body .index__post .card.card__video > .card__media-wrap.cotinder-storage-media,
html body .post__slide--video.cotinder-storage-media {
  position: relative;
  overflow: hidden;
  background: #f2f2f2;
  background-color: #f2f2f2;
}

html body .index__post .card.card__video > .card__media-wrap.cotinder-storage-media > a {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

html body .index__post .card.card__video > .card__media-wrap.cotinder-storage-media .cotinder-video-still,
html body .post__slide--video.cotinder-storage-media .cotinder-video-still {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
}

html body .index__post .card.card__video > .card__media-wrap.cotinder-storage-media .bg-video,
html body .post__slide--video.cotinder-storage-media .post__video {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center center !important;
  background: #f2f2f2 !important;
}

html body .index__post .card.card__video > .card__media-wrap.cotinder-storage-media.has-storage-poster .bg-video,
html body .post__slide--video.cotinder-storage-media.has-storage-poster .post__video {
  opacity: 0;
}

html body .index__post .card.card__video > .card__media-wrap.cotinder-storage-media.has-storage-poster.is-video-playing .bg-video,
html body .post__slide--video.cotinder-storage-media.has-storage-poster.is-video-playing .post__video {
  opacity: 1;
}

html body .index__post .card.card__video > .card__media-wrap.cotinder-storage-media.has-storage-poster.is-video-playing .cotinder-video-still,
html body .post__slide--video.cotinder-storage-media.has-storage-poster.is-video-playing .cotinder-video-still {
  opacity: 0;
  transition: opacity 0.18s ease;
}

html body .index__post .card.card__video > .card__media-wrap.cotinder-storage-media:not(.has-storage-poster) .bg-video,
html body .post__slide--video.cotinder-storage-media:not(.has-storage-poster) .post__video {
  opacity: 1 !important;
}

html body .index__post .card.card__video > .card__media-wrap.cotinder-storage-media .cotinder-video-preloader,
html body .post__slide--video.cotinder-storage-media .cotinder-video-preloader {
  display: none !important;
}

html body .index__post .card > .card__media-wrap.cotinder-storage-media > a > img.card-img,
html body .index__post .card > .card__media-wrap.cotinder-storage-media .card__gallery-swiper .card-img {
  display: block;
  width: 100% !important;
  margin-bottom: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
}

html body .index__post .card > .card__media-wrap.cotinder-storage-media .card__gallery-swiper {
  margin-bottom: 0 !important;
}

/* Detail modal/page: JPEG still paints the preview until play.
   Video stays opacity:0 under the still so preload=metadata does not flash black.
   A center play button starts playback; JS adds .is-video-playing. */
html body .post__slide--video.cotinder-storage-media.has-storage-poster .cotinder-video-still {
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}
html body .post__slide--video.cotinder-storage-media.has-storage-poster .post__video {
  z-index: 1;
}
html body .post__slide--video.cotinder-storage-media.has-storage-poster .post__detail-video-play {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 5;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.55);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}
html body .post__slide--video.cotinder-storage-media.has-storage-poster .post__detail-video-play svg {
  display: block;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  fill: currentColor;
  color: #fff;
}
html body .post__slide--video.cotinder-storage-media.has-storage-poster .post__detail-video-play:hover,
html body .post__slide--video.cotinder-storage-media.has-storage-poster .post__detail-video-play:focus-visible {
  background: rgba(253, 119, 40, 0.92);
  outline: none;
}
html body .post__slide--video.cotinder-storage-media.has-storage-poster.is-video-playing .post__detail-video-play {
  display: none !important;
}
html body .post__slide--video.cotinder-storage-media.has-storage-poster.is-video-playing .post__video {
  z-index: 3;
}
html body .post__slide--video.cotinder-storage-media:not(.has-storage-poster) .post__detail-video-play {
  display: none !important;
}
