/*
 * Shared styles for Campus CMS page bodies, loaded by campus/_page-base.php.
 * The duplicated <style> blocks inside page bodies still exist and are kept
 * for now (they will be removed later, page by page).
 */

.image-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.image-row img {
  flex: 1;
  min-width: 200px;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.image-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  margin: 8px 0 14px;
  align-items: stretch;
}
.image-row img {
  display: block;
  min-width: 0;
  object-fit: cover;
  object-position: center;
  margin: 0 !important;
}

/* 1 image */
.image-row img:first-child:last-child {
  width: 100% !important;
  height: 680px !important;
}

/* 2 images */
.image-row img:first-child:nth-last-child(2),
.image-row img:nth-child(2):last-child {
  width: calc(50% - 6px) !important;
  height: 353px !important;
}

/* 3 images */
.image-row img:first-child:nth-last-child(3),
.image-row img:nth-child(2):nth-last-child(2),
.image-row img:nth-child(3):last-child {
  flex: 1 1 0;
  width: 0 !important;
  height: 265px !important;
}

/* 4 images */
.image-row img:first-child:nth-last-child(4),
.image-row img:nth-child(2):nth-last-child(3),
.image-row img:nth-child(3):nth-last-child(2),
.image-row img:nth-child(4):last-child {
  width: calc(25% - 9px) !important;
  height: 243px !important;
}

@media (max-width: 768px) {
  .image-row {
    flex-direction: column;
    gap: 10px;
  }
  .image-row img:first-child:last-child {
    width: 100% !important;
    height: auto !important;
  }
  .image-row img:first-child:nth-last-child(2),
  .image-row img:nth-child(2):last-child,
  .image-row img:first-child:nth-last-child(3),
  .image-row img:nth-child(2):nth-last-child(2),
  .image-row img:nth-child(3):last-child,
  .image-row img:first-child:nth-last-child(4),
  .image-row img:nth-child(2):nth-last-child(3),
  .image-row img:nth-child(3):nth-last-child(2),
  .image-row img:nth-child(4):last-child {
    width: 100% !important;
    height: 260px !important;
  }
}
