.gallery-heading { display:flex; align-items:end; justify-content:space-between; gap:1rem; margin:3rem 0 1.5rem; }
.gallery-heading h2 { margin:.4rem 0 0; font-size:1.8rem; }
.gallery-heading > p { color:var(--muted); font:.78rem/1.5 var(--mono); }
.gallery-tools { display:grid; grid-template-columns:minmax(0,2fr) minmax(125px,1fr) minmax(150px,1fr) auto; align-items:end; gap:1rem; padding:1.25rem; border:1px solid var(--rule); border-radius:12px; background:rgba(255,255,255,.45); }
.gallery-tools label { display:grid; gap:.45rem; color:var(--muted); font:600 .8rem/1.5 var(--sans); }
.gallery-tools input,.gallery-tools select,.gallery-reset { width:100%; min-height:44px; padding:.65rem .75rem; border:1px solid var(--rule); border-radius:6px; background:var(--paper); color:var(--ink); font:.95rem/1.3 var(--sans); }
.gallery-tools input:focus-visible,.gallery-tools select:focus-visible,.gallery-reset:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.gallery-reset { cursor:pointer; background:var(--accent); color:white; border-color:var(--accent); }
.gallery-results { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.7rem; margin:.75rem 0 1.25rem; color:var(--muted); font-size:.85rem; }
.gallery-results p { margin:0; }
.gallery-preview { display:flex; align-items:center; gap:.5rem; min-height:32px; }
.gallery-preview input { accent-color:var(--accent); width:16px; height:16px; }
.gallery-empty { padding:2rem; border:1px dashed var(--rule); border-radius:12px; color:var(--muted); text-align:center; }
.album-card { padding:.75rem; background:rgba(255,255,255,.35); border:1px solid var(--rule); border-radius:12px; align-self:start; }
.album-card[hidden] { display:none; }
.album-card img { border-radius:6px; }
.album-card-copy { padding:.85rem .35rem .45rem; }
.album-title { font:600 1.05rem/1.45 var(--sans); letter-spacing:0; margin-top:.4rem; }
.album-meta { font:.85rem/1.5 var(--sans); margin-top:.4rem; }
.album-count { font:.7rem/1.4 var(--mono); }
.album-card:hover { border-color:var(--accent); }
.gallery-dialog { width:min(calc(100% - 2rem),1100px); max-height:calc(100dvh - 2rem); border-radius:14px; overscroll-behavior:contain; }
.viewer-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.8rem; position:sticky; top:0; z-index:2; padding:.7rem 1rem; background:var(--paper); border-bottom:1px solid var(--rule); }
.viewer-options { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; }
.viewer-toolbar .dialog-close { position:static; flex-shrink:0; }
.dialog-action { display:inline-flex; align-items:center; justify-content:center; min-height:38px; border-radius:6px; text-decoration:none; }
.dialog-action:disabled { cursor:default; opacity:.45; }
.dialog-action[hidden] { display:none; }
.viewer-stage { position:relative; overflow:auto; background:#171917; max-height:60dvh; touch-action:pan-y; }
.viewer-stage .dialog-image { display:block; width:100%; height:auto; max-height:60dvh; min-height:200px; object-fit:contain; }
.viewer-stage.is-zoomed { touch-action:auto; }
.viewer-stage.is-zoomed .dialog-image { width:200%; max-width:none; max-height:none; }
.viewer-error { position:absolute; inset:0; padding:3rem 1rem; margin:0; color:white; background:#171917; text-align:center; }
.viewer-navigation { display:flex; align-items:center; justify-content:space-between; gap:.6rem; padding:.7rem 1rem; border-bottom:1px solid var(--rule); }
.viewer-navigation > span { color:var(--muted); font-size:.75rem; text-align:center; }
.dialog-copy { padding:1rem 1.5rem .75rem; }
.dialog-copy h2 { font-size:1.45rem; }
.dialog-copy #dialog-detail { color:var(--muted); font-size:.9rem; margin:.4rem 0; }
.cover-status { overflow-wrap:anywhere; }
.album-thumbnails { display:flex; gap:.6rem; padding:0 1.5rem 1rem; overflow-x:auto; overscroll-behavior-x:contain; }
.album-thumbnail { width:100px; flex:0 0 100px; border-radius:6px; overflow:hidden; }
.album-thumbnail img { width:100%; aspect-ratio:4 / 3; }
.viewer-shell:fullscreen { width:100%; height:100%; overflow:auto; background:var(--paper); }
.viewer-shell:fullscreen .viewer-stage,.viewer-shell:fullscreen .dialog-image { max-height:65dvh; }
@media(max-width:700px) {
  .gallery-heading { align-items:start; flex-direction:column; gap:.2rem; }
  .gallery-heading > p { margin:.3rem 0 0; }
  .gallery-tools { grid-template-columns:1fr 1fr; padding:1rem; gap:.8rem; }
  .gallery-search { grid-column:1 / -1; }
  .gallery-reset { grid-column:1 / -1; }
  .gallery-dialog { width:calc(100% - 1rem); max-height:calc(100dvh - 1rem); }
  .viewer-toolbar { padding:.5rem; }
  .viewer-options { gap:.3rem; }
  .viewer-toolbar .dialog-action { padding:.4rem .45rem; font-size:.7rem; }
  .viewer-toolbar .slide-status { min-width:2.5rem; }
  .viewer-navigation > span { display:none; }
  .viewer-stage,.viewer-stage .dialog-image { max-height:52dvh; }
  .dialog-copy { padding:1rem; }
  .album-thumbnails { padding:0 1rem 1rem; }
}
@media(prefers-reduced-motion:reduce) { .album-card img { transition:none; } }

.viewer-shell:fullscreen .viewer-stage.is-zoomed .dialog-image { max-height:none; }

.camera-slideshow { position:relative; width:100%; height:calc(100cqw / 3 + 96px); overflow:hidden; border-radius:12px; background:#171917; }
.camera-slideshow > img { display:block; width:100%; height:100%; object-fit:cover; object-position:center; }
.camera-overlay { position:absolute; inset:auto 0 0; display:flex; align-items:end; justify-content:space-between; gap:1rem; padding:2rem 1.25rem 1rem; background:linear-gradient(transparent,rgba(0,0,0,.75)); color:#fff; }
.camera-credit { font:600 1.15rem/1.3 var(--sans); }
.camera-overlay p { margin:.3rem 0 0; font-size:.75rem; }
.camera-controls { display:flex; align-items:center; gap:.4rem; }
.camera-controls button { min-width:40px; min-height:40px; padding:.4rem .65rem; color:#fff; background:rgba(0,0,0,.35); border:1px solid rgba(255,255,255,.65); border-radius:6px; cursor:pointer; }
.camera-controls button:focus-visible { outline:2px solid white; outline-offset:3px; }
#camera-count { font:.75rem/1 var(--mono); white-space:nowrap; margin-left:.3rem; }
@media(max-width:700px) {
 .camera-slideshow { height:calc(100cqw / 2.5 + 96px); }
 .camera-overlay { padding:1.5rem .6rem .6rem; gap:.4rem; }
 .camera-credit { font-size:.85rem; }
 .camera-overlay p { font-size:.6rem; max-width:130px; }
 .camera-controls { gap:.25rem; }
 .camera-controls button { min-width:32px; min-height:36px; padding:.3rem .4rem; font-size:.7rem; }
 #camera-count { font-size:.6rem; }
}

.section:has(.camera-slideshow) { container-type:inline-size; }

.camera-slideshow > .camera-fade-layer { position:absolute; inset:0; opacity:0; pointer-events:none; }
.camera-overlay { z-index:1; }

.camera-slideshow + .album-grid { margin-top:2.5rem; }
