/* Photo viewer (photo-view.js, user 2026-12-05): a photo opens large on the page with a big X, instead of leaving
   for the image file. Also: photos can't be long-pressed (iPhone save menu), selected or dragged out. */
img { -webkit-touch-callout: none; -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
.pv-zoom, .pv-link, .pv-link img { cursor: zoom-in; }
@media (hover: none) { .pv-zoom, .pv-link { cursor: pointer; } }
:is(.pv-zoom, .pv-link):focus-visible { outline: 3px solid var(--accent, #A73439); outline-offset: 4px; }
/* The page stays still behind the photo. */
html.pv-open { overflow: hidden; }

.pv {
  --pv-top: calc(env(safe-area-inset-top, 0px) + 84px);
  --pv-side: 14px;
  --pv-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  --pv-ease: cubic-bezier(.16, 1, .3, 1);
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: #fff; overflow: hidden;
}
.pv[open] { display: block; }
.pv::backdrop { background: transparent; }
.pv-shade { position: absolute; inset: 0; background: rgb(26 14 17 / .95); opacity: 0; transition: opacity .28s ease-out; }
.pv.is-in .pv-shade { opacity: var(--pv-fade, 1); }
.pv.is-out .pv-shade { opacity: 0; transition-duration: .2s; }
.pv.is-drag .pv-shade { transition: none; }

.pv-stage {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  padding: var(--pv-top) var(--pv-side) var(--pv-bottom); touch-action: none;
}
.pv-frame { position: relative; opacity: 0; transform: scale(.94); transition: opacity .3s ease-out, transform .45s var(--pv-ease); }
.pv.is-in .pv-frame { opacity: 1; transform: none; }
.pv.is-out .pv-frame { opacity: 0; transform: scale(.97); transition-duration: .2s, .2s; }
.pv.is-drag .pv-frame { transition: none; }
.pv-img {
  display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none;
  transform-origin: 50% 50%; transition: transform .34s var(--pv-ease);
}
.pv.is-drag .pv-img { transition: none; }
.pv.is-zoomed .pv-stage { cursor: grab; }
.pv.is-zoomed.is-drag .pv-stage { cursor: grabbing; }

/* The big X: always top right, above the photo, easy to hit with a thumb. */
.pv-close {
  position: absolute; z-index: 3; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px;
  display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%;
  background: rgb(250 247 245 / .97); color: var(--wine, #79242A); cursor: pointer;
  box-shadow: 0 8px 24px rgb(0 0 0 / .28);
  opacity: 0; transform: scale(.8);
  transition: opacity .24s ease-out, transform .38s var(--pv-ease), background-color .2s;
}
.pv.is-in .pv-close { opacity: 1; transform: none; }
.pv-close svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.pv-close:active { transform: scale(.92); }

/* Previous / next, only for a set of photos. */
.pv-step {
  position: absolute; z-index: 2; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: none; place-items: center; width: 52px; height: 52px; padding: 0;
  border: 1px solid rgb(255 255 255 / .3); border-radius: 50%; background: rgb(255 255 255 / .1); color: #fff; cursor: pointer;
  opacity: 0; transition: opacity .24s ease-out .06s, background-color .2s, transform .2s var(--pv-ease);
}
.pv.is-set .pv-step { display: grid; }
.pv.is-in .pv-step { opacity: 1; }
.pv-prev { left: 14px; }
.pv-next { right: 14px; }
.pv-step svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pv-step:active { transform: scale(.92); }
:is(.pv-close, .pv-step):focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.pv-foot {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; pointer-events: none; text-align: center;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 18px);
  opacity: 0; transition: opacity .24s ease-out .06s;
}
.pv.is-set .pv-foot { padding-left: 80px; padding-right: 80px; }
.pv.is-in .pv-foot { opacity: 1; }
.pv-cap {
  margin: 0 auto; max-width: 62ch; font: 400 15px/1.45 var(--font-ui, system-ui, sans-serif); color: rgb(255 255 255 / .9);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.pv-count { margin: 8px auto 0; max-width: none; min-height: 1em; font: 500 13px/1 var(--font-ui, system-ui, sans-serif); letter-spacing: .14em; color: rgb(255 255 255 / .62); }
.pv-count:empty { display: none; }
.pv.is-zoomed :is(.pv-foot, .pv-step) { opacity: 0; pointer-events: none; }

@media (hover: hover) and (pointer: fine) {
  .pv-close:hover { transform: scale(1.07); background: #fff; }
  .pv-step:hover { background: rgb(255 255 255 / .2); }
}

/* Tablets and computers: the X a little bigger, arrows beside the photo. */
@media (min-width: 700px) {
  .pv { --pv-top: 104px; --pv-side: 40px; --pv-bottom: 100px; }
  .pv.is-set { --pv-side: 116px; }
  .pv-close { top: 22px; right: 24px; width: 64px; height: 64px; }
  .pv-close svg { width: 28px; height: 28px; }
  .pv-step { top: 50%; bottom: auto; width: 60px; height: 60px; margin-top: -30px; }
  .pv-prev { left: 30px; }
  .pv-next { right: 30px; }
  .pv.is-set .pv-foot { padding-left: 120px; padding-right: 120px; }
  .pv-cap { font-size: 16px; }
  .pv-foot { padding-bottom: 26px; }
}

/* A phone turned sideways: little height, so the photo takes the middle and the controls go to the sides. */
@media (max-height: 520px) and (orientation: landscape) {
  .pv, .pv.is-set { --pv-top: 12px; --pv-side: 84px; --pv-bottom: calc(env(safe-area-inset-bottom, 0px) + 40px); }
  .pv-close { top: 12px; right: max(12px, env(safe-area-inset-right, 0px)); width: 56px; height: 56px; }
  .pv-step { top: 50%; bottom: auto; margin-top: -26px; width: 52px; height: 52px; }
  .pv-prev { left: max(14px, env(safe-area-inset-left, 0px)); }
  .pv-next { right: max(14px, env(safe-area-inset-right, 0px)); }
  .pv-foot, .pv.is-set .pv-foot { padding: 6px 90px calc(env(safe-area-inset-bottom, 0px) + 10px); }
  .pv-cap { -webkit-line-clamp: 1; line-clamp: 1; font-size: 14px; }
  .pv-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pv-frame, .pv.is-in .pv-frame, .pv.is-out .pv-frame, .pv-close, .pv.is-in .pv-close { transform: none; }
  .pv-img { transition: none; }
}
