/* Hobbies section — gate overlay, full-bleed photo wall, lightbox.
   Relies on the design tokens defined in styles.css (loaded first). */

/* ===== Gate ===== */
html.gate-locked { overflow: hidden; }
html.gate-locked body > *:not(#gate) { display: none !important; }

#gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper);
}
#gate-form {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gate-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
#gate-form h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0; }
.gate-sub { margin: 0 0 8px; color: var(--ink-soft); }
.gate-row { display: flex; gap: 8px; }
#gate-input {
  flex: 1;
  padding: 11px 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
}
#gate-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#gate-form button {
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
#gate-form button:hover { background: var(--accent); }
.gate-error { margin: 4px 0 0; font-size: 0.85rem; color: var(--accent); }
.gate-back {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--steel);
  transition: color 0.2s;
}
.gate-back:hover { color: var(--ink); }

/* ===== Photo wall ===== */
.wall-main { padding: 0 0 60px; }
.wall-head {
  max-width: var(--container);
  margin: 0 auto;
  padding: 36px 24px 22px;
}
.wall-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.wall-error {
  padding: 48px 24px;
  font-family: var(--font-mono);
  color: var(--steel);
}

/* Justified rows (see justified.js): every photo keeps its own aspect ratio, rows run
   edge to edge, order is left-to-right then top-to-bottom, newest first. */
.photo-wall { padding: 58px; }
@media (max-width: 760px) { .photo-wall { padding: 40px; } }
.wall-row { display: flex; }
.wall-row.is-capped { justify-content: center; }
.wall-item {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: var(--paper-raised);
}
.wall-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wall-hit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.wall-hit:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* Frosted details, shown when a photo is clicked (never on hover). */
.wall-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 52%, transparent);
  -webkit-backdrop-filter: blur(9px) saturate(115%);
  backdrop-filter: blur(9px) saturate(115%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s;
}
.wall-item.revealed .wall-info { opacity: 1; visibility: visible; }
.wall-place { font-size: 0.86rem; font-weight: 500; line-height: 1.35; }
.wall-date { font-size: 0.78rem; color: var(--ink-soft); letter-spacing: 0.02em; }
.wall-item.highlight .wall-info { padding: 22px 26px; }
.wall-item.highlight .wall-place { font-size: 1rem; }
.wall-item.highlight .wall-date { font-size: 0.86rem; }
.wall-expand {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper-raised) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s, color 0.2s;
}
.wall-expand:hover { background: var(--ink); color: var(--paper); }
.wall-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .wall-info { transition: none; }
}

/* ===== Full-screen viewer ===== */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  background: rgba(8, 10, 16, 0.97);
}
.photo-lightbox.open { display: block; }
.photo-lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-lightbox img {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.photo-lightbox-cap,
.photo-lightbox-count {
  position: absolute;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  color: #f3f5f7;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.photo-lightbox-cap { bottom: 34px; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; font-size: 0.82rem; }
.photo-lightbox-count { bottom: 14px; font-size: 0.72rem; opacity: 0.7; }
.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}
.photo-lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.photo-lightbox-prev { left: 18px; }
.photo-lightbox-next { right: 18px; }
.photo-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(10, 12, 18, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.photo-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

@media (max-width: 760px) {
  .photo-lightbox-prev { left: 8px; }
  .photo-lightbox-next { right: 8px; }
}
