/*
 * Witfire Briefing.
 *
 * Every value inherits from the theme's own tokens where they exist, with the
 * Witfire article-housing values as fallbacks, so the forms follow a colour
 * change in the Customizer and still look right on any other theme.
 *
 * Everything is scoped under .wfb. No :root, html or body rules — those leak
 * out of the block and repaint the whole site.
 */

.wfb {
	--wfb-ink: var(--we-ink, #17140f);
	--wfb-ink-soft: var(--we-ink-soft, #3b3529);
	--wfb-muted: var(--we-muted, #7c7365);
	--wfb-paper: var(--we-paper, #fbf8f1);
	--wfb-sheet: var(--we-sheet, #ffffff);
	--wfb-gold: var(--we-gold, #a67c1f);
	--wfb-gold-soft: var(--we-gold-soft, #d4b872);
	--wfb-wash: var(--we-warm, #f5eedc);
	--wfb-line: var(--we-line, #e4dcca);
	--wfb-alert: var(--we-red, #8c2f1f);
	--wfb-green: var(--we-green, #23503e);
	--wfb-display: var(--we-display, 'Cormorant Garamond', Georgia, serif);
	--wfb-body: var(--we-body, 'Crimson Pro', Georgia, serif);
	--wfb-ui: var(--we-sans, 'Outfit', Arial, Helvetica, sans-serif);

	margin: 52px 0;
	font-family: var(--wfb-body);
	color: var(--wfb-ink);
	text-align: left;
}

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

/* ---------------------------------------------------------------- shared */

.wfb__kicker {
	font-family: var(--wfb-ui);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--wfb-gold);
	margin-bottom: 10px;
}

.wfb__title {
	font-family: var(--wfb-display);
	font-weight: 600;
	font-size: clamp(25px, 4.2vw, 34px);
	line-height: 1.15;
	letter-spacing: -.012em;
	margin: 0 0 12px;
	color: var(--wfb-ink);
}

.wfb__deck {
	font-size: 17px;
	line-height: 1.62;
	color: var(--wfb-ink-soft);
	margin: 0 0 22px;
	max-width: 60ch;
}

.wfb__note {
	font-family: var(--wfb-ui);
	font-size: 11.5px;
	line-height: 1.6;
	color: var(--wfb-muted);
	margin: 14px 0 0;
}

.wfb label {
	display: block;
	font-family: var(--wfb-ui);
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--wfb-muted);
	margin-bottom: 7px;
}

.wfb input[type="text"],
.wfb input[type="email"],
.wfb select,
.wfb textarea {
	width: 100%;
	font-family: var(--wfb-body);
	font-size: 16.5px;
	line-height: 1.5;
	color: var(--wfb-ink);
	background: transparent;
	border: 0;
	border-radius: 0;
	outline: none;
	transition: border-color .2s, background .2s;
	-webkit-appearance: none;
	appearance: none;
}

.wfb textarea {
	resize: vertical;
	min-height: 104px;
}

.wfb ::placeholder {
	color: var(--wfb-muted);
	opacity: .75;
}

.wfb__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 24px;
	font-family: var(--wfb-ui);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--wfb-paper);
	background: var(--wfb-ink);
	border: 1px solid var(--wfb-ink);
	border-radius: 0;
	cursor: pointer;
	white-space: nowrap;
	transition: background .22s, color .22s;
}

.wfb__submit:hover {
	background: transparent;
	color: var(--wfb-ink);
}

.wfb__submit[disabled] {
	opacity: .55;
	cursor: progress;
}

.wfb :focus-visible {
	outline: 2px solid var(--wfb-gold);
	outline-offset: 3px;
}

/* Off screen rather than display:none — a hidden trap only works if the bot
   believes the field is real. */
.wfb__trap {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wfb__result {
	font-family: var(--wfb-ui);
	font-size: 13px;
	line-height: 1.6;
	border-left: 3px solid var(--wfb-green);
	background: var(--wfb-wash);
	padding: 13px 16px;
	margin: 0 0 20px;
}

.wfb__result--error {
	border-left-color: var(--wfb-alert);
	background: transparent;
	border: 1px dashed var(--wfb-alert);
	border-left-width: 3px;
	border-left-style: solid;
}

/* ------------------------------------------------------- briefing signup */

.wfb--briefing .wfb__inner {
	border-top: 1.5px solid var(--wfb-ink);
	padding-top: 26px;
}

.wfb--briefing .wfb__line {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 18px;
	align-items: end;
	max-width: 620px;
}

/* A rule under the field rather than a box — the newspaper subscription form,
   not a web form. */
.wfb--briefing .wfb__field input {
	border-bottom: 1.5px solid var(--wfb-line);
	padding: 9px 0;
}

.wfb--briefing .wfb__field input:hover {
	border-bottom-color: var(--wfb-gold-soft);
}

.wfb--briefing .wfb__field input:focus {
	border-bottom-color: var(--wfb-gold);
}

/* -------------------------------------------------- commissioned analysis */

.wfb--commission .wfb__inner {
	background: var(--wfb-sheet);
	border: 1.5px solid var(--wfb-ink);
	padding: 34px 32px;
}

.wfb--commission .wfb__services {
	list-style: none;
	margin: 0 0 26px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 0 28px;
	border-top: 1px solid var(--wfb-line);
}

.wfb--commission .wfb__services li {
	position: relative;
	border-bottom: 1px solid var(--wfb-line);
	padding: 10px 0 10px 18px;
	font-family: var(--wfb-ui);
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--wfb-ink-soft);
}

.wfb--commission .wfb__services li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 17px;
	width: 6px;
	height: 1.5px;
	background: var(--wfb-gold);
}

.wfb__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 22px 26px;
}

.wfb__field--wide {
	grid-column: 1 / -1;
}

.wfb--commission .wfb__field input,
.wfb--commission .wfb__field select,
.wfb--commission .wfb__field textarea {
	border: 1px solid var(--wfb-line);
	padding: 11px 13px;
	background: var(--wfb-paper);
}

.wfb--commission .wfb__field input:hover,
.wfb--commission .wfb__field select:hover,
.wfb--commission .wfb__field textarea:hover {
	border-color: var(--wfb-gold-soft);
}

.wfb--commission .wfb__field input:focus,
.wfb--commission .wfb__field select:focus,
.wfb--commission .wfb__field textarea:focus {
	border-color: var(--wfb-gold);
	background: var(--wfb-sheet);
}

.wfb--commission .wfb__field select {
	background-image: linear-gradient(45deg, transparent 50%, var(--wfb-muted) 50%), linear-gradient(135deg, var(--wfb-muted) 50%, transparent 50%);
	background-position: calc(100% - 19px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding-right: 38px;
}

.wfb__actions {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-wrap: wrap;
	border-top: 1px solid var(--wfb-line);
	margin-top: 26px;
	padding-top: 22px;
}

.wfb__actions .wfb__note {
	margin: 0;
	flex: 1 1 240px;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 620px) {
	.wfb {
		margin: 40px 0;
	}

	.wfb--commission .wfb__inner {
		padding: 24px 20px;
	}

	.wfb__grid,
	.wfb--briefing .wfb__line {
		grid-template-columns: minmax(0, 1fr);
	}

	.wfb__submit {
		width: 100%;
	}

	.wfb__actions {
		flex-direction: column;
		align-items: stretch;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wfb * {
		transition-duration: .01ms !important;
	}
}

@media print {
	.wfb {
		display: none !important;
	}
}
