/*
 * The giving nudge. A small card in the corner on wide screens, a slim bar
 * along the bottom on phones. It carries its own ink and bone so it reads on
 * any section, and falls back to plain values when the theme is not active.
 */
.wtr-nudge {
	--wtr-nudge-ink: var(--wp--preset--color--ink, #0B0B0C);
	--wtr-nudge-bone: var(--wp--preset--color--bone, #F2EFE8);
	--wtr-nudge-accent: var(--wp--preset--color--orange, #FF5A1F);
	--wtr-nudge-line: rgba(242, 239, 232, .14);
	--wtr-nudge-quiet: rgba(242, 239, 232, .62);
	--wtr-nudge-mono: var(--wp--preset--font-family--mono, ui-monospace, monospace);
	--wtr-nudge-serif: var(--wp--preset--font-family--serif, Georgia, serif);
	--wtr-nudge-gap: 24px;

	position: fixed;
	z-index: 45; /* Under the sticky header (50), so the header always wins. */
	right: var(--wtr-nudge-gap);
	bottom: var(--wtr-nudge-gap);
	box-sizing: border-box;
	width: 340px;
	max-width: calc(100vw - 2 * var(--wtr-nudge-gap));
	margin: 0;
	padding: 18px 20px 16px;
	background: var(--wtr-nudge-ink);
	color: var(--wtr-nudge-bone);
	border: 1px solid var(--wtr-nudge-line);
	border-radius: 2px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .35s cubic-bezier(.2, .7, .2, 1), transform .35s cubic-bezier(.2, .7, .2, 1);
}
.wtr-nudge[hidden] { display: none; }
.wtr-nudge.is-in { opacity: 1; transform: none; }
.wtr-nudge *, .wtr-nudge *::before, .wtr-nudge *::after { box-sizing: border-box; }
.wtr-nudge p { margin: 0; }

.wtr-nudge__eyebrow {
	padding-right: 32px;
	font-family: var(--wtr-nudge-mono);
	font-size: 11px;
	line-height: 1.3;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--wtr-nudge-quiet);
}
.wtr-nudge__eyebrow::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 8px;
	vertical-align: 1px;
	background: var(--wtr-nudge-accent);
	border-radius: 50%;
}
.wtr-nudge__headline {
	margin-top: 8px !important;
	padding-right: 24px;
	font-family: var(--wtr-nudge-serif);
	font-size: 20px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -.005em;
}
.wtr-nudge__message {
	margin-top: 6px !important;
	color: rgba(242, 239, 232, .78);
}

.wtr-nudge__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	margin-top: 14px;
}
.wtr-nudge__give {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 14px;
	margin-right: 4px;
	background: var(--wtr-nudge-accent);
	color: var(--wtr-nudge-ink) !important;
	border-radius: 2px;
	font-family: var(--wtr-nudge-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background-color .2s, color .2s;
}
.wtr-nudge__give:hover { background: var(--wtr-nudge-bone); }
.wtr-nudge__quiet {
	appearance: none;
	min-height: 32px;
	padding: 0;
	margin: 0;
	background: none;
	border: 0;
	color: var(--wtr-nudge-quiet);
	font: inherit;
	font-size: 12.5px;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
	cursor: pointer;
	transition: color .2s, text-decoration-color .2s;
}
.wtr-nudge__quiet:hover { color: var(--wtr-nudge-bone); text-decoration-color: currentColor; }

.wtr-nudge__close {
	appearance: none;
	position: absolute;
	top: 6px;
	right: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 2px;
	color: var(--wtr-nudge-quiet);
	cursor: pointer;
	transition: color .2s;
}
.wtr-nudge__close:hover { color: var(--wtr-nudge-bone); }

.wtr-nudge a:focus-visible,
.wtr-nudge button:focus-visible {
	outline: 2px solid var(--wtr-nudge-bone);
	outline-offset: 2px;
}

/* Phones: a slim bar along the bottom, clear of the home indicator. */
@media (max-width: 699px) {
	.wtr-nudge {
		--wtr-nudge-gap: 12px;
		left: var(--wtr-nudge-gap);
		right: var(--wtr-nudge-gap);
		bottom: calc(var(--wtr-nudge-gap) + env(safe-area-inset-bottom, 0px));
		width: auto;
		max-width: none;
		max-height: 25vh;
		max-height: 25dvh;
		overflow: hidden;
		padding: 12px 14px 8px;
		font-size: 13px;
		line-height: 1.4;
		transform: translateY(calc(100% + 24px));
	}
	.wtr-nudge__close { top: 2px; right: 2px; width: 40px; height: 40px; }
	.wtr-nudge__eyebrow { font-size: 10px; }
	.wtr-nudge__headline { margin-top: 4px !important; font-size: 17px; }
	.wtr-nudge__message {
		margin-top: 3px !important;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		line-clamp: 3;
		overflow: hidden;
	}
	.wtr-nudge__actions { flex-wrap: nowrap; gap: 0 12px; margin-top: 8px; }
	.wtr-nudge__give { min-height: 36px; padding: 0 14px; font-size: 11px; }
	.wtr-nudge__quiet { min-height: 40px; font-size: 12px; white-space: nowrap; }
}

/* Very short screens (a phone on its side): drop the message. */
@media (max-height: 480px) {
	.wtr-nudge__message { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	.wtr-nudge, .wtr-nudge.is-in { transition: none; transform: none; }
}

@media print {
	.wtr-nudge { display: none !important; }
}
