/**
 * The newsletter signup panel.
 *
 * Unlike the video popup — where the video IS the panel and the panel carries
 * no chrome — this one is a card: white, padded, its own heading, with the
 * Forminator form inside it.
 *
 * Scoped through .vim-form-modal, never .gb-overlay.
 *
 * 🚨 Do not restyle .gb-overlay itself. `.gb-overlay--standard` is the
 * full-screen centring container (position:fixed, 100%/100%, flex-centred).
 * Setting a width on it collapses the container and strands the panel against
 * the top left of the page. Size the content, not the panel.
 *
 * @package generatepress_child
 */

.vim-form-modal {
	position: relative;
	width: min(34rem, 92vw);
	margin-inline: auto;
	padding: 2rem;
	border-radius: 0.5rem;
	background-color: var(--white);
	/*
	 * A tall viewport is not guaranteed — a phone in landscape gives the panel
	 * very little room, and the form must stay reachable rather than being cut
	 * off by the fixed container.
	 */
	max-height: 88vh;
	overflow-y: auto;
}

/*
 * Inside the card the close control sits within the padding, in the panel's own
 * ink, rather than above it in white the way the video popup's does — there is
 * a white card behind it here, not a photograph.
 *
 * GB Pro closes the panel for any element carrying data-gb-overlay-close, so
 * this needs no script of its own.
 */
.vim-form-modal__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.35rem;
	border: 0;
	background-color: transparent;
	color: var(--teal-900);
	line-height: 0;
	cursor: pointer;
}

.vim-form-modal__close svg {
	width: 1.5rem;
	height: 1.5rem;
	display: block;
}

.vim-form-modal__close:hover {
	color: var(--plum);
}

.vim-form-modal__close:focus-visible {
	outline: 3px solid var(--teal-900);
	outline-offset: 2px;
}

.vim-form-modal__title {
	color: var(--teal-900);
	/* Clear of the close control, which overlaps the top right corner. */
	padding-right: 2.5rem;
	margin-bottom: 0.5rem;
}

.vim-form-modal__intro {
	margin-bottom: 1.5rem;
}

/*
 * The card is already at a comfortable measure, so the form fills it — the
 * 48rem cap forms.css puts on a form in page content would do nothing here but
 * leave the fields short of the card's right edge.
 */
.vim-form-modal .forminator-ui.forminator-custom-form {
	max-width: none;
}

/* wpautop leaves an empty paragraph either side of a shortcode. */
.vim-form-modal > p:empty {
	display: none;
}

/*
 * The trigger sits in the footer's first column, under the address.
 *
 * That column is `align-items: center`, so the button needs no alignment of its
 * own — it centres under the logo and address, and being a flex item in a
 * centred column it does not stretch to the column's full width either. An
 * earlier `align-self: flex-start` here left it hard against the left edge
 * while everything above it stayed centred.
 */
.vim-newsletter-trigger {
	margin-top: 1.25rem;
}
