/**
 * Layout 23 — "Lưới 4 cột"
 *
 * A plain wrapping grid. The cards, spacing and heading all come from the
 * shared settings, so this file only has to fix the picture height — without it
 * a row of four would be as tall as its tallest photo.
 */

.saigonchess4 .saigonchess4__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gutter-width, 32px);
  margin: 0;
}

.saigonchess4 .jacl-row.small-gutters.saigonchess4__grid { gap: var(--gutter-small, 3px); }
.saigonchess4 .jacl-row.large-gutters.saigonchess4__grid { gap: var(--gutter-large, 36px); }
.saigonchess4 .jacl-row.extra-large-gutters.saigonchess4__grid { gap: var(--gutter-extra-large, 36px); }
.saigonchess4 .jacl-row.no-gutters.saigonchess4__grid { gap: 0; }

.saigonchess4 .saigonchess4__grid > [class*="jacl-col"] {
  width: auto;
  max-width: none;
  flex: none;
  padding: 0;
  min-width: 0;
}

/* Every card the same height, pictures cropped rather than letterboxed. */
.saigonchess4 .jacl-item,
.saigonchess4 .jacl-item__inner {
  height: 100%;
}

.saigonchess4 .jacl-item__media,
.saigonchess4 .jacl-item__media a {
  aspect-ratio: 4 / 3;
  height: auto;
  padding-bottom: 0;
}

.saigonchess4 .jacl-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Roughly a quarter of the content width, so the same sizes as the bottom row
   of the three-column layout. */
.saigonchess4 .jacl-item__title {
  font-size: .95rem;
  line-height: 1.3;
}

.saigonchess4 .jacl-item__title a {
  -webkit-line-clamp: 2;
}

.saigonchess4 .jacl-item__body {
  padding: 14px 14px 12px;
}

.saigonchess4 .jacl-item__meta ul {
  font-size: 11px;
}

/* Two across once it gets tight. The switch follows the width of the block
   itself, not the window, because the module is often placed in one column of a
   grid layout — there it can be narrow on a wide screen. */
.saigonchess4 {
  container-type: inline-size;
}

/* Two classes deep, same as the four-column rule above — a container query
   does not raise specificity, so a one-class selector here would lose. */
@container (max-width: 760px) {
  .saigonchess4 .saigonchess4__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Same rule for browsers without container queries. */
@supports not (container-type: inline-size) {
  @media (max-width: 991px) {
    .saigonchess4 .saigonchess4__grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
}
