/* ============================================================
   Film theme: darkroom.
   Near-black, red safelight, contact-sheet monospace HUD.
   ============================================================ */

body.theme-film {
  --bg: #0a0a0b;
  --bg-soft: #101012;
  --surface: #16161a;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #e8e4dc;
  --muted: #8f8b83;
  --faint: #5d5a54;
  --accent: #e2483d;              /* safelight red */
  --accent-soft: rgba(226, 72, 61, 0.12);
  --nav-bg: rgba(10, 10, 11, 0.86);
  --font-display: "Space Mono", "Courier New", monospace;
  --font-body: "Space Mono", "Courier New", monospace;
  --radius: 8px;
}

/* film grain */
body.theme-film::before {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.88 0 0 0 0 0.85 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* safelight glow */
body.theme-film::after {
  content: "";
  position: fixed;
  top: -20vh; right: -10vw;
  width: 55vw; height: 55vh;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(226, 72, 61, 0.12), transparent 75%);
}

body.theme-film h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(2.1rem, 5.6vw, 4rem);
  text-transform: uppercase;
}
body.theme-film h1 em {
  font-style: normal;
  color: var(--accent);
  text-shadow: 0 0 26px rgba(226, 72, 61, 0.55);
}
body.theme-film .kicker { letter-spacing: 0.3em; }
body.theme-film .hero-sub { font-size: 0.92rem; }
body.theme-film .brand span { color: var(--accent); }

/* safelight-on indicator */
.safelight {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.safelight::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(226, 72, 61, 0.9);
  animation: safePulse 2.4s ease-in-out infinite;
}
@keyframes safePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) { .safelight::before { animation: none; } }

/* EXIF-style bracket tags */
body.theme-film .chip {
  border: none;
  border-radius: 0;
  padding: 3px 4px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
body.theme-film .chip::before { content: "["; color: var(--accent); margin-right: 6px; }
body.theme-film .chip::after { content: "]"; color: var(--accent); margin-left: 6px; }
.film-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* ---------- the drying line (photo grid) ---------- */
.line-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.frame-code {
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  color: rgba(226, 72, 61, 0.85);
  text-transform: uppercase;
}
#photo-count {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.photo-grid {
  columns: 3 300px;
  column-gap: 22px;
}
.print {
  break-inside: avoid;
  margin: 0 0 22px;
  background: #f0ece2;               /* the paper of a developed print */
  padding: 10px 10px 8px;
  border-radius: 2px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
  cursor: zoom-in;
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
  position: relative;
}
.print:nth-child(3n + 1) { transform: rotate(-0.5deg); }
.print:nth-child(3n + 2) { transform: rotate(0.4deg); }
.print:hover, .print:focus-visible {
  transform: rotate(0deg) translateY(-5px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(226, 72, 61, 0.12);
  z-index: 2;
  outline: none;
}
/* the pin holding it to the line */
.print::before {
  content: "";
  position: absolute;
  top: -7px; left: 50%;
  width: 9px; height: 9px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f4b9b2, var(--accent) 65%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.print img {
  width: 100%;
  display: block;
  background: #0f0f10;
  min-height: 120px;
}
.print figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 2px 2px;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6d675c;
}
.print .p-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.print .p-num { color: var(--accent); flex: none; }

/* empty state */
.photo-empty {
  position: relative;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  padding: 90px 30px;
  text-align: center;
  color: var(--muted);
}
.photo-empty p b { color: var(--text); font-weight: 700; }
.photo-empty .pe-sub { font-size: 0.78rem; color: var(--faint); margin-top: 10px; }
.photo-empty code { color: var(--accent); }
.film-strip {
  position: absolute;
  left: 0; right: 0;
  height: 24px;
  background-image: radial-gradient(rgba(232, 228, 220, 0.2) 34%, transparent 36%);
  background-size: 28px 15px;
  background-position: center;
  background-repeat: repeat-x;
}
.film-strip.top { top: 10px; }
.film-strip.bottom { bottom: 10px; }

/* ---------- lightbox ---------- */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 7, 7, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  cursor: zoom-out;
  animation: lbIn 0.25s ease;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 100%;
}
.lightbox img {
  max-width: 92vw;
  max-height: 78vh;
  object-fit: contain;
  border: 10px solid #f0ece2;
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(226, 72, 61, 0.1);
  background: #0f0f10;
}
.lightbox figcaption {
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lightbox figcaption b { color: var(--text); font-weight: 700; }
.lightbox figcaption span { color: var(--accent); }
.lightbox .lb-close {
  position: absolute;
  top: 18px; right: 26px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2.2rem;
  line-height: 1;
  opacity: 0.8;
}
.lightbox .lb-close:hover { opacity: 1; }
body.lb-open { overflow: hidden; }

@media (max-width: 880px) {
  .photo-grid { columns: 2 160px; column-gap: 14px; }
  .print { margin-bottom: 14px; padding: 7px 7px 5px; }
}

.gallery-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 26px;
  padding: 24px 28px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  background: var(--bg-soft);
}
.gallery-cta p { color: var(--muted); font-size: 0.84rem; max-width: 520px; }
.gallery-cta .btn { margin-top: 0; border-radius: 4px; }
body.theme-film .btn { border-radius: 4px; }
body.theme-film .btn:hover { box-shadow: 0 0 24px rgba(226, 72, 61, 0.25); }
