/* The footprint viewer (fp-viewer.js) — the app's FootprintPager on the web.
   A phone: the whole screen. Wider: a phone-shaped stage in the middle, the
   footprints scrolling past it, the ↑ ↓ arrows on the right. */
.fpv {
  --fpv-h: min(calc(100dvh - 40px), 980px);
  --fpv-w: min(calc(var(--fpv-h) * 9 / 16), calc(100vw - 32px));
  --fpv-glass: rgba(255, 255, 255, .14);
  position: fixed; inset: 0; z-index: 1000;
  background: #000; color: #fff;
}
.fpv[hidden] { display: none; }
html.fpv-lock { overflow: hidden; }
/* A footprint's own page opens onto the viewer: its plain version waits underneath, unseen, until then. */
html.fpv-boot body { background: #000; }
html.fpv-boot main.fp, html.fpv-boot .top, html.fpv-boot footer { visibility: hidden; }

.fpv-feed {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none;
}
.fpv-feed::-webkit-scrollbar { display: none; }
.fpv-page {
  height: 100%; display: grid; place-items: center;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.fpv-stage {
  position: relative; width: var(--fpv-w); height: var(--fpv-h);
  border-radius: 16px; overflow: hidden; background: var(--z-900);
}
.fpv-track {
  position: absolute; inset: 0; display: flex;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.fpv-track::-webkit-scrollbar { display: none; }
.fpv-fig { position: relative; flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: start; }
.fpv-media, .fpv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.fpv-video { background: transparent; }
.fpv-fig--none { background: var(--z-800); }

/* The photos of one footprint: dots on top, ‹ › on a pointer screen. */
.fpv-dots { position: absolute; top: 26px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.fpv-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.fpv-dots i.on { background: #fff; }
.fpv-side {
  position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--fpv-glass); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.fpv-side--prev { left: 10px; }
.fpv-side--next { right: 10px; }
.fpv-side[hidden] { display: none; }

/* Who, where, when, the caption, Share and Open in Otrip — over a fade, like the app's footer. */
.fpv-foot {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 96px 16px 18px;
  background: linear-gradient(180deg, rgba(9, 9, 11, 0) 0%, rgba(9, 9, 11, .55) 45%, rgba(9, 9, 11, .88) 100%);
  pointer-events: none;
}
.fpv-foot a, .fpv-foot button, .fpv-cap { pointer-events: auto; }
.fpv-who { display: flex; align-items: center; gap: 9px; color: #fff; min-width: 0; }
.fpv-who:hover { color: #fff; }
.fpv-who img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1.5px solid rgba(255, 255, 255, .8); }
.fpv-who b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpv-who span { font-size: 13px; color: rgba(255, 255, 255, .7); white-space: nowrap; }
.fpv-place { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .88); }
.fpv-place svg { flex: none; }
.fpv-cap {
  margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: #fff; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-line; overflow-wrap: anywhere;
}
.fpv-cap.is-open { -webkit-line-clamp: unset; max-height: 40vh; overflow-y: auto; }
.fpv-acts { display: flex; gap: 8px; margin-top: 14px; }
.fpv-acts .btn { flex: 1; justify-content: center; }
.fpv-share svg { margin-inline-end: 6px; }

/* Over the stage, the same size as it and clipped to its corners: the progress bar and the
   sound button (both on the video's own picture: --vx/--vy/--vw, set by fitFrame), the
   paused ▶, the loading ring. */
.fpv-hud {
  position: fixed; left: 50%; top: 50%; width: var(--fpv-w); height: var(--fpv-h);
  transform: translate(-50%, -50%); pointer-events: none; border-radius: 16px; overflow: hidden;
}
.fpv-sound {
  position: absolute; top: calc(var(--vy, 0px) + 14px); right: calc(var(--vx, 0px) + 10px); width: 40px; height: 40px;
  display: none; place-items: center; border: 0; border-radius: 50%;
  background: var(--fpv-glass); color: #fff; cursor: pointer; pointer-events: auto;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.fpv.is-video .fpv-sound { display: grid; }
.fpv-glyph {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  display: none; place-items: center; padding-left: 4px; border-radius: 50%;
  background: rgba(0, 0, 0, .42); color: #fff;
}
.fpv.is-video.is-paused .fpv-glyph { display: grid; }
.fpv-spin {
  position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  display: none; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff;
  animation: fpv-spin .8s linear infinite;
}
/* Shown for a photo or video still loading, or a video that stalls — after a quarter
   second, so a picture already in the cache never flashes it. */
.fpv.is-loading .fpv-spin, .fpv.is-video.is-waiting .fpv-spin { display: block; animation: fpv-spin .8s linear infinite, fpv-show .2s .25s both; }
@keyframes fpv-show { from { opacity: 0; } to { opacity: 1; } }
@keyframes fpv-spin { to { transform: rotate(360deg); } }

/* A video's progress along the top edge of its picture, at the picture's width: what has
   played, what has loaded; drag to jump. Its hit area reaches 22px down into the picture. */
.fpv-bar {
  position: absolute; left: var(--vx, 0px); top: var(--vy, 0px); width: var(--vw, 100%); height: 22px;
  display: none; align-items: flex-start; pointer-events: auto; cursor: pointer; touch-action: none;
}
.fpv.is-video .fpv-bar { display: flex; }
/* Until the video's shape is known, the bar and the sound button are not drawn (fitFrame). */
.fpv.is-sizing .fpv-bar, .fpv.is-sizing .fpv-sound { visibility: hidden; }
.fpv-bar:focus-visible { outline: none; }
.fpv-bar__line { position: relative; flex: 1; height: 3px; background: rgba(255, 255, 255, .28); transition: height .12s; }
.fpv-bar__got, .fpv-bar__done { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.fpv-bar__got { width: var(--got, 0%); background: rgba(255, 255, 255, .45); }
.fpv-bar__done { width: var(--done, 0%); background: #fff; }
.fpv-bar__knob {
  position: absolute; top: 50%; left: var(--done, 0%); width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); transform: scale(0); transition: transform .12s;
}
.fpv-bar:hover .fpv-bar__line, .fpv-bar:focus-visible .fpv-bar__line, .fpv.is-scrub .fpv-bar__line { height: 5px; }
.fpv-bar:hover .fpv-bar__knob, .fpv-bar:focus-visible .fpv-bar__knob, .fpv.is-scrub .fpv-bar__knob { transform: scale(1); }
.fpv-bar__time {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 600; color: #fff;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); opacity: 0; transition: opacity .12s; pointer-events: none;
}
.fpv-bar:hover .fpv-bar__time, .fpv-bar:focus-visible .fpv-bar__time, .fpv.is-scrub .fpv-bar__time { opacity: 1; }
/* The time sits where the photo dots are: they step aside while it shows. */
.fpv-dots { transition: opacity .12s; }
.fpv.is-scrub .fpv-dots, .fpv:has(.fpv-bar:hover) .fpv-dots, .fpv:has(.fpv-bar:focus-visible) .fpv-dots { opacity: 0; }
.fpv-bar:focus-visible .fpv-bar__line { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }

/* Close, top left; the footprint arrows, on the right. */
.fpv-close, .fpv-nav button {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--fpv-glass); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.fpv-close { position: fixed; top: 16px; left: 16px; z-index: 2; }
.fpv-nav { position: fixed; right: 24px; top: 50%; transform: translateY(-50%); display: grid; gap: 12px; z-index: 2; }
.fpv-nav button:disabled { opacity: .3; cursor: default; }
.fpv-close:hover, .fpv-nav button:not(:disabled):hover, .fpv-side:hover, .fpv-sound:hover { background: rgba(255, 255, 255, .24); }
.fpv-close:focus-visible, .fpv-nav button:focus-visible, .fpv-side:focus-visible, .fpv-sound:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.fpv-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* "Couldn't load more footprints" — a few seconds, over the bottom of the screen. */
.fpv-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 3;
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px;
  background: rgba(39, 39, 42, .94); color: #fff; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.fpv.is-toast .fpv-toast { opacity: 1; }

/* ── The album shape (an event's photos and videos, its header video): one wide row
   between a top bar (title, "3 of 24", close) and the strip of every photo. ── */
.fpv--album {
  --fpv-top: 64px; --fpv-bottom: 128px;
  --fpv-h: calc(100dvh - var(--fpv-top) - var(--fpv-bottom));
  --fpv-w: min(calc(100vw - 48px), 1200px);
  /* Solid: the event page must not show through behind the photos. */
  background: var(--z-950);
}
.fpv--album.fpv--single { --fpv-bottom: 24px; }
.fpv--album .fpv-page { padding: var(--fpv-top) 0 var(--fpv-bottom); }
.fpv--album .fpv-stage { border-radius: 10px; background: transparent; }
.fpv--album .fpv-hud { top: calc(var(--fpv-top) + var(--fpv-h) / 2); border-radius: 10px; }
.fpv--album .fpv-nav { display: none; }
.fpv--album .fpv-close { left: auto; right: 16px; top: 10px; }
.fpv-title { position: fixed; top: 0; left: 0; right: 76px; height: var(--fpv-top); padding: 0 20px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.fpv-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpv-title span { font-size: 13.5px; color: rgba(255, 255, 255, .65); font-variant-numeric: tabular-nums; }
.fpv-title span:empty { display: none; }
.fpv-caprow {
  position: fixed; left: 0; right: 0; bottom: 84px; height: 36px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px; color: rgba(255, 255, 255, .75);
}
.fpv--single .fpv-caprow { bottom: 0; }
.fpv-caprow span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpv-caprow a { flex: none; color: var(--teal-300); font-weight: 700; }
.fpv-strip {
  position: fixed; left: 0; right: 0; bottom: 0; height: 84px; padding: 8px 20px 18px;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
}
.fpv-strip::-webkit-scrollbar { display: none; }
.fpv-strip button {
  position: relative; flex: none; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 10px;
  overflow: hidden; background: var(--z-800); opacity: .5; cursor: pointer;
}
.fpv-strip button.on { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.fpv-strip button:focus-visible { outline: 2px solid var(--teal-300); outline-offset: 2px; }
.fpv-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fpv-strip__vid { position: absolute; left: 50%; top: 50%; transform: translate(-40%, -50%); width: 0; height: 0; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }

/* A phone (or a narrow window): edge to edge; swipe up and down, and sideways for photos. */
@media (max-width: 640px) {
  .fpv { --fpv-h: 100dvh; --fpv-w: 100vw; }
  .fpv-stage { border-radius: 0; }
  .fpv-nav { display: none; }
  /* The progress bar takes the top edge; close, sound and the dots sit under it. */
  .fpv-hud { border-radius: 0; }
  .fpv-bar { top: max(var(--vy, 0px), env(safe-area-inset-top)); }
  .fpv-close { top: max(30px, calc(env(safe-area-inset-top) + 26px)); left: 12px; width: 40px; height: 40px; }
  .fpv-dots { top: max(44px, calc(env(safe-area-inset-top) + 40px)); }
  .fpv-sound { top: max(calc(var(--vy, 0px) + 14px), calc(env(safe-area-inset-top) + 26px)); }
  .fpv-foot { padding-bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); }
  /* The album keeps its top bar and strip; the photo runs edge to edge between them. */
  .fpv--album { --fpv-top: 56px; --fpv-bottom: calc(118px + env(safe-area-inset-bottom)); --fpv-w: 100vw; }
  .fpv--album.fpv--single { --fpv-bottom: env(safe-area-inset-bottom); }
  .fpv--album .fpv-close { top: max(8px, env(safe-area-inset-top)); left: auto; right: 12px; }
  .fpv-title { padding: 0 16px; }
  .fpv-caprow { bottom: calc(80px + env(safe-area-inset-bottom)); padding: 0 16px; }
  .fpv-strip { height: calc(80px + env(safe-area-inset-bottom)); padding: 8px 16px calc(14px + env(safe-area-inset-bottom)); }
}
/* A touch screen swipes; the ‹ › buttons are for a mouse. */
@media (hover: none) {
  .fpv-side { display: none; }
}
