﻿/**
 * Index feed tab «Каналы питомцев» (?cotinder_tab=canals) — 820–912 (same as 820).
 *
 * Culprit: tablet .index__post > .card:not(...):not(#post) { height:446px !important }
 * (:not(#post) = ID specificity) + square photos (~335px) → overflow:hidden clips
 * avatar row, 3-line анонс, likes/actions. Advice/banners stay short next to clipped pets.
 *
 * Fix: natural-height pet cards + 3-line .card-desc; curator advice + mini-banners
 * stretch to row. 768 / other tabs / PC / phone untouched.
 * Does not edit custom.css / custom.min.css / mobile-card-fixes / footer.php.
 */

@media (min-width: 820px) and (max-width: 912.98px) {
  .tabs__content[data-target="canals"] .index__posts,
  .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts {
    align-items: stretch !important;
  }

  .tabs__content[data-target="canals"] .index__posts > .index__post:not(.index__post_full):not(.index__post_be-part),
  .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post:not(.index__post_full):not(.index__post_be-part) {
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
  }

  /* Beat 446px lock (:not(#post) ID specificity) — grow with square media + 3-line анонс */
  .tabs__content[data-target="canals"] .index__post > .card.user-slide:not(.card__advice):not(.card__video):not(#post):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card),
  .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__post > .card.user-slide:not(.card__advice):not(.card__video):not(#post):not(.index__events_event):not(.index__events_article):not(.index__collaborations_card):not(.index__community-card),
  .tabs__content[data-target="canals"] .index__posts > .index__post:not(.index__post_feed-banner):not(.index__post_curator-advice):not(.index__post_full) > .card.user-slide:not(.card__video):not(#post),
  .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post:not(.index__post_feed-banner):not(.index__post_curator-advice):not(.index__post_full) > .card.user-slide:not(.card__video):not(#post) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
  }

  .tabs__content[data-target="canals"] .index__posts > .index__post:not(.index__post_feed-banner):not(.index__post_curator-advice):not(.index__post_full) > .card.user-slide.card__video:not(#post),
  .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post:not(.index__post_feed-banner):not(.index__post_curator-advice):not(.index__post_full) > .card.user-slide.card__video:not(#post) {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* 3-line анонс (preview) — release 2-line / 34–51px caps */
  .tabs__content[data-target="canals"] .index__posts > .index__post > .card.user-slide:not(.index__community-card):not(#post) > .card-desc,
  .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post > .card.user-slide:not(.index__community-card):not(#post) > .card-desc {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 51px !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    margin-top: 0 !important;
    line-height: 17px !important;
  }

  /* «Советы куратора» — same row height as pet cards */
  .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_curator-advice,
  .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_curator-advice {
    align-self: stretch !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
  .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice.card__advice_has-link,
  .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice,
  .cotinder-index-feed[data-cotinder-feed-tab="canals"] .index__posts > .index__post.index__post_curator-advice > .card.card__advice.card__advice_has-link {
    --advice-card-min-h: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Mini-banner — stretch with row */
  .tabs__content.tabs__content_active[data-target="canals"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full),
  .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full),
  .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: 0 !important;
  }

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

  .tabs__content.tabs__content_active[data-target="canals"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full) > img,
  .tabs__content[data-target="canals"] .index__posts > .index__post.index__post_feed-banner:not(.index__post_full) > a.card.card__cotinder:not(.card__cotinder_full) > img,
  .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;
  }
}
