/* public/css/components/photo-carousel.css
 * Full-screen swipeable photo carousel overlay.
 * Canopy v2 — all tokens from canopy-v2.css.
 * Overlay sits at z-index 1200 (above sheets at 1000, above zone-detail scrim).
 */

/* ── Overlay shell ─────────────────────────────────────────────────────────── */

.pc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  flex-direction: column;
  align-items: stretch;
  background: var(--v2-raw-ink-950);
  /* Near-opaque dark — deepest ink token with slight transparency for depth */
  background: oklch(from var(--v2-raw-ink-950) l c h / 0.96);
}

.pc-overlay.is-open {
  display: flex;
}

/* ── Backdrop (tap-to-close region behind frame) ───────────────────────────── */

.pc-backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
  z-index: 0;
}

/* ── Close button ──────────────────────────────────────────────────────────── */

.pc-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: oklch(from var(--v2-raw-ink-800) l c h / 0.6);
  border: none;
  border-radius: 50%;
  color: var(--v2-raw-linen-0);
  cursor: pointer;
  padding: 0;
  transition: background 150ms ease;
}

.pc-close:hover,
.pc-close:focus-visible {
  background: oklch(from var(--v2-raw-ink-700) l c h / 0.8);
  outline: none;
}

.pc-close:focus-visible {
  box-shadow: 0 0 0 2px var(--v2-raw-linen-0);
}

/* ── Image frame ───────────────────────────────────────────────────────────── */

.pc-frame {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px 48px;
  z-index: 1;
  /* pointer-events: none on frame so backdrop can still receive taps through gaps */
  pointer-events: none;
}

/* Image wrapper allows pinch + drag panning while frame stays click-through. */
.pc-img-wrap {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none; /* JS handles all touch gestures (pinch/pan/swipe/double-tap) */
  overflow: hidden;
}

.pc-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  /* Subtle elevation so image reads as the focus */
  box-shadow: 0 8px 40px oklch(0% 0 0 / 0.5);
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* ── Stamp (subject label + date) ──────────────────────────────────────────── */

.pc-stamp {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
  color: var(--v2-raw-linen-0);
  font-family: var(--v2-font-body, 'DM Sans', sans-serif);
  pointer-events: none;
  text-shadow: 0 1px 4px oklch(0% 0 0 / 0.6);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.pc-stamp-label {
  font-family: var(--v2-font-heading, 'Fraunces', Georgia, serif);
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.pc-stamp-label:empty { display: none; }
.pc-stamp-date {
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 400;
  opacity: 0.92;
}

/* ── Photo counter (e.g. "2 / 5") ─────────────────────────────────────────── */

.pc-counter {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--v2-raw-linen-0);
  font-family: var(--v2-font-body, 'DM Sans', sans-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px oklch(0% 0 0 / 0.6);
  pointer-events: none;
  white-space: nowrap;
}

/* ── Navigation arrows (desktop pointer; hidden on touch) ──────────────────── */

.pc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: oklch(from var(--v2-raw-ink-800) l c h / 0.55);
  border: none;
  border-radius: 50%;
  color: var(--v2-raw-linen-0);
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: opacity 150ms ease, background 150ms ease;
}

.pc-nav:hover,
.pc-nav:focus-visible {
  opacity: 1;
  background: oklch(from var(--v2-raw-ink-700) l c h / 0.8);
  outline: none;
}

.pc-nav:focus-visible {
  box-shadow: 0 0 0 2px var(--v2-raw-linen-0);
}

.pc-nav--prev { left: 12px; }
.pc-nav--next { right: 12px; }

/* ── Touch devices: hide arrows (users swipe) ──────────────────────────────── */

@media (pointer: coarse) {
  .pc-nav {
    display: none;
  }
}

/* ── Reduced motion ────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .pc-close,
  .pc-nav {
    transition: none;
  }
}
