/* ================================
   MASONRY LAYOUT (CSS columns)
   ================================ */

.flex-images {
  width: 100%;
  max-width: 100%;
  column-count: 3;
  column-gap: 16px;
  padding: 10px;
  box-sizing: border-box;
  position: relative;
}

/* Elk item los van inline widths/heights & floats */
.flex-images .item {
  display: inline-block;
  width: 100% !important;
  height: auto !important;
  margin: 0 0 16px !important;

  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;

  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  padding: 6px; /* zorgt dat afbeelding 'in het vak' staat */
  box-shadow: 0px 0px 8px #7b7b7b;
}

/* ================================
   AFBEELDINGEN
   ================================ */

.flex-images .item img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  border-radius: 8px;
  box-sizing: border-box;
}

/* ================================
   CAPTION (sponsor link / overlay)
   ================================ */

.flex-images .item .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 6px 10px;
  font-size: 14px;
  color: #fff;
  background: rgba(0,0,0,0.7);

  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.26s ease;
  box-sizing: border-box;
}

.flex-images .item:hover .caption {
  transform: scaleY(1);
}

a.lightcase {
  display: block;
  width: 100%;
}

a.sponsor {
  color: #fff;
  text-decoration: none;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1200px) {
  .flex-images {
    column-count: 3;
  }
}

@media (max-width: 991px) {
  .flex-images {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .flex-images {
    column-count: 1;
  }
}

/* ================================
   LIGHTCASE MOBILE LIGGEND
   ================================ */

@media (max-width: 991px) and (orientation: landscape) {
  #lightcase-info {
    position: absolute;
    background: none;
    width: 100%;
    bottom: 0;
    padding: 0 !important;
    z-index: 1;
  }

  #lightcase-info #lightcase-caption {
    color: #fff !important;
    font-size: 20px !important;
    background: #0009;
    padding: 0 10px !important;
  }
}

/* Kei Media: 4 kolommen op grotere schermen */
@media (min-width: 992px) {
  .flex-images { column-count: 4; }
}

/* Kei Media: vast raster 2:1 in plaats van masonry */
.flex-images { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 991px) { .flex-images { grid-template-columns: repeat(2, 1fr); } }
.flex-images .item { margin: 0 !important; aspect-ratio: 2 / 1; display: flex !important; align-items: center; justify-content: center; padding: 10px; transition: transform .15s ease, box-shadow .15s ease; }
.flex-images .item a.mg-link { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.flex-images .item img { width: 100% !important; height: 100% !important; object-fit: contain; }
.flex-images .item:has(a.mg-link):hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.28); }
