/* =====================================================================
   css/photo-gallery.css
   Styles for the gallery upload panel (photo-gallery-upload.js).
   Supplements photo-batch.css — reuses overlay, panel, header, footer.
   ===================================================================== */

/* ── Gallery thumbnail grid ─────────────────────────────────────── */
.gallery-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  padding: 12px 16px;
}

.gallery-thumb-item {
  position: relative;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  cursor: grab;
}
.gallery-thumb-item:active { cursor: grabbing; }

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

/* ── Controls below each thumbnail ──────────────────────────────── */
.gallery-thumb-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
}

.gallery-caption-input {
  flex: 1;
  border: none;
  background: #f8f9fa;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 3px;
  min-width: 0;
}
.gallery-caption-input:focus {
  outline: 1px solid #0d6efd;
  background: #fff;
}

.gallery-thumb-remove {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.gallery-thumb-remove:hover { opacity: 1; }

/* ── Sort order badge ────────────────────────────────────────────── */
.gallery-thumb-order {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SortableJS drag ghost ───────────────────────────────────────── */
.gallery-thumb-ghost {
  opacity: 0.4;
  border-color: #0d6efd;
}

/* ── Admin gallery manager (narrower context inside admin tab) ──── */
.admin-gallery-manager .gallery-thumb-grid {
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  padding: 8px 0;
}
.admin-gallery-manager .gallery-thumb-img {
  height: 90px;
}

/* Caption overlays bottom of photo */
.admin-gallery-manager .gallery-caption-input {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 3px 6px;
  font-size: 0.7rem;
}
.admin-gallery-manager .gallery-caption-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}
.admin-gallery-manager .gallery-caption-input:focus {
  background: rgba(0, 0, 0, 0.75);
  outline: none;
}

/* Delete button in top-right corner */
.admin-gallery-manager .gallery-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  opacity: 0.7;
}
.admin-gallery-manager .gallery-thumb-remove:hover {
  opacity: 1;
  background: rgba(220, 53, 69, 0.85);
}

.admin-gallery-add-btn {
  border-style: dashed;
}
.admin-gallery-save-btn:disabled {
  opacity: 0.5;
}

/* ── Mobile: smaller grid ────────────────────────────────────────── */
@media (max-width: 576px) {
  .gallery-thumb-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
    padding: 8px;
  }
  .gallery-thumb-img { height: 70px; }
}
