/* Wedding RSVP — Mediterranean Luxury.
   Palette-Variablen (--wed-bg etc.) kommen inline aus dem Plugin (umschaltbar).
   Selbstgehostete Schrift (DSGVO: kein Google CDN zur Laufzeit). */

/* ---- Schrift: Cormorant Garamond (lokal) ---- */
@font-face {
	font-family: "Cormorant";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("fonts/cormorant.woff2") format("woff2");
}
@font-face {
	font-family: "Cormorant";
	font-style: italic;
	font-weight: 400 700;
	font-display: swap;
	src: url("fonts/cormorant-italic.woff2") format("woff2");
}
/* Schreibschrift für Namen / Akzente (lokal, OFL, DSGVO-clean) */
@font-face {
	font-family: "Great Vibes";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("fonts/great-vibes.woff2") format("woff2");
}

.wed {
	--wed-bg: #faf4ea;
	--wed-bg2: #f3e9d6;
	--wed-gold: #c9a24b;
	--wed-terra: #b5642f;
	--wed-olive: #6b7a4f;
	--wed-ink: #3a322a;
	--wed-blush: #b3446b;
	--wed-radius: 16px;
	--wed-foil: linear-gradient(105deg, #9c7322 0%, #c9a24b 28%, #f1dca0 50%, #c9a24b 72%, #9c7322 100%);
	--wed-shadow-sm: 0 2px 8px rgba(58,50,42,.08);
	--wed-shadow-md: 0 14px 40px -16px rgba(58,50,42,.32);
	--wed-shadow-lg: 0 30px 80px -28px rgba(58,50,42,.45);
	--wed-serif: "Cormorant", "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--wed-script: "Great Vibes", "Snell Roundhand", "Brush Script MT", cursive;
	--wed-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	/* feine Papier-Textur (inline, kein externer Request) */
	--wed-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

.wed, .wed * { box-sizing: border-box; }

.wed {
	font-family: var(--wed-sans);
	color: var(--wed-ink);
	line-height: 1.7;
	background-color: var(--wed-bg);
	background-image: var(--wed-paper);
}

/* Theme-Breakout: Twenty-Twenty-Five (is-layout-constrained) würde unsere Sektionen
   sonst auf die ~620px Content-Breite quetschen → auf Breitbild (34") unbrauchbar.
   Die inneren .wed-wrap/Grids zentrieren den Inhalt selbst. */
.is-layout-constrained > .wed { max-width: none; margin-left: 0; margin-right: 0; }

/* Theme-Chrome auf der privaten Einladungsseite ausblenden. */
body.wed-page .wp-site-blocks > header,
body.wed-page header.wp-block-template-part,
body.wed-page .wp-block-site-title,
body.wed-page .wp-block-navigation,
body.wed-page .wp-block-post-title {
	display: none !important;
}

.wed-wrap { max-width: 920px; margin: 0 auto; padding: 0 24px; }
.wed-narrow { max-width: 640px; }

.wed-section { padding: 84px 0; position: relative; }
.wed-section:nth-child(even) { background-color: var(--wed-bg2); background-image: var(--wed-paper); }

/* Gold-Foil-Helfer */
.wed-foil {
	background: var(--wed-foil);
	background-size: 200% auto;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.wed-h2 {
	font-family: var(--wed-serif);
	font-weight: 600;
	font-size: clamp(2rem, 4.5vw, 2.9rem);
	color: var(--wed-ink);
	margin: 0 0 10px;
	text-align: center;
	letter-spacing: .5px;
}
.wed-eyebrow {
	text-transform: uppercase;
	letter-spacing: 5px;
	font-size: .78rem;
	font-weight: 600;
	text-align: center;
	margin: 0 0 14px;
}
/* floraler Divider (Olivenzweig-SVG kommt aus render.php) */
.wed-divider { display: flex; justify-content: center; margin: 0 auto 30px; color: var(--wed-gold); }
.wed-divider svg { width: 116px; height: auto; }

.wed-prose p, .wed-lead { font-size: 1.08rem; margin: 0 0 1em; }
.wed-prose { max-width: 660px; margin: 0 auto; }
.wed-lead { text-align: center; color: var(--wed-olive); max-width: 640px; margin: 0 auto 1.4em; }
.wed-note { text-align: center; font-size: .92rem; color: var(--wed-olive); margin-top: 24px; font-style: italic; }

/* -----------------------------------------------------------------
 * Brief-Animation (Overlay)
 * Sichtbar nur wenn JS aktiv (html.wed-js); ohne JS bleibt Seite normal.
 * -------------------------------------------------------------- */
.wed-envelope-overlay { display: none; }
html.wed-js .wed-envelope-overlay {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background:
		radial-gradient(1200px 700px at 50% 20%, rgba(201,162,75,.20), transparent 70%),
		linear-gradient(180deg, #f6ead2, #efe0c4);
	background-image: var(--wed-paper), radial-gradient(1200px 700px at 50% 20%, rgba(201,162,75,.20), transparent 70%), linear-gradient(180deg, #f6ead2, #efe0c4);
	transition: opacity .8s ease, visibility .8s ease;
}
html.wed-js body.wed-locked { overflow: hidden; }

.wed-env {
	position: relative;
	width: min(460px, 86vw);
	aspect-ratio: 4 / 3;
	perspective: 1500px;
	cursor: pointer;
	animation: wed-env-float 6s ease-in-out infinite;
	filter: drop-shadow(0 36px 50px rgba(58,50,42,.28));
}
@keyframes wed-env-float {
	0%, 100% { transform: translateY(0) rotateX(2deg); }
	50%      { transform: translateY(-12px) rotateX(0deg); }
}

/* Karte im Umschlag */
.wed-env-card {
	position: absolute;
	left: 8%;
	right: 8%;
	bottom: 10%;
	height: 116%;
	background: linear-gradient(180deg, #fffdf8, #f7efdf), var(--wed-paper);
	border: 1px solid rgba(201,162,75,.25);
	border-radius: 10px;
	box-shadow: var(--wed-shadow-md);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 22px;
	z-index: 2;
	transform: translateY(0) scale(.96);
	transition: transform 1s cubic-bezier(.2,.8,.2,1);
}
.wed-env-card .wed-env-eyebrow { letter-spacing: 4px; text-transform: uppercase; font-size: .7rem; color: var(--wed-terra); margin: 0 0 4px; }
.wed-env-card .wed-env-names { font-family: var(--wed-script); font-size: clamp(2.2rem, 8vw, 3.1rem); line-height: 1.05; margin: 0; color: var(--wed-ink); }
.wed-env-card .wed-env-date { font-family: var(--wed-serif); font-style: italic; margin: 6px 0 0; color: var(--wed-terra); }

/* Umschlag-Körper (Vorderseite, deckt Karte zu) – mit sichtbarer Briefform */
.wed-env-body {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(150deg, #efe0c6, #e3cfa8) ,
		var(--wed-paper);
	border-radius: 12px;
	box-shadow: var(--wed-shadow-lg), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -2px 6px rgba(58,50,42,.08);
	z-index: 3;
	overflow: hidden;
}
/* Die zwei diagonalen Vorderkanten (Seitenklappen treffen in der Mitte) = Briefform */
.wed-env-body::before,
.wed-env-body::after {
	content: "";
	position: absolute;
	top: 0; bottom: 0;
	width: 56%;
}
.wed-env-body::before { left: 0;  background: linear-gradient(118deg, rgba(255,255,255,.30) 0 50%, transparent 50%); }
.wed-env-body::after  { right: 0; background: linear-gradient(242deg, rgba(58,50,42,.10) 0 50%, transparent 50%); }

/* obere Klappe – Außenseite via ::before (backface hidden), beim Öffnen erscheint das Innenfutter */
.wed-env-flap {
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 60%;
	background: linear-gradient(180deg, #fbf3e2, #f1e3c8); /* Innenfutter (sichtbar wenn offen) */
	clip-path: polygon(0 0, 100% 0, 50% 100%);
	transform-origin: top center;
	transform: rotateX(0deg);
	transition: transform 1.1s cubic-bezier(.5,0,.2,1);
	z-index: 5;
}
.wed-env-flap::before { /* Außenseite */
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(150deg, #e7d3b0, #d4ba8c);
	clip-path: polygon(0 0, 100% 0, 50% 100%);
	border-bottom: 1px solid rgba(201,162,75,.5);
	box-shadow: 0 2px 5px rgba(0,0,0,.08);
	backface-visibility: hidden;
	transform: translateZ(1px);
}

/* Wachssiegel */
.wed-env-seal {
	position: absolute;
	left: 50%; top: 44%;
	width: 86px; height: 86px;
	margin: -43px 0 0 -43px;
	border-radius: 50%;
	background: radial-gradient(circle at 36% 30%, #d06a8c 0%, #a8395d 45%, #7e2547 100%);
	box-shadow: 0 6px 16px rgba(142,43,80,.5), inset 0 3px 8px rgba(255,255,255,.35), inset 0 -4px 10px rgba(80,20,45,.6);
	border: 1px solid rgba(126,37,71,.6);
	z-index: 6;
	display: flex; align-items: center; justify-content: center;
	color: #f6dfe7;
	font-family: var(--wed-serif);
	font-size: 1.5rem; font-weight: 600;
	transition: transform .6s ease, opacity .6s ease;
	animation: wed-seal-pulse 2.4s ease-in-out infinite;
}
@keyframes wed-seal-pulse {
	0%, 100% { transform: scale(1); box-shadow: 0 6px 16px rgba(142,43,80,.5), inset 0 2px 6px rgba(255,255,255,.25); }
	50%      { transform: scale(1.06); box-shadow: 0 10px 26px rgba(142,43,80,.6), inset 0 2px 6px rgba(255,255,255,.25); }
}

.wed-env-hint {
	position: absolute;
	left: 0; right: 0; bottom: -42px;
	text-align: center;
	font-size: .82rem;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--wed-terra);
	opacity: .85;
}

/* Zustände der State-Machine */
.wed-env.is-opening, .wed-env.is-card { animation: none; } /* Schweben stoppt beim Öffnen */
.wed-env.is-opening .wed-env-flap { transform: rotateX(180deg); z-index: 1; }
.wed-env.is-opening .wed-env-seal { transform: scale(.4); opacity: 0; }
.wed-env.is-opening .wed-env-hint { opacity: 0; }
.wed-env.is-card .wed-env-card { transform: translateY(-54%) scale(1); z-index: 6; box-shadow: var(--wed-shadow-lg); }
html.wed-js .wed-envelope-overlay.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

/* Skip-Button */
.wed-env-skip {
	position: fixed;
	top: 18px; right: 18px;
	z-index: 10000;
	background: rgba(255,255,255,.7);
	border: 1px solid rgba(181,100,47,.4);
	color: var(--wed-terra);
	font: inherit; font-size: .82rem;
	padding: 7px 14px; border-radius: 999px;
	cursor: pointer;
}
.wed-env-skip:hover { background: #fff; }

/* -----------------------------------------------------------------
 * Hero
 * -------------------------------------------------------------- */
.wed-hero {
	position: relative;
	padding: clamp(70px, 12vh, 130px) 24px;
	background:
		radial-gradient(1100px 560px at 50% -10%, rgba(201,162,75,.20), transparent 70%),
		linear-gradient(180deg, var(--wed-bg2), var(--wed-bg));
	overflow: hidden;
}
.wed-hero-grid {
	max-width: 1100px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1.1fr .9fr;
	gap: clamp(28px, 5vw, 72px);
	align-items: center;
}
/* Breitbild (34"): Inhalt darf etwas größer atmen, bleibt aber zentriert. */
@media (min-width: 1500px) {
	.wed-hero-grid { max-width: 1280px; gap: 90px; }
	.wed-hero-main-photo img { width: min(560px, 78vw); }
	.wed-wrap { max-width: 1040px; }
}
.wed-hero-grid { position: relative; z-index: 2; }

.wed-hero-text { text-align: left; }
.wed-hero .wed-eyebrow { text-align: left; color: var(--wed-terra); }
.wed-names {
	font-family: var(--wed-script);
	font-weight: 400;
	font-size: clamp(3.6rem, 11vw, 7.4rem);
	line-height: 1.02;
	letter-spacing: 0;
	margin: 0 0 18px;
	padding-bottom: .08em; /* Platz für Unterlängen der Schreibschrift */
	color: var(--wed-ink);
}
.wed-amp {
	font-family: var(--wed-script);
	display: inline-block;
	padding: 0 .06em;
	font-size: .82em;
	vertical-align: -.02em;
}
.wed-meta {
	font-family: var(--wed-serif);
	font-size: clamp(1.15rem, 3vw, 1.55rem);
	color: var(--wed-terra);
	margin: 0 0 22px;
	letter-spacing: .5px;
}
.wed-meta .wed-dot { color: var(--wed-gold); padding: 0 .4em; }
.wed-hero-intro { font-size: 1.06rem; max-width: 520px; margin: 0 0 30px; }
.wed-hero .wed-cta { justify-content: flex-start; }

/* gerahmtes Porträt */
.wed-hero-photo { position: relative; justify-self: center; isolation: isolate; }
.wed-hero-main-photo { display: block; position: relative; z-index: 1; }
.wed-hero-main-photo img {
	display: block;
	width: min(440px, 82vw);
	aspect-ratio: 3 / 4;
	object-fit: cover;
	object-position: 50% 18%;
	border-radius: 240px 240px 16px 16px; /* Bogen oben = Editorial */
	box-shadow: var(--wed-shadow-lg);
	border: 6px solid #fffdf8;
}
.wed-hero-photo::after { /* Gold-Haarlinie als Rahmen-Akzent */
	content: "";
	position: absolute;
	inset: -14px;
	border: 1px solid rgba(201,162,75,.5);
	border-radius: 252px 252px 24px 24px;
	pointer-events: none;
	z-index: 2;
}
.wed-photo-flower {
	position: absolute;
	width: clamp(92px, 14vw, 180px);
	pointer-events: none;
	z-index: 3;
	filter: drop-shadow(0 10px 14px rgba(58,50,42,.18));
}
.wed-photo-flower img { display: block; width: 100%; height: auto; }
.wed-photo-flower-tl { top: -58px; left: -64px; }
.wed-photo-flower-tr { top: -58px; right: -64px; transform: scaleX(-1); }
.wed-photo-flower-bl { bottom: -58px; left: -64px; transform: scaleY(-1); }
.wed-photo-flower-br { bottom: -58px; right: -64px; transform: scale(-1,-1); }

@media (max-width: 640px) {
	.wed-photo-flower {
		width: clamp(78px, 25vw, 118px);
	}
	.wed-photo-flower-tl { top: -36px; left: -22px; }
	.wed-photo-flower-tr { top: -36px; right: -22px; }
	.wed-photo-flower-bl { bottom: -36px; left: -22px; }
	.wed-photo-flower-br { bottom: -36px; right: -22px; }
}

.wed-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.wed-btn {
	display: inline-block;
	padding: 14px 30px;
	border-radius: 999px;
	font-size: .98rem;
	letter-spacing: .5px;
	text-decoration: none;
	cursor: pointer;
	border: 1.5px solid var(--wed-gold);
	transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.wed-btn:hover { transform: translateY(-2px); box-shadow: var(--wed-shadow-sm); }
.wed-btn-primary { background: var(--wed-gold); color: #fff; border-color: var(--wed-gold); }
.wed-btn-primary:hover { background: var(--wed-terra); border-color: var(--wed-terra); }
.wed-btn-ghost { background: transparent; color: var(--wed-ink); }
.wed-btn-ghost:hover { background: var(--wed-gold); color: #fff; }

/* -----------------------------------------------------------------
 * Galerie
 * -------------------------------------------------------------- */
.wed-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 24px;
	max-width: 680px;
	margin: 0 auto;
	justify-items: center;
}
.wed-photo-card {
	background: #fffdf8;
	padding: 12px 12px 16px;
	border-radius: 12px;
	box-shadow: var(--wed-shadow-md);
	transform: rotate(-1.2deg);
	transition: transform .3s ease;
}
.wed-photo-card:nth-child(even) { transform: rotate(1.4deg); }
.wed-photo-card:hover { transform: rotate(0) translateY(-4px); }
.wed-photo-card img { display: block; width: 100%; max-width: 300px; height: auto; border-radius: 6px; }

/* -----------------------------------------------------------------
 * Ortskarten (Tunesien / München / Beides)
 * -------------------------------------------------------------- */
.wed-place-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin: 0 0 30px;
}
.wed-place-card {
	border: 1px solid rgba(181,100,47,.2);
	background: rgba(255,255,255,.55);
	border-radius: var(--wed-radius);
	padding: 20px 14px;
	text-align: center;
}
.wed-place-card svg { width: 40px; height: 40px; color: var(--wed-terra); margin: 0 auto 8px; display: block; }
.wed-place-card .wed-place-title { font-family: var(--wed-serif); font-size: 1.25rem; color: var(--wed-ink); }
.wed-place-card .wed-place-sub { font-size: .82rem; color: var(--wed-olive); margin-top: 2px; }

/* -----------------------------------------------------------------
 * Timeline / Ablauf
 * -------------------------------------------------------------- */
.wed-timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 580px; }
.wed-timeline-item {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 18px;
	align-items: baseline;
	padding: 16px 0;
	border-bottom: 1px solid rgba(181,100,47,.18);
}
.wed-timeline-item:last-child { border-bottom: none; }
.wed-time { font-family: var(--wed-serif); font-size: 1.25rem; color: var(--wed-terra); font-weight: 600; }
.wed-event { font-size: 1.05rem; }

/* München */
.wed-munich-status {
	margin-top: 22px;
	padding: 16px 20px;
	background: rgba(201,162,75,.12);
	border-left: 3px solid var(--wed-gold);
	border-radius: 8px;
	max-width: 660px;
	margin-left: auto; margin-right: auto;
}

/* Reiseinfos */
.wed-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 8px 0 0; }
.wed-info-item {
	background: rgba(255,255,255,.6);
	border: 1px solid rgba(181,100,47,.15);
	border-radius: var(--wed-radius);
	padding: 16px 18px;
	box-shadow: var(--wed-shadow-sm);
}
.wed-info-item dt { font-weight: 600; color: var(--wed-terra); margin: 0 0 4px; }
.wed-info-item dd { margin: 0; }

/* FAQ */
.wed-faq-item { border-bottom: 1px solid rgba(181,100,47,.18); padding: 6px 0; max-width: 720px; margin: 0 auto; }
.wed-faq-item summary {
	cursor: pointer; font-weight: 600; font-size: 1.05rem; padding: 14px 0; list-style: none;
}
.wed-faq-item summary::-webkit-details-marker { display: none; }
.wed-faq-item summary::before { content: "+ "; color: var(--wed-gold); font-weight: 700; }
.wed-faq-item[open] summary::before { content: "– "; }
.wed-faq-a { padding: 0 0 14px; }

/* Formular */
.wed-form { display: flex; flex-direction: column; gap: 18px; }
.wed-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wed-field { display: flex; flex-direction: column; gap: 6px; border: none; padding: 0; margin: 0; }
.wed-field > span, .wed-field > legend { font-weight: 600; font-size: .95rem; }
.wed-field input[type="text"],
.wed-field input[type="email"],
.wed-field input[type="tel"],
.wed-field input[type="number"],
.wed-field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d8c9a8;
	border-radius: 10px;
	font: inherit;
	background: #fffdf8;
	color: var(--wed-ink);
}
.wed-field input:focus, .wed-field textarea:focus {
	outline: none;
	border-color: var(--wed-gold);
	box-shadow: 0 0 0 3px rgba(201,162,75,.2);
}
.wed-radio { display: block; font-weight: 400; padding: 5px 0; cursor: pointer; }
.wed-check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.wed-check input { margin-top: 4px; }
.wed-submit { align-self: flex-start; margin-top: 6px; }

.wed-err { color: #a11; font-size: .85rem; }
.wed-formerror { background: #fbe6e6; border: 1px solid #e0a3a3; color: #8a1f1f; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; }
.wed-thanks { background: rgba(107,122,79,.14); border: 1px solid var(--wed-olive); border-radius: var(--wed-radius); padding: 30px; text-align: center; font-size: 1.15rem; }

/* Honeypot versteckt */
.wed-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Reveal-Animation */
.wed-reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.wed-reveal.wed-in { opacity: 1; transform: none; }

/* -----------------------------------------------------------------
 * Mobile
 * -------------------------------------------------------------- */
@media (max-width: 820px) {
	.wed-hero-grid { grid-template-columns: 1fr; text-align: center; }
	.wed-hero-text { text-align: center; }
	.wed-hero .wed-eyebrow, .wed-hero .wed-cta { text-align: center; justify-content: center; }
	.wed-hero-intro { margin-left: auto; margin-right: auto; }
	.wed-hero-photo { order: -1; }
}
@media (max-width: 640px) {
	.wed-section { padding: 56px 0; }
	.wed-row { grid-template-columns: 1fr; }
	.wed-timeline-item { grid-template-columns: 96px 1fr; gap: 12px; }
	.wed-btn { width: 100%; text-align: center; }
	.wed-place-cards { grid-template-columns: 1fr; }
	/* Brief auf Mobile: flacher (weniger 3D-Tiefe), gleiche States */
	.wed-env { perspective: 900px; }
}

/* -----------------------------------------------------------------
 * Reduced motion: keine Brief-Animation, alles sofort sichtbar
 * -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html.wed-js .wed-envelope-overlay { display: none !important; }
	.wed-reveal { opacity: 1; transform: none; transition: none; }
	.wed-btn:hover { transform: none; }
	.wed-env-seal { animation: none; }
}
