/********************** TOC & Lightbox Styles *************************/

/* Grid für TOC – steuert Spalten und Abstand über Variablen */
.ngg-gallery-toc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--ngg-min-col, 300px), 1fr));
  gap: var(--ngg-toc-gap, 0.5rem);
  padding: 0;
  margin: 1em 0;
  list-style: none;
}

/* Zeilen-Layout im TOC */
.ngg-gallery-toc-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Thumbs global drin – Anzeige via Klasse steuerbar */
.ngg-thumb {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 4px;
}

/* TOC Wrapper steuert Sichtbarkeit der Thumbs */
.ngg-show-thumbs-no .ngg-thumb { display: none; }
.ngg-show-thumbs-yes .ngg-thumb { display: inline-block; }

/* Links im TOC */
.ngg-gallery-toc-list a {
  text-decoration: none;
  color: inherit;
}

.ngg-title {
  color: var(--ngg-title-color, #ddd);
  transition: color 0.25s ease;
}

.ngg-toc-link:hover .ngg-title {
  color: var(--ngg-hover-color, #ff0000);
}

/* Toggle-Button */
.ngg-toggle-icon {
  cursor: pointer;
  background-color: #222;
  color: #fff;
  padding: 10px;
  font-size: 1.1rem;
  border-radius: 5px;
  margin-bottom: 10px;
  user-select: none;
}
.ngg-toggle-icon:hover { background-color: #444; }

.hidden { display: none !important; }

/* Lightbox Overlay + Box */
#ngg-modal-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background-color: var(--ngg-overlay, rgba(0,0,0,0.9));
  justify-content: center;
  align-items: center;
  overflow: auto;
  padding: 1rem;
}
#ngg-modal-overlay.active { display: flex; }

#ngg-modal-box {
  background: var(--ngg-modal-bg, #111);
  border-radius: 8px;
  padding: 1rem;
  max-width: 90vw;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  position: relative;
  color: #fff;
}

/* Close Button */
#ngg-modal-box .close-btn {
  position: absolute;
  top: .75rem;
  right: 1rem;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  z-index: 10000;
  background: none;
  border: none;
}

/* Galerie-Info (oberhalb vom Bild) */
.ngg-gallery-info {
  color: #fff;
  font-size: .95rem;
  margin-bottom: .5rem;
  align-self: flex-start;
  opacity: .85;
}

.ngg-image-wrapper img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
}

/* Titel & Beschreibung unter dem Bild */
.ngg-image-meta {
  overflow-y: auto;
  max-height: 25vh;
  max-width: 100%;
  text-align: center;
  width: 100%;
  padding: 0 .5rem;
}

.ngg-meta-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: .75rem 0 .25rem;
}

.ngg-meta-desc {
  font-size: 1rem;
  line-height: 1.4;
  color: #ccc;
  word-break: break-word;
}

/* Mobile */
@media (max-width: 600px) {
  #ngg-modal-box {
    max-width: 90vw;
    max-height: 90vh;
    padding: 1rem;
  }
  .ngg-image-wrapper img { max-height: 70vh; }
  .ngg-image-meta { max-height: 30vh; }
}
