/* PETIKA — компактная сетка статей в категориях */

/* Работает только на внутренних страницах, где DLE выводит несколько shortstory-карточек. */
@supports selector(.content-frame:has(> .post-card)) {
  .inner-page .content-frame:has(> .post-card) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
  }

  .inner-page .content-frame:has(> .post-card) > .post-card {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
  }

  .inner-page .content-frame:has(> .post-card) > .post-card .post-cover {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
  }

  .inner-page .content-frame:has(> .post-card) > .post-card .post-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 14px 15px 15px;
  }

  .inner-page .content-frame:has(> .post-card) > .post-card .post-meta {
    font-size: 11px;
  }

  .inner-page .content-frame:has(> .post-card) > .post-card .post-body h3 {
    font-size: 16px;
    line-height: 1.28;
    margin: 8px 0 7px;
  }

  .inner-page .content-frame:has(> .post-card) > .post-card .post-excerpt {
    font-size: 12px;
    line-height: 1.5;
    max-height: 55px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .inner-page .content-frame:has(> .post-card) > .post-card .post-foot {
    margin-top: auto;
    padding-top: 12px;
    font-size: 11px;
  }

  /* Служебные элементы DLE должны занимать всю ширину сетки. */
  .inner-page .content-frame:has(> .post-card) > .pagination,
  .inner-page .content-frame:has(> .post-card) > .navigation,
  .inner-page .content-frame:has(> .post-card) > .dle-info,
  .inner-page .content-frame:has(> .post-card) > [class*="navigation"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) {
  @supports selector(.content-frame:has(> .post-card)) {
    .inner-page .content-frame:has(> .post-card) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }
  }
}

@media (max-width: 700px) {
  @supports selector(.content-frame:has(> .post-card)) {
    .inner-page .content-frame:has(> .post-card) {
      grid-template-columns: 1fr;
      gap: 14px;
    }

    .inner-page .content-frame:has(> .post-card) > .post-card .post-cover {
      aspect-ratio: 16 / 9 !important;
    }
  }
}
