/* =============================================
   CMI Ostafrikanische Region – Gallery CSS
   Dark photo-gallery style (standalone pages)
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #1a1a1a;
  color: #ffffff;
  font-family: Arial, sans-serif;
  min-height: 100vh;
}

/* ── Gallery Header ───────────────────────── */

.gallery-header {
  background: #1a1a1a;
  padding: 16px 24px;
  border-bottom: 3px solid #e87722;
}

.gallery-header h1 {
  font-size: 1.3rem;
  color: #ffffff;
  font-family: Arial, sans-serif;
}

.back-link {
  color: #e87722;
  font-size: 0.85rem;
  text-decoration: none;
  display: block;
  margin-top: 6px;
}

.back-link:hover {
  text-decoration: underline;
}

/* ── Thumbnail Grid ───────────────────────── */

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 24px;
}

.thumb-grid a {
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: #2a2a2a;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.thumb-grid a:hover {
  border-color: #e87722;
}

.thumb-grid img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

/* ── Gallery Footer ───────────────────────── */

.gallery-footer {
  text-align: center;
  padding: 20px;
  color: #888888;
  font-size: 0.82rem;
}

.gallery-footer a {
  color: #e87722;
}

/* ── Lightbox ─────────────────────────────── */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#lightbox.open {
  display: flex;
}

#lightbox img {
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border: 2px solid #333;
  border-radius: 3px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8);
}

.lb-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: 2px solid #555;
  border-radius: 50%;
  color: #fff;
  font-size: 1.4rem;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}

.lb-btn:hover {
  background: #e87722;
  border-color: #e87722;
}

#lb-prev { left: 12px; }
#lb-next { right: 12px; }

#lb-close {
  position: fixed;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.5);
  border: 2px solid #555;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

#lb-close:hover {
  background: #c0392b;
  border-color: #c0392b;
}

#lb-counter {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #aaa;
  font-size: 0.85rem;
  background: rgba(0,0,0,0.6);
  padding: 4px 12px;
  border-radius: 12px;
}
