/* Folder Gallery — front end
 * Per-gallery values come from CSS variables set on .fgal-gallery:
 * --fgal-columns, --fgal-mobile-columns, --fgal-gap, --fgal-radius, --fgal-ratio
 * Override any of these in your theme to restyle without editing the plugin. */

.fgal-gallery {
  display: grid;
  grid-template-columns: repeat(var(--fgal-columns, 4), minmax(0, 1fr));
  gap: var(--fgal-gap, 15px);
}

.fgal-gallery .fgal-item {
  display: block;
  overflow: hidden;
  border-radius: var(--fgal-radius, 4px);
  line-height: 0;
  aspect-ratio: var(--fgal-ratio, 1 / 1);
}

.fgal-gallery .fgal-item img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform .25s ease;
}

.fgal-gallery.fgal-no-crop .fgal-item img { object-fit: contain; }
.fgal-gallery .fgal-item:hover img,
.fgal-gallery .fgal-item:focus-visible img { transform: scale(1.04); }
.fgal-gallery.fgal-no-zoom .fgal-item:hover img,
.fgal-gallery.fgal-no-zoom .fgal-item:focus-visible img { transform: none; }

@media (max-width: 700px) {
  .fgal-gallery { grid-template-columns: repeat(var(--fgal-mobile-columns, 2), minmax(0, 1fr)); }
}

/* Load more */
.fgal-load-more-wrap { text-align: center; margin-top: 20px; }
.fgal-load-more-wrap.is-hidden { display: none; }
.fgal-load-more {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  font-size: 15px;
}
.fgal-load-more:hover { opacity: .85; }
.fgal-load-more[disabled] { cursor: wait; opacity: .6; }

/* Lightbox */
.fgal-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, .92);
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.fgal-lightbox.is-open { display: flex; }
.fgal-lightbox-content { max-width: 90vw; max-height: 90vh; text-align: center; }
.fgal-lightbox-content img { max-width: 90vw; max-height: 82vh; width: auto; height: auto; object-fit: contain; }
.fgal-counter { color: #fff; margin-top: 10px; font-size: 14px; }

.fgal-close, .fgal-prev, .fgal-next {
  position: absolute;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 30px !important;
  line-height: 1;
  padding: 10px !important;
  box-shadow: none;
}
.fgal-close { top: 10px; right: 20px; font-size: 44px; }
.fgal-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.fgal-next { right: 20px; top: 50%; transform: translateY(-50%); }
.fgal-close:hover, .fgal-prev:hover, .fgal-next:hover { opacity: .7; background: transparent; }

@media (max-width: 700px) {
  .fgal-lightbox { padding: 15px; }
  .fgal-prev { left: 2px; }
  .fgal-next { right: 2px; }
}

.fgal-no-scroll, .fgal-no-scroll body { overflow: hidden; }

.fgal-admin-notice { padding: 8px 12px; border-left: 4px solid #d63638; background: #fcf0f1; }
