/**
 * /pet-owners/ «Хозяева питомцев» list + index community owners cards.
 *
 * 1) Tabs strip must be full-width above filter+list (otherwise at ≤1199
 *    .index__tabs--site-feed sits in the flex row and crushes .index__post /
 *    img.card-img to ~10–30px).
 * 2) Card columns: ≥1024 → 3; 768–1023 → 2; <768 → 1.
 *
 * Does not edit custom.css / mobile-card-fixes / footer.php.
 * Scope: .pet layout with .index__tabs--site-feed + #cotinder-pet-owners-results
 * and body.page-index community tab posts that reuse the same list markup.
 */
/* ---- layout: tabs on their own row ---- */
.pet .tabs__content.tabs__content_layout:has(> .index__tabs--site-feed) {
  flex-wrap: wrap !important;
  align-items: flex-start;
}

.pet .tabs__content.tabs__content_layout > .index__tabs--site-feed {
  order: -1 !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.pet .tabs__content.tabs__content_layout:has(> .index__tabs--site-feed) > .tabs__content_right {
  min-width: 0;
  box-sizing: border-box;
}

/* Protect owner card photos from flex shrink — keep existing height rules */
.pet #cotinder-pet-owners-results .index__post .card-img,
.pet #cotinder-pet-owners-results .index__post img.card-img {
  width: 100% !important;
  max-width: 100% !important;
  object-fit: cover;
  object-position: center;
  display: block;
  flex-shrink: 0;
}

.pet #cotinder-pet-owners-results .index__post .card-img-wrap,
.pet #cotinder-pet-owners-results .index__post > a:has(> .card-img) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: block;
}

/* ---- columns (mirror feed: 3 @1024+/PC, 2 tablet, 1 phone) ---- */
@media (min-width: 1024px) {
  .pet #cotinder-pet-owners-results .index__posts {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
  }

  .pet #cotinder-pet-owners-results .index__posts > .index__post {
    width: calc((100% - 40px) / 3) !important;
    max-width: calc((100% - 40px) / 3) !important;
    flex: 0 0 calc((100% - 40px) / 3) !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  .pet #cotinder-pet-owners-results .index__posts > .index__post.index__post_full,
  .pet #cotinder-pet-owners-results .index__posts > .index__post.index__post_be-part {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  .pet #cotinder-pet-owners-results .index__posts {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
  }

  .pet #cotinder-pet-owners-results .index__posts > .index__post {
    width: calc((100% - 15px) / 2) !important;
    max-width: calc((100% - 15px) / 2) !important;
    flex: 0 0 calc((100% - 15px) / 2) !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  .pet #cotinder-pet-owners-results .index__posts > .index__post.index__post_full,
  .pet #cotinder-pet-owners-results .index__posts > .index__post.index__post_be-part {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
}

@media (max-width: 767.98px) {
  .pet #cotinder-pet-owners-results .index__posts {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: column !important;
  }

  .pet #cotinder-pet-owners-results .index__posts > .index__post {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
  }
}

/* ≤1199: after tabs take full row, content column must use remaining width */
@media (max-width: 1199.98px) {
  .pet .tabs__content.tabs__content_layout:has(> .index__tabs--site-feed) > .tabs__content_right {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
