/*
 * Site popup — rendered by inc/site/site-popup.php (D-060, ported from the
 * Punta Mita theme's D-046 / D-101), and only while the popup can show.
 * Enqueued from the footer, so nothing here sits on the critical path: the
 * dialog stays closed until at least its delay has passed.
 *
 * Tokens come from assets/brand.css (--lvc-*). Every var() carries its literal
 * fallback so the dialog is never unstyled if that sheet is dropped.
 *
 * Button hover and focus states are declared explicitly, so the parent theme's
 * reset cannot repaint them; this sheet prints last and wins ties on order.
 */

.lvc-popup,
.lvc-popup *,
.lvc-popup *::before,
.lvc-popup *::after{box-sizing:border-box}

.lvc-popup{
	--lvc-popup-ready:1; /* site-popup.js opens nothing until this sheet has applied */
	--lvc-popup-in:cubic-bezier(.16,1,.3,1);
	--lvc-popup-out:cubic-bezier(.4,0,1,1);
	--lvc-popup-error:#F4B8A8;
	position:fixed;
	inset:0;
	width:min(30rem,calc(100vw - 2rem));
	max-width:none;
	max-height:none;
	margin:auto;
	padding:0;
	border:0;
	overflow:visible;
	background:transparent;
	color:var(--lvc-text,#FBFBFB);
	color-scheme:dark;
	font-family:var(--lvc-font-body,'Outfit',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif);
	font-size:1rem;
	line-height:1.5;
	opacity:0;
	transform:translateY(10px);
	transition:opacity .16s var(--lvc-popup-out),transform .16s var(--lvc-popup-out),overlay .16s allow-discrete,display .16s allow-discrete;
}
.lvc-popup[open]{
	opacity:1;
	transform:none;
	transition-duration:.28s;
	transition-timing-function:var(--lvc-popup-in);
}
@starting-style{
	.lvc-popup[open]{opacity:0;transform:translateY(10px)}
}

/* A thin line of accent light along the top edge. */
.lvc-popup::before{
	content:"";
	position:absolute;
	z-index:1;
	top:0;
	left:8%;
	right:8%;
	height:1px;
	background:linear-gradient(90deg,transparent,var(--lvc-accent,#6A91FB) 50%,transparent);
	pointer-events:none;
}

/* ::backdrop does not inherit custom properties in every browser still in use,
   so its colour is --lvc-bg-alt written out. */
.lvc-popup::backdrop{
	background-color:rgba(4,7,14,0);
	transition:background-color .16s linear,overlay .16s allow-discrete,display .16s allow-discrete;
}
.lvc-popup[open]::backdrop{background-color:rgba(4,7,14,.66)}
@starting-style{
	.lvc-popup[open]::backdrop{background-color:rgba(4,7,14,0)}
}

/* The panel fills the dialog edge to edge, so a click that lands on the dialog
   element itself can only have come from the backdrop. */
.lvc-popup__panel{
	position:relative;
	max-height:calc(100vh - 2rem);
	max-height:calc(100dvh - 2rem);
	overflow-y:auto;
	overscroll-behavior:contain;
	padding:1.9rem 2.2rem 2.1rem;
	border:1px solid var(--lvc-border,rgba(251,251,251,.10));
	border-radius:4px;
	background-color:var(--lvc-card,#0F172A);
	/* Accent light from above, kept faint over the flat card. */
	background-image:radial-gradient(120% 60% at 50% 0%,color-mix(in srgb,var(--lvc-accent,#6A91FB) 12%,transparent),transparent 70%);
	box-shadow:0 30px 80px rgba(0,0,0,.55);
}

.lvc-popup [hidden]{display:none}

/* ── Campaign photo (optional) ───────────────────────────────────────────── */

/* Full bleed: the negative margins cancel the panel's padding, so the photo
   meets the panel's border on three sides. The ground under it is the site's
   deepest tone, so a photo still loading reads as shade, not a hole. */
.lvc-popup__media{
	position:relative;
	margin:-1.9rem -2.2rem 1.5rem;
	aspect-ratio:16/9;
	overflow:hidden;
	border-radius:3px 3px 0 0;
	background-color:var(--lvc-bg-alt,#04070E);
}
.lvc-popup__media img{
	display:block;
	width:100%;
	height:100%;
	object-fit:cover;
	object-position:50% 55%;
	opacity:0;
	transition:opacity .45s var(--lvc-popup-in);
}
.lvc-popup__media img.is-loaded{opacity:1}
/* A soft fall to the panel colour, so the photo settles into the card
   instead of ending on a hard line above the heading. */
.lvc-popup__media::after{
	content:"";
	position:absolute;
	inset:auto 0 0;
	height:28%;
	background:linear-gradient(to bottom,transparent,color-mix(in srgb,var(--lvc-card,#0F172A) 55%,transparent));
	pointer-events:none;
}

/* With a photo the close button sits on it, top right, on a dark disc that
   keeps the X readable over a bright sky. The heading gets the full width. */
.lvc-popup__panel--media [data-lvc-popup-view="intro"] .lvc-popup__close{
	position:absolute;
	z-index:2;
	top:.6rem;
	right:.6rem;
	margin:0;
}
.lvc-popup__panel--media [data-lvc-popup-view="intro"] .lvc-popup__close,
.lvc-popup__panel--media [data-lvc-popup-view="intro"] .lvc-popup__close:focus{
	background:rgba(4,7,14,.58);
	color:var(--lvc-text,#FBFBFB);
}
.lvc-popup__panel--media [data-lvc-popup-view="intro"] .lvc-popup__close:hover{background:rgba(4,7,14,.8)}

/* ── Header row ──────────────────────────────────────────────────────────── */

.lvc-popup__bar{display:flex;align-items:flex-start;gap:1rem}
.lvc-popup__bar > .lvc-popup__title{flex:1 1 auto;min-width:0}

.lvc-popup__title{
	margin:0;
	font-family:var(--lvc-font-display,'Gilda Display',Georgia,'Times New Roman',serif);
	font-size:clamp(1.4rem,1.15rem + 1.1vw,1.75rem);
	font-weight:400; /* Gilda Display ships one weight */
	line-height:1.15;
	letter-spacing:-.015em;
	color:var(--lvc-text,#FBFBFB);
	text-wrap:pretty;
}
/* Form views move focus to their heading by script, for screen readers. It is
   not in the tab order, so it needs no ring. */
.lvc-popup__title:focus{outline:none}
.lvc-popup__title--form{font-size:clamp(1.3rem,1.1rem + .6vw,1.55rem)}
/* "Occasion — Villa": the villa is the emphasis, as in the site's own section
   titles (italic, accent), and never splits across lines. */
.lvc-popup__title em{display:inline-block;font-style:italic;color:var(--lvc-gold,#6A91FB)}
.lvc-popup__nowrap{white-space:nowrap}

.lvc-popup__close{
	flex:0 0 auto;
	display:inline-flex;
	align-items:center;
	justify-content:center;
	width:44px;
	height:44px;
	margin:-.55rem -.85rem 0 auto;
	padding:0;
	border:0;
	border-radius:50%;
	cursor:pointer;
	transition:color .2s,background-color .2s;
}
.lvc-popup__close,
.lvc-popup__close:focus{background:none;color:var(--lvc-muted,#B9C3D6)}
.lvc-popup__close:hover{background:rgba(251,251,251,.07);color:var(--lvc-text,#FBFBFB)}
.lvc-popup__close:focus-visible{border-radius:50%}

.lvc-popup__back{
	display:inline-flex;
	align-items:center;
	gap:.35rem;
	min-height:44px;
	margin:-.55rem 0 0 -.6rem;
	padding:0 .6rem;
	border:0;
	border-radius:4px;
	font:700 .74rem/1 var(--lvc-font-body,'Outfit',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif);
	letter-spacing:.12em;
	text-transform:uppercase;
	cursor:pointer;
	transition:color .2s,background-color .2s;
}
.lvc-popup__back,
.lvc-popup__back:focus{background:none;color:var(--lvc-muted,#B9C3D6)}
.lvc-popup__back:hover{background:rgba(251,251,251,.05);color:var(--lvc-text,#FBFBFB)}

/* ── Intro ───────────────────────────────────────────────────────────────── */

.lvc-popup__body{margin:1rem 0 1.6rem}
.lvc-popup__body p{margin:0 0 .8em;font-size:1rem;line-height:1.62;color:var(--lvc-soft,rgba(251,251,251,.80))}
.lvc-popup__body p:last-child{margin-bottom:0}

.lvc-popup__alt{
	display:grid;
	gap:.9rem;
	margin-top:1.5rem;
	padding-top:1.35rem;
	border-top:1px solid var(--lvc-border,rgba(251,251,251,.10));
}
.lvc-popup__note{margin:0;font-size:.95rem;font-style:italic;line-height:1.6;color:var(--lvc-muted,#B9C3D6)}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.lvc-popup__btn{
	display:flex;
	align-items:center;
	justify-content:center;
	width:100%;
	min-height:50px;
	margin:0;
	padding:.85rem 1.4rem;
	border:1px solid transparent;
	border-radius:4px;
	font:700 .78rem/1.35 var(--lvc-font-body,'Outfit',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif);
	letter-spacing:.12em;
	text-transform:uppercase;
	text-align:center;
	text-decoration:none;
	white-space:normal;
	cursor:pointer;
	transition:background-color .2s,border-color .2s,color .2s,transform .2s var(--lvc-popup-in);
}
.lvc-popup__btn:active{transform:scale(.985)}
.lvc-popup__btn:focus-visible{outline:2px solid var(--lvc-accent-hover,#92AEFC);outline-offset:3px}
.lvc-popup__btn[disabled]{cursor:progress;opacity:.72}

.lvc-popup__btn--primary,
.lvc-popup__btn--primary:focus{background:var(--lvc-accent,#6A91FB);border-color:var(--lvc-accent,#6A91FB);color:var(--lvc-accent-ink,#05080F)}
.lvc-popup__btn--primary:hover{background:var(--lvc-accent-hover,#92AEFC);border-color:var(--lvc-accent-hover,#92AEFC);color:var(--lvc-accent-ink,#05080F)}

.lvc-popup__btn--ghost,
.lvc-popup__btn--ghost:focus{background:transparent;border-color:color-mix(in srgb,var(--lvc-accent,#6A91FB) 45%,transparent);color:var(--lvc-accent,#6A91FB)}
.lvc-popup__btn--ghost:hover{background:color-mix(in srgb,var(--lvc-accent,#6A91FB) 8%,transparent);border-color:var(--lvc-accent-hover,#92AEFC);color:var(--lvc-accent-hover,#92AEFC)}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.lvc-popup__kicker{
	margin:.35rem 0 .45rem;
	font-size:.7rem;
	font-weight:700;
	line-height:1.5;
	letter-spacing:.14em;
	text-transform:uppercase;
	color:var(--lvc-muted,#B9C3D6);
}
.lvc-popup__form{margin:1.25rem 0 0}
.lvc-popup__fields{display:grid;gap:.95rem;margin:0 0 1.1rem}
.lvc-popup__pair{display:grid;grid-template-columns:repeat(auto-fit,minmax(9rem,1fr));gap:.95rem}
.lvc-popup__field{display:grid;gap:.4rem;min-width:0}
.lvc-popup__field label{
	font-size:.7rem;
	font-weight:700;
	line-height:1.4;
	letter-spacing:.14em;
	text-transform:uppercase;
	color:var(--lvc-muted,#B9C3D6);
}
.lvc-popup__optional{font-weight:400;letter-spacing:.04em;text-transform:none;color:var(--lvc-muted,#B9C3D6)}

.lvc-popup__field input,
.lvc-popup__field select,
.lvc-popup__field textarea{
	display:block;
	width:100%;
	min-width:0;
	min-height:48px;
	margin:0;
	padding:.7rem .85rem;
	border:1px solid rgba(185,195,214,.5);
	/* Half-strength --lvc-muted: 3.4:1 against the card, the WCAG 1.4.11
	   minimum for a field's edge. */
	border-color:color-mix(in srgb,var(--lvc-muted,#B9C3D6) 50%,transparent);
	border-radius:4px;
	background:var(--lvc-bg-alt,#04070E);
	color:var(--lvc-text,#FBFBFB);
	/* 16px: iOS zooms the page on focus into anything smaller. */
	font:400 1rem/1.4 var(--lvc-font-body,'Outfit',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif);
	box-shadow:none;
	transition:border-color .2s;
}
.lvc-popup__field textarea{min-height:5.25rem;resize:vertical}
.lvc-popup__field input::-webkit-date-and-time-value{text-align:left}
.lvc-popup__field input:focus,
.lvc-popup__field select:focus,
.lvc-popup__field textarea:focus{border-color:var(--lvc-accent,#6A91FB)}
.lvc-popup__field input:focus-visible,
.lvc-popup__field select:focus-visible,
.lvc-popup__field textarea:focus-visible{outline:2px solid var(--lvc-accent-hover,#92AEFC);outline-offset:1px}
.lvc-popup__field [aria-invalid="true"]{border-color:var(--lvc-popup-error)}
/* The sleeping select's list keeps the panel's colours. */
.lvc-popup__field select option{background:var(--lvc-bg-alt,#04070E);color:var(--lvc-text,#FBFBFB)}

/* Status and errors come from RM Inquiry's inquiry.js; only their look is set here. */
.lvc-popup__status{margin:0 0 1rem;font-size:.95rem;line-height:1.55;color:var(--lvc-soft,rgba(251,251,251,.80))}
.lvc-popup__status:focus{outline:none}
.lvc-popup__status.is-error{color:var(--lvc-popup-error)}
.lvc-popup__status.is-success{font-size:1.02rem;color:var(--lvc-text,#FBFBFB)}

.lvc-popup .rm-inquiry__field-error{margin:0;font-size:.85rem;line-height:1.45;color:var(--lvc-popup-error)}
.lvc-popup .rm-inquiry__error-summary{margin:0 0 1.1rem;padding:.75rem .95rem;border-left:2px solid var(--lvc-popup-error);background:rgba(244,184,168,.07)}
.lvc-popup .rm-inquiry__error-summary:focus{outline:none}
.lvc-popup .rm-inquiry__error-summary h3{margin:0 0 .3rem;font-family:inherit;font-size:.9rem;font-weight:700;line-height:1.4;color:var(--lvc-text,#FBFBFB)}
.lvc-popup .rm-inquiry__error-summary ul{margin:0;padding-left:1.1rem}
.lvc-popup .rm-inquiry__error-summary a{color:var(--lvc-popup-error);text-decoration:underline;text-underline-offset:2px}

/* Privacy consent: every guest form on this site asks for it. */
.lvc-popup__consent{display:flex;align-items:flex-start;gap:.65rem;margin:0 0 1rem;font-size:.88rem;line-height:1.5;color:var(--lvc-muted,#B9C3D6);cursor:pointer}
.lvc-popup__consent input{flex:0 0 auto;width:1.15rem;height:1.15rem;margin:.15rem 0 0;accent-color:var(--lvc-accent,#6A91FB)}
.lvc-popup__consent input:focus-visible{outline:2px solid var(--lvc-accent-hover,#92AEFC);outline-offset:2px}
.lvc-popup__consent a,
.lvc-popup__consent a:hover{color:var(--lvc-text,#FBFBFB);text-decoration:underline;text-underline-offset:2px}

/* Holds the challenge's height, so the button does not jump when it renders. */
.lvc-popup__turnstile{min-height:65px}

/* Sent: RM Inquiry's thank-you line and reference stay; the form steps aside. */
.lvc-popup__view.is-sent .lvc-popup__back,
.lvc-popup__view.is-sent .lvc-popup__fields,
.lvc-popup__view.is-sent .lvc-popup__consent,
.lvc-popup__view.is-sent .lvc-popup__turnstile,
.lvc-popup__view.is-sent .lvc-popup__submit,
.lvc-popup__view.is-sent .rm-inquiry__error-summary{display:none}

/* ── Motion ──────────────────────────────────────────────────────────────── */

.lvc-popup__view--in{animation:lvcPopupView .2s var(--lvc-popup-in) both}
@keyframes lvcPopupView{from{opacity:0;transform:translateY(4px)}}

/* ── Phones: a bottom sheet, never a full-screen takeover ────────────────── */

@media (max-width:640px){
	.lvc-popup{
		width:100%;
		margin:auto 0 0;
		transform:translateY(100%);
		transition:opacity .2s var(--lvc-popup-out),transform .2s var(--lvc-popup-out),overlay .2s allow-discrete,display .2s allow-discrete;
	}
	.lvc-popup[open]{transform:none;transition-duration:.34s}
	@starting-style{
		.lvc-popup[open]{opacity:1;transform:translateY(100%)}
	}
	.lvc-popup::before{left:0;right:0}
	.lvc-popup__panel{
		max-height:calc(100vh - .75rem);
		max-height:calc(100dvh - .75rem);
		padding:1.05rem 1.25rem calc(1.35rem + env(safe-area-inset-bottom,0px));
		border-width:1px 0 0;
		border-radius:12px 12px 0 0;
	}
	.lvc-popup__body{margin:.7rem 0 1.25rem}
	.lvc-popup__alt{margin-top:1.2rem;padding-top:1.1rem}
	/* A shorter crop on phones, so the photo never turns the sheet into a
	   full-screen takeover. */
	.lvc-popup__media{
		margin:-1.05rem -1.25rem 1.1rem;
		aspect-ratio:12/5;
		border-radius:11px 11px 0 0;
	}
}

/* Short phones (an iPhone SE is 568 px tall): the text alone fills the sheet,
   so the photo is left out and the close button returns to the header row. */
@media (max-width:640px) and (max-height:640px){
	.lvc-popup__media{display:none}
	.lvc-popup__panel--media [data-lvc-popup-view="intro"] .lvc-popup__close{
		position:static;
		margin:-.55rem -.85rem 0 auto;
	}
	.lvc-popup__panel--media [data-lvc-popup-view="intro"] .lvc-popup__close,
	.lvc-popup__panel--media [data-lvc-popup-view="intro"] .lvc-popup__close:focus{
		background:none;
		color:var(--lvc-muted,#B9C3D6);
	}
	.lvc-popup__panel--media [data-lvc-popup-view="intro"] .lvc-popup__close:hover{
		background:rgba(251,251,251,.07);
		color:var(--lvc-text,#FBFBFB);
	}
}

/* Last, so it overrides the sheet's slide as well. The [open] selectors are
   listed because the open-state duration rules above outrank the bare class. */
@media (prefers-reduced-motion:reduce){
	.lvc-popup,
	.lvc-popup[open],
	.lvc-popup::backdrop,
	.lvc-popup[open]::backdrop,
	.lvc-popup__btn,
	.lvc-popup__close,
	.lvc-popup__back,
	.lvc-popup__field input,
	.lvc-popup__field select,
	.lvc-popup__field textarea,
	.lvc-popup__media img{transition:none}
	.lvc-popup,
	.lvc-popup[open],
	.lvc-popup__btn:active{transform:none}
	.lvc-popup__view--in{animation:none}
}
