/**
 * Entity detail «Последние посты» (/pets/…, /pet-owners/…).
 * Photo media 1:1, video media 3:4 (no flex-stretch of the image box).
 * Curator advice stretches to the same row height as posts.
 * Scope: ONLY .tabs__content_right--entity-page .tabs__content_pet[data-target="last"]
 * Index feed untouched. Marker: entityposts20260814a
 */

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts {
  align-items: stretch !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_full):not(.index__post_be-part) {
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
}

/* Photo posts: card fills row; media locked to 1:1 */
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card__media-wrap,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card-img-wrap {
  aspect-ratio: 1 / 1 !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card__media-wrap > a,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card-img-wrap > a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) .card-img,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card__media-wrap img,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card-img-wrap img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* Gallery: same 1:1 box as single photo */
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card__media-wrap--gallery {
  display: flex !important;
  flex-direction: column !important;
  aspect-ratio: 1 / 1 !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card__media-wrap--gallery > .card__gallery-swiper {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  margin-bottom: 0 !important;
  width: 100% !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card__media-wrap--gallery .swiper-wrapper,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card__media-wrap--gallery .swiper-slide,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card__media-wrap--gallery .swiper-slide > a {
  height: 100% !important;
  min-height: 0 !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post:not(.index__post_curator-advice):not(.index__post_full):not(.index__post_feed-banner) > .card.user-slide:not(.card__video):not(.index__events_article) > .card__media-wrap--gallery .card-img {
  height: 100% !important;
  max-height: none !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide:not(.card__video):not(.index__events_article) > .card-desc,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide:not(.card__video):not(.index__events_article) > .card-likes,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide:not(.card__video):not(.index__events_article) > .card-user,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide:not(.card__video):not(.index__events_article) > .card-stars__wrapper {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide:not(.card__video):not(.index__events_article) > .card-desc {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-height: none !important;
  min-height: 0 !important;
}

/* Video: media locked to 3:4 */
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card__media-wrap,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card-img-wrap {
  aspect-ratio: 3 / 4 !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card__media-wrap img,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card__media-wrap video,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card-img-wrap img,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card-img-wrap video,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video .card-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card-desc,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card-likes,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card-user {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
}

/* Same white gap as the index feed: rating and activity sit under the video, not on it. */
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post > .card.user-slide.card__video > .card-stars__wrapper {
  flex: 0 0 auto !important;
  margin: 12px 0 10px !important;
  padding: 0 12px !important;
  max-height: none !important;
  overflow: visible !important;
  background: #fff !important;
  position: relative !important;
  z-index: 2 !important;
}

/* Curator advice: same height as the post row */
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post.index__post_curator-advice {
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
}

.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
.tabs__content_right--entity-page .tabs__content_pet[data-target="last"] > .index__posts > .index__post.index__post_curator-advice > .card.card__advice.card__advice_has-link {
  --advice-card-min-h: 0 !important;
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}
