/**
 * Index feed «Лента» — tablet 768–1199.98 only.
 *
 * Culprit: mobile-card-fixes BODY_END locks .index__post > .card at 446px
 * while photo/video media is forced to 3:4 (~600px) → text/likes/gift clipped.
 * Earlier last-tall / photo-match / equal-tablet lose the cascade order fight.
 *
 * Injected late via cotinder-feed-tablet-card-unlock.js (after mobile-card-fixes).
 * PC ≥1200 and phone ≤767.98 untouched. Does not edit custom.css /
 * mobile-card-fixes / footer.php.
 *
 * Portrait void fix: cards hug content (align start). Dense 2-col
 * (feed-pc-columns) backfills the half-slot beside the first post so the
 * next user post sits there — not a white hole from stretch/610px floors.
 * Marker: feedtabunlock20261007b
 */

@media (min-width: 768px) and (max-width: 1199.98px) {
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts,
  html body .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts {
    align-items: start !important;
  }

  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post:not(.index__post_full):not(.index__post_be-part):not(.index__post_curator-advice),
  html body .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post:not(.index__post_full):not(.index__post_be-part):not(.index__post_curator-advice) {
    display: flex !important;
    flex-direction: column !important;
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  /* Beat mobile-card-fixes .index__post > .card { height:446 } — hug content */
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card:not(.card__advice):not(.card__video):not(#post):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card),
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post:not(.index__post_feed-banner):not(.index__post_curator-advice):not(.index__post_full) > .card.user-slide,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post:not(.index__post_feed-banner):not(.index__post_curator-advice):not(.index__post_full) > .card.user-slide.card__video,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    align-self: start !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* 3:4 media; no flex-grow white slab under short captions */
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide:not(.card__video):not(.cotinder-lucky-wheel) > .card__media-wrap,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide:not(.card__video):not(.cotinder-lucky-wheel) > .card-img-wrap,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide:not(.card__video):not(.cotinder-lucky-wheel) > a.card-img-wrap,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide.card__video > .card__media-wrap {
    display: block !important;
    position: relative !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 0 10px !important;
    aspect-ratio: 3 / 4 !important;
    overflow: hidden !important;
  }

  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide:not(.card__video) > .card__media-wrap img.card-img,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide:not(.card__video) > .card-img-wrap img.card-img,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide:not(.card__video) > a.card-img-wrap img.card-img,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide:not(.card__video) .card__gallery-swiper img.card-img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    aspect-ratio: auto !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide.card__video video,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide.card__video .bg-video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide:not(.index__community-card) > .card-desc {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    /* Same text block height so short/long captions don't open a white pad */
    min-height: calc(17px * 3) !important;
    max-height: calc(17px * 3) !important;
    line-height: 17px !important;
    flex: 0 0 auto !important;
  }

  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide > .card-stars__wrapper,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide > .card-likes,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide > .card__buttons,
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide > .cotinder-feed-gift {
    flex: 0 0 auto !important;
    overflow: visible !important;
    max-height: none !important;
  }

  /* Gift + views must not be clipped by the old 34px tablet gift lock */
  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide > .cotinder-feed-gift:has(> .cotinder-views) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) {
    display: flex !important;
    flex-direction: column !important;
    align-self: start !important;
    min-height: 0 !important;
  }

  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full) {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full) > img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
  }
}
