/* Scoped reading surface; theme.json owns the shared palette and typography. */
.stillpaw-app.sp-memorial-page { max-width: 72rem; padding: 1.5rem; margin: 0 auto; }
.sp-memorial { color: var(--wp--preset--color--ink); overflow-wrap: anywhere; }
.sp-memorial [hidden] { display: none !important; }
.sp-memorial-intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; margin-top: 2rem; }
.sp-gallery, .sp-memorial-details { min-width: 0; }
.sp-gallery-slides { display: grid; gap: 1rem; }
.sp-gallery-photo { display: block; aspect-ratio: 1; background: var(--wp--preset--color--subtle); border: 1px solid var(--wp--preset--color--border); border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.sp-gallery-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sp-gallery-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .75rem; }
.sp-memorial button { min-width: 44px; min-height: 44px; background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); border: 1px solid var(--wp--preset--color--border); border-radius: 6px; padding: .5rem .75rem; font: inherit; cursor: pointer; }
.sp-memorial button:hover { background: var(--wp--preset--color--subtle); }
.sp-memorial button svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.sp-memorial :is(button,a):focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 4px; }
.sp-memorial ::selection { color: var(--wp--preset--color--surface); background: var(--wp--preset--color--accent); }
.sp-gallery-count, .sp-lightbox-count { margin: 0; font-variant-numeric: tabular-nums; }

.sp-memorial-details p { margin: 0 0 .75rem; }
.sp-memorial-dates { font-size: 1.125rem; }
.sp-memorial :is(.sp-memorial-dates,.sp-memorial-facts,.sp-memorial-hometown,.sp-memorial-by,.sp-gallery-count) { color: var(--wp--preset--color--muted); }
.sp-memorial-details .sp-memorial-epitaph { margin-top: 2.5rem; margin-bottom: 1.5rem; font-size: clamp(1.375rem, 2.4vw, 1.875rem); line-height: 1.4; }
.sp-memorial-memories { max-width: 70ch; margin: 3rem auto; }
.sp-memorial-memories section + section { margin-top: 3rem; }
.sp-memorial-memories h2 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 1rem; }
.sp-memorial-memories p { margin: 0; line-height: 1.8; }
.sp-lightbox { width: min(72rem, 96vw); max-width: 96vw; max-height: 94dvh; box-sizing: border-box; padding: 1rem; border: 0; border-radius: 12px; color: var(--wp--preset--color--ink); background: var(--wp--preset--color--surface); }
.sp-lightbox::backdrop { background: rgb(0 0 0 / .8); }
.sp-lightbox-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.sp-lightbox > img { display: block; width: 100%; height: min(65dvh, 48rem); object-fit: contain; background: var(--wp--preset--color--subtle); }
.sp-gallery-ready .sp-gallery-photo, .sp-lightbox > img { touch-action: pan-y pinch-zoom; }
.sp-lightbox > img.sp-gallery-zoomed { touch-action: auto; }
@media (max-width: 720px) {
 .stillpaw-app.sp-memorial-page { padding: 1rem; }
 .sp-memorial-intro { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; margin-top: 1.5rem; }
 .sp-memorial-details .sp-memorial-epitaph { margin-top: 1.75rem; }
 .sp-memorial-memories { margin-block: 2.5rem; }
}

/* Shared approved presentation for pending and published content. */
.stillpaw-app.sp-memorial-page { box-sizing:border-box; width:100%; max-width:1200px; padding:48px 36px 72px; min-height:calc(100vh - 190px); }
.sp-memorial { font:16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.sp-memorial-intro { grid-template-columns:minmax(0,480px) minmax(0,1fr); gap:48px; margin-top:0; }
.sp-memorial-details { padding-top:30px; }
.sp-memorial .sp-memorial-details h1 { font-size:48px; line-height:1.18; letter-spacing:-1px; font-weight:650; margin:0 0 24px; }
.sp-memorial .sp-memorial-dates { font-size:23px; margin-bottom:18px; }
.sp-memorial .sp-memorial-hometown { display:flex; align-items:flex-start; gap:10px; margin:28px 0; }
.sp-memorial-hometown svg { flex:none; width:20px; height:24px; }
.sp-memorial-details .sp-memorial-epitaph { font-size:25px; line-height:1.5; margin:32px 0 22px; }
.sp-memorial-memories { max-width:none; margin:40px 0 0; }
.sp-memorial-memories section { border-top:1px solid #d8dee4; padding-top:32px; }
.sp-memorial-memories section + section { margin-top:40px; }
.sp-memorial-memories h2 { font-size:23px; }
.sp-memorial-memories p { max-width:75ch; font-size:17px; line-height:1.8; }
@media(max-width:700px) {
 .stillpaw-app.sp-memorial-page { padding:28px 18px 48px; }
 .sp-memorial-intro { grid-template-columns:minmax(0,1fr); gap:26px; margin:0; }
 .sp-memorial-details { padding:0; }
 .sp-memorial .sp-memorial-details h1 { font-size:38px; }
 .sp-memorial .sp-memorial-dates { font-size:20px; }
 .sp-memorial-details .sp-memorial-epitaph { font-size:22px; }
 .sp-memorial-memories { margin-top:30px; }
 .sp-memorial-memories section { padding-top:26px; }
}

.sp-memorial .sp-memorial-details h1 { margin-bottom:28px; }
.sp-memorial .sp-memorial-dates { margin-bottom:20px; }
.sp-memorial .sp-gallery-controls { font-size:14px; }
.sp-memorial .sp-gallery-controls > button { min-width:54px; }
.sp-memorial .sp-memorial-memories h2 { margin-bottom:20px; }
.sp-memorial .sp-memorial-memories p { margin:0; }
@media(max-width:700px) {
 .sp-memorial .sp-memorial-details h1 { margin-bottom:18px; }
 .sp-memorial .sp-memorial-hometown { margin-top:22px; }
 .sp-memorial-details .sp-memorial-epitaph { margin:24px 0 18px; }
 .sp-memorial-memories p { font-size:16px; }
}

.sp-memorial .sp-memorial-memories p + p { margin-top:16px; }

html:has(.sp-gallery .sp-lightbox[open]) { overflow: hidden; }
.sp-gallery .sp-lightbox { overscroll-behavior: contain; }
[data-access-ended] :is(label, textarea) { display: block; }
[data-access-ended] textarea { width: 100%; box-sizing: border-box; }
