/* ── Gallery pill pane ──────────────────────────────────────────────────── */

#pane-gallery {
  padding: 14px 16px 20px;
}

/* ── Thumbnail strip ────────────────────────────────────────────────────── */
.gallery-strip-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gallery-strip-overflow {
  flex: 1;
  overflow: hidden;
}

.gallery-strip {
  display: flex;
  gap: 6px;
  transition: transform 0.25s ease;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 82px;
  height: 82px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, border-color 0.15s;
}

.gallery-thumb:hover {
  opacity: 0.85;
  border-color: var(--accent);
}

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

.gallery-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
}

.gallery-thumb-empty {
  flex-shrink: 0;
  width: 82px;
  height: 82px;
  border-radius: 8px;
  background: var(--bg-card-inner);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 6px;
  line-height: 1.3;
}

.gallery-strip-prev,
.gallery-strip-next {
  background: var(--bg-pill);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  width: 26px;
  height: 82px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.gallery-strip-prev:hover,
.gallery-strip-next:hover {
  background: var(--bg-pill-hover);
}

.gallery-empty {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 24px 0;
  font-style: italic;
}

/* ── Lightbox ───────────────────────────────────────────────────────────── */
#gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.9);
}

.lightbox-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90vw;
  max-width: 860px;
  max-height: 90vh;
  gap: 8px;
  padding: 0 44px;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: 0;
  background: #333;
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s;
}

.lightbox-close:hover { background: #555; }

.lightbox-description {
  color: #eee;
  font-size: 0.82rem;
  text-align: center;
  max-width: 600px;
  line-height: 1.4;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.lightbox-media {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 55vh;
  border-radius: 10px;
  object-fit: contain;
  display: block;
}

.lightbox-iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 55vh;
  border-radius: 10px;
  border: none;
}

.lightbox-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.lightbox-source {
  color: #aaa;
  font-size: 0.72rem;
  text-decoration: none;
  border-bottom: 1px solid #555;
  transition: color 0.15s;
}

.lightbox-source:hover { color: #fff; }

.lightbox-counter {
  color: #777;
  font-size: 0.72rem;
}

/* ── Lightbox strip ─────────────────────────────────────────────────────── */
.lightbox-strip-wrapper {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.lightbox-strip-wrapper::-webkit-scrollbar { display: none; }

.lightbox-strip {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 2px 0;
}

.lb-strip-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s;
  background: #222;
}

.lb-strip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-strip-thumb.active {
  border-color: #fff;
  opacity: 1;
}

.lb-strip-thumb:hover:not(.active) { opacity: 0.8; }

.lb-strip-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  background: rgba(0,0,0,0.45);
}

/* ── Lightbox nav buttons ───────────────────────────────────────────────── */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: calc(50% - 30px);
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
}

.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.25); }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .lightbox-box {
    width: 100vw;
    padding: 0 40px;
  }
}