:root {
  --bg: #111111;
  --fg: #f0f0f0;
  --muted: #a0a0a0;
  --accent: #e8e8e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---------- Index page ---------- */

header.site-header {
  padding: 32px 24px 8px;
  text-align: center;
}

header.site-header h1 {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-item {
  width: 150px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-item .thumb-wrap {
  width: 150px;
  height: 262.5px;
  overflow: hidden;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
  opacity: 0.9;
}

/* ---------- Viewer page ---------- */

.viewer {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.viewer-image-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
  cursor: zoom-in;
}

.viewer-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.hotspot-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  cursor: pointer;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0);
  border: 1px solid rgba(255, 255, 255, 0);
  border-radius: 6px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.hotspot:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.45);
}

/* Clicked state: show the image at native/full resolution.
   The wrapper scrolls if the image is bigger than the window. */
.viewer-image-wrap.native {
  overflow: auto;
  cursor: zoom-out;
  align-items: flex-start;
  justify-content: flex-start;
}

.viewer-image-wrap.native img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}

.viewer-caption {
  text-align: center;
  padding: 12px 16px 0;
  color: #999999;
  font-size: 1.5rem;
  font-style: italic;
  min-height: 1.3em;
}

.viewer-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 14px;
  flex-wrap: wrap;
}

.viewer-controls a.btn {
  background: #222;
  color: var(--fg);
  border: 1px solid #3a3a3a;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.viewer-controls a.btn:hover {
  background: #333;
}

.viewer-controls button {
  background: none;
  color: var(--muted);
  border: none;
  padding: 8px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  opacity: 0.6;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.viewer-controls button:hover {
  opacity: 1;
  color: var(--fg);
}

.viewer-controls button:disabled {
  opacity: 0.2;
  cursor: default;
}

.viewer-controls button:disabled:hover {
  color: var(--muted);
}