.page-title {
  margin: 0 0 8px 0;
  font-size: 31px;
  font-weight: 600;
  color: var(--text);
}

.page-desc {
  margin: 0 0 22px 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

.empty { color: var(--muted); font-size: 15px; }
.empty a { color: var(--text); }

/* ── Gallery ─────────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tile {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  padding: 0;
  transition: border-color 150ms, box-shadow 150ms;
  position: relative;
}

.tile img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  transition: transform 220ms ease;
}

.tile:hover {
  border-color: rgba(109,71,21,0.45);
  box-shadow: 0 4px 18px rgba(109,71,21,0.1);
}

.tile:hover img { transform: scale(1.04); }

/* ── Lightbox overlay ────────────────────────── */

.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: rgba(4, 4, 4, 0.9);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.lb-overlay.lb-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Top toolbar ─────────────────────────────── */

.lb-toolbar {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  z-index: 20;
}

.lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms;
  font-size: 13px;
  font-family: inherit;
  white-space: nowrap;
  padding: 0 12px;
  text-decoration: none;
  line-height: 1;
}

.lb-btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
  color: #fff;
}

.lb-info-btn,
.lb-close-btn {
  width: 34px;
  padding: 0;
  flex-shrink: 0;
}

/* Active state for info button */
.lb-info-active {
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.4) !important;
  color: #fff !important;
}

/* ── Main stage ──────────────────────────────── */

.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  /* leaves room for toolbar & counter */
  padding: 52px 0 40px;
}

/* ── Nav buttons ─────────────────────────────── */

.lb-nav {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, opacity 150ms;
  z-index: 10;
  padding: 0;
  line-height: 1;
  margin: 0 10px;
}

.lb-nav:hover:not(:disabled) {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.35);
}

.lb-nav:disabled,
.lb-nav.lb-nav-off {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Image wrapper ───────────────────────────── */

.lb-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  transition: opacity 180ms ease;
}

.lb-img.lb-loading { opacity: 0.25; }

/* ── Metadata panel ──────────────────────────── */
/*
  Sits to the RIGHT of the image, inside .lb-stage.
  It's always in the DOM but has width:0 + overflow:hidden
  when closed, expanding to a fixed width when open.
  The image flex-shrinks naturally to make room.
*/

.lb-meta-panel {
  flex-shrink: 0;
  width: 0;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  /* slide + fade together */
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 300ms ease;
  opacity: 0;
}

.lb-meta-panel.meta-open {
  width: 230px;
  opacity: 1;
}

.lb-meta-scroll {
  width: 230px;            /* fixed inner width so text doesn't reflow */
  padding: 20px 18px 20px 14px;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.lb-meta-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 14px;
  line-height: 1.4;
  word-break: break-word;
}

.meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.meta-row:last-child { margin-bottom: 0; }

.meta-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
}

.meta-value {
  font-size: 13.5px;
  color: rgba(255,255,255,0.82);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  word-break: break-word;
  line-height: 1.4;
}

.meta-empty {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

/* ── Counter ─────────────────────────────────── */

.lb-counter {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.06em;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 1100px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-meta-panel.meta-open { width: 180px; }
  .lb-meta-scroll { width: 180px; }
  .lb-nav { width: 40px; height: 40px; font-size: 19px; margin: 0 4px; }
}

@media (max-width: 480px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { aspect-ratio: 1 / 1; }
  .tile:nth-child(3n+1) { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
  .tile img { width: 100%; height: 100%; }
  /* on very small screens meta panel slides up from bottom instead */
  .lb-stage { flex-direction: column; justify-content: center; padding: 52px 0 40px; }
  .lb-img-wrap { flex: 0 1 auto; height: auto; max-height: 65vh; width: 100%; }
  .lb-img { max-height: 65vh; }
  .lb-prev, .lb-next {
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.55);
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  }
  .lb-prev { margin-bottom: 10px; }
  .lb-next { margin-top: 10px; }
  .lb-meta-panel { width: 100% !important; height: 0; opacity: 0; transition: height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease; border-left: none; }
  .lb-meta-panel.meta-open { height: 180px; width: 100% !important; opacity: 1; }
  .lb-meta-scroll { width: 100%; border-left: none; border-top: 1px solid rgba(255,255,255,0.1); }
}
