/* ============================================================
   /photo-toggle.css — v4.48
   Lightbox modal + clickable-image affordance.
   Replaces the v3.97 Enhanced/Original/Colorized toggle UI.
   ============================================================ */

/* ---------- the clickable image affordance ----------
   We don't want every <img> to scream "I'm a button" — the
   change should be subtle: cursor:zoom-in on hover, slight
   shadow lift on focus, nothing that disrupts the calm
   museum-mat aesthetic. */

img.feig-lb-image {
  cursor: zoom-in;
  transition: filter 200ms ease, box-shadow 200ms ease;
}
img.feig-lb-image:hover {
  filter: brightness(1.02);
}
img.feig-lb-image:focus-visible {
  outline: 2px solid var(--maroon, #8A322A);
  outline-offset: 3px;
}

/* On touch devices skip the hover brightness — feels jittery on tap */
@media (hover: none) {
  img.feig-lb-image:hover { filter: none; }
}

/* ---------- lightbox modal ---------- */

.feig-lightbox[hidden] {
  display: none !important;
}

.feig-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 180ms ease;
}
.feig-lightbox.is-open {
  opacity: 1;
}

.feig-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 8, 0.94);
  cursor: zoom-out;
}

.feig-lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 80px;
  box-sizing: border-box;
  cursor: zoom-out;
}

.feig-lightbox-figure {
  position: relative;
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.feig-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  background: #1a1611;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  cursor: default;
  /* allow the browser to apply touch pinch-zoom */
  touch-action: pinch-zoom;
}

.feig-lightbox-caption {
  margin-top: 14px;
  max-width: 760px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(251, 247, 236, 0.88);
  text-align: center;
  padding: 0 10px;
}
.feig-lightbox-caption[hidden] { display: none; }

/* ---------- the close button (top right) ---------- */

.feig-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(251, 247, 236, 0.35);
  background: rgba(15, 12, 8, 0.6);
  color: rgba(251, 247, 236, 0.92);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
  z-index: 2;
}
.feig-lightbox-close:hover,
.feig-lightbox-close:focus-visible {
  background: rgba(138, 50, 42, 0.85); /* maroon */
  border-color: rgba(251, 247, 236, 0.6);
  outline: none;
}
.feig-lightbox-close:active {
  transform: scale(0.96);
}

/* ---------- the download button (top left, mobile: bottom) ---------- */

.feig-lightbox-download {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  min-height: 44px;
  background: rgba(15, 12, 8, 0.65);
  color: rgba(251, 247, 236, 0.94);
  border: 1px solid rgba(251, 247, 236, 0.35);
  border-radius: 22px;
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
  z-index: 2;
}
.feig-lightbox-download:hover,
.feig-lightbox-download:focus-visible {
  background: rgba(174, 134, 54, 0.85); /* gold */
  border-color: rgba(251, 247, 236, 0.6);
  color: #1F1A14;
  outline: none;
}
.feig-lightbox-download:active {
  transform: scale(0.97);
}
.feig-lightbox-download svg {
  flex-shrink: 0;
}

/* ---------- mobile adjustments ---------- */

@media (max-width: 720px) {
  .feig-lightbox-stage {
    padding: 48px 8px 70px;
  }
  .feig-lightbox-img {
    max-height: calc(100vh - 130px);
  }
  /* On phone, move download to bottom — easier thumb reach */
  .feig-lightbox-download {
    top: auto;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    padding: 10px 18px;
  }
  .feig-lightbox-download:active {
    transform: translateX(-50%) scale(0.97);
  }
  .feig-lightbox-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
  }
  .feig-lightbox-caption {
    font-size: 13px;
    margin-top: 10px;
  }
}

/* ---------- reduced-motion accommodation ---------- */

@media (prefers-reduced-motion: reduce) {
  .feig-lightbox {
    transition: none;
  }
  img.feig-lb-image,
  .feig-lightbox-close,
  .feig-lightbox-download {
    transition: none;
  }
}
