/* Click-to-enlarge lightbox for inner-page figures (SHI-194).
   Loaded by app/views/layouts/static_home_inner.html.slim. Sibling to
   layouts.css — owns its own visual treatment, not template-themed
   (the dialog overlays the page; theme tokens would conflict with the
   dim backdrop). */

/* ---------- Trigger wrapper + zoom-in affordance ---------- */
.sh-figure-zoom-trigger {
  display: block;
  position: relative;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}
.sh-figure-zoom-trigger:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.sh-figure-zoom-trigger img {
  width: 100%;
  display: block;
}
.sh-figure-zoom-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0.55;
  transition: opacity 120ms ease;
  pointer-events: none;
}
.sh-figure-zoom-icon svg {
  width: 18px;
  height: 18px;
}
.sh-figure-zoom-trigger:hover .sh-figure-zoom-icon,
.sh-figure-zoom-trigger:focus-visible .sh-figure-zoom-icon {
  opacity: 1;
}

/* ---------- Dialog ---------- */
.sh-figure-lightbox-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  color: #fff;
}
.sh-figure-lightbox-dialog::backdrop {
  background: rgba(0, 0, 0, 0.86);
}
.sh-figure-lightbox-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  justify-items: center;
  padding: 12px;
  box-sizing: border-box;
}
.sh-figure-lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-height: 100%;
}
.sh-figure-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}
.sh-figure-lightbox-caption {
  margin: 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  max-width: 720px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
}
.sh-figure-lightbox-caption[hidden] {
  display: none;
}
.sh-figure-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.sh-figure-lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }
.sh-figure-lightbox-close svg { width: 20px; height: 20px; }
.sh-figure-lightbox-nav {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.sh-figure-lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.sh-figure-lightbox-nav svg { width: 24px; height: 24px; }
.sh-figure-lightbox-nav.invisible { visibility: hidden; }

@media (max-width: 640px) {
  .sh-figure-lightbox-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    padding: 16px;
  }
  .sh-figure-lightbox-nav-prev,
  .sh-figure-lightbox-nav-next {
    grid-row: 2;
  }
  .sh-figure-lightbox-figure {
    grid-row: 1;
  }
}
