/**
 * Cover (Dioendang) widget — frontend styles.
 *
 * The cover element itself is any Elementor container/section the author
 * designed; assets/js/di-cover.js elevates it with .di-cover--fixed (plus an
 * exit-animation variant class) and locks scrolling via .di-cover-lock on
 * <html>. The button reuses Elementor's .elementor-button styling — colors,
 * typography, border and padding come from the widget's Style panel.
 */

/* The elevated cover: a fixed full-viewport overlay above the content.
   The di-audio toggle stays hidden until the cover's button is clicked, so
   it needs no place in this order. JS may override z-index from the
   widget's Z-Index control. */
.di-cover--fixed {
	position: fixed !important;
	/* Physical offsets first: `inset` is Chrome 87 / iOS Safari 14.5, above the
	   phones these invitations are opened on. Without them the shorthand is
	   dropped, `position: fixed` keeps all-auto offsets and the cover renders at
	   its *static* position — so anything preceding it in flow (a sticky top
	   frame, a header) leaves invitation content peeking above a cover the
	   guest cannot scroll away, because the rule below locks html/body. */
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	inset: 0;
	width: 100% !important;
	max-width: none !important; /* a boxed e-con keeps its max-width clamp otherwise */
	height: 100vh;
	height: 100dvh;
	min-height: 100vh; /* beat .e-con's min-height: var(--min-height) */
	min-height: 100dvh;
	margin: 0 !important;
	overflow: hidden;
	z-index: 1400;
}

/* Exit transition lives on the compound selector: (0,2,0) beats Elementor's
   .e-con transition regardless of stylesheet order, and the base state never
   animates unrelated transform changes (motion effects etc.). */
.di-cover--fixed.di-cover--closing {
	transition:
		transform var(--di-cover-duration, 800ms) cubic-bezier(0.4, 0, 0.2, 1),
		opacity var(--di-cover-duration, 800ms) ease;
}

/* Keep the cover clear of the admin bar in logged-in previews. */
.admin-bar .di-cover--fixed {
	top: var(--wp-admin--admin-bar--height, 32px);
	height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
	height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
}

/* Exit animations — applied while .di-cover--closing. */
.di-cover--anim-slide-up.di-cover--closing {
	transform: translateY(-100%);
}

.di-cover--anim-fade.di-cover--closing {
	opacity: 0;
}

.di-cover--anim-zoom.di-cover--closing {
	transform: scale(1.1);
	opacity: 0;
}

.di-cover--closing {
	pointer-events: none;
}

.di-cover--closed {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.di-cover--fixed.di-cover--closing {
		transition-duration: 1ms;
	}
}

/* Scroll lock while the cover shows (class on <html>, set by JS). */
html.di-cover-lock,
html.di-cover-lock body {
	overflow: hidden !important;
	overscroll-behavior: none;
}

/* <button> element resets so Elementor's .elementor-button styling applies
   the same as it does to the usual <a> buttons. */
.di-cover .di-cover-open {
	border: 0;
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
	cursor: pointer;
}

/* Editor-only explanatory note under the button. */
.di-cover-note {
	margin-top: 12px;
	padding: 10px 14px;
	border: 1px dashed #bbbbbb;
	border-radius: 4px;
	color: #777777;
	font-size: 13px;
	text-align: center;
}
