/**
 * Newsletter invitation (see includes/newsletter-invite.php). Colours and
 * fonts come from the active theme's presets when it has them, with plain
 * fallbacks. Mobile first: a strip across the bottom of the screen; from
 * 600px, a card in the bottom right corner.
 */
.wdc-invite {
	position: fixed;
	right: 0.75rem;
	bottom: 0.75rem;
	left: 0.75rem;
	z-index: 999; /* Under the cookie banner (1000). */
	box-sizing: border-box;
	padding: 1rem 1.1rem 0.9rem;
	background: var(--wp--preset--color--base, #faf7f2);
	border: 1px solid var(--wp--preset--color--line, #e4ddd2);
	border-top: 3px solid var(--wp--preset--color--accent, #8b1e2d);
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
	color: var(--wp--preset--color--contrast, #1f1d1b);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	line-height: 1.45;
	opacity: 0;
	transform: translateY(1.5rem);
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.wdc-invite[hidden] {
	display: none;
}

.wdc-invite.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.wdc-invite {
		transition: none;
	}
}

@media (min-width: 600px) {
	.wdc-invite {
		right: 1.5rem;
		bottom: 1.5rem;
		left: auto;
		width: 23rem;
		padding: 1.25rem 1.35rem 1.1rem;
	}
}

.wdc-invite__close {
	position: absolute;
	top: 0.35rem;
	right: 0.35rem;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: var(--wp--preset--color--muted, #6b645c);
	cursor: pointer;
}

.wdc-invite__close:is(:hover, :focus-visible) {
	background: var(--wp--preset--color--line, #e4ddd2);
	color: var(--wp--preset--color--contrast, #1f1d1b);
}

.wdc-invite__close:focus-visible,
.wdc-invite__submit:focus-visible,
.wdc-invite input:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #8b1e2d);
	outline-offset: 2px;
}

.wdc-invite__text {
	padding-right: 2rem; /* Room for the close button. */
}

.wdc-invite__text > * {
	margin: 0 0 0.35rem;
}

.wdc-invite__title,
.wdc-invite__text :is(h2, h3, h4) {
	font-family: var(--wp--preset--font-family--title, inherit);
	font-size: var(--wp--preset--font-size--large, 1.25rem);
	font-weight: 600;
	line-height: 1.2;
}

.wdc-invite__form {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.wdc-invite__form input[type="email"] {
	flex: 1 1 auto;
	min-width: 0;
	box-sizing: border-box;
	padding: 0.6em 0.75em;
	background: #fff;
	border: 1px solid var(--wp--preset--color--muted, #6b645c);
	border-radius: 3px;
	color: inherit;
	font: inherit;
	font-size: 1rem; /* 16px at least: no automatic zoom on iPhone. */
}

.wdc-invite__submit {
	flex: 0 0 auto;
	padding: 0.6em 1.1em;
	background: var(--wp--preset--color--accent, #8b1e2d);
	border: 0;
	border-radius: 3px;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}

.wdc-invite__submit:hover {
	background: var(--wp--preset--color--contrast, #1f1d1b);
}

.wdc-invite__note {
	margin: 0.6rem 0 0;
	color: var(--wp--preset--color--muted, #6b645c);
	font-size: 0.8rem;
}

.wdc-invite__note a {
	color: inherit;
	text-underline-offset: 0.2em;
}

.wdc-invite .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
