#project-dialog{width:min(1020px,calc(100% - 32px));border:1px solid var(--control)}#project-dialog>.close-dialog{position:sticky;top:0;z-index:3;box-shadow:0 3px 16px rgba(var(--glow),.1)}
.project-gallery{margin:1.5rem 0 2rem;min-width:0}.project-gallery figure{margin:0}.gallery-stage{display:grid;place-items:center;background:var(--paper);background-image:radial-gradient(ellipse at center,rgba(var(--glow),.07),transparent 75%);border:1px solid var(--line);border-radius:12px;overflow:hidden;height:clamp(220px,52vh,540px);isolation:isolate;touch-action:pan-y pinch-zoom}.gallery-photo{width:100%;height:100%;min-height:0;object-fit:contain}.project-gallery figcaption{padding:1rem .25rem;font-size:1rem;line-height:1.6;color:var(--muted);min-height:3.6rem}.gallery-toolbar{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin:.25rem 0 1rem}.gallery-toolbar button{width:52px;min-height:48px;border-radius:50%;font-size:1.5rem;background:var(--panel);color:var(--ink)}.gallery-toolbar>span{font-variant-numeric:tabular-nums;letter-spacing:.15em;font-size:1rem}.gallery-thumbnails{position:relative;display:flex;gap:.75rem;overflow-x:auto;padding:.5rem .25rem 1rem;scrollbar-width:thin}.gallery-thumbnails button{position:relative;flex:0 0 104px;min-height:78px;padding:5px;background:var(--paper);border:2px solid var(--control);border-radius:8px}.gallery-thumbnails img{width:100%;height:64px;object-fit:contain}.gallery-thumbnails button>span{position:absolute;bottom:3px;right:3px;min-width:24px;background:var(--panel);color:var(--ink);border:1px solid var(--control);font-size:.875rem}.gallery-thumbnails [aria-pressed=true]{outline:3px solid var(--ink);outline-offset:1px}.gallery-thumbnails [aria-pressed=true]>span::before{content:'✓ ';}.gallery-error{padding:2rem;text-align:center}.project-gallery [hidden]{display:none}
:root[data-motion=full] .gallery-photo{animation:gallery-enter .3s ease-out}@keyframes gallery-enter{from{opacity:.5;transform:scale(.985)}to{opacity:1;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.gallery-photo{animation:none!important}}@media(max-width:600px){#project-dialog{width:calc(100% - 24px)}.gallery-stage{height:clamp(200px,42vh,420px)}.gallery-thumbnails button{flex-basis:84px}.gallery-thumbnails img{height:56px}}@media(orientation:landscape) and (max-height:540px){.gallery-stage{height:60vh;min-height:180px}}

/* Preserve the project cover framing; additional gallery photos stay uncropped. */
.gallery-stage>.gallery-crop{width:min(100%,65vh);height:auto;aspect-ratio:1.35}.gallery-crop img{object-fit:initial}.gallery-thumbnails .gallery-crop{height:auto;aspect-ratio:1.35}.gallery-thumbnails .gallery-crop img{height:auto;max-width:none;width:440%}.gallery-thumbnails .creation-crop img{width:220%}.gallery-stage .gallery-crop img{height:auto;width:440%;max-width:none}.gallery-stage .creation-crop img{width:220%}

.project-detail-actions{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;margin-top:1.5rem}.project-detail-actions .button{margin:0}.project-share-status{flex-basis:100%;overflow-wrap:anywhere}.project-pagination{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem;border-top:1px solid var(--line);padding-top:1.25rem;margin-top:2rem}.project-pagination .button{margin:0;flex:1 1 200px}.project-pagination>span{flex-basis:100%;text-align:center;font-variant-numeric:tabular-nums;color:var(--muted)}.project-pagination button:disabled{opacity:.5;cursor:default;transform:none;box-shadow:none}.project-link-status{margin-block:1rem;color:var(--muted)}
