/**
 * Loving Digitals — public memorial page (/memorial/<slug>).
 * Standalone document styles: soft, elegant, mobile-first. Shares the product
 * palette (navy / gold) with a softer neutral memorial ground.
 */

:root {
	--ldmp-navy: #0b1f3a;
	--ldmp-navy-2: #102a4c;
	--ldmp-gold: #c9a227;
	--ldmp-gold-2: #b8901f;
	--ldmp-ink: #26303c;
	--ldmp-muted: #6b7684;
	--ldmp-line: #e7e3d9;
	--ldmp-ground: #f6f3ec;
	--ldmp-card: #ffffff;
	--ldmp-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
	--ldmp-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body.ldmp {
	margin: 0;
	background: var(--ldmp-ground);
	color: var(--ldmp-ink);
	font-family: var(--ldmp-sans);
	line-height: 1.65;
	font-size: 17px;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.ldmp-wrap { min-height: 100vh; display: flex; flex-direction: column; }

img { max-width: 100%; height: auto; display: block; }

/* ---- Hero ---- */
.ldmp-hero {
	text-align: center;
	padding: max(40px, env(safe-area-inset-top)) 22px 40px;
	background: linear-gradient(180deg, #fbf9f4 0%, var(--ldmp-ground) 100%);
	border-bottom: 1px solid var(--ldmp-line);
}
.ldmp-hero__photo {
	width: 180px;
	height: 180px;
	margin: 0 auto 24px;
	border-radius: 50%;
	overflow: hidden;
	background: #ece7dc;
	box-shadow: 0 10px 34px rgba(11, 31, 58, 0.16);
	border: 5px solid #fff;
}
.ldmp-hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.ldmp-hero__eyebrow {
	margin: 0 0 6px;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	font-size: 12px;
	font-weight: 700;
	color: var(--ldmp-gold-2);
}
.ldmp-hero__name {
	font-family: var(--ldmp-serif);
	font-weight: 600;
	font-size: clamp(30px, 7vw, 46px);
	line-height: 1.12;
	color: var(--ldmp-navy);
	margin: 0 0 10px;
}
.ldmp-hero__nick { font-family: var(--ldmp-serif); font-style: italic; font-size: 20px; color: var(--ldmp-gold-2); margin: 0 0 8px; }
.ldmp-hero__dates { font-size: 18px; color: var(--ldmp-muted); margin: 0 0 8px; letter-spacing: 0.02em; }
.ldmp-hero__places { font-size: 14px; color: var(--ldmp-muted); margin: 0 0 14px; }
.ldmp-hero__tag { font-style: italic; color: var(--ldmp-ink); margin: 0; }
.ldmp-hero__fh { margin: 16px 0 0; font-size: 13px; color: var(--ldmp-muted); }

/* Optional-feature action buttons */
.ldmp-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
@media (max-width: 600px) { .ldmp-actions { flex-direction: column; } .ldmp-actions .ldmp-btn { width: 100%; text-align: center; } }

/* ---- Layout ---- */
.ldmp-main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 34px 20px; }
.ldmp-section { margin: 0 0 34px; }
.ldmp-card {
	background: var(--ldmp-card);
	border: 1px solid var(--ldmp-line);
	border-radius: 16px;
	padding: 26px 28px;
	box-shadow: 0 2px 14px rgba(11, 31, 58, 0.04);
}
.ldmp-h2 {
	font-family: var(--ldmp-serif);
	font-size: 24px;
	font-weight: 600;
	color: var(--ldmp-navy);
	margin: 0 0 18px;
}
.ldmp-h2--center { text-align: center; margin-bottom: 22px; }
.ldmp-h2--center::after {
	content: "";
	display: block;
	width: 54px;
	height: 3px;
	margin: 12px auto 0;
	border-radius: 2px;
	background: var(--ldmp-gold);
}
.ldmp-muted { color: var(--ldmp-muted); }
.ldmp-small { font-size: 13px; }

/* ---- Service info ---- */
.ldmp-svc { display: grid; gap: 20px; }
@media (min-width: 620px) { .ldmp-svc { grid-template-columns: 1fr 1fr; } }
.ldmp-svc__item { display: flex; flex-direction: column; gap: 3px; }
.ldmp-svc__label {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 11px;
	font-weight: 700;
	color: var(--ldmp-gold-2);
}
.ldmp-svc__value { font-size: 17px; color: var(--ldmp-ink); }
.ldmp-svc__time { display: block; color: var(--ldmp-muted); font-size: 15px; }
.ldmp-directions {
	display: inline-block;
	margin-top: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ldmp-navy);
	text-decoration: none;
	border-bottom: 1px solid var(--ldmp-gold);
	padding-bottom: 1px;
}
.ldmp-directions:hover { color: var(--ldmp-gold-2); }

/* ---- Obituary ---- */
.ldmp-obit__body {
	max-width: 760px;
	margin: 0 auto;
	font-size: 18px;
	line-height: 1.8;
	color: #333c47;
}
.ldmp-obit__body p { margin: 0 0 1.1em; }

/* ---- Gallery ---- */
.ldmp-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}
.ldmp-gallery__item {
	padding: 0;
	border: 0;
	background: #ece7dc;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 1 / 1;
}
.ldmp-gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.ldmp-gallery__item:hover img { transform: scale(1.04); }

/* ---- CTA ---- */
.ldmp-cta { text-align: center; }
.ldmp-btn {
	display: inline-block;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	border-radius: 12px;
	padding: 14px 28px;
	border: 1.5px solid transparent;
	letter-spacing: 0.02em;
}
.ldmp-btn--primary { background: var(--ldmp-navy); color: #fff; border-color: var(--ldmp-navy); }
.ldmp-btn--primary:hover { background: var(--ldmp-navy-2); }
.ldmp-btn--ghost { background: transparent; color: var(--ldmp-navy); border-color: var(--ldmp-navy); }
.ldmp-btn--ghost:hover { background: var(--ldmp-navy); color: #fff; }

/* ---- Share-a-memory form ---- */
.ldmp-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; }
.ldmp-field { margin: 0 0 16px; }
.ldmp-field label { display: block; font-weight: 600; font-size: 14px; color: var(--ldmp-navy); margin: 0 0 6px; }
.ldmp-form input[type=text],
.ldmp-form input[type=email],
.ldmp-form textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 50px;
	padding: 13px 14px;
	font: inherit;
	font-size: 16px; /* no iOS zoom */
	color: var(--ldmp-ink);
	background: #fff;
	border: 1px solid #d8d2c4;
	border-radius: 12px;
	-webkit-appearance: none;
	appearance: none;
}
.ldmp-form textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.ldmp-form input:focus, .ldmp-form textarea:focus {
	outline: none;
	border-color: var(--ldmp-navy);
	box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.1);
}
.ldmp-form input[type=file] { font-size: 15px; color: var(--ldmp-muted); }
.ldmp-help { display: block; margin-top: 6px; font-size: 13px; color: var(--ldmp-muted); }
.ldmp-check { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; font-size: 15px; color: var(--ldmp-ink); }
.ldmp-check input { width: 20px; height: 20px; accent-color: var(--ldmp-navy); }
.ldmp-form .ldmp-btn { width: 100%; }
.ldmp-note {
	background: #eaf6ee;
	border: 1px solid #b7ddc4;
	color: #17663a;
	border-radius: 12px;
	padding: 13px 16px;
	margin: 0 0 18px;
}

/* ---- Memory wall ---- */
.ldmp-wall { display: grid; gap: 16px; }
@media (min-width: 640px) { .ldmp-wall { grid-template-columns: 1fr 1fr; } }
.ldmp-memory {
	background: var(--ldmp-card);
	border: 1px solid var(--ldmp-line);
	border-radius: 14px;
	padding: 18px 20px;
	box-shadow: 0 2px 12px rgba(11, 31, 58, 0.04);
}
.ldmp-memory.is-reply { border-left: 3px solid var(--ldmp-gold); }
.ldmp-memory__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ldmp-memory__name { font-weight: 700; color: var(--ldmp-navy); }
.ldmp-memory__date { font-size: 13px; color: var(--ldmp-muted); white-space: nowrap; }
.ldmp-memory__msg { margin: 0; white-space: pre-line; }
.ldmp-memory__img { margin-top: 12px; border-radius: 10px; }

/* ---- Share row ---- */
.ldmp-share-row { text-align: center; }
.ldmp-copied { display: inline-block; margin-left: 10px; color: #17663a; font-weight: 600; font-size: 14px; }
.ldmp-copied[hidden] { display: none; }

/* ---- Footer ---- */
.ldmp-footer {
	text-align: center;
	padding: 34px 22px calc(34px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--ldmp-line);
	background: #fbf9f4;
}
.ldmp-footer__eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; font-weight: 700; color: var(--ldmp-muted); margin: 0 0 12px; }
.ldmp-footer__logo { max-height: 60px; width: auto; margin: 0 auto 10px; }
.ldmp-footer__name { font-family: var(--ldmp-serif); font-size: 18px; color: var(--ldmp-navy); margin: 0 0 4px; }
.ldmp-footer__contact { margin: 0 0 18px; font-size: 14px; color: var(--ldmp-muted); }
.ldmp-footer__contact a { color: var(--ldmp-navy); text-decoration: none; }
.ldmp-footer__contact a:hover { text-decoration: underline; }
.ldmp-dot { margin: 0 8px; color: var(--ldmp-line); }
.ldmp-footer__powered { font-size: 12px; color: var(--ldmp-muted); letter-spacing: 0.04em; margin: 0; }

/* ---- Lightbox ---- */
.ldmp-lightbox[hidden] { display: none; }
.ldmp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999;
	background: rgba(11, 21, 40, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.ldmp-lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.ldmp-lightbox__close {
	position: absolute;
	top: max(14px, env(safe-area-inset-top));
	right: 18px;
	width: 44px; height: 44px;
	font-size: 30px;
	line-height: 1;
	color: #fff;
	background: transparent;
	border: 0;
	cursor: pointer;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
	body.ldmp { font-size: 16px; }
	.ldmp-card { padding: 20px 18px; border-radius: 14px; }
	.ldmp-hero__photo { width: 150px; height: 150px; }
	.ldmp-main { padding: 26px 16px; }
	.ldmp-obit__body { font-size: 17px; }
}
