/* gallery-variants.css
   Instagram-style (cropped squares) and Masonry-style (natural aspect ratios)
   Minimal, dependency-free gallery layout variants.
*/

/* Reset small gap differences to align with global styles */
.gallery-variants {
  box-sizing: border-box;
}

/* Instagram-style (cropped squares)
   Constrain max columns for better balance: mobile 1, tablet 2, small-desktop 3, desktop 4.
*/
.gallery-instagram {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(1, 1fr);
}

/* responsive breaks */
@media (min-width: 600px) {
  .gallery-instagram { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .gallery-instagram { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  .gallery-instagram { grid-template-columns: repeat(4, 1fr); }
}

.gallery-instagram .gallery-item {
  aspect-ratio: 1/1;
  overflow: hidden;
  background: transparent;
  border-radius: 0;
  padding: 0; /* ensure no padding from global styles */
}
.gallery-instagram .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 180ms ease, filter 260ms ease, opacity 260ms ease;
}
.gallery-instagram .gallery-item:hover img {
  transform: scale(1.04);
}
/* Ensure inner wrapper fills the square (override global .img-wrap/bg/padding) */
.gallery-instagram .img-wrap {
  aspect-ratio: 1/1;
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  border-radius: 0;
  display: block;
}

/* Masonry-style (natural aspect ratios) */
.gallery-masonry {
  column-count: 1;
  column-gap: 8px;
}
@media (min-width: 600px) {
  .gallery-masonry { column-count: 2; }
}
@media (min-width: 1000px) {
  .gallery-masonry { column-count: 3; }
}
.gallery-masonry .gallery-item {
  break-inside: avoid;
  margin-bottom: 8px;
  display: block;
  width: 100%;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.gallery-masonry .gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  transition: transform 180ms ease;
}
.gallery-masonry .gallery-item:hover img {
  transform: scale(1.02);
}

/* Common, frameless gallery tweaks (applies to both variants) */
.gallery-item { background: transparent; border: none; padding: 0; }
.gallery-item figcaption { display: none; }

/* Lightbox controls (overlay arrows centered vertically) */
.lightbox .lb-prev,
.lightbox .lb-next,
.lightbox .lb-close {
  background: rgba(255,255,255,0.95);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(17,17,17,0.08);
}

/* Slightly larger arrows on desktop */
@media (min-width: 700px) {
  .lightbox .lb-prev, .lightbox .lb-next {
    padding: 0.6rem 0.8rem;
    font-size: 1.1rem;
  }
}

/* Small accessibility focus style */
.lightbox .lb-prev:focus, .lightbox .lb-next:focus, .lightbox .lb-close:focus {
  outline: 2px solid rgba(17,17,17,0.12);
  outline-offset: 2px;
}

/* Utility classes to hide/show variants (JS toggles these) */
.gallery-toggle {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.gallery-toggle button {
  background: transparent;
  border: 1px solid var(--muted-2);
  color: var(--muted);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}
.gallery-toggle button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Small spacing tweaks for pages */
.gallery-wrapper { margin-top: 1rem; }

/* Ensure Instagram variant overrides any global .gallery-item padding/background */
.gallery-instagram .gallery-item {
  padding: 0 !important;
  background: transparent !important;
}

/* Ensure masonry variant also unaffected by global gallery-item rules */
.gallery-masonry .gallery-item {
  padding: 0 !important;
  background: transparent !important;
}
