/* One photo collection, uncropped viewing and user-controlled navigation. */
.memorial-page .m-photo-album { position:relative; background:#f8f7f1; }
.m-album-legacy-anchor { position:absolute; top:0; scroll-margin-top:80px; }
.personal-space .memorial-page #gallery .m-album-heading { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; }
.personal-space .memorial-page #gallery .m-album-heading h2 { margin:0; }
.m-album-heading>span { flex:none; color:#6b7368; font:400 13px/1.7 'Noto Sans KR',sans-serif; }
.m-album-layout { display:block; max-width:1000px; margin-inline:auto; }
.m-album-image-stage { position:relative; }
.m-album-side { position:absolute; z-index:2; top:50%; transform:translateY(-50%); display:grid; place-items:center; width:48px; height:48px; padding:0; border:1px solid #b8b9a4; border-radius:50%; background:#fffdf3ed; color:#405a46; box-shadow:0 3px 10px #26392122; font:400 32px/1 serif; cursor:pointer; }
.m-album-side-previous { left:10px; }
.m-album-side-next { right:10px; }
.m-album-side:disabled { opacity:.35; cursor:default; }
.m-album-main,.m-album-photo { min-width:0; margin:0; scroll-margin-top:84px; }
.m-album-photo[hidden],.m-photo-album [hidden] { display:none!important; }
.m-album-photos:focus-visible { outline:3px solid #8d784c; outline-offset:5px; }
.m-album-open { display:grid; width:100%; height:clamp(300px,42vw,520px); place-items:center; overflow:hidden; padding:0; border:1px solid #e0e3d8; border-radius:18px; background:#e9ece4; cursor:zoom-in; }
.m-album-open img { display:block; width:100%; height:100%; min-height:0; object-fit:contain; }
.m-album-open:focus-visible,.m-photo-album button:focus-visible,.m-album-other-records>summary:focus-visible { outline:3px solid #9d8450; outline-offset:3px; }
.m-album-caption { padding:20px 0 0; color:#354b3d; }
.m-album-caption h3 { margin:0; font:600 19px/1.6 'Gowun Batang',serif; overflow-wrap:anywhere; }
.m-album-caption p { margin:8px 0 0; color:#697166; font:400 15px/1.8 'Noto Sans KR',sans-serif; overflow-wrap:anywhere; }
.memorial-page .m-album-caption>.cr { position:static; display:flex; justify-content:flex-start; width:auto; margin:12px 0 0; padding:0; border:0; background:transparent; box-shadow:none; }
.m-album-controls,.m-album-viewer-controls { display:flex; align-items:center; gap:12px; margin-top:16px; }
.m-album-controls>button,.m-album-viewer-controls>button { display:grid; place-items:center; flex:none; min-width:44px; height:44px; padding:0 12px; border:1px solid #d8dfd3; border-radius:50%; background:transparent; color:#405a46; font-size:20px; }
.m-album-controls>span,.m-album-viewer-controls>span { min-width:46px; text-align:center; color:#65715f; font-size:12px; font-variant-numeric:tabular-nums; }
.m-album-controls>button:disabled,.m-album-viewer-controls>button:disabled { opacity:.35; cursor:default; }
.m-album-controls>.m-album-enlarge { display:flex; gap:10px; margin-left:auto; border-radius:8px; font:500 13px/1.5 'Noto Sans KR',sans-serif; }
.m-album-enlarge span { font-size:20px; }
.m-album-thumbnails:not([hidden]) { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; max-height:520px; overflow-y:auto; overscroll-behavior:contain; }
.m-album-thumbnails button { position:relative; display:block; min-width:0; padding:3px; border:2px solid transparent; border-radius:10px; background:transparent; cursor:pointer; }
.m-album-thumbnails button[aria-pressed="true"] { border-color:#4d7056; background:#f2f6ed; }
.m-album-thumbnails img { display:block; width:100%; aspect-ratio:1; object-fit:cover; border-radius:5px; }
.m-album-thumbnails span { position:absolute; right:7px; bottom:7px; display:grid; min-width:20px; height:20px; place-items:center; border-radius:50%; background:#fffef2eb; color:#3b5342; font:500 10px/1 sans-serif; }
.m-album-other-records { margin-top:12px; border-top:1px solid #e0e4d9; font-size:13px; }
.m-album-other-records>summary { min-height:44px; padding:12px 0; color:#67745f; cursor:pointer; }
.m-album-other-records>div { padding:4px 0 12px; }
.m-album-other-records h4 { margin:0; color:#435b46; font-size:14px; font-weight:500; }
.m-album-other-records p { font-size:14px; }
.m-album-viewer { position:fixed; inset:0; width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; padding:0; border:0; background:#151a16; color:#f8f6ec; overflow:hidden; }
.m-album-viewer[open] { display:flex; flex-direction:column; }
.m-album-viewer::backdrop { background:#151a16; }
.m-album-viewer>header { display:flex; align-items:center; gap:12px; flex:none; padding:max(12px,env(safe-area-inset-top)) 20px 12px; }
.m-album-viewer>header h2 { flex:1; margin:0; font:500 15px/1.6 'Noto Sans KR',sans-serif; }
.m-album-viewer>header button { min-width:44px; height:44px; padding:0 12px; border:1px solid #657263; border-radius:10px; background:transparent; color:inherit; font-size:13px; }
.m-album-viewer>header [data-album-close] { font-size:28px; }
.m-album-viewer-stage { display:grid; flex:1; min-height:0; place-items:center; overflow:hidden; padding:0 24px; touch-action:pan-y pinch-zoom; }
.m-album-viewer-stage img { display:block; width:100%; height:100%; min-height:0; object-fit:contain; }
.m-album-viewer.is-zoomed .m-album-viewer-stage { display:block; overflow:auto; overscroll-behavior:contain; touch-action:auto; }
.m-album-viewer.is-zoomed .m-album-viewer-stage img { width:200%; max-width:none; height:200%; object-fit:contain; }
.m-album-viewer-caption { flex:none; max-height:24dvh; overflow:auto; padding:16px 24px 0; text-align:center; }
.m-album-viewer-caption h3 { margin:0; font:500 17px/1.6 'Gowun Batang',serif; overflow-wrap:anywhere; }
.m-album-viewer-caption p { margin:6px 0 0; color:#c3cdbc; font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.m-album-viewer-caption p:empty { display:none; }
.m-album-viewer-controls { flex:none; justify-content:center; margin:0; padding:12px 20px max(16px,env(safe-area-inset-bottom)); }
.m-album-viewer-controls>button { border-color:#657263; color:#f8f6ec; }
.m-album-viewer-controls>span { color:#d2dacb; }
body:has(.m-album-viewer[open]) { overflow:hidden; }
body:has(.m-album-viewer[open]) .space-mobile-nav { display:none!important; }
@media(max-width:820px) {
 .m-album-layout { grid-template-columns:minmax(0,1fr); gap:20px; }
 .personal-space .memorial-page #gallery .m-album-heading { margin-bottom:18px; }
 .m-album-heading>span { font-size:12px; }
 .m-album-open { height:clamp(240px,72vw,410px); border-radius:14px; touch-action:pan-y pinch-zoom; }
 .m-album-caption { padding-top:16px; }
 .m-album-caption h3 { font-size:18px; }
 .m-album-caption p { font-size:14px; }
 .m-album-thumbnails:not([hidden]) { grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; max-height:none; overflow:visible; }
 .m-album-viewer>header { padding-inline:14px; }
 .m-album-viewer-stage { padding-inline:8px; }
 .m-album-viewer-caption { padding-inline:18px; }
}
@media print {
 .m-photo-album [data-album-photo][hidden] { display:block!important; }
 .m-album-photo { break-inside:avoid; margin-bottom:24px; }
 .m-album-layout { display:block; }
 .m-album-thumbnails,.m-album-controls,.m-album-viewer { display:none!important; }
}
