/**
 * Ready Rating survey modal.
 *
 * Custom properties are declared on the overlay so a theme or child theme can
 * override any of them without fighting specificity.
 */

.rr-survey-overlay {
	--rr-survey-accent: #a4343a;
	--rr-survey-accent-ink: #ffffff;
	--rr-survey-ink: #1d1f20;
	--rr-survey-muted: #5a6164;
	--rr-survey-surface: #ffffff;
	--rr-survey-rule: #d9dedf;          /* decorative dividers only */
	--rr-survey-control: #7d8386;       /* interactive borders — WCAG 1.4.11 */
	--rr-survey-backdrop: rgba(15, 20, 22, 0.62);
	--rr-survey-radius: 8px;
	--rr-survey-height: 620px;

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

.rr-survey-overlay[hidden] {
	display: none;
}

.rr-survey-backdrop {
	position: absolute;
	inset: 0;
	background: var(--rr-survey-backdrop);
}

.rr-survey-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 720px;
	max-height: calc(100vh - 48px);
	background: var(--rr-survey-surface);
	color: var(--rr-survey-ink);
	border-radius: var(--rr-survey-radius);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
	padding: 22px 24px 18px;
	overflow-y: auto;
	font-size: 15px;
	line-height: 1.5;
}

.rr-survey-overlay.is-open .rr-survey-dialog {
	animation: rr-survey-in 180ms ease-out;
}

@keyframes rr-survey-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.rr-survey-overlay.is-open .rr-survey-dialog { animation: none; }
}

.rr-survey-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.rr-survey-title {
	margin: 0;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--rr-survey-ink);
}

.rr-survey-title:focus {
	outline: none;
}

.rr-survey-close {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	line-height: 1;
	background: none;
	border: 1px solid transparent;
	border-radius: 4px;
	color: var(--rr-survey-muted);
	cursor: pointer;
	padding: 0;
}

.rr-survey-close:hover {
	background: #f1f3f3;
	border-color: var(--rr-survey-control);
	color: var(--rr-survey-ink);
}

.rr-survey-intro {
	margin: 10px 0 0;
	color: var(--rr-survey-muted);
}

.rr-survey-frame {
	margin: 16px 0 0;
	border: 1px solid var(--rr-survey-rule);
	border-radius: 6px;
	overflow: hidden;
	background: #f7f8f8;
}

.rr-survey-iframe {
	display: block;
	width: 100%;
	height: var(--rr-survey-height);
	max-height: 62vh;
	border: 0;
}

.rr-survey-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 16px 0 0;
}

.rr-survey-btn {
	font: inherit;
	font-weight: 600;
	padding: 11px 20px;
	border-radius: 4px;
	cursor: pointer;
	border: 1px solid transparent;
	min-height: 44px;
}

.rr-survey-btn-primary {
	background: var(--rr-survey-accent);
	color: var(--rr-survey-accent-ink);
	border-color: var(--rr-survey-accent);
}

.rr-survey-btn-primary:hover {
	filter: brightness(1.08);
}

.rr-survey-btn-ghost {
	background: transparent;
	color: var(--rr-survey-ink);
	border-color: var(--rr-survey-control);
}

.rr-survey-btn-ghost:hover {
	background: #f1f3f3;
}

/*
 * A visible focus ring on every control. Avada strips outlines in places, so
 * this is stated explicitly rather than relying on the browser default.
 */
.rr-survey-dialog :is(button, a, [tabindex]):focus-visible {
	outline: 3px solid #1c6bba;
	outline-offset: 2px;
}

@media (forced-colors: active) {
	.rr-survey-dialog { border: 1px solid CanvasText; }
	.rr-survey-btn { border: 1px solid ButtonText; }
	.rr-survey-dialog :is(button, a, [tabindex]):focus-visible { outline: 3px solid Highlight; }
}

.rr-survey-note {
	margin: 12px 0 0;
	font-size: 13px;
	color: var(--rr-survey-muted);
}

/* Sentinels exist only to catch focus leaving the dialog. */
.rr-survey-sentinel {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

/* Present in most themes, restated so the plugin never depends on it. */
.rr-survey-dialog .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

body.rr-survey-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.rr-survey-overlay { padding: 0; }

	.rr-survey-dialog {
		max-width: none;
		max-height: 100vh;
		height: 100vh;
		border-radius: 0;
		padding: 18px 16px 16px;
	}

	.rr-survey-iframe { max-height: none; height: 58vh; }

	.rr-survey-actions .rr-survey-btn { flex: 1 1 100%; }
}

/*
 * Outcome announcements. Positioned off-screen rather than display:none,
 * which would stop assistive technology reading it at all.
 */
.rr-survey-announce {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
