main:has(mnk-photo-album) { background:#faf9f7; border-bottom:1px solid #e4e0dc; }
mnk-photo-album {
  --gallery-red:#8e333b;
  display:block; width:min(calc(100% - 4rem),1200px); margin:auto;
  padding:calc(clamp(6.25rem,9vw,9rem) + env(safe-area-inset-top)) 0 clamp(2.75rem,6vw,5rem); color:#2d2a29;
}
mnk-photo-album [hidden] { display:none !important; }
.gallery-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; border-bottom:1px solid #dbd7d3; padding-bottom:clamp(1.25rem,2.6vw,2rem); margin-bottom:clamp(1rem,2.2vw,1.6rem); }
.gallery-author { display:flex; align-items:center; gap:.65rem; margin:0 0 .6rem; color:var(--gallery-red); font-size:.84rem; font-weight:700; }
.gallery-author::before { content:""; width:1.7rem; border-top:2px solid currentColor; }
.mnk-root .gallery-heading h1 { margin:0; font-size:clamp(2.25rem,4.2vw,4rem); line-height:1.08; letter-spacing:-.045em; font-weight:650; }
.gallery-totals { margin:0; color:#675f5c; white-space:nowrap; font-size:.88rem; font-variant-numeric:tabular-nums; }
.gallery-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(3px,.68vw,9px); }
.gallery-shot { display:block; position:relative; aspect-ratio:1; overflow:hidden; background:#eeeae5; cursor:zoom-in; }
.gallery-shot img,.gallery-thumb img { display:block; width:100%; height:100%; object-fit:cover; }
.gallery-shot[data-gallery-rotation="-90"] img,.gallery-thumb[data-gallery-rotation="-90"] img { transform:rotate(-90deg); }
.gallery-expand { position:absolute; right:.65rem; bottom:.65rem; display:grid; place-items:center; width:32px; height:32px; color:white; background:#201b18be; border-radius:6px; opacity:0; pointer-events:none; }
@media(hover:hover) { .gallery-shot:hover .gallery-expand { opacity:1; } }
.gallery-shot:focus-visible .gallery-expand { opacity:1; }
.gallery-shot:focus-visible { outline:3px solid var(--gallery-red); outline-offset:1px; z-index:1; }

.gallery-open { overflow:hidden; scrollbar-gutter:stable; }
.gallery-dialog {
  --viewer-line:#ffffff24;
  margin:auto; padding:0; width:min(1280px,calc(100vw - 40px)); height:min(960px,calc(100dvh - 40px));
  max-width:none; max-height:none; overflow:hidden; border:1px solid var(--viewer-line); border-radius:12px;
  background:#222121; color:#f7f5f2; box-shadow:0 18px 80px #0008;
}
.gallery-dialog::backdrop { background:#151313dc; }
.gallery-dialog-inner { display:grid; height:100%; grid-template-rows:auto minmax(0,1fr) auto auto; }
.gallery-dialog-header { display:flex; align-items:center; gap:.5rem; padding:.4rem 1rem; border-bottom:1px solid var(--viewer-line); }
.mnk-root .gallery-dialog h2 { margin:0 auto 0 0; font-size:1rem; font-weight:650; }
.gallery-tool,.gallery-retry {
  display:grid; place-items:center; min-width:44px; height:44px; padding:0; border:1px solid var(--viewer-line); border-radius:6px; color:inherit; background:transparent; cursor:pointer; touch-action:manipulation;
}
.gallery-tool svg { display:block; width:20px; height:20px; }
.gallery-tool:enabled:hover,.gallery-retry:hover { background:#ffffff16; }
.gallery-tool:disabled { opacity:.45; }
.gallery-zoom { display:flex; align-items:center; justify-content:center; gap:.35rem; padding:0 .65rem; font-size:.85rem; }
.gallery-zoom[aria-pressed="true"] { background:#f5e6e1; color:#55252a; }
.gallery-viewport { position:relative; min-height:0; overflow:hidden; background:#121111; touch-action:pan-y pinch-zoom; scrollbar-width:none; overscroll-behavior:contain; }
.gallery-viewport::-webkit-scrollbar { display:none; }
.gallery-viewport[data-zoomed="true"] { overflow:auto; touch-action:pan-x pan-y pinch-zoom; cursor:grab; }
.gallery-viewport[data-dragging] { cursor:grabbing; }
.gallery-canvas { position:relative; min-width:100%; min-height:100%; }
.gallery-full-image { position:absolute; left:50%; top:50%; max-width:none; object-fit:contain; transform:translate(-50%,-50%) rotate(var(--photo-rotation,0deg)); user-select:none; -webkit-touch-callout:none; }
.gallery-loading,.gallery-error { position:absolute; inset:0; display:grid; align-content:center; justify-items:center; gap:1rem; text-align:center; font-size:.9rem; }
.gallery-retry { padding:0 1rem; }
.gallery-filmstrip { display:flex; position:relative; gap:6px; overflow-x:auto; overscroll-behavior-x:contain; padding:.65rem .8rem .25rem; border-top:1px solid var(--viewer-line); scrollbar-width:thin; scrollbar-color:#675e5b transparent; }
.gallery-thumb { flex:none; width:54px; height:54px; padding:2px; border:2px solid transparent; border-radius:6px; cursor:pointer; touch-action:manipulation; opacity:.62; }
.gallery-thumb img { border-radius:2px; }
.gallery-thumb:hover,.gallery-thumb:focus-visible { opacity:1; }
.gallery-thumb[aria-current="true"] { border-color:#f2c3ad; opacity:1; }
.gallery-navigation { display:grid; grid-template-columns:44px 7ch 44px; justify-content:center; align-items:center; gap:.65rem; padding:.35rem 1rem .55rem; }
.gallery-position { text-align:center; font-variant-numeric:tabular-nums; font-size:.87rem; font-weight:650; }
.gallery-prev svg { transform:rotate(180deg); }
.gallery-dialog :focus-visible { outline:2px solid #f1bd95; outline-offset:-2px; }

@media(max-width:700px) {
  mnk-photo-album { width:100%; padding:calc(5.75rem + env(safe-area-inset-top)) 0 2.75rem; }
  .gallery-heading { margin-inline:1rem; }
  .gallery-grid { padding-inline:.3rem; }
  .gallery-shot { border-radius:3px; }
}
@media(max-width:700px), (max-height:500px) {
  .gallery-dialog { width:100%; height:100dvh; border:0; border-radius:0; }
  .gallery-dialog-header { padding:max(.4rem,env(safe-area-inset-top)) max(.65rem,env(safe-area-inset-right)) .4rem max(.65rem,env(safe-area-inset-left)); }
  .gallery-filmstrip { padding-inline:max(.8rem,env(safe-area-inset-left)) max(.8rem,env(safe-area-inset-right)); }
  .gallery-navigation { padding-bottom:max(.45rem,env(safe-area-inset-bottom)); }
  .gallery-thumb { width:46px; height:46px; }
}
@media(max-width:500px) { .gallery-heading { display:block; } .gallery-totals { margin-top:.6rem; } }
@media(max-height:500px) {
  .gallery-dialog-header { padding-block:max(.15rem,env(safe-area-inset-top)) .15rem; }
  .gallery-navigation { padding-block:.15rem max(.15rem,env(safe-area-inset-bottom)); }
  .gallery-filmstrip { padding-block:.15rem; }
  .gallery-thumb { width:44px; height:44px; }
}
