/**
 * Donate popup — bank transfer details.
 *
 * Every colour, radius and font here resolves from the theme's design-token
 * variables, so changing the palette in the Customizer restyles the popup
 * with it. Static fallbacks keep it presentable if the token block is missing.
 */

.pcf-dm[hidden] {
	display: none;
}

.pcf-dm {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.pcf-dm__backdrop {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--pcf-color-overlay, #04305c) 72%, transparent);
	backdrop-filter: blur(4px);
	animation: pcf-dm-fade 0.2s ease-out;
}

/* color-mix is widely supported, but fall back to flat opacity where it is not. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
	.pcf-dm__backdrop {
		background: rgba(4, 48, 92, 0.72);
	}
}

.pcf-dm__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: var(--pcf-dm-width, 560px);
	max-height: calc(100vh - 48px);
	overflow: hidden;
	background: var(--pcf-color-surface, #fff);
	border-radius: var(--pcf-radius-lg, 32px);
	box-shadow: 0 24px 64px rgba(4, 48, 92, 0.32);
	animation: pcf-dm-rise 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.pcf-dm__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 24px 28px;
	background: linear-gradient(
		135deg,
		var(--pcf-color-primary, #024e9c),
		var(--pcf-color-primary-alt, #0c7bd8)
	);
	color: var(--pcf-color-text-invert, #fff);
}

.pcf-dm__title {
	margin: 0;
	font-family: var(--pcf-font-heading, sans-serif);
	font-size: var(--pcf-h3-size, 24px);
	line-height: var(--pcf-h3-lh, 32px);
	font-weight: var(--pcf-h3-weight, 600);
	color: inherit;
}

.pcf-dm__subtitle {
	margin: 6px 0 0;
	font-family: var(--pcf-font-body, sans-serif);
	font-size: var(--pcf-small-size, 14px);
	line-height: var(--pcf-small-lh, 20px);
	opacity: 0.9;
}

.pcf-dm__close {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	padding: 0;
	font-size: 26px;
	line-height: 1;
	color: inherit;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.16);
	border: 0;
	border-radius: var(--pcf-radius-btn, 999px);
	transition: background 0.15s ease, transform 0.15s ease;
}

.pcf-dm__close:hover,
.pcf-dm__close:focus-visible {
	background: rgba(255, 255, 255, 0.3);
	transform: scale(1.06);
}

.pcf-dm__close:focus-visible {
	outline: 2px solid var(--pcf-color-text-invert, #fff);
	outline-offset: 2px;
}

.pcf-dm__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 8px 28px 28px;
	background: var(--pcf-color-surface, #fff);
}

.pcf-dm__rows {
	margin: 0;
}

.pcf-dm__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--pcf-color-border, #cfe2f7);
}

.pcf-dm__row:last-child {
	border-bottom: 0;
}

.pcf-dm__label {
	flex: 0 0 auto;
	margin: 0;
	font-family: var(--pcf-font-body, sans-serif);
	font-size: var(--pcf-small-size, 14px);
	line-height: var(--pcf-small-lh, 20px);
	color: var(--pcf-color-text-muted, #4a5568);
}

.pcf-dm__value {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	min-width: 0;
	text-align: right;
}

.pcf-dm__text {
	font-family: var(--pcf-font-heading, sans-serif);
	font-size: 16px;
	font-weight: 600;
	color: var(--pcf-color-text, #0b1f33);
	overflow-wrap: anywhere;
}

/* Tabular figures line the digits up and stop IBANs looking like a typo. */
.pcf-dm__text--mono {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

.pcf-dm__copy {
	flex: 0 0 auto;
	padding: 6px 14px;
	font-family: var(--pcf-font-body, sans-serif);
	font-size: 13px;
	font-weight: 600;
	color: var(--pcf-color-primary, #024e9c);
	cursor: pointer;
	background: var(--pcf-color-surface-alt, #edf4fd);
	border: 1px solid var(--pcf-color-border, #cfe2f7);
	border-radius: var(--pcf-radius-btn, 999px);
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pcf-dm__copy:hover,
.pcf-dm__copy:focus-visible {
	background: var(--pcf-color-surface-high, #d8e9fb);
}

.pcf-dm__copy:focus-visible {
	outline: 2px solid var(--pcf-color-primary, #024e9c);
	outline-offset: 2px;
}

.pcf-dm__copy.is-copied {
	color: var(--pcf-color-text-invert, #fff);
	background: var(--pcf-color-tertiary, #4ca512);
	border-color: var(--pcf-color-tertiary, #4ca512);
}

.pcf-dm__note {
	margin: 20px 0 0;
	padding: 14px 16px;
	font-family: var(--pcf-font-body, sans-serif);
	font-size: var(--pcf-small-size, 14px);
	line-height: var(--pcf-small-lh, 20px);
	color: var(--pcf-color-text-muted, #4a5568);
	background: var(--pcf-color-surface-alt, #edf4fd);
	border-radius: var(--pcf-radius-sm, 8px);
}

/* Stop the page behind the popup scrolling while it is open. */
.pcf-dm-open {
	overflow: hidden;
}

@keyframes pcf-dm-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes pcf-dm-rise {
	from { opacity: 0; transform: translateY(16px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

/* Stack label over value on phones, where side-by-side rows squeeze an IBAN. */
@media (max-width: 520px) {
	.pcf-dm {
		padding: 0;
	}

	.pcf-dm__dialog {
		max-width: none;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.pcf-dm__head {
		padding: 18px 20px;
	}

	.pcf-dm__body {
		padding: 8px 20px 24px;
	}

	.pcf-dm__row {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.pcf-dm__value {
		width: 100%;
		justify-content: space-between;
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pcf-dm__backdrop,
	.pcf-dm__dialog,
	.pcf-dm__close,
	.pcf-dm__copy {
		animation: none;
		transition: none;
	}
}
