/* Photo-first outer layer. The V1 science renderer and procedures are unchanged. */
.cells-page [hidden]{display:none!important}
.cell-media-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.cell-media-tabs button{flex:1 1 140px;font-size:22px;min-height:48px}
.cell-media-tabs button.active{background:var(--yellow);color:var(--bg-base);border-color:var(--yellow)}
.cell-photo-figure{width:100%;margin:0;min-width:0}
.cell-photo-stage{position:relative;width:100%;aspect-ratio:var(--photo-ar,1.5);overflow:hidden;border:1px solid var(--rule);border-radius:14px;background:#0b1a15;touch-action:pan-y}
.cell-photo-stage[data-draggable=true]{touch-action:none;cursor:grab}
.cell-photo-stage[data-draggable=true]:active{cursor:grabbing}
.cell-photo-stage img{display:block;width:100%;height:100%;object-fit:contain;transform-origin:50% 50%;user-select:none;-webkit-user-select:none;pointer-events:none}
.cell-photo-credit{padding:16px;border:1px solid var(--rule);border-radius:12px;background:var(--bg-deep);margin-top:14px;overflow-wrap:anywhere}
.cell-photo-credit h4{font-size:24px;line-height:1.5;color:var(--yellow);margin:0 0 8px}
.cell-photo-credit p{font-size:22px;line-height:1.6;margin:8px 0}
.cell-photo-credit .rights{font-size:18px;color:var(--muted);line-height:1.7}
.cell-photo-credit a{color:var(--teal);text-underline-offset:3px}
.cell-image-state{font-size:22px;color:var(--yellow);margin:10px 0}
.cell-part-marker{position:absolute;width:48px;height:48px;border:3px solid var(--yellow);border-radius:50%;background:rgba(17,38,31,.20);box-shadow:0 0 0 4px rgba(253,224,71,.17);transform:translate(-50%,-50%);pointer-events:none}
.cell-photo-controls{margin-top:14px;padding-top:12px;border-top:1px solid var(--rule)}
.cell-photo-controls p{font-size:22px;line-height:1.6}
.cell-photo-controls .pan-keys{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.cell-photo-controls .pan-keys button{font-size:22px;min-height:48px;padding:7px 4px;min-width:0;overflow-wrap:anywhere}
.cell-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:22px 0}
.cell-gallery figure{margin:0;min-width:0;border:1px solid var(--rule);border-radius:14px;overflow:hidden;background:var(--bg-deep)}
.cell-gallery img{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:contain;background:#0b1a15}
.cell-gallery figcaption{padding:16px;font-size:22px;line-height:1.6}
.cell-gallery strong{display:block;color:var(--yellow);font-size:24px;margin-bottom:8px}
.cell-gallery .rights{display:block;font-size:18px;color:var(--muted);line-height:1.6;overflow-wrap:anywhere}
.cell-gallery a{color:var(--teal)}
.cells-page .scope-full .cell-photo-figure{height:100%;min-height:0;display:flex;align-items:center;justify-content:center}
.cells-page .scope-full .cell-photo-stage{flex:0 0 auto;width:min(100%,calc(var(--photo-h,420px)*var(--photo-ar,1.5)));max-height:var(--photo-h,420px)}
.cells-page .scope-full .cell-photo-credit{padding:12px}
.cells-page .scope-full .cell-photo-controls{margin-top:12px}
@media(max-width:800px){.cell-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.cell-gallery{grid-template-columns:1fr}}
@media(max-aspect-ratio:1/1){.cells-page .scope-full .cell-photo-figure{height:auto}.cells-page .scope-full .cell-photo-stage{width:100%;max-height:none}}

/* iPad touch-first photo viewer: no directional pad or zoom slider. */
.cell-photo-controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.cell-photo-zoom{font-size:22px;font-weight:700;color:var(--yellow)}
.cell-photo-controls p{flex:1 0 100%;margin:0}
.cell-photo-controls button{min-height:48px;font-size:22px}
.cell-photo-open-full{display:block;margin:0 0 14px;width:100%;min-height:52px;font-size:22px;background:var(--yellow);color:var(--bg-base)}
.scope-full .cell-photo-open-full{display:none}
.cell-photo-source-details{margin-top:16px;border-top:1px solid var(--rule);padding-top:12px}
.cell-photo-source-details summary{font-size:22px;color:var(--teal);cursor:pointer;min-height:44px}
.cell-touch-only .scope-sidebar>.cell-photo-source-details{order:4}
.cell-touch-only .scope-sidebar>.cell-photo-controls{order:3}
.cell-touch-only .scope-sidebar{display:flex;flex-direction:column}
.cell-touch-only .scope-sidebar>p{margin-top:0}
.cell-touch-only .cell-function{margin:12px 0}
.cells-page .scope-full.cell-touch-only .scope-view .lens-wrap{padding:0;gap:8px}
.cell-photo-stage[data-draggable=true]{touch-action:none;-webkit-user-select:none}
@media(max-aspect-ratio:1/1){
 .cells-page .scope-full.cell-touch-only .cell-photo-stage{width:min(100%,calc(50dvh * var(--photo-ar,1.5)));max-height:50dvh}
}
