/* Shared image viewer: regional PWA and read-only public catalogue. */
.fs-photo-viewer[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0d1511;
  color: #fff;
  z-index: 200;
  overflow: hidden;
  box-sizing: border-box;
}
.fs-photo-viewer::backdrop { background: rgba(5, 12, 8, .9); }
.fs-photo-viewer *, .fs-photo-viewer *::before, .fs-photo-viewer *::after { box-sizing: border-box; }
.fs-photo-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 68px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: #101b15;
}
.fs-photo-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 16px/1.35 system-ui, sans-serif;
  margin: 0;
  color: #fff;
}
.fs-photo-counter { flex: 0 0 auto; color: #d2e2d6; font: 500 14px/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.fs-photo-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 14px;
  color: #fff;
  background: rgba(34, 53, 42, .94);
  font: 400 26px/1 system-ui, sans-serif;
  cursor: pointer;
}
.fs-photo-button:hover { background: #274332; }
.fs-photo-button:focus-visible, .fs-photo-viewer a:focus-visible {
  outline: 3px solid #9be7b5;
  outline-offset: 3px;
}
.fs-photo-frame { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.fs-photo-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.fs-photo-stage.is-zoomed { display: block; touch-action: pan-x pan-y pinch-zoom; }
.fs-photo-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}
.fs-photo-image[hidden] { display: none; }
.fs-photo-stage.is-zoomed .fs-photo-image {
  width: 200%;
  max-width: none;
  max-height: none;
  height: auto;
  cursor: zoom-out;
}
.fs-photo-error { padding: 16px; color: #fff; text-align: center; }
.fs-photo-error[hidden] { display: none; }
.fs-photo-previous, .fs-photo-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(12, 24, 17, .82);
}
.fs-photo-previous { left: max(12px, env(safe-area-inset-left)); }
.fs-photo-next { right: max(12px, env(safe-area-inset-right)); }
.fs-photo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  min-height: 48px;
  color: #d2e2d6;
  font: 13px/1.4 system-ui, sans-serif;
  background: #101b15;
}
.fs-photo-footer a { color: #b4ebc6; }
.fs-photo-footer a[hidden] { display: none; }
@media (max-width: 620px) {
  .fs-photo-toolbar { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .fs-photo-title { font-size: 14px; }
  .fs-photo-footer { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .fs-photo-viewer *, .fs-photo-viewer *::before, .fs-photo-viewer *::after { transition: none !important; animation: none !important; }
}
