/* Shared across the wesleyshur.com theme directions: charts, the contact form, focus. */

:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent, #0B6E4F);
	outline-offset: 3px;
}

/* Charts ------------------------------------------------------------------ */

.ws-chart {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 14px;
	color: var(--wp--custom--chart--label, currentColor);
}

.ws-chart__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 6px 24px;
}

.ws-chart__swatch {
	display: inline-block;
	width: 18px;
	height: 3px;
	vertical-align: middle;
	margin-right: 8px;
}

.ws-chart__stage {
	position: relative;
}

.ws-chart__ribbon {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ws-chart__svg {
	position: relative;
	display: block;
	width: 100%;
}

.ws-chart__axis {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	padding: 0 4px;
}

.ws-chart__grid {
	fill: none;
	stroke: var(--wp--custom--chart--grid, #D4DAD6);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}

.ws-line {
	fill: none;
	stroke-width: 2.5;
	vector-effect: non-scaling-stroke;
	stroke-dasharray: 1;
}

.ws-line--secondary {
	stroke-width: 2;
}

.ws-area {
	fill-opacity: 0.14;
}

/* Visible by default; the hidden start state lives only inside the keyframes, so a paused
   animation still shows a complete chart. */
.is-visible .ws-line {
	animation: ws-draw 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both;
}

.is-visible .ws-bars {
	transform-box: fill-box;
	transform-origin: bottom;
	animation: ws-rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both;
}

.is-visible .ws-area {
	animation: ws-fade 0.9s ease 0.7s both;
}

@keyframes ws-draw {
	from { stroke-dashoffset: 1; }
	to { stroke-dashoffset: 0; }
}

@keyframes ws-rise {
	from { transform: scaleY(0); }
	to { transform: scaleY(1); }
}

@keyframes ws-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.is-visible .ws-line,
	.is-visible .ws-bars,
	.is-visible .ws-area {
		animation: none;
	}
}

.ws-chart--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	border: 1px dashed currentColor;
	opacity: 0.7;
	text-align: center;
}

/* Contact form ------------------------------------------------------------ */

.ws-form {
	position: relative;
	background: var(--wp--custom--form--background, #FFFFFF);
	color: var(--wp--custom--form--text, #141A17);
	padding: var(--wp--custom--form--padding, 28px);
	border: var(--wp--custom--form--border, 0);
	border-radius: var(--wp--custom--form--radius, 0);
}

.ws-form__form,
.ws-form__done {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ws-form__done {
	min-height: 300px;
	justify-content: center;
}

.ws-form__done p {
	margin: 0;
	max-width: 40ch;
}

.ws-form__heading {
	margin: 0;
	font-size: var(--wp--custom--form--heading-size, 22px);
	line-height: 1.2;
}

.ws-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.ws-form__field {
	margin: 0;
	flex: 1 1 180px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
}

.ws-form__field input,
.ws-form__field textarea {
	font: inherit;
	font-size: 16px;
	font-weight: 400;
	color: inherit;
	background: var(--wp--custom--form--field-background, #FFFFFF);
	border: var(--wp--custom--form--field-border, 1px solid #C5CDC8);
	border-radius: var(--wp--custom--form--field-radius, 6px);
	padding: 0 14px;
	min-height: 48px;
	width: 100%;
	box-sizing: border-box;
}

.ws-form__field textarea {
	padding: 12px 14px;
	min-height: 120px;
	resize: vertical;
}

.ws-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ws-form__actions {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
}

.ws-form__button {
	min-height: 52px;
	padding: 0 24px;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	background: var(--wp--custom--form--button-background, var(--wp--preset--color--accent, #0B6E4F));
	color: var(--wp--custom--form--button-text, #FFFFFF);
	border-radius: var(--wp--custom--form--button-radius, 6px);
}

.ws-form__note {
	font-size: 13px;
	opacity: 0.8;
}

.ws-form__error {
	margin: 0;
	padding: 10px 14px;
	border-left: 3px solid #B3261E;
	background: #FBEAE8;
	color: #7A1D16;
	font-size: 15px;
}
