/* Gallery page */
.rm-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
}
@media (min-width: 576px) {
  .rm-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
}
@media (min-width: 992px) {
  .rm-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

.rm-gallery-item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: #fff;
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  cursor: zoom-in;
  transition: transform .2s ease, box-shadow .2s ease;
}
.rm-gallery-item:hover,
.rm-gallery-item:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
}
.rm-gallery-item:focus-visible { outline: 3px solid #F08143; outline-offset: 2px; }

/* contain: the whole picture is visible, nothing important is cropped */
.rm-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rm-gallery-empty {
  max-width: 480px;
  margin: 2rem auto;
  text-align: center;
}
.rm-gallery-empty i { font-size: 3rem; color: #F08143; }

/* Lightbox */
.rm-lightbox .modal-content { background: rgba(0, 0, 0, .92); border: 0; }
.rm-lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2.5rem 3rem;
}
.rm-lightbox-stage img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.rm-lightbox-close { position: absolute; top: .75rem; right: .75rem; z-index: 2; }
.rm-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
}
.rm-lightbox-nav:hover { background: rgba(255, 255, 255, .35); }
.rm-lightbox-prev { left: .5rem; }
.rm-lightbox-next { right: .5rem; }
.rm-lightbox-count { position: absolute; bottom: .5rem; left: 0; right: 0; text-align: center; color: #ddd; font-size: .85rem; }

/* Admin */
.rm-gallery-admin-thumb { aspect-ratio: 4 / 3; background: #f3f4f6; border-radius: .5rem; overflow: hidden; }
.rm-gallery-admin-thumb img { width: 100%; height: 100%; object-fit: contain; }
