/* Gallery page — dark mode, inherits tokens from styles.css */

.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 32px;
  height: var(--nav-h);
  background: rgba(12, 12, 12, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.gallery-nav-back {
  font-family: var(--font-heading);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.gallery-nav-back:hover { color: var(--text); }

.gallery-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  text-align: center;
}

.gallery-eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}

.gallery-header h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.gallery-tagline {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  opacity: 0.75;
  line-height: 1.5;
}

.gallery-intro {
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.gallery-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.gallery-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.gallery-item + .gallery-item { border-top: none; }
.gallery-item:first-child { padding-top: 0; }
.gallery-item:last-child { border-bottom: none; padding-bottom: 0; }

.gallery-figure {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  font: inherit;
  text-align: left;
}

.gallery-figure--zoomable {
  cursor: zoom-in;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gallery-figure--zoomable:hover,
.gallery-figure--zoomable:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(74, 222, 128, 0.08);
  outline: none;
}

.gallery-figure--zoomable:focus-visible {
  box-shadow: 0 0 0 2px var(--bg, #060A10), 0 0 0 4px var(--accent);
}

.gallery-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  pointer-events: none;
}

.gallery-zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-figure--zoomable:hover .gallery-zoom-hint,
.gallery-figure--zoomable:focus-visible .gallery-zoom-hint { opacity: 1; }

.gallery-caption { padding: 4px 0; }

.gallery-step {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
  opacity: 0.7;
}

.gallery-caption h2 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.gallery-caption p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

.gallery-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px 64px;
  border-top: 1px solid var(--border);
}

/* Lightbox */
body.gallery-lightbox-open { overflow: hidden; }

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gallery-lightbox[hidden] { display: none; }

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.gallery-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(30, 30, 30, 0.95);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible {
  background: var(--accent);
  color: #0C0C0C;
  outline: none;
}

.gallery-lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1600px);
  max-height: 92vh;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
}

.gallery-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 80px);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 3px;
}

.gallery-lightbox-caption {
  margin: 10px 4px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 4px;
  background: var(--accent);
  color: #060A10;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.85; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover {
  border-color: rgba(255,255,255,0.3);
  color: var(--text);
}

/* Responsive */
@media (min-width: 768px) {
  .gallery-item {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    gap: 40px;
  }

  .gallery-figure { padding: 14px; }

  .gallery-caption {
    position: sticky;
    top: calc(var(--nav-h) + 20px);
    padding-top: 4px;
  }
}

@media (max-width: 767px) {
  .gallery-header h1 { font-size: 1.9rem; }
  .gallery-main { padding: 0 16px 56px; }
  .gallery-item { padding-bottom: 40px; margin-bottom: 40px; }
  .gallery-zoom-hint { opacity: 1; }
}
