/* =========================================================
   Webitjo Invitations — public invitation
   Colours arrive as --wj-* custom properties from the template.
   ========================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html,
body {
	margin: 0;
	padding: 0;
	min-height: 100%;
}

body.wjinv {
	position: relative;
	color: var(--wj-ink);
	background: var(--wj-bg);
	background-attachment: fixed;
	font-family: var(--wj-font-body);
	font-size: 16px;
	line-height: 1.85;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* ---------- background layers ---------- */

.wj-bg,
.wj-photo,
.wj-pattern {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
}

.wj-bg { background: var(--wj-bg); background-attachment: fixed; }

.wj-photo {
	background-image: var(--wj-bg-image, none);
	background-size: var(--wj-bg-size, cover);
	background-repeat: var(--wj-bg-repeat, no-repeat);
	background-position: center;
	background-attachment: fixed;
	opacity: var(--wj-bg-image-op, 1);
}

.wj-pattern {
	background-image: var(--wj-pattern);
	background-repeat: repeat;
	background-size: 120px 120px;
	opacity: var(--wj-pattern-op);
}

/* ---------- typography ---------- */

.wj-display {
	margin: 0;
	font-family: var(--wj-font-display);
	font-size: clamp(30px, 9vw, var(--wj-display-size));
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0;
}

.wj-display .wj-name { display: block; }

.wj-display .wj-amp {
	display: block;
	margin: 4px 0;
	color: var(--wj-accent);
	font-size: .58em;
}

.wj-h2 {
	margin: 0 0 18px;
	font-family: var(--wj-font-display);
	font-size: clamp(19px, 5.4vw, 25px);
	font-weight: 400;
	line-height: 1.5;
	text-align: center;
	color: var(--wj-ink);
}

.wj-eyebrow {
	margin: 0 0 14px;
	color: var(--wj-accent);
	font-size: .82rem;
	letter-spacing: .04em;
}

.wj-muted { color: var(--wj-muted); }
.wj-center { text-align: center; }

/* ---------- cover gate ---------- */

.wj-cover {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: grid;
	place-items: center;
	padding: 28px;
	background: var(--wj-bg);
	transition: opacity .7s ease, visibility .7s;
}

.wj-cover.is-open {
	opacity: 0;
	visibility: hidden;
}

.wj-cover-inner { text-align: center; }

.wj-cover-kicker {
	margin: 0 0 26px;
	color: var(--wj-muted);
	font-size: .9rem;
	letter-spacing: .06em;
}

.wj-seal {
	display: grid;
	place-content: center;
	gap: 12px;
	width: min(70vw, 250px);
	aspect-ratio: 1;
	padding: 26px;
	border: 1px solid var(--wj-accent);
	border-radius: 50%;
	background: var(--wj-accent-soft);
	color: var(--wj-ink);
	font-family: var(--wj-font-display);
	font-size: 1.28rem;
	line-height: 1.6;
	cursor: pointer;
	transition: transform .3s ease, box-shadow .3s ease;
	box-shadow: 0 0 0 8px var(--wj-accent-soft);
}

.wj-seal-arch { border-radius: 50% 50% 12px 12px; aspect-ratio: 4 / 5; }
.wj-seal-square { border-radius: var(--wj-radius); aspect-ratio: 4 / 5; }

.wj-seal:hover,
.wj-seal:focus-visible { transform: scale(1.03); }

.wj-seal-names {
	display: block;
	font-size: 1.05em;
}

.wj-seal-names .wj-name { display: block; }

.wj-seal-names .wj-amp {
	display: block;
	color: var(--wj-accent);
	font-size: .78em;
}

.wj-seal-cta {
	display: block;
	margin-top: 10px;
	color: var(--wj-accent);
	font-family: var(--wj-font-body);
	font-size: .78rem;
	letter-spacing: .08em;
}

/* ---------- document reveal ---------- */

.wj-doc {
	position: relative;
	z-index: 1;
	max-width: 640px;
	margin: 0 auto;
	padding: 0 20px 132px;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .8s ease, transform .8s ease;
}

.wj-doc.is-visible {
	opacity: 1;
	transform: none;
}

/* One rhythm rule for every section, so nothing cancels out. */
.wj-doc > .wj-s {
	margin: 0;
	padding: 46px 0;
	text-align: center;
}

.wj-doc > .wj-s + .wj-s { border-top: 1px solid var(--wj-line); }

.wj-doc > .wj-hero {
	padding-top: 74px;
	border-top: 0;
}

.wj-doc > .wj-footer { border-top: 1px solid var(--wj-line); }

/* ---------- ornament ---------- */

.wj-orn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 26px auto 0;
	max-width: 190px;
	color: var(--wj-accent);
}

.wj-orn-l {
	flex: 1;
	height: 1px;
	background: currentColor;
	opacity: .45;
}

.wj-orn-d {
	width: 6px;
	height: 6px;
	border-radius: 1px;
	background: currentColor;
	transform: rotate(45deg);
}

.wj-orn-dot span {
	display: inline-block;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--wj-accent);
}

/* ---------- chips ---------- */

.wj-chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 9px;
	margin-top: 24px;
}

.wj-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 15px;
	border: 1px solid var(--wj-line);
	border-radius: 999px;
	background: var(--wj-surface);
	backdrop-filter: blur(var(--wj-blur));
	font-size: .85rem;
	color: var(--wj-ink);
}

.wj-i {
	width: 17px;
	height: 17px;
	flex: none;
	color: var(--wj-accent);
}

/* ---------- cards ---------- */

.wj-card {
	padding: 22px 20px;
	border: 1px solid var(--wj-line);
	border-radius: var(--wj-radius);
	background: var(--wj-surface);
	backdrop-filter: blur(var(--wj-blur));
}

.wj-body-card p { margin: 0 0 12px; }
.wj-body-card p:last-child { margin-bottom: 0; }

.wj-hosts p {
	margin: 0 0 6px;
	font-family: var(--wj-font-display);
	font-size: 1.14rem;
	line-height: 1.7;
}

/* ---------- verse ---------- */

.wj-verse-card {
	padding: 26px 22px;
	border-block: 1px solid var(--wj-line);
}

.wj-verse-text {
	margin: 0;
	font-family: var(--wj-font-display);
	font-size: clamp(17px, 4.6vw, 21px);
	line-height: 2.1;
}

.wj-verse-ref {
	margin: 12px 0 0;
	color: var(--wj-muted);
	font-size: .8rem;
}

/* ---------- deceased ---------- */

.wj-deceased-name {
	margin: 0;
	font-family: var(--wj-font-display);
	font-size: clamp(23px, 6.6vw, 32px);
	line-height: 1.5;
}

.wj-deceased-dates,
.wj-deceased-age,
.wj-deceased-burial {
	margin: 10px 0 0;
	color: var(--wj-muted);
	font-size: .92rem;
}

/* ---------- date leaf ---------- */

.wj-leaf {
	max-width: 220px;
	margin: 0 auto 22px;
	border: 1px solid var(--wj-line);
	border-radius: var(--wj-radius);
	background: var(--wj-surface);
	backdrop-filter: blur(var(--wj-blur));
	overflow: hidden;
}

.wj-leaf-top,
.wj-leaf-bottom {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 11px 14px;
	font-size: .82rem;
	color: var(--wj-muted);
}

.wj-leaf-top {
	border-bottom: 1px solid var(--wj-line);
	color: var(--wj-accent);
	letter-spacing: .04em;
}

.wj-leaf-bottom { border-top: 1px solid var(--wj-line); }

.wj-leaf-dot {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: var(--wj-muted);
	opacity: .6;
}

.wj-leaf-day {
	padding: 16px 0;
	font-family: var(--wj-font-display);
	font-size: 3.4rem;
	line-height: 1;
}

/* ---------- buttons ---------- */

.wj-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border: 1px solid var(--wj-accent);
	border-radius: 999px;
	font: inherit;
	font-size: .88rem;
	text-decoration: none;
	cursor: pointer;
	transition: opacity .2s ease;
}

.wj-btn:hover { opacity: .84; }

.wj-btn-ghost {
	background: transparent;
	color: var(--wj-ink);
}

.wj-btn-solid {
	background: var(--wj-accent);
	color: #fff;
}

.wj-btn-solid .wj-i { color: currentColor; }

.wj-btn-wide { width: 100%; }

.wj-btn:disabled {
	opacity: .55;
	cursor: not-allowed;
}

/* ---------- countdown ---------- */

.wj-count {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 9px;
	max-width: 400px;
	margin: 0 auto;
}

.wj-count-cell {
	padding: 15px 6px;
	border: 1px solid var(--wj-line);
	border-radius: var(--wj-radius);
	background: var(--wj-surface);
	backdrop-filter: blur(var(--wj-blur));
}

.wj-count-cell b {
	display: block;
	font-family: var(--wj-font-display);
	font-size: 1.7rem;
	font-weight: 400;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.wj-count-cell span {
	display: block;
	margin-top: 4px;
	color: var(--wj-muted);
	font-size: .72rem;
}

/* ---------- location ---------- */

.wj-loc-card {
	display: flex;
	align-items: flex-start;
	gap: 13px;
	margin-bottom: 18px;
	text-align: start;
}

.wj-loc-card > .wj-i { margin-top: 3px; }

.wj-loc-name {
	margin: 0;
	font-family: var(--wj-font-display);
	font-size: 1.16rem;
	line-height: 1.6;
}

.wj-loc-city,
.wj-loc-note {
	margin: 5px 0 0;
	color: var(--wj-muted);
	font-size: .88rem;
}

/* ---------- timeline ---------- */

.wj-timeline {
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: start;
}

.wj-tl-item {
	position: relative;
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 14px 0 14px 20px;
	padding-inline: 20px 0;
	border-inline-start: 1px solid var(--wj-line);
	margin-inline-start: 7px;
}

.wj-tl-dot {
	position: absolute;
	inset-inline-start: -4px;
	top: 21px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wj-accent);
}

.wj-tl-body { flex: 1; }

.wj-tl-label {
	margin: 0;
	font-size: 1rem;
}

.wj-tl-note {
	margin: 3px 0 0;
	color: var(--wj-muted);
	font-size: .82rem;
}

.wj-tl-time {
	flex: none;
	color: var(--wj-accent);
	font-size: .84rem;
	font-variant-numeric: tabular-nums;
}

/* ---------- details ---------- */

.wj-detail-list {
	display: grid;
	gap: 10px;
	text-align: start;
}

.wj-detail {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid var(--wj-line);
	border-radius: var(--wj-radius);
	background: var(--wj-surface);
	backdrop-filter: blur(var(--wj-blur));
}

.wj-detail > .wj-i { margin-top: 3px; }

.wj-detail-label { margin: 0; font-size: .95rem; }

.wj-detail-sub {
	margin: 3px 0 0;
	color: var(--wj-muted);
	font-size: .82rem;
}

/* ---------- gallery ---------- */

.wj-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 9px;
}

.wj-shot {
	margin: 0;
	border-radius: calc(var(--wj-radius) - 4px);
	overflow: hidden;
	aspect-ratio: 3 / 4;
	background: var(--wj-accent-soft);
}

.wj-shot img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---------- forms ---------- */

.wj-form {
	display: grid;
	gap: 15px;
	text-align: start;
}

.wj-field { display: block; }

.wj-label {
	display: block;
	margin-bottom: 7px;
	color: var(--wj-muted);
	font-size: .82rem;
}

.wj-label em {
	font-style: normal;
	opacity: .7;
}

.wj-form input[type="text"],
.wj-form input[type="tel"],
.wj-form textarea {
	width: 100%;
	padding: 13px 15px;
	border: 1px solid var(--wj-line);
	border-radius: calc(var(--wj-radius) - 4px);
	background: var(--wj-surface);
	color: var(--wj-ink);
	font: inherit;
	font-size: .95rem;
	transition: border-color .2s ease;
}

.wj-form input::placeholder,
.wj-form textarea::placeholder {
	color: var(--wj-muted);
	opacity: .65;
}

.wj-form input:focus,
.wj-form textarea:focus {
	outline: none;
	border-color: var(--wj-accent);
}

.wj-form textarea {
	resize: vertical;
	min-height: 92px;
	line-height: 1.8;
}

.wj-radios { display: grid; gap: 8px; }
.wj-radios-2 { grid-template-columns: 1fr 1fr; }

.wj-radios label {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 12px 14px;
	border: 1px solid var(--wj-line);
	border-radius: calc(var(--wj-radius) - 4px);
	background: var(--wj-surface);
	font-size: .88rem;
	cursor: pointer;
	transition: border-color .2s ease;
}

.wj-radios input { accent-color: var(--wj-accent); flex: none; }

.wj-radios label:has(input:checked) {
	border-color: var(--wj-accent);
	background: var(--wj-accent-soft);
}

/* stepper */

.wj-stepper {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	border: 1px solid var(--wj-line);
	border-radius: 999px;
	background: var(--wj-surface);
	padding: 4px;
}

.wj-step {
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wj-ink);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.wj-step:hover { background: var(--wj-accent-soft); }

.wj-stepper output {
	min-width: 44px;
	text-align: center;
	font-size: 1.05rem;
	font-variant-numeric: tabular-nums;
}

/* honeypot */

.wj-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.wj-form-msg {
	margin: 0;
	min-height: 1.2em;
	font-size: .86rem;
	color: var(--wj-accent);
	text-align: center;
}

.wj-form-msg.is-error { color: #c0392b; }

.wj-form.is-done { opacity: .6; pointer-events: none; }

/* ---------- counter ---------- */

.wj-counter-label {
	margin: 0;
	color: var(--wj-muted);
	font-size: .86rem;
}

.wj-counter-num {
	margin: 6px 0 0;
	font-family: var(--wj-font-display);
	font-size: 3rem;
	line-height: 1.2;
	color: var(--wj-accent);
}

/* ---------- wishes ---------- */

.wj-wish-list {
	display: grid;
	gap: 11px;
	margin-top: 26px;
	text-align: start;
}

.wj-wish {
	margin: 0;
	padding: 16px 18px;
	border: 1px solid var(--wj-line);
	border-radius: var(--wj-radius);
	background: var(--wj-surface);
	backdrop-filter: blur(var(--wj-blur));
}

.wj-wish p {
	margin: 0 0 8px;
	font-size: .94rem;
	line-height: 1.8;
}

.wj-wish cite {
	color: var(--wj-accent);
	font-size: .8rem;
	font-style: normal;
}

/* ---------- contact ---------- */

.wj-contact-list { display: grid; gap: 9px; }

.wj-contact-item {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 14px 16px;
	border: 1px solid var(--wj-line);
	border-radius: var(--wj-radius);
	background: var(--wj-surface);
	color: var(--wj-ink);
	text-decoration: none;
	text-align: start;
}

.wj-contact-name { flex: 1; font-size: .94rem; }

.wj-contact-num {
	color: var(--wj-muted);
	font-size: .82rem;
	font-variant-numeric: tabular-nums;
}

/* ---------- closing / footer ---------- */

.wj-closing-text p {
	margin: 0 0 8px;
	font-family: var(--wj-font-display);
	font-size: 1.1rem;
	line-height: 1.9;
}

.wj-closing-names {
	margin: 18px 0 0;
	color: var(--wj-accent);
	font-family: var(--wj-font-display);
	font-size: 1.2rem;
}

.wj-closing-names .wj-name,
.wj-closing-names .wj-amp { display: inline; }

.wj-closing-names .wj-amp { margin: 0 6px; }

.wj-footer-date {
	margin: 0 0 16px;
	color: var(--wj-muted);
	font-size: .84rem;
	letter-spacing: .08em;
	font-variant-numeric: tabular-nums;
}

.wj-share {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border: 1px solid var(--wj-line);
	border-radius: 999px;
	background: var(--wj-surface);
	color: var(--wj-ink);
	font: inherit;
	font-size: .84rem;
	cursor: pointer;
}

.wj-watermark {
	margin: 22px 0 0;
	font-size: .72rem;
	opacity: .55;
}

.wj-watermark a {
	color: var(--wj-muted);
	text-decoration: none;
}

/* ---------- bottom nav ---------- */

.wj-nav {
	position: fixed;
	inset-inline: 0;
	bottom: max(14px, env(safe-area-inset-bottom));
	z-index: 40;
	display: flex;
	justify-content: center;
	gap: 2px;
	width: fit-content;
	max-width: calc(100% - 28px);
	margin: 0 auto;
	padding: 6px;
	border: 1px solid var(--wj-line);
	border-radius: 999px;
	background: var(--wj-surface);
	backdrop-filter: blur(18px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .13);
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .5s ease .5s, transform .5s ease .5s;
	pointer-events: none;
}

.wj-nav.is-visible {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.wj-nav-item {
	display: grid;
	justify-items: center;
	gap: 2px;
	padding: 8px 11px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--wj-ink);
	font: inherit;
	font-size: .66rem;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
}

.wj-nav-item .wj-i { width: 19px; height: 19px; }

.wj-nav-item:hover { background: var(--wj-accent-soft); }

.wj-nav-primary {
	background: var(--wj-accent);
	color: #fff;
	padding-inline: 15px;
}

.wj-nav-primary .wj-i { color: #fff; }

#wj-music-btn[aria-pressed="true"] { background: var(--wj-accent-soft); }

/* Placeholder text, preview only. */
.wj-ph { opacity: .38; }

/* ---------- preview flag ---------- */

.wj-preview-flag {
	position: fixed;
	top: 0;
	inset-inline: 0;
	z-index: 90;
	padding: 7px 14px;
	background: #1B1A17;
	color: #fff;
	font-size: .76rem;
	text-align: center;
}

/* ---------- dark templates ---------- */

.wj-dark .wj-btn-solid { color: #16150F; }
.wj-dark .wj-nav-primary { color: #16150F; }
.wj-dark .wj-nav-primary .wj-i { color: #16150F; }
.wj-dark .wj-nav { box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }

/* ---------- accessibility ---------- */

:focus-visible {
	outline: 2px solid var(--wj-accent);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
	.wj-doc { transform: none; }
}

/* ---------- larger screens ---------- */

@media (min-width: 700px) {
	.wj-doc { padding-inline: 34px; }
	.wj-grid { grid-template-columns: repeat(3, 1fr); }
	.wj-doc > .wj-s { padding-block: 58px; }
}
