/* BAKIPA FITNESS - Desktop course gallery density refinement v5.
   Research-backed optical balance for the homepage course collection.
   Scope: desktop/tablet-landscape course gallery only. Mobile, copy, image
   bytes, typography, actions and business content remain unchanged. */

:root { --nl-refinement-v5: 1; }

/* Course cards are peer offerings. On layouts wide enough for two columns,
   use equal visual weight, a bounded gallery measure and a wider rich-media
   slot. This reduces the photograph's visual mass without shrinking the
   accepted information hierarchy below it. */
@media (min-width: 901px) {
  body:has(> main > .hero) section:has(.course-list) .section-head,
  body:has(> main > .hero) .course-list {
    width: min(100%, 1160px);
    margin-inline: auto;
  }

  body:has(> main > .hero) .course-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1rem, 1.8vw, 1.5rem);
  }

  /* Override the older 12-column nth-child layout for every peer card, not
     only the original four. This keeps odd/future course counts in the same
     two-column gallery at the 901-1120px compatibility range as well. */
  body:has(> main > .hero) .course-item:nth-child(n) {
    grid-column: auto;
  }

  body:has(> main > .hero) .course-item .cover {
    width: 100%;
    min-height: 0;
    max-height: 340px;
    aspect-ratio: 16 / 9;
  }

  body:has(> main > .hero) .course-item .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
