/* Folder-based photo gallery: /api/gallery -> tabs (category) > albums > thumbnail grid. */

.lss-gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3em 1.5em 4em;
}

.lss-gallery__intro {
  text-align: center;
  margin-bottom: 1.5em;
}

.lss-gallery__title {
  margin: 0 0 0.25em;
}

.lss-gallery__subtitle {
  color: #76767f;
  font-size: 1.05rem;
  margin: 0;
}

.lss-gallery__status {
  text-align: center;
  color: #76767f;
  padding: 2em 0;
}

.lss-gallery__status[data-state="error"] {
  color: #ec1e22;
}

.lss-gallery__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6em;
  margin: 0 0 2.5em;
}

.lss-gallery__tab {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: #f6f7fd;
  color: #26262c;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.6em 1.4em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lss-gallery__tab:hover {
  border-color: #243673;
}

.lss-gallery__tab[aria-selected="true"] {
  background: #243673;
  color: #fff;
}

.lss-gallery__album {
  margin-bottom: 3em;
  border-radius: 12px;
  transition: box-shadow 0.4s ease, background-color 0.4s ease;
}

.lss-gallery__album--highlight {
  box-shadow: 0 0 0 3px #ec1e22;
  background-color: #fff5f5;
  padding: 1em;
  margin-inline: -1em;
}

@media (prefers-reduced-motion: reduce) {
  .lss-gallery__album {
    transition: none;
  }
}

.lss-gallery__album-title {
  font-size: 1.4rem;
  border-left: 5px solid #ec1e22;
  padding-left: 0.6em;
  margin-bottom: 1em;
}

.lss-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75em;
}

.lss-gallery__thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: #f6f7fd;
}

.lss-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.lss-gallery__thumb:hover img,
.lss-gallery__thumb:focus-visible img {
  transform: scale(1.06);
}

.lss-gallery__thumb:focus-visible {
  outline: 3px solid #243673;
  outline-offset: 2px;
}

/* Lightbox */

.lss-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 15, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lss-lightbox[hidden] {
  display: none;
}

.lss-lightbox__figure {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lss-lightbox__image {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lss-lightbox__caption {
  color: #f6f7fd;
  text-align: center;
  margin-top: 0.75em;
  font-size: 0.9rem;
  opacity: 0.85;
}

.lss-lightbox__close,
.lss-lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lss-lightbox__close:hover,
.lss-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lss-lightbox__close {
  top: 1.25em;
  right: 1.25em;
  width: 2.5em;
  height: 2.5em;
  font-size: 1.5rem;
  line-height: 1;
}

.lss-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 3em;
  height: 3em;
  font-size: 1.1rem;
}

.lss-lightbox__nav--prev {
  left: 1em;
}

.lss-lightbox__nav--next {
  right: 1em;
}

@media (max-width: 600px) {
  .lss-gallery {
    padding: 2em 1em 3em;
  }
  .lss-gallery__grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5em;
  }
  .lss-lightbox__nav {
    width: 2.4em;
    height: 2.4em;
  }
}
