/* RedFeed — contain for perfil/explorar. Feed home usa rf-feed-instagram-media.css */

body:not(.rf-redfeed-home) .rf-post-stream .rf-post-list article.rf-post .rf-post-media,
body:not(.rf-redfeed-home) .rf-post-list article.rf-post .rf-post-media,
body:not(.rf-redfeed-home) article.rf-post .rf-post-media,
html[data-rf-native-app="1"] body:not(.rf-redfeed-home) .rf-post-media-wrap .rf-post-media,
html[data-rf-feed-layout="classic"][data-rf-native-app="1"] .rf-post-media-wrap .rf-post-media,
html[data-rf-feed-layout="classic"] body:not(.rf-redfeed-home) .rf-post-media-wrap .rf-post-media,
body.rf-feed-layout-classic:not(.rf-redfeed-home) .rf-post-media-wrap .rf-post-media {
  aspect-ratio: auto !important;
  max-height: min(82vh, 820px) !important;
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  background: #000 !important;
}

body:not(.rf-redfeed-home) .rf-post-stream .rf-post-list article.rf-post .rf-post-media > video,
body:not(.rf-redfeed-home) .rf-post-list article.rf-post .rf-post-media > video,
body:not(.rf-redfeed-home) article.rf-post .rf-post-media > video,
body:not(.rf-redfeed-home) .rf-post-media video.rf-feed-vid-lazy,
body:not(.rf-redfeed-home) .rf-post-media > video,
html[data-rf-native-app="1"] body:not(.rf-redfeed-home) .rf-post-media video.rf-feed-vid-lazy,
html[data-rf-native-app="1"] body:not(.rf-redfeed-home) .rf-post-media > video {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(82vh, 820px) !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  background: #000 !important;
  transform: none !important;
}

body:not(.rf-redfeed-home) .rf-post-stream .rf-post-list article.rf-post .rf-post-media > img,
body:not(.rf-redfeed-home) .rf-post-list article.rf-post .rf-post-media > img,
body:not(.rf-redfeed-home) article.rf-post .rf-post-media > img,
html[data-rf-native-app="1"] body:not(.rf-redfeed-home) .rf-post-media > img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(82vh, 820px) !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  transform: none !important;
}

body:not(.rf-redfeed-home) .rf-feed-vid-shell {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  display: block !important;
  background: #000 !important;
}

body:not(.rf-redfeed-home) .rf-feed-vid-shell .rf-feed-vid-poster {
  object-fit: contain !important;
  object-position: center center !important;
}

body:not(.rf-redfeed-home) .rf-feed-vid-shell .rf-feed-vid-lazy,
body:not(.rf-redfeed-home) .rf-feed-vid-shell > video {
  width: 100% !important;
  height: auto !important;
  max-height: min(82vh, 820px) !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
}

html[data-rf-native-app="1"] body:not(.rf-redfeed-home) .rf-feed-vid-poster,
body:not(.rf-redfeed-home) .rf-feed-vid-poster {
  object-fit: contain !important;
  object-position: center center !important;
}

/* —— Reels fullscreen —— */
.rf-feed-reels-media-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #000 !important;
}

.rf-feed-reels-media-wrap img,
.rf-feed-reels-media-wrap video {
  object-fit: contain !important;
  object-position: center center !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

.rf-reels-poster-cover {
  object-fit: contain !important;
  object-position: center center !important;
  z-index: 4 !important;
}

.rf-feed-reels-media-wrap video {
  z-index: 1;
  position: relative;
}

.rf-feed-reels-viewer.rf-reels-comments-open .rf-feed-reels-slide.is-active-view .rf-feed-reels-media-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Comentários inline no feed */
body.rf-comments-open .rf-post.rf-comment-active .rf-post-media {
  max-height: 44vh !important;
  aspect-ratio: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.rf-comments-open .rf-post.rf-comment-active .rf-post-media img,
body.rf-comments-open .rf-post.rf-comment-active .rf-post-media video {
  max-height: 44vh !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

@media (max-width: 780px) {
  body.rf-comments-open .rf-post.rf-comment-active .rf-post-media {
    max-height: 28vh !important;
  }

  body.rf-comments-open .rf-post.rf-comment-active .rf-post-media img,
  body.rf-comments-open .rf-post.rf-comment-active .rf-post-media video {
    max-height: 28vh !important;
  }
}

/* Rail Em alta */
.rf-trend-card .rf-trend-thumb-img,
html[data-rf-native-app="1"] .rf-trend-card .rf-trend-thumb-img,
body.rf-redfeed-home .rf-trend-card .rf-trend-thumb-img {
  width: 100% !important;
  aspect-ratio: 3 / 4 !important;
  object-fit: cover !important;
  display: block !important;
  background: #12121d !important;
}

html[data-rf-native-app="1"] .rf-trend-card video.rf-trend-media-vid,
body.rf-redfeed-home .rf-trend-card video.rf-trend-media-vid {
  object-fit: cover !important;
  background: #0a0a10 !important;
}
