/* PANORAMAS — a work far wider than it is tall (task B80, 2026-11-25). Linked
   AFTER /works.css, and only by a works page whose show file says
   `panoramas: yes`. /panorama.js says what each part is for. */

/* ── THE SECOND LEVEL: A PANORAMA AS TALL AS THE WINDOW, SCROLLED SIDEWAYS ── */

/* While a panorama is up, the two ordinary layers are out of sight: they hold
   the work fitted whole, which is the first level's picture. */
#second-level.is-pan .second-layer { opacity: 0 !important; }

.pan-box {
  position: absolute;
  left: 70px;                 /* the second level's own side margins */
  right: 70px;
  top: 21px;                  /* and its own top line */
  z-index: 6;                 /* over the two click halves, under nothing else */
  overflow-x: auto;
  overflow-y: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
  overscroll-behavior-x: contain;   /* a sideways swipe at the end is not "back" */
  touch-action: pan-x;
  -webkit-user-select: none;
  user-select: none;
}
.pan-box.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms ease, visibility 0s;
}
.pan-box img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  margin: 0 auto;             /* a panorama shorter than the room is centred */
  -webkit-user-drag: none;
  pointer-events: none;
}
/* The same drawn arrows as the two halves of every slideshow on the site:
   here a click travels along the panorama, and at its end goes on. */
.pan-box.to-back {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ctext x='10' y='25' font-size='16' fill='%23501219' font-family='Helvetica, sans-serif'%3E%E2%86%90%3C/text%3E%3C/svg%3E") 12 12, w-resize;
}
.pan-box.to-on {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ctext x='10' y='25' font-size='16' fill='%23501219' font-family='Helvetica, sans-serif'%3E%E2%86%92%3C/text%3E%3C/svg%3E") 12 12, e-resize;
}

/* ── ITS SCROLL BAR: THE MENU'S STROKE, LAID ON ITS SIDE ──────────────────
   Nine pixels to take hold of, 1.25 drawn, the menu's own ink (nav.css,
   #nav-thumb). Under the picture, in the gap above the caption. */
.pan-rail {
  position: absolute;
  left: 70px;
  right: 70px;
  height: 9px;
  z-index: 7;
  display: none;
  touch-action: none;
  cursor: grab;
}
.pan-rail.is-on { display: block; }
.pan-thumb {
  position: absolute;
  top: 3.875px;
  left: 0;
  height: 1.25px;
  background: rgb(80, 25, 30);
  opacity: 0.9;
}
/* The browser's own bar is hidden only where ours is drawn; under a finger
   there is none of ours, and the browser's comes and goes as it does (B71). */
@media (pointer: fine) {
  .pan-box { scrollbar-width: none; }
  .pan-box::-webkit-scrollbar { display: none; }
}
@media (pointer: coarse) {
  .pan-rail.is-on { display: none; }
}

/* ── THE FIRST LEVEL: WHERE A CLICK WILL TAKE YOU ─────────────────────────
   Over a panorama the pointer carries a thin frame: the part of the work the
   second level will open on. */
.picture-hit { position: relative; }
.pan-frame {
  position: absolute;
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.9);
  outline: 1px solid rgba(80, 25, 30, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
}
.picture-hit:hover .pan-frame.is-on { opacity: 1; }

/* ── A PHONE: THE HEIGHT OF AN ORDINARY PICTURE, AND A FINGER SIDEWAYS ─────
   The phone has one level, a column. A panorama fitted to its width would be
   a ribbon 60px high, so it stands as tall as a 3:2 picture does there and
   runs on off the right-hand edge. */
#picture-scroll .picture-scroll-item.pan-item {
  aspect-ratio: 3 / 2;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
#picture-scroll .picture-scroll-item.pan-item img {
  height: 100%;
  width: auto;
  max-width: none;
}
