/* ═══════════════════════════════════════════════════════
   photo.css — Photo Viewer (Film Mode)
═══════════════════════════════════════════════════════ */

#page-photo {
  background: var(--film-bg);
}

/* ── Trip Bar ───────────────────────────────────────── */
.trip-bar {
  height: 32px;
  background: var(--film-bar);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  position: relative;
}

.trip-dot {
  width: 5px;
  height: 5px;
  background: var(--accent-red);
  border-radius: 50%;
  flex-shrink: 0;
}
.trip-name {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--film-muted);
}
.trip-back {
  position: absolute;
  left: 2rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  color: var(--film-muted);
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
}
.trip-back:hover { color: var(--film-text); }

/* ── Photo Stage ────────────────────────────────────── */
#photo-stage {
  position: relative;
  height: calc(100vh - var(--nav-h) - 32px - 100px);
  overflow: hidden;
  background: var(--film-bg);
}

/* ── Individual Frame ───────────────────────────────── */
.photo-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}
.photo-frame.visible {
  opacity: 1;
  pointer-events: all;
}

/* Photo background (color swatch / real image) */
.photo-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

/* Film color grade */
.photo-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    155deg,
    rgba(14,18,30,0.22) 0%,
    transparent 45%,
    rgba(30,18,10,0.16) 100%
  );
}

/* Film grain on photo */
.photo-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Illustration layer (SVG overlays) */
.illus-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* ── Text Overlay ───────────────────────────────────── */
.photo-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  transition: opacity 0.4s ease;
}
.photo-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.ov-grad-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 22%;
  background: linear-gradient(to bottom, rgba(10,10,14,0.55) 0%, transparent 100%);
}
.ov-grad-bot {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(
    to top,
    rgba(10,10,14,0.82) 0%,
    rgba(10,10,14,0.4) 42%,
    transparent 100%
  );
}

/* HUD: location + metadata */
.ov-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 5;
}
.ov-loc {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ov-country {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--film-muted);
}
.ov-city {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--film-text);
  letter-spacing: 0.03em;
}
.ov-meta {
  font-family: var(--font-mono);
  font-size: 0.45rem;
  letter-spacing: 0.15em;
  color: var(--film-muted);
  text-align: right;
  line-height: 1.9;
}

/* Text content: emotion + body */
.ov-text {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem 3rem;
  z-index: 5;
}
.ov-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(208,204,200,0.45);
  margin-bottom: 0.5rem;
}
.ov-emotion {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--film-text);
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
  margin-bottom: 0.8rem;
  max-width: 580px;
}
.ov-body {
  font-size: 0.78rem;
  line-height: 1.9;
  color: rgba(208,204,200,0.62);
  max-width: 480px;
  font-weight: 300;
}

/* ── Stage Controls ─────────────────────────────────── */
.stage-ctrl {
  position: absolute;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 20;
}

.s-btn {
  width: 34px;
  height: 34px;
  background: rgba(20,20,24,0.7);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--film-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.s-btn:hover {
  background: rgba(40,40,50,0.9);
  border-color: rgba(255,255,255,0.2);
}
.s-btn.on {
  background: var(--film-text);
  color: var(--film-bg);
  border-color: var(--film-text);
}
.s-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Navigation Arrows ──────────────────────────────── */
.nav-arr {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(20,20,24,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--film-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}
.nav-arr:hover { background: rgba(40,40,50,0.9); }
.nav-arr svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#p-prev { left: 1.5rem; }
#p-next { right: 5rem; }

/* Photo counter */
#p-counter {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: var(--film-muted);
  z-index: 20;
}

/* ── Contact Sheet (Grid overview) ─────────────────── */
#contact-sheet {
  position: absolute;
  inset: 0;
  background: rgba(10,10,14,0.97);
  z-index: 100;
  display: none;
  overflow-y: auto;
  padding: 2rem 2.5rem;
  backdrop-filter: blur(4px);
}
#contact-sheet.open { display: block; }

.cs-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.cs-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--film-text);
}
.cs-cnt {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: var(--film-muted);
}

.cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 2px;
}
.cs-cell {
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  filter: saturate(0.75) brightness(0.7);
  transition: filter 0.2s, transform 0.2s;
}
.cs-cell:hover {
  filter: saturate(0.95) brightness(0.95);
  transform: scale(1.02);
  z-index: 2;
}
.cs-cell-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 0.5rem;
}
.cs-cell-cap {
  font-family: var(--font-mono);
  font-size: 0.42rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.38);
}
.cs-num {
  position: absolute;
  top: 5px;
  left: 6px;
  font-family: var(--font-mono);
  font-size: 0.42rem;
  color: rgba(255,255,255,0.22);
}

/* ── Filmstrip ──────────────────────────────────────── */
#filmstrip {
  height: 100px;
  background: var(--film-bar);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  padding: 0 64px;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
}
#filmstrip::-webkit-scrollbar { display: none; }

/* Perforations */
#filmstrip::before,
#filmstrip::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0, transparent 15px,
    var(--film-bg) 15px, var(--film-bg) 22px
  );
  z-index: 2;
  pointer-events: none;
}
#filmstrip::before { top: 0; }
#filmstrip::after  { bottom: 0; }

.f-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 68px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1.5px solid transparent;
  filter: brightness(0.6) saturate(0.7);
  transition: filter 0.2s, transform 0.2s, border-color 0.2s;
}
.f-thumb:hover {
  filter: brightness(0.82) saturate(0.88);
  transform: translateY(-2px);
}
.f-thumb.active {
  border-color: rgba(208,204,200,0.7);
  filter: brightness(1) saturate(0.95);
  transform: translateY(-3px);
}
.f-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.f-num {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-family: var(--font-mono);
  font-size: 0.4rem;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.1em;
}
