/* ── Photos in a sleeve ─────────────────────────────────────────
   The photographs sit together in one sleeve at the foot of the
   Photography card, the front one showing through the plastic. The
   sleeve itself is the one from pull-card.css; behaviour is in
   photo-pull.js. A print is drawn at one fixed size and scaled.
   --------------------------------------------------------------- */

.project-slot--photos > .project-card { padding-bottom: calc(40% + 32px); }   /* room for the sleeve and the prints poking out of it */

/* wider than a card sleeve, and deep enough to show half a photograph */
.pull--photos {
  height: auto;
  aspect-ratio: 304 / 122;
}

/* ── A print ──
   Like a wide instant photo: a thin white margin, a deeper one at
   the foot, and where it was taken written there by hand. */
.ph-fly {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 480px;
  margin-left: -240px;   /* centred on wherever it is put; photo-pull.js sets its height to match the photograph */
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}
.ph-print {
  position: absolute;
  inset: 0;
  display: block;
  padding: 12px 12px 50px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.3s ease, scale 0.2s ease;
}
.ph-shot {
  position: relative;
  display: block;
  height: 100%;
}
.ph-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* the photograph sits a hair below the paper around it */
.ph-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 0.5px rgba(0, 0, 0, 0.3);
}
.ph-hand {
  position: absolute;
  left: 17px;
  right: 12px;
  bottom: 10px;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  font-family: "Bradley Hand", "Ink Free", "Segoe Print", cursive;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  color: #27357c;
  transform: rotate(-2deg);
  transform-origin: 0 100%;
}

/* ── Out of the sleeve ──
   The page dims, the Photography card stays lit above the dimming
   so the sleeve is still there to pull from, and the prints lie
   over both. */
.photo-dim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 10, 16, 0);
  transition: background 0.35s ease, backdrop-filter 0.35s ease;
}
.photo-dim.is-open {
  background: rgba(8, 10, 16, 0.66);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
}
.photo-dim[hidden],
.photo-table[hidden] { display: none; }
.project-slot.is-lit { z-index: 41; }

.photo-table {
  position: fixed;
  inset: 0;
  z-index: 42;
  pointer-events: none;   /* only the prints and the close button take the pointer */
}
.photo-table .ph-fly {
  position: fixed;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.photo-table .ph-fly.is-held { cursor: grabbing; }
.photo-table .ph-fly:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
.photo-table .ph-print { box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.45), 0 16px 34px -12px rgba(0, 0, 0, 0.7); }
.photo-table .is-held .ph-print {
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.45), 0 30px 50px -14px rgba(0, 0, 0, 0.75);
  scale: 1.03;
}

.photo-table .pull-close {
  z-index: 1000;   /* above every print, however many times they have been picked up */
  pointer-events: auto;
}
.photo-table .pull-hint {
  top: 30px;       /* the sleeve is usually at the foot of the screen */
  bottom: auto;
  padding: 0 64px; /* clear of the close button when it wraps on a phone */
  line-height: 1.7;
}
.photo-table.is-open .pull-close,
.photo-table.is-open .pull-hint { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .ph-print,
  .photo-dim { transition: none; }
}
