/*
 * Accessible, site-wide image zoom for photographic content.
 * Decorative artwork, logos, separators and navigation images are excluded
 * by scripts/image-zoom.js.
 */

img.zoomable-image {
  cursor: zoom-in !important;
  transform-origin: center center !important;
  transition:
    transform 240ms ease,
    filter 240ms ease !important;
  will-change: transform;
}

img.zoomable-image:hover,
img.zoomable-image:focus-visible {
  filter: brightness(1.035);
  transform: scale(1.035);
}

img.zoomable-image:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: -5px;
}

body.image-zoom-open {
  overflow: hidden !important;
}

.image-zoom-overlay {
  align-items: center;
  background: rgba(24, 14, 7, 0.88);
  box-sizing: border-box;
  display: none;
  inset: 0;
  justify-content: center;
  padding: 34px;
  position: fixed;
  z-index: 2147483647;
}

.image-zoom-overlay.is-open {
  display: flex;
}

.image-zoom-frame {
  background: #fff;
  border: 6px solid rgba(255, 255, 255, 0.98);
  border-radius: 5px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  box-sizing: border-box;
  line-height: 0;
  max-height: calc(100vh - 68px);
  max-width: calc(100vw - 68px);
  position: relative;
}

.image-zoom-frame img {
  display: block;
  height: auto;
  max-height: calc(100vh - 80px);
  max-width: calc(100vw - 80px);
  object-fit: contain;
  transform: none !important;
  width: auto;
}

.image-zoom-close {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
  color: #482f00;
  cursor: pointer;
  display: flex;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 25px;
  font-weight: 400;
  height: 40px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 2px;
  position: absolute;
  right: -20px;
  top: -20px;
  width: 40px;
  z-index: 1;
}

.image-zoom-close:hover,
.image-zoom-close:focus-visible {
  background: #ffeddb;
  color: #301d0b;
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .image-zoom-overlay {
    padding: 22px;
  }

  .image-zoom-frame {
    max-height: calc(100vh - 44px);
    max-width: calc(100vw - 44px);
  }

  .image-zoom-frame img {
    max-height: calc(100vh - 56px);
    max-width: calc(100vw - 56px);
  }

  .image-zoom-close {
    right: -15px;
    top: -15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  img.zoomable-image {
    transition: none !important;
  }
}
