/* Shutterbench Gallery — client-facing template.
   --accent = photographer's brand color (set by gallery.js).
   Looks: body.look-classic (default) / body.look-editorial / body.look-noir. */
:root {
  --accent: #b48c5a;
  --bg: #ffffff;
  --ink: #1c1a17;
  --ink-soft: #6b665e;
  --line: rgba(28, 26, 23, 0.12);
  --row-h: 250px;
  --display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --track: 0.01em;
}
body.look-editorial {
  --bg: #faf7f2;
  --ink: #262019;
  --ink-soft: #837a6d;
  --line: rgba(38, 32, 25, 0.14);
  --display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --track: 0.02em;
}
body.look-noir {
  --bg: #0f0f10;
  --ink: #f0eeea;
  --ink-soft: #98938b;
  --line: rgba(240, 238, 234, 0.14);
  --track: 0.16em;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; scroll-behavior: smooth; }
body.look-noir { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
button, input { font: inherit; }

/* ---- lock screen ---- */
#lock { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
#lock-form {
  width: min(380px, 100%);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2.75rem 2.25rem;
  background: var(--bg);
}
#lock-logo { max-height: 44px; max-width: 180px; margin-bottom: 1.25rem; }
#lock-form h1 { margin: 0 0 0.25rem; font-family: var(--display); letter-spacing: var(--track); font-size: 1.6rem; font-weight: 600; }
body.look-noir #lock-form h1 { text-transform: uppercase; font-size: 1.2rem; }
#lock-form p { color: var(--ink-soft); margin: 0.25rem 0 1.5rem; font-size: 0.95rem; }
#lock-pw {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 0.8rem;
  background: transparent;
  color: var(--ink);
  text-align: center;
}
.remember { display: block; color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 1.1rem; }
#lock-form button[type='submit'] {
  width: 100%;
  padding: 0.7rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.04em;
}
#lock-msg { color: #c0392b; min-height: 1.5em; margin: 0.8rem 0 0; font-size: 0.9rem; }
#lock-form.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---- hero cover ---- */
#hero { position: relative; height: 92dvh; min-height: 420px; overflow: hidden; }
#hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 6s ease-out, opacity 0.8s ease-out;
  opacity: 0;
}
#hero.ready #hero-img { opacity: 1; transform: scale(1); }
#hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.12), rgba(0,0,0,0) 35%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.45));
}
#hero-inner {
  position: absolute; inset: auto 0 12dvh 0;
  text-align: center;
  color: #fff;
  padding: 0 1.5rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease-out 0.35s, transform 0.9s ease-out 0.35s;
}
#hero.ready #hero-inner { opacity: 1; transform: none; }
#hdr-logo { max-height: 48px; max-width: 190px; margin-bottom: 1rem; filter: drop-shadow(0 1px 8px rgba(0,0,0,0.4)); }
#hdr-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 600;
  letter-spacing: var(--track);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}
body.look-noir #hdr-title { text-transform: uppercase; font-weight: 500; }
#hdr-count {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.85;
}
#hero-cue {
  position: absolute; left: 50%; bottom: 3dvh;
  width: 22px; height: 22px;
  border-right: 2px solid rgba(255,255,255,0.8);
  border-bottom: 2px solid rgba(255,255,255,0.8);
  transform: translateX(-50%) rotate(45deg);
  animation: cue 2s infinite;
}
@keyframes cue { 50% { transform: translateX(-50%) translateY(6px) rotate(45deg); } }

/* ---- toolbar ---- */
#toolbar {
  display: flex; gap: 0.6rem; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 1.6rem 1rem;
}
#toolbar button {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.03em;
}
#toolbar button:hover { border-color: var(--accent); color: var(--accent); }
#zip-status { color: var(--ink-soft); font-size: 0.875rem; }

/* ---- justified grid ---- */
#grid { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 4px 4px; }
body.look-editorial #grid { gap: 10px; padding: 0 10px 10px; }
#grid .ph {
  position: relative;
  margin: 0;
  flex-grow: calc(var(--ar) * 100);
  flex-basis: calc(var(--row-h) * var(--ar));
  aspect-ratio: var(--ar);
  max-height: calc(var(--row-h) * 1.8);
  overflow: hidden;
  cursor: zoom-in;
  background: color-mix(in srgb, var(--ink) 7%, var(--bg));
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}
#grid .ph.in { opacity: 1; transform: none; }
#grid .ph img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.6s ease-out;
}
#grid .ph:hover img { transform: scale(1.025); }
#grid::after { content: ''; flex-grow: 1e4; }
.fav-btn {
  position: absolute; top: 8px; right: 8px;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 999px;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.ph:hover .fav-btn, .fav-btn.on { opacity: 1; }
.fav-btn.on { background: var(--accent); }
@media (hover: none) { .fav-btn { opacity: 1; } }
@media (max-width: 600px) { :root { --row-h: 150px; } #hero { height: 70dvh; } }

/* ---- favorites bar ---- */
#favbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; gap: 0.75rem; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 0.7rem 1rem;
  background: color-mix(in srgb, var(--ink) 94%, var(--bg));
  color: var(--bg);
  font-size: 0.9rem;
  z-index: 5;
}
body.look-noir #favbar { background: #1c1c1e; color: #f0eeea; }
#fav-count { font-weight: 600; }
#fav-msg { opacity: 0.85; }
#favbar button, #favbar a {
  color: inherit;
  background: none;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
#favbar button:hover, #favbar a:hover { border-color: var(--accent); color: var(--accent); }
body.has-favbar { padding-bottom: 64px; }

/* ---- lightbox ---- */
#lb {
  border: 0; padding: 0; background: transparent;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
}
#lb::backdrop { background: rgba(8, 8, 9, 0.96); }
#lb[open] { animation: lbin 0.25s ease-out; }
@keyframes lbin { from { opacity: 0; } }
#lb-img {
  position: absolute; inset: 0; margin: auto;
  max-width: 100vw; max-height: calc(100dvh - 64px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
#lb button { position: absolute; z-index: 2; background: none; border: 0; color: rgba(255,255,255,0.85); cursor: pointer; }
#lb-close { top: 10px; right: 14px; font-size: 2rem; }
#lb-prev, #lb-next { top: 50%; transform: translateY(-50%); font-size: 3rem; padding: 1rem; }
#lb-prev { left: 6px; }
#lb-next { right: 6px; }
#lb-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 1rem; align-items: center; justify-content: center;
  padding: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}
#lb-bar button, #lb-bar a {
  position: static; color: inherit; text-decoration: none;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; padding: 0.25rem 0.8rem;
}
#lb-bar .on { color: var(--accent); border-color: var(--accent); }

/* ---- footer ---- */
#foot { text-align: center; padding: 3rem 1rem 2.5rem; color: var(--ink-soft); font-size: 0.9rem; }
#foot a { color: inherit; }
#foot-contact { color: var(--accent) !important; text-decoration: none; margin-right: 1.5rem; }
#foot-trial { opacity: 0.7; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  #hero-img, #hero-inner, #grid .ph { opacity: 1 !important; transform: none !important; }
  #hero-cue { display: none; }
}
