/* ============================================================
   GALLERY — page-specific styles (extends shared.css)
   ============================================================ */


/* Fixed-height layout required for the scrollable film-roll effect */
html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  overflow: hidden;
}


/* ============================================================
   HEADER — gallery spacing overrides
   ============================================================ */

.site-header {
  gap: 24px;
  padding: 48px 0 28px;
  margin-bottom: 32px;
}


/* ============================================================
   LAYOUT
   ============================================================ */

.roll-wrapper {
  padding-left:  60px;
  padding-right: 60px;
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}

.roll-wrapper::-webkit-scrollbar {
  display: none;
}


/* ============================================================
   ALBUM FILTER
   ============================================================ */

.album-filter:empty {
  display: none;
}

.album-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  transition: border-color 0.3s;
}

.album-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 0.15em;
  padding: 6px 14px;
  cursor: pointer;
  text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s;
}

.album-btn:hover,
.album-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}


/* ============================================================
   GRID GALLERY  (CSS columns — natural masonry)
   ============================================================ */

.gallery {
  columns: 3;
  column-gap: 4px;
}

.frame {
  break-inside: avoid;
  margin-bottom: 4px;
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
  background-color: var(--bg-surface);
  transition: background-color 0.3s;
  display: block;
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity var(--fade-dur, 0.7s) ease var(--fade-delay, 0s),
              transform 0.45s ease;
}

.frame img.is-loaded {
  opacity: 1;
}

.frame:hover img {
  transform: scale(1.03);
}

/* Hover overlay: gradient + text */
.frame-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  pointer-events: none;
}

.frame:hover .frame-overlay {
  opacity: 1;
}

.overlay-number {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
  display: block;
}

.overlay-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.92);
  text-transform: uppercase;
  display: block;
}

/* Missing image placeholder */
.img-placeholder {
  width: 100%;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface);
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px dashed var(--border);
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}


/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 60px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: min(92vw, 1100px);
}

.lightbox-toolbar {
  display: flex;
  justify-content: flex-end;
}

.lightbox-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.22em;
  cursor: pointer;
  padding: 4px 0;
  text-transform: uppercase;
  transition: color 0.2s;
}

.lightbox-close:hover { color: #fff; }

.lightbox-layout {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox-layout.is-ready {
  opacity: 1;
}

/* Landscape image — details below */
.lightbox-layout.is-landscape {
  flex-direction: column;
}

.lightbox-layout.is-landscape .lightbox-img-wrap {
  width: 100%;
}

.lightbox-layout.is-landscape .lightbox-img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.lightbox-layout.is-landscape .lightbox-meta {
  flex: none;
  width: 100%;
  max-height: none;
  overflow-y: visible;
}

.lightbox-layout.is-landscape .lb-specs {
  flex-direction: row;
  flex-wrap: wrap;
  column-gap: 28px;
  row-gap: 10px;
}

.lightbox-img-wrap {
  flex: 1;
  min-width: 0;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
}

/* Metadata panel */
.lightbox-meta {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: 78vh;
  padding-bottom: 4px;
}

.lb-number {
  display: block;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: var(--text-muted);
  transition: color 0.3s;
}

.lb-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1.4;
  transition: color 0.3s;
}

.lb-desc {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.85;
  transition: color 0.3s;
}

.lb-specs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  list-style: none;
  transition: border-color 0.3s;
}

.lb-spec {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lb-spec dt {
  font-size: 12px;
  letter-spacing: 0.35em;
  color: var(--text-muted);
  text-transform: uppercase;
  transition: color 0.3s;
}

.lb-spec dd {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text);
  transition: color 0.3s;
}


/* ============================================================
   LOADING / EMPTY / ERROR
   ============================================================ */

.state-message {
  padding: 80px 0;
  text-align: center;
}

.state-message h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  transition: color 0.3s;
}

.state-message p {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  transition: color 0.3s;
}

.loading-dots::after {
  content: '';
  animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
  0%   { content: '.';   }
  33%  { content: '..';  }
  66%  { content: '...'; }
}


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  margin-top: 48px;
  padding: 28px 0 60px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  text-transform: uppercase;
  transition: color 0.3s, border-color 0.3s;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
  .gallery { columns: 2; }
}

@media (max-width: 560px) {
  .roll-wrapper {
    padding-left:  36px;
    padding-right: 36px;
  }

  /* Override shared.css header mobile values for gallery spacing */
  .site-header {
    gap: 16px;
    padding-top: 32px;
    margin-bottom: 20px;
  }

  .gallery { columns: 1; }

  .lightbox {
    padding: 20px 32px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .lightbox-layout {
    flex-direction: column;
  }

  .lightbox-img {
    width: 100%;
    max-height: none;
  }

  .lightbox-meta {
    flex: none;
    width: 100%;
    max-height: none;
    overflow-y: visible;
  }
}
