/* Vitrine photos — zoom au survol et visionneuse plein écran */

/* ---------- Photo principale ---------- */

.vp-cover--clickable,
.vp-cover--clickable img {
  cursor: zoom-in;
}

.vp-cover:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* La loupe intégrée du thème Classic devient inutile */
.vp-cover .layer {
  display: none !important;
}

.vp-zoom {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background-color: #fff;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.vp-zoom.is-visible {
  opacity: 1;
}

/* ---------- Visionneuse ---------- */

html.vp-locked,
html.vp-locked body {
  overflow: hidden;
}

.vp-lightbox {
  --vp-bg: #fff;
  --vp-fg: #1f1f1f;
  --vp-muted: #6b6b6b;
  --vp-btn-bg: #fff;
  --vp-btn-border: rgba(0, 0, 0, 0.12);
  --vp-thumb-bg: #fff;
  --vp-active: #1f1f1f;

  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: var(--vp-bg);
  color: var(--vp-fg);
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

.vp-lightbox--dark {
  --vp-bg: rgba(0, 0, 0, 0.96);
  --vp-fg: #f2f2f2;
  --vp-muted: #a8a8a8;
  --vp-btn-bg: rgba(255, 255, 255, 0.1);
  --vp-btn-border: rgba(255, 255, 255, 0.18);
  --vp-thumb-bg: rgba(255, 255, 255, 0.06);
  --vp-active: #f2f2f2;
}

.vp-lightbox[hidden] {
  display: none;
}

.vp-lightbox.is-open {
  opacity: 1;
}

.vp-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 56px 72px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none; /* le module gère glissement et pincement */
  user-select: none;
  -webkit-user-select: none;
}

.vp-image {
  display: block;
  max-width: none;
  object-fit: contain;
  transform-origin: center center;
  cursor: zoom-in;
  will-change: transform;
}

.vp-image.is-animated {
  transition: transform 0.25s ease;
}

.vp-lightbox.is-zoomed .vp-image {
  cursor: grab;
}

.vp-lightbox.is-zoomed .vp-image:active {
  cursor: grabbing;
}

/* ---------- Boutons ---------- */

.vp-btn {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--vp-btn-border);
  border-radius: 50%;
  background: var(--vp-btn-bg);
  color: var(--vp-fg);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.vp-btn:hover {
  transform: scale(1.06);
}

.vp-btn:focus-visible,
.vp-thumb:focus-visible {
  outline: 2px solid var(--vp-active);
  outline-offset: 2px;
}

.vp-close {
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
}

.vp-prev,
.vp-next {
  top: 50%;
  margin-top: -60px;
}

.vp-prev {
  left: calc(14px + env(safe-area-inset-left, 0px));
}

.vp-next {
  right: calc(14px + env(safe-area-inset-right, 0px));
}

.vp-lightbox--single .vp-prev,
.vp-lightbox--single .vp-next,
.vp-lightbox--single .vp-thumbs,
.vp-lightbox--single .vp-count {
  display: none;
}

/* ---------- Légende et miniatures ---------- */

.vp-footer {
  flex: 0 0 auto;
  padding: 10px 16px 14px;
  text-align: center;
}

.vp-caption {
  margin: 0 0 10px;
  font-size: 0.875rem;
  line-height: 1.4;
}

.vp-count {
  color: var(--vp-muted);
  font-variant-numeric: tabular-nums;
  margin-right: 0.5em;
}

.vp-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.vp-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 3px;
  border: 1px solid var(--vp-btn-border);
  border-radius: 4px;
  background: var(--vp-thumb-bg);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

/* Centrées, mais toujours défilables quand elles débordent */
.vp-thumb:first-child {
  margin-left: auto;
}

.vp-thumb:last-child {
  margin-right: auto;
}

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

.vp-thumb:hover,
.vp-thumb[aria-current="true"] {
  opacity: 1;
}

.vp-thumb[aria-current="true"] {
  border-color: var(--vp-active);
}

.vp-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--vp-muted);
}

.vp-lightbox.is-zoomed .vp-hint {
  visibility: hidden;
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  .vp-stage {
    margin: 60px 0 0;
  }

  /* Sur mobile, on glisse : les flèches deviennent discrètes */
  .vp-prev,
  .vp-next {
    width: 36px;
    height: 36px;
    opacity: 0.8;
  }

  .vp-thumb {
    width: 52px;
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vp-lightbox,
  .vp-zoom,
  .vp-btn,
  .vp-thumb,
  .vp-image.is-animated {
    transition: none;
  }
}
