/* ArtZoom viewer chrome — shared by all Art page variants.
   Accent colour comes per-work via --az-accent. */

html.az-lock, html.az-lock body { overflow: hidden; }

.az-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0a0a0c;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  --az-accent: #d4a017;
}
.az-overlay.az-open { opacity: 1; pointer-events: auto; }

.az-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.az-overlay.az-zoomed .az-stage { cursor: move; }

.az-img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  max-width: none;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.7);
}

.az-btn {
  position: absolute;
  z-index: 4;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(12, 12, 14, 0.55);
  color: #eee;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.az-btn:hover { background: rgba(30, 30, 34, 0.85); border-color: var(--az-accent); transform: scale(1.06); }
.az-btn:focus-visible { outline: 2px solid var(--az-accent); outline-offset: 2px; }

.az-close { top: max(14px, env(safe-area-inset-top)); right: 16px; }
.az-prev, .az-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.7rem;
  padding-bottom: 4px;
}
.az-prev:hover, .az-next:hover { transform: translateY(-50%) scale(1.06); }
.az-prev { left: 14px; }
.az-next { right: 14px; }

.az-hint {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: max(20px, env(safe-area-inset-top));
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(12, 12, 14, 0.6);
  color: rgba(255, 255, 255, 0.85);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
.az-hint.on { opacity: 1; }

.az-loader {
  position: absolute;
  z-index: 4;
  left: 16px;
  top: max(14px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 18px;
  background: rgba(12, 12, 14, 0.6);
  color: rgba(255, 255, 255, 0.8);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.az-loader.on { opacity: 1; }
.az-loader span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--az-accent);
  border-top-color: transparent;
  animation: az-spin 0.8s linear infinite;
}
@keyframes az-spin { to { transform: rotate(360deg); } }

.az-bar {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 40px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(5, 5, 7, 0.85));
  color: #eee;
  font-family: Georgia, 'Times New Roman', serif;
  pointer-events: none;
}
.az-caption b {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}
.az-caption span {
  display: block;
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}
.az-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}
.az-zoom {
  color: var(--az-accent);
  font-variant-numeric: tabular-nums;
  min-width: 3.2em;
  text-align: right;
}

@media (max-width: 700px) {
  .az-prev, .az-next { display: none; } /* swipe territory is pan; arrows clutter small screens */
  .az-caption b { font-size: 0.92rem; }
  .az-hint { font-size: 0.68rem; max-width: 88vw; white-space: normal; text-align: center; }
}

/* ---------- light theme (gallery) overrides ---------- */
:root[data-theme="light"] .az-overlay { background: #e7e5df; }
:root[data-theme="light"] .az-img { box-shadow: 0 14px 50px -12px rgba(40, 34, 28, 0.4); }
:root[data-theme="light"] .az-btn {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(20, 18, 22, 0.2);
  color: #201f22;
}
:root[data-theme="light"] .az-btn:hover { background: rgba(255, 255, 255, 0.92); }
:root[data-theme="light"] .az-hint,
:root[data-theme="light"] .az-loader { background: rgba(255, 255, 255, 0.72); color: rgba(32, 31, 34, 0.85); }
:root[data-theme="light"] .az-bar {
  background: linear-gradient(transparent, rgba(231, 229, 223, 0.94));
  color: #201f22;
}
:root[data-theme="light"] .az-caption b { color: #141317; }
:root[data-theme="light"] .az-caption span { color: rgba(32, 31, 34, 0.65); }
:root[data-theme="light"] .az-meta { color: rgba(32, 31, 34, 0.7); }
