/* Galerie Dogon – Blätterkatalog-Viewer */

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

html, body { height: 100%; }
body {
  background: #0a0a0a;
  color: #fff;
  font-family: "Inter", sans-serif;
  overflow: hidden;
}

#viewer {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* ---------- Kopfleiste ---------- */

.vw-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid #222;
  z-index: 10;
}
.vw-back {
  color: #ccc;
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  transition: 0.3s color;
}
.vw-back:hover { color: #f09800; }
.vw-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vw-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vw-pageinfo {
  font-size: 14px;
  color: #999;
  margin-right: 8px;
  white-space: nowrap;
}
.vw-tools button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid #333;
  border-radius: 6px;
  color: #ccc;
  cursor: pointer;
  transition: 0.3s all;
}
.vw-tools button:hover { color: #f09800; border-color: #f09800; }

/* ---------- Bühne ---------- */

.vw-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden; /* Buch darf nie über Kopfzeile/Thumbnails malen */
  background: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 70%);
}

#flipbook { margin: 0 auto; }
#flipbook .page {
  background: #fff;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}
#flipbook .page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.vw-prev, .vw-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  color: #fff;
  font-size: 46px;
  line-height: 1;
  padding: 16px 12px;
  cursor: pointer;
  transition: 0.3s color;
  border-radius: 6px;
}
.vw-prev { left: 10px; }
.vw-next { right: 10px; }
.vw-prev:hover, .vw-next:hover { color: #f09800; }
.vw-prev[disabled], .vw-next[disabled] { opacity: 0.25; cursor: default; }

.vw-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #888;
  font-size: 15px;
  background: #0a0a0a;
  z-index: 4;
  transition: opacity 0.4s;
}
.vw-loading.done { opacity: 0; pointer-events: none; }

/* ---------- Thumbnail-Leiste ---------- */

.vw-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.85);
  border-top: 1px solid #222;
  scrollbar-width: thin;
  scrollbar-color: #444 #000;
}
.vw-thumbs button {
  flex: 0 0 auto;
  position: relative;
  background: #1c1c1c;
  border: 2px solid #333;
  border-radius: 3px;
  padding: 0;
  cursor: pointer;
  height: 84px;
  overflow: hidden;
  transition: 0.25s border-color;
}
.vw-thumbs button img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.6;
  transition: 0.25s opacity;
}
.vw-thumbs button:hover img { opacity: 1; }
.vw-thumbs button.active { border-color: #f09800; }
.vw-thumbs button.active img { opacity: 1; }
.vw-thumbs button span {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #ddd;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ---------- Zoom-Ansicht ---------- */

.vw-zoomlayer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.96);
}
.vw-zoomscroll {
  height: 100%;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 30px 10px;
}
.vw-zoomscroll img {
  max-width: none;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
}
.vw-zoomclose {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 101;
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}
.vw-zoomclose:hover { color: #f09800; }

@media (max-width: 700px) {
  .vw-bar { gap: 10px; padding: 8px 12px; }
  .vw-title { font-size: 14px; }
  .vw-pageinfo { display: none; }
  .vw-prev, .vw-next { font-size: 34px; padding: 10px 6px; }
  .vw-thumbs button { height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
