/**
 * /posts/{id}/ (.post-public-page) PC ≥1200:
 * show rating, post text, like/comment/share; keep the comment in the card.
 *
 * Culprits (custom.min.css, not in compiled .post-public-page overrides):
 * 1) .post__wrapper { max-height:730px; overflow:hidden } clips the right column
 *    and, with #post-comments-* scrollIntoView, sends text/rating/buttons off-screen.
 * 2) .delete-alert { transform:translateY(500px) } on #post (overflow:visible)
 *    paints «Вы действительно хотите удалить…» over/beside the card.
 *
 * Phone/tablet: wrapper already auto in custom.css max-width 1199.98px.
 * Does not edit custom.css / custom.min.css / mobile-card-fixes / footer.php.
 * Marker: postpublicpc20261129b
 *
 * Photo (incl. multi-swiper) used fixed 730px .post__img from custom.css.
 * At 1200–1366 that crushed .post__text (~390px) and clipped Сохранить/tags.
 */

/* Closed delete overlay leaks on this page at every width (#post overflow:visible). */
.post-public-page #post.card > .delete-alert:not(.delete-alert__active),
.post-public-page #post.card > .cotinder-delete-alert:not(.delete-alert__active),
.post-public-page #post.card > .delete-alert[aria-hidden="true"],
.post-public-page #post.card > .cotinder-delete-alert[aria-hidden="true"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.post-public-page #post.card > .delete-alert.delete-alert__active,
.post-public-page #post.card > .cotinder-delete-alert.delete-alert__active,
.post-public-page #post.card > .delete-alert[aria-hidden="false"],
.post-public-page #post.card > .cotinder-delete-alert[aria-hidden="false"] {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 12 !important;
  transform: translateY(0) !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  /* Tall public card: keep confirm next to the trash icon, not at the footer. */
  top: 52px !important;
  bottom: auto !important;
  border-radius: 16px !important;
}

/* «Жалоба» must sit under edit/delete, not on top of the trash icon. */
.post-public-page #post.card > .card__owner-actions ~ .entity-page-report,
.post-public-page #post.card > .card__owner-actions + .entity-page-report,
.post-public-page #post.js-cotinder-post-modal > .card__owner-actions ~ .entity-page-report {
  top: 48px !important;
  right: 10px !important;
  z-index: 5 !important;
}

@media (max-width: 1199.98px) {
  .post-public-page #post.card > .card__owner-actions ~ .entity-page-report,
  .post-public-page #post.card > .card__owner-actions + .entity-page-report,
  .post-public-page #post.js-cotinder-post-modal > .card__owner-actions ~ .entity-page-report {
    top: 66px !important;
  }

  .post-public-page #post .post__img:not(:has(.post__video)) {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    max-width: min(100%, 548px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .post-public-page #post .post__img:not(:has(.post__video)) .post__swiper,
  .post-public-page #post .post__img:not(:has(.post__video)) .swiper-wrapper,
  .post-public-page #post .post__img:not(:has(.post__video)) .swiper-slide {
    height: 100% !important;
  }

  .post-public-page #post .post__img:not(:has(.post__video)) img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
  }
}

@media (min-width: 1200px) {
  .post-public-page #post.card,
  .post-public-page #post.card.user-slide {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .post-public-page #post .post__wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    align-items: flex-start !important;
  }

  /* Фото: квадрат 1:1 как в ленте; видео — отдельно 3:4 ниже. */
  .post-public-page #post .post__img:not(:has(.post__video)) {
    align-self: flex-start !important;
    flex: 0 0 auto !important;
    aspect-ratio: 1 / 1 !important;
    width: min(560px, 46vw, calc(100% - 400px)) !important;
    max-width: min(560px, 46vw, calc(100% - 400px)) !important;
    height: auto !important;
    max-height: min(560px, 46vw, calc(100vh - 160px)) !important;
    overflow: hidden !important;
    background: #f3f0eb;
  }

  .post-public-page #post .post__img:not(:has(.post__video)) .post__swiper,
  .post-public-page #post .post__img:not(:has(.post__video)) .swiper-wrapper,
  .post-public-page #post .post__img:not(:has(.post__video)) .swiper-slide {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
  }

  .post-public-page #post .post__img:not(:has(.post__video)) img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
  }

  /* Same 3:4 frame as the Fancybox detail. Absolute still/video need explicit width. */
  .post-public-page #post .post__img:has(.post__video) {
    align-self: flex-start !important;
    flex: 0 0 auto !important;
    aspect-ratio: 3 / 4 !important;
    width: min(548px, 42vw) !important;
    max-width: min(548px, 42vw) !important;
    height: auto !important;
    max-height: min(730px, calc(100vh - 120px)) !important;
    background: #ececec;
  }

  .post-public-page #post .post__img:has(.post__video) .post__swiper,
  .post-public-page #post .post__img:has(.post__video) .swiper-wrapper,
  .post-public-page #post .post__img:has(.post__video) .swiper-slide {
    width: 100% !important;
    height: 100% !important;
  }

  .post-public-page #post .post__img:has(.post__video) .post__video,
  .post-public-page #post .post__img:has(.post__video) .cotinder-video-still {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
  }

  .post-public-page #post .post__text {
    flex: 1 1 360px !important;
    min-width: 360px !important;
    max-width: 566px !important;
    width: auto !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  .post-public-page #post .post__text_wrapper {
    overflow: visible !important;
    height: auto !important;
  }

  .post-public-page #post .post__text_top,
  .post-public-page #post .post__text_text,
  .post-public-page #post .post__text_bottom,
  .post-public-page #post .post__text_comment,
  .post-public-page #post .post__add {
    visibility: visible !important;
    opacity: 1 !important;
  }

  .post-public-page #post .comment--post {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .post-public-page #post .comment__text {
    max-width: 100% !important;
  }

  /* Hash #post-comments-* keeps author/rating/text above the comment in view. */
  .post-public-page #post .post__text_comment[id^="post-comments-"] {
    scroll-margin-top: 240px;
  }
}

.post-public-page .post__page-title {
  margin: 0 0 12px;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  font-weight: 700;
  line-height: 1.35;
  color: #1a1a1a;
}

.post-public-page #post .post__wrapper {
  font-size: 14px;
  line-height: 17px;
}

.post-public-page #post .post__text_text,
.post-public-page #post .post__text_text p,
.post-public-page #post .post__text_text li {
  font-size: 14px !important;
  line-height: 1.35 !important;
  font-weight: 400 !important;
}

.post-public-page #post .post__text_text h1 {
  font-size: 1.15rem !important;
  line-height: 1.3 !important;
}

.post-public-page #post .post__text_text h2 {
  font-size: 1.05rem !important;
  line-height: 1.3 !important;
}
