/**
 * Feed mini-banner height / stacking fix (feedbanner20260810b).
 *
 * Culprit on tablet 768–1199: equal-tablet sets a.card { position:absolute; inset:0 }
 * while the parent .index__post_feed-banner has no in-flow content. Alone in a row
 * the post collapses to height:0; the card (446px) overflows and paints under
 * .index__post_be-part («Примите участие…»).
 *
 * Also: mobile-card-fixes height:446px !important keeps the absolute card short when
 * the row stretches taller than 446 — image no longer matches neighbor cards.
 *
 * Fix: keep post min-height floor + in-flow flex card (relative, height 100%) so the
 * cell always reserves space and fills the stretched row. Higher specificity via
 * .tabs__content_active beats duplicate equal-tablet links in Bitrix merge.
 *
 * Scope: ONLY .cotinder-index-feed mini banners. PC ≥1200 unchanged.
 */

/* Tablet 768–1199 */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
    min-height: 446px !important;
    z-index: 2;
  }

  .tabs__content.tabs__content_active .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),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="canals"] .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;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: block !important;
    flex: 1 1 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 446px !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .tabs__content.tabs__content_active .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,
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full) > img,
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full) > img,
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="canals"] .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;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_be-part,
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_be-part,
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_be-part,
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_be-part {
    position: relative;
    z-index: 1;
  }
}

/* Phone / narrow: stack above be-part */
@media (max-width: 767.98px) {
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) {
    position: relative !important;
    z-index: 2;
  }

  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.index__post_be-part,
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_be-part,
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_be-part,
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_be-part {
    position: relative;
    z-index: 1;
  }
}

/* Phone ≤480 community/nko: floor aligns with community card min-height 525 */
@media (max-width: 480px) {
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) {
    min-height: 525px !important;
  }

  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="comunity"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full),
  .tabs__content.tabs__content_active .cotinder-index-feed[data-cotinder-feed-tab="nko"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full) {
    height: 100% !important;
    min-height: 525px !important;
  }
}
