@font-face { font-family: "Ma Shan Zheng"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/ma-shan-zheng/ma-shan-zheng-chinese-simplified-400-normal.woff2") format("woff2"); }
@font-face { font-family: "ChongXi Seal"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/chongxi-seal/chongxi_seal.otf") format("opentype"); }
/* LXGW WenKai GB v1.522 remains the complete-glyph fallback for the brush
   lettering, so uncommon characters do not fall back to a browser default. */
@font-face { font-family: "LXGW WenKai GB"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/lxgw-wenkai-gb/LXGWWenKaiGB-Medium.woff2") format("woff2"); }
.memorial-page { padding-bottom: 3rem; }
.memorial-hero { position: relative; overflow: hidden; padding: 3.25rem 0 2.9rem; background: linear-gradient(135deg,var(--site-teal-dark),var(--site-teal) 55%,#2e6b66); color: #fff; }
.memorial-hero-pattern { position: absolute; inset: 0; opacity: .12; background-image: radial-gradient(circle at 20% 30%,#fff 0 1px,transparent 2px),radial-gradient(circle at 80% 65%,#fff 0 1px,transparent 2px); background-size: 45px 45px,60px 60px; }
.memorial-hero-inner { position: relative; display: grid; grid-template-columns: 190px minmax(0,1fr); align-items: center; gap: 2.25rem; max-width: 920px; background: transparent !important; }
.memorial-portrait { width: 190px; height: 228px; object-fit: contain; border: 4px solid rgba(255,255,255,.88); border-radius: 18px; box-shadow: 0 16px 38px rgba(0,0,0,.3); background: #f1f7f5; }
.memorial-label { color: #f7dfb0; font-size: .9rem; font-weight: 750; letter-spacing: .16em; }
.memorial-identity h1 { margin: .45rem 0 .35rem; font-size: clamp(2.2rem,5vw,3.4rem); letter-spacing: .08em; }
.memorial-lifespan { color: #fff; font-weight: 550; }
.memorial-actions { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1.45rem; }
.memorial-hero .btn-outline-primary, .memorial-hero .btn-outline-secondary { border-color: rgba(255,255,255,.62) !important; color: #fff !important; }
.memorial-hero .btn-outline-primary:hover, .memorial-hero .btn-outline-secondary:hover { border-color: #fff !important; background: rgba(255,255,255,.15) !important; }
.memorial-music { margin-top: 1rem; }
.music-control { width: 58px; height: 58px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 2px solid #07c160; border-radius: 50%; background: #07c160; color: #fff; box-shadow: 0 4px 12px rgba(7,193,96,.32); cursor: pointer; transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.music-control:hover { background: #06ad56; border-color: #06ad56; transform: translateY(-1px); }
.music-control:focus-visible { outline: 3px solid #f7dfb0; outline-offset: 3px; }
.music-control .music-disc { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%; }
.music-control .music-disc i { font-size: 1.3rem; line-height: 1; }
.music-control.is-playing .music-disc { animation: memorialMusicSpin 2.8s linear infinite; }
@keyframes memorialMusicSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.memorial-content-grid { max-width: 1160px; display: grid; grid-template-columns: minmax(310px,.85fr) minmax(0,1.65fr); gap: 1.4rem; padding-top: 2rem; align-items: start; }
.memorial-left-column, .memorial-right-column { min-width: 0; display: flex; flex-direction: column; gap: 1.4rem; }
.memorial-left-column > .memorial-section, .memorial-right-column > .memorial-section { margin-bottom: 0; }
.memorial-section { margin-bottom: 1.4rem; padding: 1.5rem; background: #fff; border: 1px solid var(--site-line); border-radius: 18px; box-shadow: 0 8px 28px rgba(31,70,65,.07); }
.memorial-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.memorial-section-heading h2 { margin: .3rem 0 0; font-size: 1.35rem; }
.memorial-section-heading > span { color: #625a5f; font-size: .9rem; }
.memorial-intro-section { position: relative; overflow: visible; padding: 0 .7rem; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.memorial-scroll-paper { position: relative; z-index: 1; padding: 2rem 2.4rem 2.1rem; background: linear-gradient(90deg,rgba(210,177,116,.34),transparent 10%,transparent 90%,rgba(210,177,116,.34)),linear-gradient(180deg,#f5e8cf 0%,#fffaf0 10%,#fffaf0 90%,#f2e1c2 100%); border-left: 1px solid #c9a873; border-right: 1px solid #c9a873; box-shadow: inset 8px 0 16px rgba(135,93,36,.08),inset -8px 0 16px rgba(135,93,36,.08),0 10px 24px rgba(79,58,28,.12); }
.memorial-scroll-paper::before,.memorial-scroll-paper::after { content: ""; position: absolute; top: 0; bottom: 0; width: 5px; background: linear-gradient(90deg,rgba(142,94,36,.22),rgba(255,255,255,.45),rgba(142,94,36,.12)); }
.memorial-scroll-paper::before { left: 0; }
.memorial-scroll-paper::after { right: 0; }
.memorial-scroll-roller { position: relative; z-index: 2; width: calc(100% + 1.4rem); height: 24px; margin-left: -.7rem; border: 1px solid #8e5d27; border-radius: 999px; background: linear-gradient(180deg,#ead29d 0%,#b27a35 35%,#81501f 52%,#d4ae6d 75%,#f0dca8 100%); box-shadow: 0 4px 8px rgba(73,50,20,.28),inset 0 1px 1px rgba(255,255,255,.75),inset 0 -2px 2px rgba(74,43,13,.35); }
.memorial-scroll-roller::before,.memorial-scroll-roller::after { content: ""; position: absolute; top: 50%; width: 22px; height: 32px; transform: translateY(-50%); border: 1px solid #85531f; border-radius: 50%; background: radial-gradient(ellipse at 35% 30%,#f4dfae 0%,#c48d43 34%,#7a4b1b 72%,#b8782e 100%); box-shadow: 0 3px 6px rgba(73,50,20,.3); }
.memorial-scroll-roller::before { left: -10px; }
.memorial-scroll-roller::after { right: -10px; }
.memorial-scroll-roller-top { margin-bottom: -1px; }
.memorial-scroll-roller-bottom { margin-top: -1px; }
.memorial-intro-section .memorial-section-heading { justify-content: center; text-align: center; margin-bottom: 1.5rem; }
.memorial-intro-section .memorial-section-heading h2 { margin: 0; color: #244a43; font-family: "Ma Shan Zheng", "LXGW WenKai GB", "Noto Serif SC", "Songti SC", SimSun, serif; font-size: 1.85rem; font-weight: 400; letter-spacing: .14em; }
.memorial-intro-section .memorial-section-heading h2::after { content: ""; display: block; width: 72px; height: 2px; margin: .55rem auto 0; background: var(--site-gold); }
.memorial-intro-text { max-width: 660px; margin: 0 auto; color: #26352f; font-family: "Ma Shan Zheng", "LXGW WenKai GB", "Noto Serif SC", "Songti SC", SimSun, serif; font-weight: 400; }
.memorial-intro-text p { margin: 0; }
.memorial-intro-text.is-verse { display: grid; gap: .15rem; text-align: center; font-family: "Ma Shan Zheng", "LXGW WenKai GB", "Noto Serif SC", "Songti SC", SimSun, serif; font-size: 1.22rem; font-weight: 400; line-height: 2.05; letter-spacing: .05em; }
.memorial-intro-text.is-verse p { padding: .42rem .5rem; border-bottom: 1px solid rgba(157,119,63,.28); }
.memorial-intro-text.is-verse p:last-child { border-bottom: 0; }
.memorial-intro-text.is-prose { font-size: 1rem; line-height: 2; text-align: left; }
.memorial-intro-text.is-prose p + p { margin-top: 1rem; }
.memorial-empty-epitaph { margin: 0; padding: 1.2rem; color: #5f575b; text-align: center; background: #faf7f4; border-radius: 10px; }
.memorial-scene { position: relative; min-height: 320px; overflow: hidden; border-radius: 14px; background: #e8efec; }
.memorial-scene > img { display: block; width: 100%; max-height: 620px; object-fit: contain; margin: 0 auto; }
.scene-placeholder { min-height: 360px; display: grid; place-content: center; gap: .75rem; color: #5f575b; text-align: center; }
.scene-placeholder i { font-size: 2.3rem; }
.grave-items-container { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.placed-offering { position: absolute; display: block; width: clamp(22px, 6.5%, 48px); aspect-ratio: 1 / 1; pointer-events: auto; touch-action: none; user-select: none; cursor: move; transform-origin: top left; transition: box-shadow .15s ease; }
.placed-offering img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 3px 10px rgba(0,0,0,.2); pointer-events: none; }
.placed-offering.is-selected { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 4px rgba(138,100,52,.8); }
.placed-offering.dragging { cursor: grabbing; }
.offering-controls { position: absolute; top: .75rem; right: .75rem; z-index: 8; display: flex; align-items: center; gap: .35rem; padding: .35rem .45rem; border: 1px solid rgba(255,255,255,.8); border-radius: 12px; background: rgba(22,59,57,.94); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.22); pointer-events: auto; }
.offering-controls[hidden] { display: none; }
.offering-controls button { min-width: 34px; min-height: 32px; padding: .15rem .45rem; border: 1px solid rgba(255,255,255,.65); border-radius: 6px; background: #fff; color: #2b2327; font: inherit; font-weight: 700; line-height: 1; cursor: pointer; }
.offering-controls button:hover, .offering-controls button:focus-visible { background: #e7f1ed; }
.offering-controls .offering-controls-remove { background: #ffe8e8; color: #8a1c1c; }
.offering-controls-label { min-width: 58px; text-align: center; font-size: .8rem; white-space: nowrap; }
.offering-panel { margin-top: 1rem; padding: 1rem; border: 1px solid var(--site-line); border-radius: 14px; background: #f5faf8; }
.offering-panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.offering-panel-title span { color: #625a5f; font-size: .88rem; }
.offering-category { display: grid; grid-template-columns: 75px minmax(0,1fr); align-items: center; gap: .5rem; margin-top: .6rem; }
.offering-category > span { color: #554e52; font-size: .9rem; }
.tribute-row { display: flex; gap: .45rem; overflow-x: auto; padding: .2rem; }
.offering-item { flex: 0 0 54px; width: 54px; height: 54px; min-height: 54px; padding: .25rem; background: #fff; border: 1px solid #cbdad6; border-radius: 12px; }
.offering-item:disabled { opacity: .6; cursor: default; }
.offering-item img { width: 100%; height: 100%; object-fit: contain; }
.placed-offering.is-readonly { cursor: default; touch-action: auto; }
.placed-offering.is-readonly:hover { transform: none; }

.memorial-gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; }
.memorial-gallery a { position: relative; display: block; overflow: hidden; aspect-ratio: 1/1; border-radius: 10px; background: #eee8e3; }
.memorial-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.memorial-gallery a:hover img { transform: scale(1.035); }
.memorial-gallery span { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.1rem .65rem .5rem; color: #fff; background: linear-gradient(transparent,rgba(0,0,0,.88)); font-size: .875rem; font-weight: 600; }
.panorama-viewer, .memorial-map { width: 100%; height: 420px; overflow: hidden; border-radius: 12px; }
.location-privacy-note { padding: .75rem; color: #314b46; background: #edf4f1; border: 1px solid #c9dbd6; border-radius: 10px; font-size: .9rem; }
.location-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.map-error { display: grid; place-content: center; height: 100%; color: #842029; }

.guestbook-section { padding: 1.2rem; }
.message-list { max-height: 670px; overflow-y: auto; padding-right: .25rem; }
.message-item { padding: 1rem 0; border-bottom: 1px solid #eee7e1; }
.message-item:last-child { border-bottom: 0; }
.message-item header { display: flex; justify-content: space-between; gap: .7rem; margin-bottom: .55rem; padding: 0 !important; color: inherit !important; text-align: left !important; background: transparent !important; }
.message-item time { color: #50484d; font-size: .875rem; white-space: nowrap; }
.message-item p { margin: 0; color: #4e484b; line-height: 1.75; word-break: break-word; }
.pending-review-button { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: .55rem; margin-bottom: .75rem; border: 1px solid #e8c66b; border-radius: 9px; background: #fff8df; color: #6f5300; }
.pending-container { margin-bottom: .75rem; }
.memorial-section-empty { padding: 2rem 1rem; text-align: center; color: #5f575b; background: #faf8f6; border: 1px solid #d8cfc9; border-radius: 10px; }
.quiet-note { display: flex; gap: .9rem; align-items: flex-start; color: #6f696d; }
.quiet-note i { margin-top: .25rem; color: #b68a5b; }
.quiet-note p { margin: 0; line-height: 1.8; }

@media(max-width:991px){.memorial-content-grid{grid-template-columns:1fr}.memorial-left-column,.memorial-right-column{gap:.8rem}.memorial-hero-inner{grid-template-columns:160px minmax(0,1fr)}.memorial-portrait{width:160px;height:192px}.message-list{max-height:none}}
@media(max-width:650px){.memorial-hero{padding:2rem 0 1.75rem}.memorial-hero-inner{grid-template-columns:1fr;gap:1.15rem;text-align:center}.memorial-portrait{width:132px;height:158px;margin:0 auto;border-width:3px;border-radius:14px}.memorial-label{font-size:.82rem}.memorial-identity h1{margin:.35rem 0 .25rem;font-size:2rem}.memorial-lifespan{margin:0;font-size:.95rem;line-height:1.7}.memorial-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin-top:1.15rem}.memorial-actions>.btn-primary{grid-column:1/-1}.memorial-actions.has-primary-action>.btn:last-child:nth-child(even),.memorial-actions:not(.has-primary-action)>.btn:last-child:nth-child(odd){grid-column:1/-1}.memorial-actions .btn{width:auto;min-height:44px;padding:.62rem .55rem}.memorial-music{text-align:center}.music-control{width:58px;height:58px}.memorial-content-grid{padding-top:.8rem}.memorial-section{padding:1rem;border-radius:14px}.memorial-intro-section{padding:0 .45rem}.memorial-scroll-paper{padding:1.8rem .95rem 1.9rem}.memorial-scroll-roller{width:calc(100% + .9rem);height:20px;margin-left:-.45rem}.memorial-scroll-roller::before,.memorial-scroll-roller::after{width:18px;height:27px}.memorial-scroll-roller::before{left:-8px}.memorial-scroll-roller::after{right:-8px}.memorial-intro-section .memorial-section-heading{margin-bottom:.9rem}.memorial-intro-section .memorial-section-heading h2{font-size:1.6rem}.memorial-intro-text.is-verse{font-size:1.1rem;line-height:1.95;letter-spacing:.03em}.memorial-intro-text.is-verse p{padding:.42rem .15rem}.memorial-intro-text.is-prose{font-size:1.04rem;line-height:1.95}.memorial-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.panorama-viewer,.memorial-map{height:320px}.location-footer{align-items:stretch;flex-direction:column}.offering-panel-title{align-items:flex-start;flex-direction:column}.offering-category{grid-template-columns:1fr}}

