#life-album {
  margin-block-start: clamp(40px, 6vw, 78px);
  scroll-margin-block-start: 16px;
}

.life-section:has(#life-album) {
  padding-block-end: clamp(55px, 7vw, 100px);
}

#life-album .album-mast {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.45vw, 20px);
  margin-block-end: clamp(17px, 2.3vw, 30px);
}

#life-album .album-mast::after {
  content: "";
  flex: 1;
  border-block-end: 1px solid var(--line);
}

#album-title {
  flex: 0 0 auto;
  margin: 0;
  font: 500 clamp(18px, 1.55vw, 22px)/1.45 var(--serif);
  letter-spacing: 0;
  white-space: nowrap;
}

#life-album[data-enhanced="true"] :is(#gallery, #gallery-toggle),
body:has(#life-album[data-enhanced="true"]) #lightbox-count {
  display: none;
}

body:has(#life-album[data-enhanced="true"]) .lightbox-toolbar {
  justify-content: flex-end;
}

.trip-stage {
  --stage-height: clamp(280px, min(35.5vw, 49svh), 460px);
  --wing-distance: .34;
  --step-x: calc(var(--wing-distance) * 100cqw);
  --frame-w: 51.5cqw;
  --frame-h: calc(var(--stage-height) - 34px);
  --side-scale: .74;
  --side-blur: 3.2px;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  width: 100%;
  height: var(--stage-height);
  overflow: clip;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}

.trip-frame {
  --x: 0px;
  --scale: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  margin: 0;
  width: min(var(--frame-w), calc(var(--frame-h) * var(--frame-ratio)));
  aspect-ratio: var(--frame-ratio);
  transform: translate(-50%, -50%) translateX(calc(var(--x) + var(--pull, 0px))) scale(var(--scale));
}

.trip-frame[data-slot="0"] { z-index: 4; }
.trip-frame[data-slot="-1"] { --x: calc(-1 * var(--step-x)); --scale: var(--side-scale); }
.trip-frame[data-slot="1"] { --x: var(--step-x); --scale: var(--side-scale); }
.trip-frame[data-slot="-2"] { --x: -65cqw; --scale: .65; }
.trip-frame[data-slot="2"] { --x: 65cqw; --scale: .65; }

.trip-frame .photo-open {
  appearance: none;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.trip-frame .photo-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}

.trip-frame[data-slot="0"] .photo-open { cursor: zoom-in; }
.trip-stage[data-dragging] .photo-open { cursor: grabbing; }
.trip-frame:is([data-slot="-1"], [data-slot="1"]) .photo-open { opacity: .84; }
.trip-frame:not([data-slot="0"]) .photo-open img { filter: blur(var(--side-blur)); }
.trip-frame .photo-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.trip-meta {
  inline-size: min(100%, 48ch);
  margin: clamp(8px, 1.15vw, 16px) auto 0;
  text-align: center;
}

.trip-title {
  font: 500 clamp(17px, 1.38vw, 20px)/1.48 var(--serif);
  color: var(--ink);
  text-wrap: balance;
}

.trip-caption {
  max-inline-size: 56ch;
  margin: 4px auto 0;
  font: 400 14px/1.72 var(--sans);
  color: var(--muted);
  text-wrap: pretty;
}

/* Each grid row takes the height of its longest translated entry. */
.trip-title, .trip-caption, .trip-copy-reserve {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.trip-current-copy, .trip-copy-reserve, .trip-copy-reserve > span {
  grid-area: 1 / 1;
  align-self: start;
}

.trip-copy-reserve { visibility: hidden; user-select: none; pointer-events: none; }
.trip-copy-reserve > span::before { content: attr(data-copy); }

.trip-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .trip-stage:not([data-dragging], [data-seeking]) .trip-frame {
    transition: transform var(--turn-duration, 320ms) var(--slide-ease, cubic-bezier(.22, .74, .26, 1));
  }
  .trip-stage:not([data-seeking]) .photo-open {
    transition: opacity calc(var(--turn-duration, 320ms) * .72) ease-out, transform 160ms ease-out;
  }
  .trip-stage:not([data-seeking]) .photo-open img {
    transition: filter calc(var(--turn-duration, 320ms) * .72) ease-out;
  }
  .trip-frame[data-slot="0"] .photo-open:focus-visible { transform: translateY(-2px); }
  @media (hover: hover) {
    .trip-stage:not([data-dragging]) .trip-frame[data-slot="0"] .photo-open:hover { transform: translateY(-2px); }
  }
}

@media (max-width: 650px) {
  .trip-stage {
    --stage-height: clamp(204px, 59vw, 316px);
    --wing-distance: .39;
    --frame-w: 61cqw;
    --frame-h: calc(var(--stage-height) - 28px);
    --side-scale: .59;
    --side-blur: 2.6px;
  }
  .trip-meta { inline-size: min(100%, 32ch); margin-block-start: 8px; }
}

@media print {
  #album-display { display: none; }
  #life-album[data-enhanced="true"] #gallery { display: grid; }
}
