/* Forms (EmDash forms plugin, drawn by src/components/SiteForm.astro inside the Form block).
   Recreates the look of susiesplace.org's Gravity Forms ("gravity-theme" markup on the
   GeneratePress theme: Lexend, bold labels, rose-bordered inputs, the rose-to-orange gradient
   button) without GF's CSS. Scoped to .spf; colours checked against WCAG 2.2 AA. */
.spf {
	--spf-text: #222;
	--spf-muted: #555;
	--spf-border: #db5461;    /* GF input border on the live site; 3.9:1 on white (UI needs 3:1) */
	--spf-error: #c02b0a;     /* 5.9:1 */
	--spf-accent: #bd4f52;    /* live button start colour #ca6063 darkened for white text (4.8:1) */
	--spf-accent-end: #d03416;
	--spf-progress: #036493;
	--spf-font: var(--sp-font-body, Lexend, sans-serif);
	--spf-heading-font: var(--sp-font-heading, Goldplay, p22-mackinac-pro, sans-serif);
	font-family: var(--spf-font);
	font-weight: 300;
	color: var(--spf-text);
	margin: 0 0 1.5em;
}
.spf *, .spf *::before, .spf *::after { box-sizing: border-box; }
.spf [hidden] { display: none !important; }
.spf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Heading above the form (GF form title / description) */
.spf-heading { margin-bottom: 24px; }
.spf-title { font-family: var(--spf-heading-font); font-weight: 800; font-size: 1.4em; line-height: 1.3; margin: 0 0 8px; }
.spf-description { margin: 0; }
.spf-legend { font-size: 1em; margin: 0 0 24px; }

/* Grid: 12 columns, like GF's */
.spf-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px 16px; }
.spf-field, .spf-section { grid-column: 1 / -1; min-width: 0; margin: 0; }
.spf-span-6 { grid-column: span 6; }
.spf-span-4 { grid-column: span 4; }
.spf-hp { display: none !important; }
fieldset.spf-field { border: 0; padding: 0; }
fieldset.spf-field > legend { padding: 0; float: left; width: 100%; }
fieldset.spf-field > legend + * { clear: both; }

/* Labels, help, required markers */
.spf-label { display: block; font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--spf-text); margin: 0 0 8px; }
.spf-req { color: var(--spf-error); font-weight: 700; margin-left: 4px; }
.spf-label > .spf-req:not([aria-hidden]) { font-size: 13px; font-style: italic; font-weight: 400; }
.spf-help { font-size: 15px; line-height: 1.6; color: var(--spf-text); margin: 8px 0 0; }
.spf-label + .spf-help { margin: 0 0 8px; }
.spf-error { font-size: 15px; line-height: 1.5; font-weight: 400; color: var(--spf-error); margin: 6px 0 0; }
.spf-error:empty { display: none; }

/* Controls */
.spf input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),
.spf select, .spf textarea {
	display: block; width: 100%; margin: 0; padding: 8px; min-height: 42px;
	font: 300 15px/1.5 var(--spf-font); color: var(--spf-text);
	background: #fff; border: 1px solid var(--spf-border); border-radius: 0; box-shadow: none;
}
.spf textarea { min-height: 192px; resize: vertical; }
.spf ::placeholder { color: #6b6b6b; opacity: 1; }
.spf input[type=file] { display: block; max-width: 100%; font: 300 15px/1.5 var(--spf-font); }
.spf-medium > input, .spf-medium > select { max-width: calc(50% - 8px); }
.spf-type-date > input { max-width: 16em; }  /* GF date pickers were narrow */
.spf :is(input, select, textarea, button):focus-visible { outline: 2px solid var(--spf-text); outline-offset: 2px; }
.spf-invalid > :is(input, select, textarea), .spf-invalid :is(input, select, textarea):not([type=checkbox]):not([type=radio]) { border-color: var(--spf-error); box-shadow: inset 0 0 0 1px var(--spf-error); }

/* Compound fields (Name, Address): parts side by side, sub-labels below like GF */
.spf-subfields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 16px; }
.spf-sub { grid-column: span 6; min-width: 0; }
.spf-sub.spf-span-12 { grid-column: 1 / -1; }
.spf-sublabel { display: block; font-size: 15px; line-height: 1.5; padding-top: 5px; }

/* Radio buttons and checkboxes */
.spf-choices { display: grid; gap: 4px; }
.spf-choices--inline { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.spf-choice { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 15px; line-height: 1.5; }
.spf-choice input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--spf-accent); }
.spf-choice label { cursor: pointer; }

/* Section headings (GF section fields) */
.spf-section { border-bottom: 1px solid #ccc; padding-bottom: 8px; margin-top: 8px; }
.spf-section-title { font-family: var(--spf-heading-font); font-size: 29px; font-weight: 800; line-height: 1.4; margin: 0 0 12px; }
.spf-section-description { font-size: 15px; line-height: 1.6; margin: 0; }

/* Multi-page progress */
.spf-progress-wrap { margin-bottom: 32px; }
.spf-progress-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; margin: 0 0 12px; }
.spf-progress { font-size: 16px; font-weight: 700; margin: 0; }
.spf-pct { font-size: 15px; color: var(--spf-progress); font-weight: 700; }
.spf-progress:focus { outline: none; }
.spf-progress:focus-visible { outline: 2px solid var(--spf-text); outline-offset: 2px; }
.spf-bar { height: 12px; border-radius: 12px; background: #e3e3e3; overflow: hidden; }
.spf-bar-fill { height: 100%; background: var(--spf-progress); transition: width 0.3s; }
@media (prefers-reduced-motion: reduce) { .spf-bar-fill { transition: none; } }

/* Buttons */
.spf-turnstile { margin-top: 24px; }
.spf-turnstile:empty { margin: 0; }
.spf-footer { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.spf-button {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px;
	font: 700 16px/1 var(--spf-font); letter-spacing: 0.4px; text-transform: uppercase; color: #fff; cursor: pointer;
	background: var(--spf-accent) linear-gradient(135deg, var(--spf-accent) 40%, var(--spf-accent-end));
	border: 0; border-radius: 10px;
}
.spf-button:hover { background: #425365 linear-gradient(135deg, #425365 40%, #29758b); } /* live GF button hover: slate to teal */
.spf-button:disabled { opacity: 0.7; cursor: progress; }
.spf-button--secondary { color: var(--spf-text); background: #fff; box-shadow: inset 0 0 0 1px var(--spf-text); }
.spf-button--secondary:hover { background: #f3f3f3; }
.spf-footer--full .ec-form-submit { flex: 1 1 100%; text-transform: none; font-weight: 400; }

/* Status / confirmation (the plugin rewrites this element's class, so style by attribute) */
.spf [data-form-status]:empty { display: none; }
.spf [data-form-status] { margin-top: 16px; font-size: 1em; }
.spf [data-form-status].ec-form-status--error { color: var(--spf-error); font-weight: 400; }
.spf [data-form-status]:focus { outline: none; }
.spf [data-form-status] h2, .spf [data-form-status] h3 { font-family: var(--spf-heading-font); font-weight: 800; line-height: 1.3; margin: 0 0 12px; }
.spf [data-form-status] p { margin: 0 0 12px; }
.spf [data-form-status] a { color: inherit; text-decoration: underline; }
.spf form.spf-done > :not([data-form-status]) { display: none !important; }
.spf.spf-done > .spf-legend { display: none; }

@media (max-width: 640px) {
	.spf-span-6, .spf-span-4, .spf-sub { grid-column: 1 / -1; }
	.spf-medium > input, .spf-medium > select { max-width: none; }
}

/* "What Susie's Place means to you" answers (src/blocks/MeaningAnswers.astro) */
.sp-meaning { margin: 2em 0; }
.sp-meaning__heading { margin: 0 0 16px; }
.sp-meaning__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.sp-meaning__item figure { margin: 0; padding: 0 0 0 20px; border-left: 4px solid #db5461; }
.sp-meaning__item blockquote { margin: 0; font-style: italic; }
.sp-meaning__item blockquote p { margin: 0 0 8px; }
.sp-meaning__item figcaption { font-weight: 700; font-size: 0.85em; }
.sp-meaning__item figcaption::before { content: "— "; }

