/* In-page screenshot zoom (pairs with /js/zoom.js).
   Loaded only by pages that show zoomable product screenshots: the six home pages and the seven
   landing pages. The landing pages do not load css/styles.css (each has its own design system),
   so this file is self-contained and uses no theme tokens: the hint strip inherits the link colour
   and tints itself with currentColor, and the overlay is the same dark on every page. */

/* ---------- Zoomable link on the page ---------- */
a.zoomable {
  display: block;
  text-decoration: none;
  cursor: zoom-in;
}
/* Inset ring: frames clip with overflow:hidden, so an outside ring would be cut off. */
a.zoomable:focus-visible {
  outline: 3px solid #2563EB;
  outline-offset: -3px;
}

/* "Click or tap to enlarge" strip. It sits under the screenshot, never over it. */
.zoom-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  background: rgba(0, 0, 0, 0.04);
  background: color-mix(in srgb, currentColor 7%, transparent);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}
.zoom-hint::before {
  content: "";
  flex: none;
  width: 1.15em;
  height: 1.15em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / contain no-repeat;
}
a.zoomable:hover .zoom-hint {
  background: rgba(0, 0, 0, 0.08);
  background: color-mix(in srgb, currentColor 13%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .zoom-hint { transition: background-color 150ms ease; }
}

/* ---------- Hover zoom (devices with a mouse) ----------
   js/zoom.js magnifies the picture in place; the frame clips it. The "enlarge" strip is hidden on these devices
   (the hover is the cue, and a click still opens the full-size dialog). Touch devices do not match this query and
   keep the strip and tap-to-open exactly as before. */
@media (hover: hover) and (pointer: fine) {
  a.zoomable[data-zoom] { overflow: hidden; }
  a.zoomable[data-zoom] .zoom-hint { display: none; }
}
.is-zoom-target { transform-origin: 50% 50%; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .is-zoom-target { transition: transform 220ms cubic-bezier(.16, 1, .3, 1), transform-origin 90ms linear; }
}

/* ---------- Overlay ---------- */
.zoom-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
  overscroll-behavior: contain;
}
.zoom-dialog::backdrop {
  background: rgba(7, 11, 22, 0.92);
}

/* The scroller fills the dialog. Content is never locked: it scrolls, and the browser's own
   pinch-zoom is left alone (no touch-action override anywhere). */
.zoom-scroll {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 68px 16px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(255, 255, 255, 0.6) transparent;
  cursor: zoom-out;
}
.zoom-scroll:focus-visible {
  outline: 3px solid #FBBF24;
  outline-offset: -3px;
}
/* Fits the width of the screen and never grows past its own pixels. A taller image scrolls. */
.zoom-img {
  display: block;
  flex: none;
  align-self: center;
  margin: auto;
  max-width: 100%;
  height: auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.zoom-img.is-pannable { cursor: grab; }
.zoom-scroll.is-panning,
.zoom-scroll.is-panning .zoom-img { cursor: grabbing; }

.zoom-close {
  position: absolute;
  top: 12px;
  right: 28px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  height: 44px;
  padding: 0 16px 0 14px;
  font: 600 0.9375rem/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #fff;
  background: #0F172A;
  border: 2px solid #fff;
  border-radius: 999px;
  cursor: pointer;
}
.zoom-close:hover { background: #1E293B; }
/* Amber ring inside a dark halo, so it reads on the dark backdrop and on a white screenshot. */
.zoom-close:focus-visible {
  outline: 3px solid #FBBF24;
  outline-offset: 2px;
  box-shadow: 0 0 0 8px #0F172A;
}
.zoom-close svg { flex: none; }

@media (max-width: 720px) {
  .zoom-scroll { padding: 64px 8px 16px; }
  .zoom-close { right: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .zoom-dialog[open] { animation: zoom-pop 160ms ease-out; }
  .zoom-dialog[open]::backdrop { animation: zoom-fade 160ms ease-out; }
}
@keyframes zoom-pop {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes zoom-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media print {
  .zoom-hint, .zoom-dialog { display: none !important; }
}

/* ---------- True-size mode and the page lock (see js/zoom.js) ---------- */
html.zoom-lock { overflow: hidden; }
.zoom-img.is-true { max-width: none; }
html.zoom-lock body { overflow: hidden; }
