/* Evita Raven – floating newsletter raven + letter popup.
   Placement: Havran > Mailchimp a kupóny, or override these variables.
   --evita-raven-bubble is the raven image / hit-area size (name kept for existing Additional CSS). */
:root {
	--evita-raven-x: 20px;
	--evita-raven-y: 20px;
	--evita-raven-z: 9990;
	--evita-raven-ink: #1f1b24;
	--evita-raven-wing: #3a3342;
	--evita-raven-paper: #f3e4c1;
	--evita-raven-seal: #9c2b2b;
	--evita-raven-parchment: #f4e7c9;
	--evita-raven-parchment-edge: #c9a96e;
	--evita-raven-letter-paper: #fdf6e6;
	--evita-raven-letter-light: #fffaf0;
	--evita-raven-glint: #f3d27a;
	--evita-raven-glint-light: #fff3c4;
	--evita-raven-text: #3b2f22;
	--evita-raven-focus: #9c2b2b;
	--evita-raven-bubble: 110px;
}
@media (hover: none), (pointer: coarse) {
	:root { --evita-raven-bubble: 110px; }
}

/* ---------- Floating raven ---------- */
.evita-raven {
	position: fixed;
	bottom: calc(var(--evita-raven-y) + env(safe-area-inset-bottom, 0px));
	z-index: var(--evita-raven-z);
}
.evita-raven--bottom-left { left: calc(var(--evita-raven-x) + env(safe-area-inset-left, 0px)); }
.evita-raven--bottom-right { right: calc(var(--evita-raven-x) + env(safe-area-inset-right, 0px)); }

.evita-raven__button,
.evita-raven__button:hover,
.evita-raven__button:focus,
.evita-raven__button:active {
	position: relative;
	display: block;
	width: var(--evita-raven-bubble);
	height: var(--evita-raven-bubble);
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	box-shadow: none;
	color: var(--evita-raven-text);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	overflow: visible;
	-webkit-tap-highlight-color: transparent;
}
.evita-raven__button:focus { outline: none; }
.evita-raven__button:focus-visible { outline: 3px solid var(--evita-raven-focus); outline-offset: 3px; }

/* Layout wrapper only – no glass disc (class kept so existing markup still works). */
.evita-raven__bubble {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	background: none;
	border: 0;
	box-shadow: none;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	pointer-events: none;
}

.evita-raven__art {
	display: block;
	width: 100%;
	height: 100%;
	transform: none;
	overflow: visible;
	transition: transform .35s ease;
}
.evita-raven__svg, .evita-raven__img { display: block; width: 100%; height: 100%; object-fit: contain; overflow: visible; }
.evita-raven__art-desktop, .evita-raven__art-mobile { display: block; width: 100%; height: 100%; }
.evita-raven__art-mobile { display: none; }
.evita-raven__envelope { transition: opacity .25s ease; }
.evita-raven-flying .evita-raven__envelope { opacity: 0; transition: none; }

/* Parchment: tucked behind the raven, unrolls sideways from it on hover/focus. */
.evita-raven__parchment {
	position: absolute;
	z-index: 1;
	top: 50%;
	left: calc(var(--evita-raven-bubble) / 2);
	transform: translateY(-50%);
	white-space: nowrap;
	pointer-events: none;
	clip-path: inset(-12px 100% -12px 0);
	opacity: 0;
	transition: clip-path .5s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}
.evita-raven__parchment-text {
	position: relative;
	display: block;
	padding: 8px 18px 8px calc(var(--evita-raven-bubble) / 2 + 12px);
	background: linear-gradient(180deg, #faf1dc 0%, var(--evita-raven-parchment) 55%, #ead7ad 100%);
	border: 1px solid rgba(201, 169, 110, .7);
	border-left: 0;
	border-radius: 0 6px 6px 0;
	box-shadow: 0 3px 10px rgba(59, 47, 34, .16);
	font-size: 15px;
	font-style: italic;
	line-height: 1.2;
	letter-spacing: .01em;
	color: var(--evita-raven-text);
}
/* Rolled edge of the scroll. */
.evita-raven__parchment-text::after {
	content: "";
	position: absolute;
	right: -4px;
	top: -3px;
	bottom: -3px;
	width: 8px;
	border-radius: 4px;
	background: linear-gradient(90deg, #d9c08b, #f8eccf 45%, #c9a96e);
	box-shadow: 1px 0 2px rgba(59, 47, 34, .25);
}
/* Bottom-right placement: the parchment unrolls to the left instead. */
.evita-raven--bottom-right .evita-raven__parchment { left: auto; right: calc(var(--evita-raven-bubble) / 2); clip-path: inset(-12px 0 -12px 100%); }
.evita-raven--bottom-right .evita-raven__parchment-text { padding: 8px calc(var(--evita-raven-bubble) / 2 + 12px) 8px 18px; border-left: 1px solid rgba(201, 169, 110, .7); border-right: 0; border-radius: 6px 0 0 6px; }
.evita-raven--bottom-right .evita-raven__parchment-text::after { right: auto; left: -4px; }

@media (hover: hover) and (pointer: fine) {
	.evita-raven__button:hover .evita-raven__parchment,
	.evita-raven__button:focus-visible .evita-raven__parchment { clip-path: inset(-12px -12px -12px 0); opacity: 1; }
	.evita-raven--bottom-right .evita-raven__button:hover .evita-raven__parchment,
	.evita-raven--bottom-right .evita-raven__button:focus-visible .evita-raven__parchment { clip-path: inset(-12px 0 -12px -12px); }
	.evita-raven__button:hover .evita-raven__art,
	.evita-raven__button:focus-visible .evita-raven__art { transform: rotate(-5deg); }
}

/* Touch: no hover behaviour; optional separate mobile artwork. */
@media (hover: none), (pointer: coarse) {
	.evita-raven__parchment { display: none; }
	.evita-raven__art-desktop { display: none; }
	.evita-raven__art-mobile { display: block; }
}

/* ---------- Popup (native <dialog>) ---------- */
html.evita-raven-lock, html.evita-raven-lock body { overflow: hidden; }

/* The dialog is a full-viewport transparent stage; the letter is centred in it. */
.evita-raven-dialog {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--evita-raven-text);
	overflow: auto;
	overscroll-behavior: contain;
}
.evita-raven-dialog:not([open]) { display: none; }
.evita-raven-dialog::backdrop { background: rgba(20, 16, 24, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.evita-raven-dialog--fallback[open] { z-index: 2147483000; display: block; background: rgba(20, 16, 24, .55); }

.evita-raven-dialog__inner {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100%;
	padding: 12px;
}

.evita-raven-letter {
	position: relative;
	box-sizing: border-box;
	width: min(520px, 100%);
	margin: auto;
	padding: 44px 32px 28px;
	background:
		radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .7), transparent 60%),
		radial-gradient(ellipse at 100% 100%, rgba(201, 169, 110, .12), transparent 55%),
		linear-gradient(180deg, var(--evita-raven-letter-light), var(--evita-raven-letter-paper));
	border: 1px solid var(--evita-raven-parchment-edge);
	border-radius: 6px;
	box-shadow: 0 18px 50px rgba(20, 16, 24, .35);
	font-size: 16px;
	line-height: 1.55;
	text-align: center;
}
.evita-raven-letter__seal {
	position: relative;
	width: 34px;
	height: 34px;
	margin: -18px auto 10px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #c2474a, var(--evita-raven-seal) 60%, #6e1c1c);
	box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
}
.evita-raven-letter__image { display: block; max-width: 100%; max-height: 180px; height: auto; margin: 0 auto 12px; object-fit: contain; }
.evita-raven-letter__small { margin: 14px 0 0; font-size: .82em; opacity: .8; }
.evita-raven-letter__title { margin: 0 0 12px; font-size: 1.6em; line-height: 1.2; color: inherit; }
.evita-raven-letter__text p,
.evita-raven-letter__promise p,
.evita-raven-letter__gift p,
.evita-raven-letter__small p { margin: 0 0 .8em; }
.evita-raven-letter__promise p:last-child,
.evita-raven-letter__gift p:last-child,
.evita-raven-letter__small p:last-child { margin-bottom: 0; }
.evita-raven-letter__gift { font-weight: 600; }

.evita-raven-letter__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--evita-raven-text);
	cursor: pointer;
}
.evita-raven-letter__close:hover { background: rgba(59, 47, 34, .08); color: var(--evita-raven-text); }
.evita-raven-letter__close:focus-visible,
.evita-raven-form :focus-visible { outline: 3px solid var(--evita-raven-focus); outline-offset: 2px; }

.evita-raven-form__status { margin-top: 10px; font-weight: 600; white-space: pre-wrap; }
.evita-raven-form__status:empty { margin-top: 0; }
.evita-raven-form__status.is-error { color: #8a1f1f; }
.evita-raven-is-done .evita-raven-form { display: none; }

/* ---------- Flying envelope (exists only while the letter opens or closes) ---------- */
.evita-raven-fly { position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; transform-origin: 50% 50%; perspective: 700px; }
.evita-raven-fly__back, .evita-raven-fly__front, .evita-raven-fly__flap, .evita-raven-fly__paper { position: absolute; box-sizing: border-box; }
.evita-raven-fly svg { display: block; overflow: visible; }
/* Body: back panel and front pocket share the full box, so their corners are identical. */
.evita-raven-fly__back { left: 0; top: 0; width: 100%; height: 100%; z-index: 1; }
.evita-raven-fly__paper { left: 7%; right: 7%; top: 8%; height: 80%; z-index: 2; background: linear-gradient(180deg, var(--evita-raven-letter-light), var(--evita-raven-letter-paper)); border: 1px solid var(--evita-raven-parchment-edge); border-radius: 3px; box-shadow: 0 1px 3px rgba(59, 47, 34, .18); }
.evita-raven-fly__front { left: 0; top: 0; width: 100%; height: 100%; z-index: 3; }
/* Lid: exactly the body width, hinged on the body's top edge (58.09 % = 39.5 / 68 of the height). */
.evita-raven-fly__flap { left: 0; top: 0; width: 100%; height: 58.088%; z-index: 4; transform-origin: 50% 0; transform-style: preserve-3d; }
.evita-raven-fly__lid { position: absolute; left: 0; top: 0; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.evita-raven-fly__lid--out { filter: drop-shadow(0 1px 1px rgba(59, 47, 34, .18)); }
.evita-raven-fly__lid--in { transform: rotateX(180deg); }
.evita-raven-fly__seal { position: absolute; left: 50%; top: 58.088%; z-index: 5; width: 18%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c2474a, var(--evita-raven-seal) 60%, #6e1c1c); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }

/* Mailchimp form, styled lightly to fit the letter (its own CSS is not loaded). */
.evita-raven-form { margin-top: 16px; text-align: left; }
.evita-raven-form h2 { display: none; } /* Mailchimp's default "Subscribe" heading; the letter has its own. */
.evita-raven-form .indicates-required { font-size: .8em; opacity: .75; text-align: right; }
.evita-raven-form .mc-field-group { margin: 0 0 14px; }
.evita-raven-form label, .evita-raven-form strong { display: block; margin: 0 0 4px; }
.evita-raven-form input[type="email"],
.evita-raven-form input[type="text"] {
	box-sizing: border-box;
	width: 100%;
	min-height: 46px;
	padding: 10px 12px;
	border: 1px solid #a8874f;
	border-radius: 4px;
	background: #fff;
	color: var(--evita-raven-text);
	font: inherit;
	font-size: 16px; /* avoids iOS zoom */
}
.evita-raven-form ul { margin: 0; padding: 0; list-style: none; }
.evita-raven-form li { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.evita-raven-form li label, .evita-raven-form .checkbox { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.evita-raven-form input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--evita-raven-seal); }
.evita-raven-form input[type="submit"],
.evita-raven-form button[type="submit"] {
	display: block;
	width: 100%;
	min-height: 48px;
	margin-top: 8px;
	padding: 12px 18px;
	border: 0;
	border-radius: 4px;
	background: var(--evita-raven-seal);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.evita-raven-form input[type="submit"][disabled] { opacity: .6; cursor: progress; }
.evita-raven-form [aria-hidden="true"]:has(input[name^="b_"]),
.evita-raven-form .evita-raven-honeypot { position: absolute !important; left: -5000px !important; }
.evita-raven-form .refferal_badge,
.evita-raven-mode-inline .evita-raven-form #mce-responses { display: none; }


/* Wider letter on desktop so the copy is less tall. Fly-out still
   measures letter.getBoundingClientRect(), so the envelope lines up. */
@media (min-width: 900px) {
	.evita-raven-letter { width: min(720px, 100%); padding: 44px 40px 32px; }
	.evita-raven-form ul {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 4px 24px;
	}
	.evita-raven-form li { margin: 0; }
}

@media (max-width: 480px) {
	.evita-raven-dialog__inner { padding: 8px; }
	.evita-raven-letter { padding: 40px 18px 22px; }
	.evita-raven-letter__title { font-size: 1.35em; }
}

/* Gentle float: a few slow cycles after load and once after scrolling stops
   (started and stopped by the script; never loops forever). Transform only. */
@keyframes evita-raven-float {
	0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
	50% { transform: translate3d(0, -3px, 0) rotate(-.5deg); }
}
.evita-raven--float {
	animation: evita-raven-float 3.8s ease-in-out var(--evita-raven-float-cycles, 3);
	will-change: transform;
}
.evita-raven--float:hover,
.evita-raven--float:focus-within,
.evita-raven-is-open .evita-raven--float { animation-play-state: paused; }

/* Sparkles when the letter opens: created by the script, removed afterwards. */
.evita-raven-sparkles {
	position: absolute;
	inset: 0;
	z-index: 6;
	overflow: hidden;
	pointer-events: none;
}
.evita-raven-spark {
	position: absolute;
	top: 0;
	left: 0;
	opacity: 0;
	pointer-events: none;
	will-change: transform, opacity;
}
.evita-raven-spark--star { color: var(--evita-raven-glint); filter: drop-shadow(0 0 1px rgba(184, 134, 40, .55)) drop-shadow(0 0 4px rgba(243, 210, 122, .9)); }
.evita-raven-spark--star svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.evita-raven-spark--light { color: var(--evita-raven-glint-light); }
.evita-raven-spark--dot {
	border-radius: 50%;
	background: radial-gradient(circle, var(--evita-raven-glint-light) 0%, var(--evita-raven-glint) 55%, rgba(243, 210, 122, 0) 72%);
	box-shadow: 0 0 6px 1px rgba(243, 210, 122, .6), 0 0 1px rgba(184, 134, 40, .5);
}

/* Reduced motion: no transitions here; the script swaps the fly-out for a short fade. */
@media (prefers-reduced-motion: reduce) {
	.evita-raven *, .evita-raven-dialog, .evita-raven-dialog * { transition: none !important; }
	.evita-raven--float { animation: none !important; }
	.evita-raven-sparkles { display: none !important; }
	.evita-raven__button:hover .evita-raven__art,
	.evita-raven__button:focus-visible .evita-raven__art { transform: none; }
}
