/* ObitPress submission form. */

/*
 * Everything hangs off these properties. Settings → Appearance sets the main
 * ones (see FormStyle), and a theme can still go further with a few lines of
 * Additional CSS rather than overriding rule by rule:
 *
 *     .op-shell { --op-accent: #3c4a6b; }
 *
 * The body text inherits the theme's font. Headings use a serif already on the
 * reader's machine: loading a web font from a third party onto a page where
 * families type about a death is not a trade worth making for a typeface.
 */
.op-shell {
	/* The five a newsroom sets in Settings → Appearance. */
	--op-accent: #2f5d50;
	--op-on-accent: #fff;
	--op-paper: #f6f4ef;
	--op-card: #fff;
	--op-ink: #1f2421;

	/* Everything else is mixed from those, so a brand colour carries through
	   to borders, hints and hover states without being set one by one. */
	--op-accent-dark: color-mix(in srgb, var(--op-accent) 78%, #000);
	--op-accent-tint: color-mix(in srgb, var(--op-accent) 8%, var(--op-card));
	--op-field: color-mix(in srgb, var(--op-ink) 2%, var(--op-card));
	--op-ink-soft: color-mix(in srgb, var(--op-ink) 85%, var(--op-card));
	--op-muted: color-mix(in srgb, var(--op-ink) 72%, var(--op-card));
	--op-line: color-mix(in srgb, var(--op-ink) 12%, var(--op-card));
	--op-input-line: color-mix(in srgb, var(--op-ink) 24%, var(--op-card));
	--op-error: #b3261e;
	--op-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--op-scale: 1;

	font-size: calc(1em * var(--op-scale));
	container-type: inline-size;
	max-width: 1120px;
	margin: 0 auto;
	padding: clamp(1rem, 4vw, 2.5rem);
	border-radius: 20px;
	background: var(--op-paper);
	color: var(--op-ink);
	line-height: 1.55;
	box-sizing: border-box;
}

.op-shell *,
.op-shell *::before,
.op-shell *::after {
	box-sizing: border-box;
}

/* Header ------------------------------------------------------------------ */

.op-header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
	max-width: 42rem;
	margin: 0 0 1.75rem;
}

.op-form__title {
	margin: 0;
	font-family: var(--op-serif);
	font-weight: 500;
	font-size: clamp(2em, 5vw, 3em);
	line-height: 1.08;
	letter-spacing: -0.015em;
	color: var(--op-ink);
}

.op-lede {
	margin: 0;
	font-size: 1.1em;
	color: var(--op-ink-soft);
}

.op-test-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0.35rem 0.8rem;
	border-radius: 999px;
	background: #fff1d6;
	color: #6e4300;
	font-size: 0.85em;
	font-weight: 600;
}

.op-test-badge::before {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: #c98500;
}

/* Progress ---------------------------------------------------------------- */

.op-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.75rem;
	padding: 0;
	list-style: none;
}

.op-step {
	flex: 1 1 9rem;
	margin: 0;
}

.op-step a {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.25rem 0;
	color: var(--op-muted);
	font-size: 0.85em;
	font-weight: 600;
	text-decoration: none;
}

.op-step__bar {
	display: block;
	height: 4px;
	border-radius: 4px;
	background: var(--op-line);
	transition: background-color 0.2s, opacity 0.2s;
}

.op-step.is-done .op-step__bar {
	background: var(--op-accent);
	opacity: 0.4;
}

.op-step.is-current .op-step__bar {
	background: var(--op-accent);
	opacity: 1;
}

.op-step.is-current a {
	color: var(--op-accent);
}

/* Layout ------------------------------------------------------------------ */

.op-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.75rem;
	align-items: start;
}

.op-form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	min-width: 0;
	margin: 0;
}

/* Too narrow for a second column: the preview would end up under the pay
   button, where it is no use to anybody. */
.op-aside {
	display: none;
}

/* No side column: one comfortable column, not a form stretched across the page. */
.op-shell--single {
	max-width: 860px;
}

@container (min-width: 880px) {
	.op-layout--split {
		grid-template-columns: minmax(0, 1fr) 320px;
	}

	.op-aside {
		position: sticky;
		top: 1.5rem;
		display: flex;
		flex-direction: column;
		gap: 1rem;
	}
}

/* Sections ---------------------------------------------------------------- */

.op-fieldset {
	min-width: 0;
	margin: 0;
	padding: clamp(1.25rem, 3vw, 1.75rem);
	border: 1px solid var(--op-line);
	border-radius: 16px;
	background: var(--op-card);
	box-shadow: 0 1px 2px rgba(40, 35, 25, 0.04);
	scroll-margin-top: 1.5rem;
}

/*
 * A legend sits on the fieldset's border by default. Floating it puts it
 * inside the card like a heading, in every browser, without changing what a
 * screen reader announces as the group's name.
 */
.op-legend {
	float: left;
	width: 100%;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 0.25rem;
	padding: 0;
	font-family: var(--op-serif);
	font-size: 1.6em;
	font-weight: 500;
	line-height: 1.2;
	color: var(--op-ink);
}

.op-legend + * {
	clear: both;
}

.op-num {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: var(--op-accent);
	color: var(--op-on-accent);
	font-family: inherit;
	font-size: 0.875em;
	font-weight: 600;
	line-height: 1;
}

.op-fieldset__intro {
	margin: 0 0 1.25rem;
	color: var(--op-muted);
	font-size: 0.95em;
}

.op-private {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.op-icon {
	flex: 0 0 auto;
}

/* Fields ------------------------------------------------------------------ */

.op-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1rem;
}

.op-row > .op-field {
	flex: 1 1 13rem;
}

.op-row > .op-field--narrow {
	flex: 0 1 9rem;
}

.op-field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-width: 0;
	margin: 0 0 1.1rem;
	padding: 0;
	border: 0;
}

.op-field--last,
.op-row--last > .op-field {
	margin-bottom: 0;
}

.op-field label,
.op-label {
	display: block;
	padding: 0;
	font-size: 0.9em;
	font-weight: 600;
	color: var(--op-ink);
}

.op-optional {
	margin-left: 0.25rem;
	font-weight: 400;
	color: var(--op-muted);
}

.op-shell input[type="text"],
.op-shell input[type="email"],
.op-shell input[type="date"],
.op-shell input[type="time"],
.op-shell input[type="tel"],
.op-shell select,
.op-shell textarea {
	width: 100%;
	min-height: 3rem;
	margin: 0;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--op-input-line);
	border-radius: 10px;
	background: var(--op-field);
	color: var(--op-ink);
	font: inherit;
	font-size: 1em;
	box-shadow: none;
	transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.op-shell input:focus,
.op-shell select:focus,
.op-shell textarea:focus {
	border-color: var(--op-accent);
	background: var(--op-card);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--op-accent) 25%, transparent);
}

.op-shell .op-input--short {
	max-width: 20rem;
}

.op-shell .op-story {
	font-family: var(--op-serif);
	font-size: 1.1em;
	line-height: 1.65;
}

.op-required {
	color: var(--op-error);
}

.op-help {
	display: block;
	font-size: 0.85em;
	color: var(--op-muted);
}

.op-field-error {
	display: block;
	color: var(--op-error);
	font-size: 0.85em;
	font-weight: 600;
}

.op-field-error:empty {
	display: none;
}

.op-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Photo ------------------------------------------------------------------- */

.op-field .op-dropzone {
	position: relative;
	display: flex;
	align-items: center;
	gap: 1.1rem;
	padding: 1.1rem;
	border: 1.5px dashed var(--op-input-line);
	border-radius: 12px;
	background: var(--op-field);
	font-weight: 400;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.op-field .op-dropzone:hover,
.op-field .op-dropzone.is-dragging {
	border-color: var(--op-accent);
	background: var(--op-accent-tint);
}

.op-field .op-dropzone:focus-within {
	border-style: solid;
	border-color: var(--op-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--op-accent) 25%, transparent);
}

.op-dropzone__media {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 4.5rem;
	height: 4.5rem;
	overflow: hidden;
	border-radius: 12px;
	background: var(--op-accent-tint);
	color: var(--op-accent);
}

.op-dropzone.has-photo .op-dropzone__icon {
	display: none;
}

.op-photo-preview {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.op-photo-preview[hidden] {
	display: none;
}

.op-dropzone__text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.op-dropzone__title {
	color: var(--op-ink);
	font-weight: 600;
	overflow-wrap: anywhere;
}

/* Service ----------------------------------------------------------------- */

.op-chips {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.op-chips > .op-label {
	float: left;
	width: 100%;
	margin-bottom: 0.1rem;
}

.op-field .op-chip {
	position: relative;
	display: inline-flex;
	margin: 0;
	font-weight: 500;
	cursor: pointer;
}

.op-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.op-chip span {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.5rem 1rem;
	border: 1px solid var(--op-input-line);
	border-radius: 999px;
	background: var(--op-card);
	color: var(--op-ink);
	font-size: 0.9em;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.op-chip:hover span {
	border-color: var(--op-accent);
}

.op-chip input:checked + span {
	border-color: var(--op-accent);
	background: var(--op-accent);
	color: var(--op-on-accent);
}

.op-chip input:focus-visible + span {
	outline: 3px solid color-mix(in srgb, var(--op-accent) 40%, transparent);
	outline-offset: 2px;
}

.op-more {
	margin: 0.25rem 0 0;
	padding-top: 1rem;
	border-top: 1px solid var(--op-line);
}

.op-more summary {
	display: flex;
	list-style: none;
	align-items: center;
	min-height: 2rem;
	color: var(--op-accent);
	font-weight: 600;
	cursor: pointer;
}

.op-more summary::-webkit-details-marker {
	display: none;
}

.op-more summary::before {
	content: "+";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	margin-right: 0.5rem;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	font-size: 0.9em;
	line-height: 1;
}

.op-more[open] summary::before {
	content: "−";
}

.op-more[open] summary {
	margin-bottom: 1rem;
}

/* Price ------------------------------------------------------------------- */

.op-plans {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: 0.75rem;
	min-width: 0;
	margin: 0 0 1.25rem;
	padding: 0;
	border: 0;
}

.op-plans > .op-label {
	grid-column: 1 / -1;
	float: left;
	margin-bottom: 0.1rem;
}

.op-plans .op-plan {
	position: relative;
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	margin: 0;
	padding: 1rem 1.1rem;
	border: 1.5px solid var(--op-input-line);
	border-radius: 12px;
	background: var(--op-card);
	font-weight: 400;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.op-plans .op-plan:hover,
.op-plans .op-plan.is-selected {
	border-color: var(--op-accent);
}

.op-plans .op-plan.is-selected {
	background: var(--op-accent-tint);
	box-shadow: inset 0 0 0 1px var(--op-accent);
}

.op-plan input {
	flex: 0 0 auto;
	width: 1.1rem;
	height: 1.1rem;
	margin: 0.2rem 0 0;
	accent-color: var(--op-accent);
}

.op-plan__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.op-plan__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
}

.op-plan__name {
	color: var(--op-ink);
	font-weight: 600;
}

.op-plan__price {
	color: var(--op-ink);
	font-family: var(--op-serif);
	font-size: 1.3em;
	white-space: nowrap;
}

.op-summary {
	margin: 0 0 1.25rem;
	padding: 1rem 1.1rem;
	border-radius: 12px;
	background: var(--op-paper);
}

.op-summary__line {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin: 0;
	padding: 0.2rem 0;
}

.op-summary__line[hidden] {
	display: none;
}

.op-total {
	margin-top: 0.5rem;
	padding-top: 0.7rem;
	border-top: 1px solid var(--op-line);
	font-size: 1.1em;
}

/* Payment ----------------------------------------------------------------- */

.op-card-element {
	min-height: 3rem;
	padding: 0.85rem;
	border: 1px solid var(--op-input-line);
	border-radius: 10px;
	background: var(--op-field);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.op-card-element.StripeElement--focus {
	border-color: var(--op-accent);
	background: var(--op-card);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--op-accent) 25%, transparent);
}

.op-card-element.StripeElement--invalid {
	border-color: var(--op-error);
}

.op-submit-wrap {
	margin: 0.5rem 0 0;
}

.op-shell .op-submit {
	width: 100%;
	min-height: 3.5rem;
	padding: 0.85rem 1.75rem;
	border: 0;
	border-radius: 12px;
	background: var(--op-accent);
	color: var(--op-on-accent);
	font: inherit;
	font-size: 1.05em;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s;
}

.op-shell .op-submit:hover,
.op-shell .op-submit:focus-visible {
	background: var(--op-accent-dark);
}

.op-shell .op-submit:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--op-accent) 40%, transparent);
	outline-offset: 2px;
}

.op-shell .op-submit[disabled] {
	opacity: 0.7;
	cursor: progress;
}

/* Side column ------------------------------------------------------------- */

.op-panel {
	overflow: hidden;
	border: 1px solid var(--op-line);
	border-radius: 16px;
	background: var(--op-card);
}

.op-panel__title {
	margin: 0;
	padding: 0.9rem 1.25rem;
	border-bottom: 1px solid var(--op-line);
	background: var(--op-field);
	color: var(--op-muted);
	font-size: 0.75em;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.op-preview__body {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	padding: 1.5rem 1.25rem;
	text-align: center;
}

.op-preview__body p {
	margin: 0;
}

.op-preview__photo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 6rem;
	height: 7.5rem;
	margin-bottom: 0.5rem;
	overflow: hidden;
	border-radius: 3rem;
	background: var(--op-line);
	color: var(--op-muted);
	font-family: var(--op-serif);
	font-size: 1.8em;
}

.op-preview__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.op-preview__photo img[hidden] {
	display: none;
}

.op-preview__photo img:not([hidden]) + span {
	display: none;
}

.op-preview__name {
	font-family: var(--op-serif);
	font-size: 1.5em;
	font-weight: 500;
	line-height: 1.15;
	overflow-wrap: anywhere;
}

.op-preview__dates {
	font-size: 0.9em;
	color: var(--op-ink-soft);
}

.op-preview__place {
	font-size: 0.85em;
	color: var(--op-muted);
}

.op-preview__dates:empty,
.op-preview__place:empty {
	display: none;
}

.op-preview__body .op-preview__text {
	margin-top: 0.75rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--op-line);
	font-family: var(--op-serif);
	font-size: 1em;
	line-height: 1.55;
	text-align: left;
	overflow-wrap: anywhere;
}

.op-preview__text.is-empty,
.op-preview__name.is-empty {
	color: var(--op-muted);
}

.op-preview__body .op-preview__service {
	width: 100%;
	margin-top: 0.5rem;
	padding: 0.75rem;
	border-radius: 10px;
	background: var(--op-paper);
	font-size: 0.85em;
	text-align: left;
	white-space: pre-line;
}

.op-preview__service[hidden] {
	display: none;
}

.op-next {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin: 0;
	padding: 1.1rem 1.25rem 1.25rem;
	list-style: none;
	counter-reset: op-next;
	font-size: 0.9em;
}

.op-next li {
	display: flex;
	gap: 0.75rem;
	margin: 0;
	counter-increment: op-next;
}

.op-next li::before {
	content: counter(op-next);
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: var(--op-accent);
	color: var(--op-on-accent);
	font-size: 0.75em;
	font-weight: 600;
}

/* Messages ---------------------------------------------------------------- */

.op-alert,
.op-form-error {
	padding: 0.85rem 1rem;
	border-radius: 10px;
	background: #fdf0ef;
	border: 1px solid #f3c7c3;
	color: #8c1d18;
	margin-bottom: 1rem;
}

.op-form .op-alert {
	margin: 0;
}

.op-success {
	max-width: 42rem;
	margin: 0 auto;
	padding: 1.5rem 1.75rem;
	border-radius: 16px;
	background: #f1f6f3;
	border: 1px solid #cfe3d5;
	color: #1f3f36;
	font-size: 1.05em;
}

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.op-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 1px;
	overflow: hidden;
}

.op-debug {
	margin: 0.75rem 0 0;
	padding: 0.6rem 0.75rem;
	background: #fff;
	border: 1px dashed #fca5a5;
	border-radius: 4px;
	font-size: 0.8em;
	white-space: pre-wrap;
	color: #7f1d1d;
}

@media (prefers-reduced-motion: reduce) {
	.op-shell * {
		transition: none !important;
	}
}
