/*
 * Survey page styling — single-page vertical layout, no external font or
 * asset requests. "Newsreader" and "Urbanist" are referenced by name only;
 * if the site does not already host them locally, the stack falls back to
 * the system fonts listed and nothing is fetched from a CDN — this still
 * needs confirming on staging (see docs/TESTING_AND_REMOVAL.md).
 *
 * Colours are the exact approved MR palette (2026-08-11 code review),
 * replacing 1.0.0's approximate colours:
 *   #15130F  ink       — primary text, headings
 *   #8C2F1F  accent    — buttons, focus states, emphasis
 *   #FFFEFB  bg        — page background
 *   #F8F7F3  bg-soft   — panels (crisis line, support reminder)
 *   #CBC3B5  border    — borders, secondary text
 */

:root {
	--mr-ink: #15130F;
	--mr-accent: #8C2F1F;
	--mr-bg: #FFFEFB;
	--mr-bg-soft: #F8F7F3;
	--mr-border: #CBC3B5;
}

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body.mr-survey-body {
	margin: 0;
	padding: 0;
	background: var(--mr-bg);
	color: var(--mr-ink);
	font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 17px;
	line-height: 1.6;
}

.mr-survey-page {
	max-width: 680px;
	margin: 0 auto;
	padding: 32px 20px 96px;
}

.mr-logo-wrap {
	text-align: center;
	margin-bottom: 24px;
}

/* Rendered from wp_get_attachment_image() directly (no surrounding <a>),
   so the logo is deliberately not a link on this page — see
   templates/survey-page-template.php. */
.mr-logo-wrap .mr-logo-image {
	max-width: 220px;
	height: auto;
}

.mr-logo-fallback {
	font-weight: 700;
	font-size: 20px;
	text-align: center;
	color: var(--mr-ink);
}

.mr-title {
	font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
	font-size: 32px;
	line-height: 1.25;
	text-align: center;
	margin: 0 0 8px;
	color: var(--mr-ink);
}

.mr-subtitle {
	text-align: center;
	color: var(--mr-ink);
	opacity: 0.72;
	margin: 0 0 32px;
	font-size: 18px;
}

.mr-contact-block {
	border-top: 1px solid var(--mr-border);
	border-bottom: 1px solid var(--mr-border);
	padding: 16px 0;
	margin: 24px 0;
	font-size: 14px;
	color: var(--mr-ink);
	opacity: 0.8;
	text-align: center;
}

.mr-contact-block p {
	margin: 2px 0;
}

.mr-intro p,
.mr-intro li {
	font-size: 16px;
}

.mr-intro a {
	color: var(--mr-accent);
}

.mr-intro ul {
	padding-left: 20px;
}

.mr-crisis-line {
	background: var(--mr-bg-soft);
	border-left: 4px solid var(--mr-accent);
	padding: 12px 16px;
	font-size: 15px;
}

.mr-support-reminder {
	background: var(--mr-bg-soft);
	border-left: 4px solid var(--mr-accent);
	padding: 12px 16px;
	font-size: 15px;
	margin-bottom: 24px;
}

.mr-section {
	margin: 40px 0;
	padding-top: 24px;
	border-top: 1px solid var(--mr-border);
}

.mr-section-title {
	font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
	font-size: 24px;
	margin: 0 0 20px;
	color: var(--mr-ink);
}

fieldset.mr-q {
	border: none;
	padding: 0;
	margin: 0 0 28px;
}

.mr-q legend,
.mr-longtext label {
	font-weight: 600;
	margin-bottom: 10px;
	padding: 0;
	font-size: 16px;
	color: var(--mr-ink);
}

.mr-required {
	color: var(--mr-accent);
	font-weight: 400;
	font-size: 14px;
}

.mr-optional {
	color: var(--mr-ink);
	opacity: 0.6;
	font-weight: 400;
	font-size: 14px;
}

.mr-hint {
	color: var(--mr-ink);
	opacity: 0.65;
	font-size: 14px;
	margin: -4px 0 4px;
}

.mr-cap-status {
	font-size: 13px;
	color: var(--mr-accent);
	min-height: 18px;
	margin: 0 0 10px;
}

.mr-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid var(--mr-bg-soft);
}

.mr-option input[type="radio"],
.mr-option input[type="checkbox"] {
	width: 20px;
	height: 20px;
	flex: none;
	margin-top: 2px;
	accent-color: var(--mr-accent);
}

.mr-option label {
	flex: 1;
	cursor: pointer;
}

.mr-inline-text {
	flex: 1 1 100%;
	margin-top: 6px;
	padding: 8px;
	border: 1px solid var(--mr-border);
	border-radius: 4px;
	font-family: inherit;
	font-size: 15px;
	background: var(--mr-bg);
	color: var(--mr-ink);
}

.mr-scale-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.mr-scale-label {
	font-size: 13px;
	color: var(--mr-ink);
	opacity: 0.65;
	flex: none;
}

.mr-scale-point {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.mr-scale-point input[type="radio"] {
	width: 22px;
	height: 22px;
	accent-color: var(--mr-accent);
}

/* Grid questions (C1/C2): one fieldset per row statement, columns as a
   horizontally-wrapping choice list. Deliberately no <table> and no
   horizontal-scroll container — wraps onto additional lines instead,
   never requiring horizontal page or grid scrolling on any viewport. */
.mr-grid-prompt {
	font-weight: 600;
	font-size: 16px;
	margin-bottom: 14px;
	color: var(--mr-ink);
}

.mr-grid-row {
	border: none;
	border-top: 1px solid var(--mr-bg-soft);
	padding: 12px 0 4px;
	margin: 0;
}

.mr-grid-row legend {
	font-weight: 500;
	font-size: 15px;
	padding: 0;
	margin-bottom: 8px;
	color: var(--mr-ink);
}

.mr-grid-row-options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
}

.mr-grid-choice {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
}

.mr-grid-choice input[type="radio"] {
	width: 18px;
	height: 18px;
	accent-color: var(--mr-accent);
}

.mr-longtext textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--mr-border);
	border-radius: 4px;
	font-family: inherit;
	font-size: 15px;
	resize: vertical;
	background: var(--mr-bg);
	color: var(--mr-ink);
}

.mr-note {
	font-size: 13px;
	color: var(--mr-ink);
	opacity: 0.65;
	margin: 4px 0 10px;
}

.mr-submit-row {
	text-align: center;
	margin-top: 40px;
}

.mr-submit-button {
	background: var(--mr-ink);
	color: var(--mr-bg);
	border: none;
	border-radius: 4px;
	padding: 16px 40px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
}

.mr-submit-button:hover {
	background: var(--mr-accent);
}

.mr-submit-secondary {
	padding: 12px 28px;
	font-size: 16px;
}

.mr-form-status {
	text-align: center;
	min-height: 24px;
	color: var(--mr-accent);
	font-weight: 600;
}

.mr-thankyou,
.mr-ended,
.mr-contact-wrap,
.mr-contact-done {
	max-width: 680px;
	margin: 0 auto;
}

.mr-thankyou h2,
.mr-ended h2,
.mr-contact-wrap h2 {
	font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
	font-size: 26px;
	color: var(--mr-ink);
}

.mr-honeypot-wrap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.mr-field {
	margin-bottom: 16px;
}

.mr-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--mr-ink);
}

.mr-field input[type="text"],
.mr-field input[type="email"] {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--mr-border);
	border-radius: 4px;
	font-family: inherit;
	font-size: 16px;
	background: var(--mr-bg);
	color: var(--mr-ink);
}

.mr-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.mr-consent input {
	margin-top: 4px;
	width: 20px;
	height: 20px;
	flex: none;
	accent-color: var(--mr-accent);
}

.mr-privacy-footer {
	font-size: 14px;
	color: var(--mr-ink);
	opacity: 0.7;
	margin-top: 24px;
}

/* Visible, non-suppressed focus states throughout, per WCAG 2.2 AA,
   using the approved accent colour rather than an off-palette blue. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 3px solid var(--mr-accent);
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.mr-title {
		font-size: 26px;
	}

	.mr-survey-page {
		padding: 20px 14px 80px;
	}

	.mr-submit-button {
		width: 100%;
	}

	.mr-grid-row-options {
		flex-direction: column;
		gap: 8px;
	}
}
