/*
 * gallery.css — ANZ v3 PDP Image Gallery Component
 *
 * Namespace: .anz-v3-gallery
 * Covers: PDP image gallery with thumbnails
 * All selectors scoped: body.anz-v3 .anz-v3-gallery*
 * No hex values — var(--...) only.
 *
 * Phase 4 pages: PDP (DIGITAL-6478)
 * Provenance: IA spec §4.3 (photography voice — spacious compositions),
 *             IA spec §6.2 (spacing, radius)
 */


/* ===================================================================
 * GALLERY WRAPPER
 * =================================================================== */

body.anz-v3 .anz-v3-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}


/* ===================================================================
 * MAIN IMAGE
 * =================================================================== */

body.anz-v3 .anz-v3-gallery__main {
  aspect-ratio: 4 / 3;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  width: 100%;
}

body.anz-v3 .anz-v3-gallery__main-img {
  height: 100%;
  object-fit: contain;
  transition: opacity var(--motion-standard) var(--motion-exit);
  width: 100%;
}

body.anz-v3 .anz-v3-gallery__main-img.is-loading {
  opacity: 0;
}

/* Zoom hint overlay */
body.anz-v3 .anz-v3-gallery__zoom-hint {
  background-color: var(--anz-deep-sea);
  border-radius: var(--radius-sm);
  bottom: var(--space-3);
  color: var(--text-on-inverse);
  font-size: var(--type-caption-size);
  opacity: 0;
  padding: var(--space-1) var(--space-3);
  pointer-events: none;
  position: absolute;
  right: var(--space-3);
  transition: opacity var(--motion-fast) var(--motion-exit);
}

body.anz-v3 .anz-v3-gallery__main:hover .anz-v3-gallery__zoom-hint {
  opacity: 0.8;
}


/* ===================================================================
 * PREV / NEXT CONTROLS
 * =================================================================== */

body.anz-v3 .anz-v3-gallery__prev,
body.anz-v3 .anz-v3-gallery__next {
  align-items: center;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: var(--type-body-m-size);
  height: 40px;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition:
    background-color var(--motion-fast) var(--motion-exit),
    box-shadow var(--motion-fast) var(--motion-exit);
  width: 40px;
  z-index: 2;
}

body.anz-v3 .anz-v3-gallery__prev {
  left: var(--space-3);
}

body.anz-v3 .anz-v3-gallery__next {
  right: var(--space-3);
}

body.anz-v3 .anz-v3-gallery__prev:focus,
body.anz-v3 .anz-v3-gallery__prev:hover,
body.anz-v3 .anz-v3-gallery__next:focus,
body.anz-v3 .anz-v3-gallery__next:hover {
  background-color: var(--anz-pacific-blue);
  box-shadow: var(--shadow-md);
  color: var(--text-on-primary);
}


/* ===================================================================
 * THUMBNAIL STRIP
 * =================================================================== */

body.anz-v3 .anz-v3-gallery__thumbs {
  display: flex;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

body.anz-v3 .anz-v3-gallery__thumb {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  height: 72px;
  overflow: hidden;
  transition:
    border-color var(--motion-fast) var(--motion-exit),
    opacity var(--motion-fast) var(--motion-exit);
  width: 72px;
}

body.anz-v3 .anz-v3-gallery__thumb:focus,
body.anz-v3 .anz-v3-gallery__thumb:hover {
  border-color: var(--anz-pacific-blue);
}

body.anz-v3 .anz-v3-gallery__thumb--active {
  border-color: var(--anz-pacific-blue);
  border-width: 2px;
}

body.anz-v3 .anz-v3-gallery__thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}


/* ===================================================================
 * RESPONSIVE
 * =================================================================== */

@media (max-width: 768px) {
  body.anz-v3 .anz-v3-gallery__thumb {
    height: 56px;
    width: 56px;
  }

  body.anz-v3 .anz-v3-gallery__main:hover .anz-v3-gallery__zoom-hint {
    opacity: 0;
  }
}


/* ===================================================================
 * REDUCED MOTION
 * =================================================================== */

@media (prefers-reduced-motion: reduce) {
  body.anz-v3 .anz-v3-gallery__main-img,
  body.anz-v3 .anz-v3-gallery__zoom-hint,
  body.anz-v3 .anz-v3-gallery__prev,
  body.anz-v3 .anz-v3-gallery__next,
  body.anz-v3 .anz-v3-gallery__thumb {
    transition: none;
  }
}
