/* The shared photo viewer (family-photo-stage.js; 0.1.160, Н8 and Н2): the photo large over the page, three slides
   side by side, one strip of icons over the photo. A phone: the whole page on black; a computer: a window over the page. */
.photo-stage{position:fixed;inset:0;width:100vw;height:100svh;max-width:none;max-height:none;margin:0;padding:0;border:0;box-sizing:border-box;z-index:2000;background:#000;color:#fff;touch-action:none;overflow:hidden;outline:0;font:15px/1.4 system-ui,sans-serif;user-select:none;-webkit-user-select:none}
.photo-stage::backdrop{background:#000}
.photo-stage[hidden]{display:none}
html.photo-stage-open,html.photo-stage-open body{overflow:hidden}
/* The whole photo in what the browser really shows (Andrew 17.10, iPad: the chin went under the edge): the stage is as high
   as the visual viewport, the photo sits between the strip and the caption, never under them. */
.photo-stage{height:min(100svh,var(--stage-vh,100svh))}
.photo-stage-track{position:absolute;inset-inline:0;top:var(--stage-top,0px);bottom:var(--stage-bottom,0px)}
.photo-stage-slide{position:absolute;inset:0;margin:0;display:grid;grid-template:minmax(0,100%)/minmax(0,100%);place-items:center;transition:transform .22s ease-out;will-change:transform}
.photo-stage-slide[hidden]{display:none}
.photo-stage.still .photo-stage-slide{transition:none}
.photo-stage-slide img{max-width:100%;max-height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none;transition:transform .2s ease-out;transform-origin:center}
/* The strip over the photo: × back · «3 из 49» · ▦ · ▶ · ⛶ · print · ↓ (the order mirrors in Hebrew). */
.photo-stage-bar{position:absolute;inset-inline:0;top:0;z-index:3;display:flex;align-items:center;gap:2px;padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) 22px max(6px,env(safe-area-inset-left));background:linear-gradient(#000c,#0000)}
.photo-stage-bar button{flex:none;width:46px;height:46px;padding:0;display:grid;place-items:center;border:0;border-radius:23px;background:transparent;color:#fff;cursor:pointer}
.photo-stage-bar button:hover{background:#ffffff26}
.photo-stage-bar button:focus-visible,.photo-stage-side:focus-visible{outline:3px solid #d7b671;outline-offset:-3px}
.photo-stage-bar button[hidden]{display:none}
.photo-stage-bar button[aria-pressed=true]{color:#d7b671}
.photo-stage-bar svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.photo-stage-play svg path{fill:currentColor}
.photo-stage-play[aria-pressed=true] svg path{fill:none;stroke-width:3}
.photo-stage-count{flex:1;min-width:0;text-align:center;font-size:16px;font-variant-numeric:tabular-nums;white-space:nowrap}
/* ‹ › on a computer, over the photo at its sides. */
.photo-stage-side{position:absolute;top:50%;z-index:2;width:56px;height:56px;margin-top:-28px;padding:0;border:0;border-radius:28px;background:#0008;color:#fff;font-size:36px;line-height:1;cursor:pointer}
.photo-stage-side:hover{background:#000c}
.photo-stage-side:disabled{opacity:0;pointer-events:none}
.photo-stage-prev{inset-inline-start:14px}.photo-stage-next{inset-inline-end:14px}
.photo-stage-caption{position:absolute;inset-inline:0;bottom:0;z-index:2;padding:10px 16px max(12px,env(safe-area-inset-bottom));background:#000;text-align:center;font-size:15px;line-height:1.35;pointer-events:none}
.photo-stage-caption:empty{display:none}
.photo-stage-bar,.photo-stage-caption,.photo-stage-side{transition:opacity .2s}
/* A tap (and the slide show) hides the strip; another tap brings it back. */
.photo-stage.bare .photo-stage-bar,.photo-stage.bare .photo-stage-caption,.photo-stage.bare .photo-stage-side{opacity:0;pointer-events:none}
/* A phone, also lying (narrow or low and not wide): no ⛶, print or ‹ › — a swipe turns, the page is already black. */
@media (max-width:700px),(max-width:950px) and (max-height:500px){.photo-stage .desk{display:none}}
/* All photos of a person: whole photos on a computer (4–6 columns), square tiles on a phone (3 columns). */
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px}
@media (min-width:1500px){.photo-grid{grid-template-columns:repeat(6,1fr)}}
.photo-grid button{position:relative;display:block;width:100%;aspect-ratio:4/3;padding:0;border:0;border-radius:8px;background:#eef1ea;overflow:hidden;cursor:pointer}
.photo-grid img{width:100%;height:100%;object-fit:contain;display:block}
@media (max-width:700px){.photo-grid{grid-template-columns:repeat(3,1fr);gap:3px}.photo-grid button{aspect-ratio:1;border-radius:2px}.photo-grid img{object-fit:cover}}
.photo-grid button[aria-current=true]{outline:3px solid #d7b671;outline-offset:2px}
.photo-grid button.flash{outline:4px solid #d7b671;outline-offset:2px;animation:photo-flash 2s ease-out}
@keyframes photo-flash{0%{box-shadow:0 0 0 6px #d7b671aa}100%{box-shadow:0 0 0 0 #d7b67100}}
.photo-grid-end{grid-column:1/-1;height:1px}
.photo-grid-more{margin:10px auto 0;display:block}
.photo-grid-more[hidden]{display:none}
/* «Reduce motion» in the system: photos change without sliding. */
@media (prefers-reduced-motion:reduce){.photo-stage-slide,.photo-stage-slide img,.photo-stage-bar,.photo-stage-caption,.photo-stage-side{transition:none}.photo-grid button.flash{animation:none}}
/* «Все фото на сайте ↗» in the strip: a light pill, after the buttons. */
.photo-stage-site{display:inline-flex;align-items:center;min-height:36px;margin-inline-start:6px;padding:4px 12px;border:1px solid #ffffff59;border-radius:999px;background:#ffffff1f;color:#fff;font:600 13px/1.2 system-ui,sans-serif;text-decoration:none;white-space:nowrap}.photo-stage-site[hidden]{display:none}.photo-stage-site:hover{background:#ffffff33}.photo-stage-site:focus-visible{outline:3px solid #b68c50;outline-offset:2px}@media (max-width:420px){.photo-stage-site{padding:4px 9px;font-size:12px}}
/* «‹ Карточка: Имя» (Andrew 27.10): from the photos to the person's card. */
.photo-stage-bar .photo-stage-card{flex:0 1 auto;width:auto;height:auto;min-width:0;display:inline-flex;align-items:center;min-height:40px;max-width:46vw;padding:4px 14px;border:1px solid #ffffff8c;border-radius:999px;background:#ffffff2e;color:#fff;font:700 14px/1.2 system-ui,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.photo-stage-bar .photo-stage-card[hidden]{display:none}.photo-stage-bar .photo-stage-card:hover{background:#ffffff40}.photo-stage-card-name{overflow:hidden;text-overflow:ellipsis}@media (max-width:560px){.photo-stage-card-name{display:none}}
/* Words beside the icons where there is room (audit P4-21): a strip of bare pictures says little with a mouse in hand. */
@media (min-width:900px) and (hover:hover){.photo-stage-bar .photo-stage-grid,.photo-stage-bar .photo-stage-play,.photo-stage-bar .photo-stage-film,.photo-stage-bar .photo-stage-print,.photo-stage-bar .photo-stage-save{width:auto;padding:0 14px 0 10px;grid-auto-flow:column;gap:6px}.photo-stage-bar .photo-stage-grid::after,.photo-stage-bar .photo-stage-play::after,.photo-stage-bar .photo-stage-film::after,.photo-stage-bar .photo-stage-print::after,.photo-stage-bar .photo-stage-save::after{content:attr(title);font:600 13px/1 system-ui,sans-serif;white-space:nowrap}}
