:root {
	--bg: #f3e3d6;
	--bg-soft: #ede0d2;
	--ink: #15110d;
	--muted: #4d4239;
	--rule: #b8a08d;
	--rule-soft: #d2bda9;
	--card: #faf2e9;
	--ok: #3e5f44;
	--err: #8c2e22;
	--maxw: 960px;
	--maxw-form: 560px;
	--maxw-prose: 620px;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
	font-size: 20px;
	font-weight: 500;
	line-height: 1.6;
}

.page {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 3rem 2rem 2.5rem;
}

@media (max-width: 600px) {
	.page { padding: 2rem 1.25rem 2rem; }
}

.page--centered {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.page-footer {
	margin-top: 4rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--rule-soft);
	text-align: center;
	font-family: 'Cormorant Garamond', serif;
}

.page-footer p { margin: 0.4rem 0; font-size: 1.05rem; font-weight: 500; }

.footer-monogram {
	font-family: 'Cinzel', serif;
	font-size: clamp(1.6rem, 3.4vw, 2.2rem);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-decoration: underline;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
	color: var(--ink);
	margin: 1rem 0 0.4rem !important;
}

a { color: var(--ink); }

/* --- Masthead --- */
.masthead { text-align: center; }

.masthead-title {
	font-family: 'Cinzel', serif;
	font-weight: 500;
	font-size: clamp(2.2rem, 6.5vw, 4rem);
	letter-spacing: 0.06em;
	margin: 0 0 1.4rem;
	line-height: 1.05;
}

.masthead-title .plus {
	font-weight: 400;
	margin: 0 0.15em;
	font-size: 0.95em;
}

.masthead-subtitle {
	font-family: 'Cormorant Garamond', serif;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: 0.85rem;
	font-weight: 600;
	margin: 0.4rem 0;
	color: var(--ink);
}

.masthead-subtitle.countdown { font-weight: 700; }
.masthead-subtitle--secondary { margin-top: 1.2rem; }

.primary-nav {
	margin: 1.8rem 0 0.5rem;
	display: flex;
	justify-content: center;
	gap: 1.4rem;
	flex-wrap: wrap;
}

.primary-nav a {
	font-family: 'Cormorant Garamond', serif;
	font-style: italic;
	font-size: 1.15rem;
	font-weight: 500;
	color: var(--ink);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	padding-bottom: 0.15rem;
	transition: border-color 0.15s ease;
}

.primary-nav a.is-active { border-bottom-color: var(--ink); }
.primary-nav a:hover { border-bottom-color: var(--muted); }

/* --- Content --- */
.content { margin-top: 1.5rem; }

h1, h2, h3 {
	font-family: 'Cinzel', serif;
	font-weight: 500;
	letter-spacing: 0.05em;
	color: var(--ink);
}

h1 { font-size: 1.8rem; margin: 0 0 0.8rem; }
h2 { font-size: 1.3rem; margin: 1.6rem 0 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; }
h3 { font-size: 1.05rem; margin: 0.6rem 0 0.3rem; }

p { margin: 0.7rem 0; }

.muted { color: var(--muted); }
.small { font-size: 0.95rem; }
.lede { font-size: 1.2rem; font-weight: 500; color: var(--ink); }

.visually-hidden {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Hero photo --- */
.hero-photo {
	position: relative;
	margin: 1.5rem 0;
	aspect-ratio: 16 / 11;
	background: linear-gradient(135deg, #d4c5b8, #c5b29f);
	border: 1px solid var(--rule-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0 1rem;
	color: var(--bg);
	font-family: 'Cormorant Garamond', serif;
	font-style: italic;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.85rem;
	overflow: hidden;
}

.hero-photo.is-filled { background: var(--ink); padding: 0; }

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

.hero-photo--wide { aspect-ratio: 21 / 9; }

@media (max-width: 600px) {
	.hero-photo--wide { aspect-ratio: 16 / 10; }
}

/* --- Inline upload affordance (admin only) --- */
.hero-photo-form {
	position: absolute;
	inset: 0;
	margin: 0;
	pointer-events: none;
}

.hero-photo-btn {
	position: absolute;
	bottom: 0.85rem;
	left: 50%;
	transform: translateX(-50%);
	display: inline-block;
	cursor: pointer;
	pointer-events: auto;
	border: 1px solid rgba(255, 255, 255, 0.85);
	padding: 0.4rem 0.85rem;
	background: rgba(21, 17, 13, 0.6);
	color: #fff;
	font-family: 'Cormorant Garamond', serif;
	font-style: italic;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.8rem;
	opacity: 0;
	transition: opacity 0.15s ease;
	z-index: 2;
}

.hero-photo.is-editable.is-filled::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(21, 17, 13, 0);
	pointer-events: none;
	transition: background 0.15s ease;
	z-index: 1;
}

.hero-photo.is-editable:hover .hero-photo-btn { opacity: 1; }
.hero-photo.is-editable.is-filled:hover::after { background: rgba(21, 17, 13, 0.25); }

/* Always show button when no photo yet */
.hero-photo.is-editable:not(.is-filled) .hero-photo-btn { opacity: 1; }

/* --- Custom resize handle (vertical only) --- */
.hero-photo-resize {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 14px;
	cursor: ns-resize;
	background: linear-gradient(to top, rgba(21, 17, 13, 0.5), rgba(21, 17, 13, 0));
	z-index: 4;
	touch-action: none;
}

.hero-photo-resize::after {
	content: '';
	position: absolute;
	bottom: 4px;
	left: 50%;
	transform: translateX(-50%);
	width: 38px;
	height: 3px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.85);
}

.hero-photo.is-resizing { user-select: none; }
.hero-photo.is-resizing img { pointer-events: none; }

/* --- Editable text --- */
.editable-text {
	white-space: pre-wrap;
	margin: 0.7rem 0;
}

.editable-text.is-placeholder {
	color: var(--muted);
	font-style: italic;
}

.editable-text.is-editable-mode {
	cursor: text;
	border-radius: 2px;
	padding: 0.1rem 0.25rem;
	margin-left: -0.25rem;
	margin-right: -0.25rem;
	transition: background 0.15s ease;
}

.editable-text.is-editable-mode:hover {
	background: rgba(21, 17, 13, 0.06);
	outline: 1px dashed rgba(21, 17, 13, 0.25);
}

.editable-text-edit {
	margin: 0.7rem 0;
}

.editable-textarea {
	width: 100%;
	min-height: 6rem;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--rule);
	background: var(--card);
	color: var(--ink);
	resize: vertical;
}

.editable-text-actions {
	margin-top: 0.4rem;
	display: flex;
	gap: 0.5rem;
}

.editable-text-actions button {
	padding: 0.4rem 0.95rem;
	font-family: 'Cormorant Garamond', serif;
	font-style: italic;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	cursor: pointer;
	border: 1px solid var(--ink);
	background: var(--ink);
	color: var(--bg);
}

.editable-text-actions button.cancel {
	background: transparent;
	color: var(--ink);
}

/* --- Full-bleed background photo (home page) --- */
body.has-hero-bg { background: transparent; }

.hero-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	background:
		linear-gradient(rgba(243, 227, 214, 0.55), rgba(243, 227, 214, 0.35)),
		linear-gradient(135deg, #d4c5b8, #c5b29f);
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 1.25rem;
	overflow: hidden;
	pointer-events: none;
}

.hero-bg.is-filled { background: var(--ink); }

.hero-bg-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero-bg-caption {
	color: rgba(255, 255, 255, 0.7);
	font-family: 'Cormorant Garamond', serif;
	font-style: italic;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.7rem;
	z-index: 1;
}

.hero-bg-form {
	position: absolute;
	bottom: 1.25rem;
	left: 1.25rem;
	z-index: 2;
	pointer-events: auto;
	margin: 0;
}

.hero-bg-btn {
	display: inline-block;
	padding: 0.5rem 0.9rem;
	border: 1px solid rgba(255, 255, 255, 0.85);
	background: rgba(21, 17, 13, 0.6);
	color: #fff;
	font-family: 'Cormorant Garamond', serif;
	font-style: italic;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.8rem;
	cursor: pointer;
}

body.has-hero-bg .page { position: relative; z-index: 1; }

/* --- Admin editing banner --- */
.admin-edit-banner {
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--ink);
	color: var(--bg);
	padding: 0.55rem 1rem;
	text-align: center;
	font-family: 'Cormorant Garamond', serif;
	font-style: italic;
	font-size: 0.95rem;
	letter-spacing: 0.04em;
}

.admin-edit-banner a { color: var(--bg); margin-left: 0.4rem; }
.admin-edit-banner a:hover { color: #fff; }

.photo-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin: 1.5rem 0;
}

.photo-grid .hero-photo { margin: 0; aspect-ratio: 4 / 5; }

@media (max-width: 720px) {
	.photo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
	.photo-grid { grid-template-columns: 1fr; gap: 0.75rem; }
	.photo-grid .hero-photo { aspect-ratio: 16 / 11; }
}

/* --- Event summary (the two-column block at the bottom) --- */
.event-summary {
	display: grid;
	grid-template-columns: 1fr 1px 1fr;
	align-items: center;
	margin: 2.5rem 0 1.5rem;
	text-align: center;
}

.event-summary + .event-summary {
	margin-top: 0.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--rule-soft);
}

.event-summary .col {
	padding: 1.8rem 0.5rem;
	font-family: 'Cinzel', serif;
	font-size: clamp(1.15rem, 2.6vw, 1.75rem);
	letter-spacing: 0.06em;
	line-height: 1.45;
	font-weight: 500;
}

.event-summary .col .line { display: block; }

.event-summary .divider {
	background: var(--ink);
	align-self: stretch;
	width: 1px;
	opacity: 0.6;
}

.event-detail {
	text-align: center;
	margin-top: -0.5rem;
	font-size: 1.15rem;
	font-weight: 500;
	color: var(--ink);
}

.event-detail em { color: var(--muted); font-size: 1rem; font-weight: 500; }

/* --- Forms --- */
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.1rem;
	font-weight: 500;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--rule);
	border-radius: 2px;
	background: var(--card);
	color: var(--ink);
	width: 100%;
}

input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--ink);
	box-shadow: 0 0 0 1px var(--ink);
}

textarea { resize: vertical; }

::placeholder { color: var(--muted); font-style: italic; opacity: 0.85; }

label { display: block; font-family: 'Cormorant Garamond', serif; font-weight: 500; }

/* --- Buttons --- */
.btn, button.btn, input[type="submit"].btn {
	display: inline-block;
	background: var(--ink);
	color: var(--bg);
	border: none;
	padding: 0.75rem 1.7rem;
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.05rem;
	font-weight: 600;
	font-style: italic;
	letter-spacing: 0.06em;
	cursor: pointer;
	border-radius: 2px;
	text-transform: uppercase;
}

.btn:hover { background: #2d2620; }

.btn-link {
	background: none;
	border: none;
	color: var(--ink);
	cursor: pointer;
	font-family: 'Cormorant Garamond', serif;
	font-style: italic;
	font-size: 1rem;
	font-weight: 500;
	padding: 0;
	text-decoration: underline;
}

.btn-link.danger { color: var(--err); }

/* --- Public landing --- */
.public-intro {
	text-align: center;
	margin-top: 1.5rem;
}

.public-intro .lede {
	font-style: italic;
	font-size: 1.25rem;
	font-weight: 500;
	color: var(--ink);
	margin-bottom: 1.8rem;
}

.code-form {
	display: flex;
	gap: 0.5rem;
	max-width: 420px;
	margin: 1rem auto;
	align-items: stretch;
}

.code-form input[type="text"] {
	flex: 1 1 auto;
	min-width: 0;
	text-transform: lowercase;
	text-align: center;
	letter-spacing: 0.08em;
}

.code-form .btn { flex: 0 0 auto; white-space: nowrap; }

/* --- Flashes --- */
.flashes { margin: 1rem 0; display: grid; gap: 0.5rem; }
.flash {
	padding: 0.8rem 1.1rem;
	border: 1px solid var(--rule);
	background: var(--card);
	font-style: italic;
	font-weight: 500;
	font-size: 1.05rem;
	color: var(--ink);
}
.flash--success { border-color: var(--ok); color: var(--ok); }
.flash--error { border-color: var(--err); color: var(--err); }

/* --- RSVP form --- */
.rsvp-form {
	display: grid;
	gap: 1.25rem;
	max-width: var(--maxw-form);
	margin: 0 auto;
}

.guest-card {
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: 3px;
	padding: 1.5rem 1.6rem;
}

.guest-card.has-error {
	border-color: var(--err);
	background: #f7e8e1;
}

.guest-card-name {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
	font-family: 'Cinzel', serif;
	font-size: 1.1rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink);
	padding-bottom: 0.85rem;
	margin-bottom: 1.1rem;
	border-bottom: 1px solid var(--rule-soft);
}

.guest-card-name .name-text { line-height: 1.2; }

.field-errors {
	margin: 0 0 1rem;
	padding-left: 1.3rem;
	color: var(--err);
	font-size: 1rem;
	font-weight: 500;
	font-style: italic;
}

.rsvp-row { margin-bottom: 1.1rem; }
.rsvp-row:last-child { margin-bottom: 0; }

.rsvp-row.name-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

@media (max-width: 480px) {
	.rsvp-row.name-fields { grid-template-columns: 1fr; }
}

.rsvp-row.attendance {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.rsvp-event-label,
.rsvp-field-label {
	display: block;
	font-family: 'Cinzel', serif;
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink);
	margin-bottom: 0.4rem;
}

.rsvp-event-label { margin-bottom: 0; }

.rsvp-options {
	display: flex;
	gap: 0.6rem;
}

.rsvp-option {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	padding: 0.7rem 1rem;
	border: 1px solid var(--rule);
	background: var(--bg);
	cursor: pointer;
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.1rem;
	font-weight: 500;
	color: var(--ink);
	border-radius: 2px;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	user-select: none;
}

.rsvp-option:hover { border-color: var(--ink); background: var(--bg-soft); }

.rsvp-option:focus-within {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

.rsvp-option input {
	margin: 0;
	width: 1rem;
	height: 1rem;
	accent-color: var(--ink);
	cursor: pointer;
}

.rsvp-option.is-selected {
	background: var(--ink);
	color: var(--bg);
	border-color: var(--ink);
}

.rsvp-option.is-selected input { accent-color: var(--bg); }

.rsvp-field { display: block; }

.rsvp-actions {
	display: flex;
	justify-content: center;
	margin-top: 0.5rem;
}

.tag {
	display: inline-block;
	font-family: 'Cormorant Garamond', serif;
	font-size: 0.78rem;
	font-weight: 600;
	font-style: italic;
	padding: 0.1rem 0.55rem;
	border: 1px solid var(--rule);
	background: var(--bg-soft);
	color: var(--ink);
	margin-left: 0.4rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

/* --- Q+A page --- */
.qa-list { margin: 1rem auto 0; max-width: var(--maxw-prose); }
.qa-item {
	padding: 1.2rem 0;
	border-bottom: 1px solid var(--rule-soft);
}
.qa-item:last-child { border-bottom: none; }
.qa-item .q {
	font-family: 'Cinzel', serif;
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin: 0 0 0.4rem;
	color: var(--ink);
}
.qa-item .a {
	color: var(--ink);
	margin: 0;
	font-size: 1.1rem;
	font-weight: 500;
	line-height: 1.55;
}

/* --- Story page --- */
.story-text {
	max-width: var(--maxw-prose);
	margin: 1.5rem auto;
	font-size: 1.2rem;
	font-weight: 500;
	line-height: 1.65;
	color: var(--ink);
}

.story-text p { margin: 1.1rem 0; }

/* --- Registry --- */
.registry-links {
	display: grid;
	gap: 0.75rem;
	margin: 1.5rem auto;
	max-width: var(--maxw-prose);
}

.registry-link {
	display: block;
	padding: 1.1rem 1.25rem;
	background: var(--card);
	border: 1px solid var(--rule-soft);
	font-family: 'Cinzel', serif;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 1rem;
	font-weight: 500;
	color: var(--ink);
	text-align: center;
	text-decoration: none;
}

.registry-link:hover { border-color: var(--ink); }

/* --- Admin (kept utilitarian, light styling only) --- */
.admin-bar {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 1rem;
}

.admin-bar-actions { display: flex; gap: 1rem; align-items: center; }

.parties, .guests {
	width: 100%;
	border-collapse: collapse;
	background: var(--card);
	border: 1px solid var(--rule);
}

.parties th, .parties td, .guests th, .guests td {
	padding: 0.55rem 0.75rem;
	border-bottom: 1px solid var(--rule-soft);
	text-align: left;
	font-size: 0.95rem;
}

.parties th, .guests th {
	background: var(--bg-soft);
	font-weight: 500;
	color: var(--muted);
	font-family: 'Cinzel', serif;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.parties tr:last-child td, .guests tr:last-child td { border-bottom: none; }

code {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	background: var(--bg-soft);
	padding: 0.1rem 0.45rem;
	border-radius: 2px;
	font-size: 0.95em;
}

.code-display { font-size: 1rem; margin: 1rem 0; }

.party-form, .guest-add, .auth-form form { display: grid; gap: 0.8rem; max-width: 480px; }

.guests-section { margin-top: 2rem; }
.danger-zone { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
