/* Silent Hill Media: picture viewer (Dec 5, 2026). Loaded by js/shm-lightbox.js into whichever window draws the viewer
   (the top window, so it has to carry its own look: sepia ink on near-black brown, like the SH1 pages). */
html.shm-lb-lock, html.shm-lb-lock body { overflow: hidden !important; }

.shm-lb {
  position: fixed; inset: 0; z-index: 2147483600;
  display: flex; align-items: flex-start; justify-content: center;   /* picture sits at the TOP: nothing to centre, nothing to scroll to */
  background: rgba(14, 9, 5, .97);
  color: #ead7bb; font: 16px/1.45 Arial, Helvetica, sans-serif;
  overflow: hidden; overscroll-behavior: contain; touch-action: none;
}
.shm-lb[hidden] { display: none; }

.shm-lb-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px 10px 20px;
  background: linear-gradient(rgba(14, 9, 5, .92), rgba(14, 9, 5, 0));
}
.shm-lb-count { font-size: 14px; letter-spacing: .12em; color: #c8ad88; min-width: 4.5em; }
.shm-lb-open {
  margin-left: auto; color: #f3e2c4 !important; font-size: 14px; font-weight: bold; text-decoration: none;
  padding: 8px 14px; border: 1px solid rgba(243, 226, 196, .45); border-radius: 3px; background: rgba(90, 65, 46, .55);
}
.shm-lb-open:hover { background: rgba(120, 88, 62, .8); border-color: #f3e2c4; }

.shm-lb button {
  font: inherit; cursor: pointer; color: #f3e2c4;
  background: rgba(90, 65, 46, .55); border: 1px solid rgba(243, 226, 196, .45); border-radius: 3px;
  -webkit-tap-highlight-color: transparent;
}
.shm-lb button:hover { background: rgba(120, 88, 62, .85); border-color: #f3e2c4; }
.shm-lb button svg { display: block; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin: auto; }
.shm-lb-close { width: 44px; height: 44px; padding: 0; }

.shm-lb a:focus-visible, .shm-lb button:focus-visible { outline: 3px solid #f3e2c4; outline-offset: 2px; }

.shm-lb-nav { position: absolute; top: 50%; z-index: 3; width: 52px; height: 84px; margin-top: -42px; padding: 0; }
.shm-lb-prev { left: 14px; }
.shm-lb-next { right: 14px; }
.shm-lb.is-single .shm-lb-nav { display: none; }

.shm-lb-stage { margin: 0; padding: 64px 84px 8px; max-width: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; }
.shm-lb-img {
  display: block; max-width: 100%; max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); max-height: calc(var(--lb-vh, 100dvh) - 190px);
  width: auto; height: auto; object-fit: contain;
  border: 3px solid #5a412e; background: #1b110a; box-shadow: 0 8px 40px rgba(0, 0, 0, .7);
  user-select: none; -webkit-user-drag: none;
  transition: opacity .18s ease;
  transform-origin: center center; cursor: zoom-in;
  will-change: transform;
}
.shm-lb.is-zoomed .shm-lb-img { cursor: grab; }

.shm-lb.is-loading .shm-lb-img { opacity: .25; }
.shm-lb.is-error .shm-lb-img { visibility: hidden; }
.shm-lb.is-error .shm-lb-stage::before { content: "This picture could not be loaded."; color: #f3e2c4; padding: 40px 0; }
.shm-lb-cap { margin-top: 14px; text-align: center; max-width: 52em; }
.shm-lb-text { display: block; font-size: 17px; color: #f3e2c4; }
.shm-lb-credit { display: block; margin-top: 4px; font-size: 13px; letter-spacing: .03em; color: #b49c7c; }
.shm-lb-text:empty, .shm-lb-credit:empty { display: none; }

@media (max-width: 700px) {
  .shm-lb-stage { padding: 62px 10px 6px; }
  .shm-lb-img { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); max-height: calc(var(--lb-vh, 100dvh) - 230px); }
  .shm-lb-nav { top: auto; bottom: 14px; margin-top: 0; width: 56px; height: 48px; background: rgba(40, 27, 17, .85); }
  .shm-lb-prev { left: 12px; }
  .shm-lb-next { right: 12px; }
  .shm-lb-open { font-size: 13px; padding: 7px 10px; }
  .shm-lb-top { gap: 8px; padding-left: 12px; }
  .shm-lb-cap { padding-bottom: 66px; }
  .shm-lb-text { font-size: 15px; }
}
@media (max-height: 520px) and (min-width: 701px) { .shm-lb-img { max-height: calc(100vh - 150px); max-height: calc(var(--lb-vh, 100vh) - 150px); } }
/* drawn inside a frame (fallback): pinned to the visible part of the frame by the script */
.shm-lb.is-framed { position: absolute; inset: auto 0 auto 0; }
.shm-lb.is-framed .shm-lb-nav { top: calc(var(--lb-vh, 800px) / 2); }
@media (prefers-reduced-motion: reduce) { .shm-lb-img { transition: none; } }
