/* Supplements ../css/theme.css (shared palette, topbar, and the #date-nav sidebar styles reused
   as-is from the main app). This page has no wrapping "#app" div like the main app does, so body
   itself is the fixed-viewport flex column. */
body { display: flex; flex-direction: column; }
#topbar { flex-shrink: 0; }

#topbar-title { font-size: 16px; font-weight: 600; }

#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Album list (own scroll region, centered content) ── */
#albums-view { flex: 1; overflow-y: auto; padding: 20px; max-width: 1400px; margin: 0 auto; width: 100%; }
#albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.album-card {
  background: var(--surface-variant);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: background .15s;
}
.album-card:hover { background: var(--hover); }
.album-card i { font-size: 28px; color: var(--primary); }
.album-card .album-card-name { font-weight: 600; margin-top: 8px; }
.album-card .album-card-meta { color: var(--on-surface-dim); font-size: 12px; margin-top: 4px; }
#albums-empty { color: var(--on-surface-dim); text-align: center; margin-top: 60px; }

/* ── Album view: header (fixed) + body (fills remaining height) ── */
#album-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#album-header { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 16px 20px 12px; }
#album-title { font-size: 18px; font-weight: 600; }
#album-owner { color: var(--on-surface-dim); font-size: 13px; }

/* Same split as the main app's #grid-area: a scrollable content pane plus the (reused,
   unmodified) #date-nav sidebar from theme.css. */
#album-body {
  flex: 1; display: flex; overflow: hidden;
  max-width: 1400px; margin: 0 auto; width: 100%; padding: 0 20px 20px;
}
#photos-scroll { flex: 1; overflow-y: auto; }

/* ── Photo grid (simple responsive tiles, not the main app's justified/virtualized layout —
   public albums are expected to be small enough that full virtualization isn't worth the
   added code here) ── */
#photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px;
}
.photo-tile { aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--surface-variant); cursor: pointer; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
#load-more-sentinel { height: 1px; }

/* ── Lightbox ── */
#lightbox {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  align-items: center; justify-content: center; z-index: 1000;
}
#lightbox.open { display: flex; }
#lightbox-img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
#lightbox-caption {
  position: absolute; bottom: 16px; left: 0; right: 0;
  text-align: center; color: #eee; font-size: 13px;
}
.lightbox-btn {
  position: absolute; color: #fff; font-size: 22px;
  background: rgba(255,255,255,.08); border-radius: 50%;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
}
.lightbox-btn:hover { background: rgba(255,255,255,.18); }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-download { top: 16px; right: 68px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  #albums-view, #album-body { padding: 12px; }
  #photos-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
