/* Donation modal — the form itself is styled by donate.css so this file only
 * handles the overlay shell: backdrop, sizing, close button, scroll behavior.
 * The form inside is rendered exactly as on /donate so styling stays identical.
 */

.rsm-donate-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	padding: 40px 16px;
	background: rgba(0, 0, 0, 0.6);
	-webkit-overflow-scrolling: touch;
}

.rsm-donate-modal.is-open {
	display: flex;
}

/* Lock body scroll while modal is open. Applied via JS. */
body.rsm-donate-modal-open {
	overflow: hidden;
}

.rsm-donate-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 760px;
	margin: auto;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
	animation: rsm-donate-modal-in 0.18s ease-out;
}

@keyframes rsm-donate-modal-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

.rsm-donate-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: #222;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.rsm-donate-modal__close:hover,
.rsm-donate-modal__close:focus {
	background: rgba(0, 0, 0, 0.12);
	outline: none;
}

.rsm-donate-modal__close::before {
	content: "\00d7"; /* multiplication sign — clean X */
	font-weight: 400;
	display: block;
	transform: translateY(-1px);
}

/* The form section pads itself; we just need to make sure the close button
 * doesn't overlap the form title. Add a small top offset on small screens. */
.rsm-donate-modal__body {
	padding-top: 8px;
}

/* donate.css makes .rsm-donate at-least viewport-height with hefty outer
 * padding so the standalone /donate page fills the screen. Inside the modal
 * dialog those rules make the modal feel huge with too much top space — clamp
 * them down. Scoped to the modal so /donate page is untouched. */
.rsm-donate-modal .rsm-donate {
	min-height: 0;
	padding: 24px 24px 32px;
}

@media (max-width: 640px) {
	.rsm-donate-modal .rsm-donate {
		padding: 16px 14px 32px;
	}
}

/* On mobile, go full-screen for usable form height. */
@media (max-width: 640px) {
	.rsm-donate-modal {
		padding: 0;
	}
	.rsm-donate-modal__dialog {
		max-width: 100%;
		min-height: 100%;
		border-radius: 0;
	}
	.rsm-donate-modal__close {
		top: 8px;
		right: 8px;
	}
}
