/**
 * The welcome popup — own stylesheet, loaded only when the popup is switched
 * on (board-cut file map: never style.css).
 *
 * Colour, font and heading size come from custom properties the PHP writes as
 * an inline `style` on `.gv-popup`, each falling back to a theme.json token —
 * so an unset setting inherits the site palette rather than a hex literal
 * frozen into this file. Do not hard-code those six values here.
 */

.gv-popup {
	position: fixed;
	inset: 0;
	z-index: 120;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	/* Clears the phone's notch and home indicator, so the close control is
	   never under either. */
	padding-top: calc( 1.5rem + env( safe-area-inset-top, 0px ) );
	padding-bottom: calc( 1.5rem + env( safe-area-inset-bottom, 0px ) );
}

/* `[hidden]` must beat the `display: flex` above — without this the popup
   would be on screen from first paint, before popup.js has decided whether
   this visitor should see it at all. */
.gv-popup[hidden] {
	display: none;
}

/* Stops the page behind scrolling while the overlay is open. */
.gv-popup-open {
	overflow: hidden;
}

.gv-popup__scrim {
	position: absolute;
	inset: 0;
	background: rgba( 38, 36, 31, 0.55 );
}

.gv-popup__card {
	position: relative;
	width: 100%;
	max-width: 26rem;
	max-height: 100%;
	overflow-y: auto;
	border-radius: 0.5rem;
	padding: 2rem 1.75rem;
	text-align: center;
	background: var( --gv-popup-bg );
	color: var( --gv-popup-fg );
	box-shadow: 0 24px 60px rgba( 38, 36, 31, 0.28 );
}

.gv-popup__close {
	position: absolute;
	top: 0.25rem;
	right: 0.25rem;
	/* 44px: this is the only way out of a modal overlay, and it sits in a
	   corner. Undersizing it is how a popup becomes a trap on a phone. */
	width: 2.75rem;
	height: 2.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	line-height: 1;
	border: 0;
	background: transparent;
	color: currentColor;
	opacity: 0.55;
	cursor: pointer;
	transition: opacity 0.3s;
	/* Round, so the focus ring follows the control rather than drawing a
	   square box across the card's rounded corner. */
	border-radius: 50%;
}

.gv-popup__close:hover,
.gv-popup__close:focus-visible {
	opacity: 1;
}

.gv-popup__media {
	margin: -0.5rem 0 1.25rem;
}

.gv-popup__img {
	width: 100%;
	height: auto;
	border-radius: 0.375rem;
	display: block;
}

.gv-popup__heading {
	font-family: var( --gv-popup-font );
	font-size: var( --gv-popup-head );
	line-height: 1.2;
	color: currentColor;
	margin: 0;
}

.gv-popup__body {
	font-family: var( --wp--preset--font-family--body );
	font-size: 0.9375rem;
	line-height: 1.6;
	opacity: 0.8;
	margin: 0.75rem 0 0;
}

.gv-popup__form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.gv-popup__form input[type="email"] {
	width: 100%;
	font-family: var( --wp--preset--font-family--body );
	font-size: 0.9375rem;
	color: currentColor;
	background: transparent;
	border: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	padding: 0.625rem 0;
	text-align: center;
	/* The border is the only affordance, so it must not sit at the same
	   opacity as the body copy or the field reads as decoration. */
	opacity: 0.75;
}

.gv-popup__form input[type="email"]:focus {
	outline: none;
	opacity: 1;
}

.gv-popup__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 2.75rem;
	font-family: var( --wp--preset--font-family--body );
	font-size: var( --wp--preset--font-size--eyebrow );
	text-transform: uppercase;
	letter-spacing: 0.22em;
	background: var( --gv-popup-btn-bg );
	color: var( --gv-popup-btn-fg );
	border: 1px solid var( --gv-popup-btn-bg );
	border-radius: 999px;
	padding: 0.875rem 1.75rem;
	margin-top: 0.25rem;
	cursor: pointer;
	transition: opacity 0.3s;
}

.gv-popup__btn:hover,
.gv-popup__btn:focus-visible {
	opacity: 0.85;
}

/* The purpose-at-point-of-collection line. Quieter than the body, but never
   so quiet it stops being readable — it is the statement the email field
   depends on, not a footnote. */
.gv-popup__consent {
	font-family: var( --wp--preset--font-family--body );
	font-size: var( --wp--preset--font-size--micro );
	line-height: 1.6;
	opacity: 0.7;
	margin: 1rem 0 0;
}

/* Honeypot: in the layout and off-screen, not `display: none` — some bots
   skip anything obviously hidden. */
.gv-popup__hp {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
}

.gv-popup__pane[hidden] {
	display: none;
}
