/**
 * Join Our Team – Careers Form
 * Front-end styles. Scoped under .jot-form-wrap; colours are CSS variables so
 * themes can override them easily.
 */

.jot-form-wrap {
	--jot-brown: #9c5a2c;
	--jot-brown-dark: #874c23;
	--jot-cream: #f3edda;
	--jot-field: #ece5d1;
	--jot-border: #cabf9f;
	--jot-ink: #2c2622;
	--jot-muted: #6f665a;
	--jot-error: #b23b3b;
	--jot-serif: "Playfair Display", Georgia, "Times New Roman", serif;
	--jot-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	box-sizing: border-box;
	max-width: 1000px;
	margin: 2.5rem auto;
	/* No top padding: the heading banner sits on the top border and its own
	   in-flow height provides the spacing below it. */
	padding: 0 2.5rem 2.5rem;
	background: var(--jot-cream);
	border: 2px solid var(--jot-brown);
	color: var(--jot-ink);
	font-family: var(--jot-serif);
}

.jot-form-wrap *,
.jot-form-wrap *::before,
.jot-form-wrap *::after {
	box-sizing: border-box;
}

/* --- Heading banner --------------------------------------------------- */
/*
 * The banner is laid out at the very top of the panel, then shifted up by
 * exactly half its own height, so the panel's top border always runs through
 * its vertical centre — whatever the font size or text length.
 */
.jot-heading {
	display: flex;
	justify-content: center;
	margin: 0 0 1rem;
}

.jot-heading span {
	display: inline-block;
	background: var(--jot-brown);
	color: #fff;
	font-style: italic;
	font-weight: 600;
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	line-height: 1.2;
	text-align: center;
	padding: 0.45em 1.5em;
	/* -1px compensates for the 2px border so the line is dead centre. */
	transform: translateY(calc(-50% - 1px));
}

/* --- Messages --------------------------------------------------------- */
.jot-messages {
	display: none;
	margin: 0 0 1.5rem;
	padding: 0.9rem 1.1rem;
	font-family: var(--jot-sans);
	font-size: 0.95rem;
	border-radius: 3px;
}

.jot-messages.is-error {
	display: block;
	background: #f7e2e2;
	color: #8a2b2b;
	border: 1px solid #e0b4b4;
}

.jot-messages.is-success {
	display: block;
	background: #e4f0e2;
	color: #2f6b2f;
	border: 1px solid #b7d8b4;
}

.jot-noscript {
	font-family: var(--jot-sans);
	background: #f7e2e2;
	color: #8a2b2b;
	padding: 0.75rem 1rem;
	border-radius: 3px;
}

/* --- Rows & labels ---------------------------------------------------- */
.jot-row {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.jot-label {
	flex: 0 0 auto;
	min-width: 150px;
	padding-top: 0.55rem;
	font-style: italic;
	font-size: 1.15rem;
	color: var(--jot-ink);
}

.jot-label--inline {
	min-width: 90px;
	text-align: right;
}

.jot-control {
	flex: 1 1 220px;
	min-width: 200px;
}

/* --- Inputs & selects ------------------------------------------------- */
.jot-input,
.jot-select {
	width: 100%;
	padding: 0.7rem 0.9rem;
	background: var(--jot-field);
	border: 1px solid var(--jot-border);
	border-radius: 2px;
	font-family: var(--jot-sans);
	font-size: 1rem;
	color: var(--jot-ink);
	line-height: 1.3;
}

.jot-input:focus,
.jot-select:focus {
	outline: none;
	border-color: var(--jot-brown);
	box-shadow: 0 0 0 2px rgba(156, 90, 44, 0.2);
}

.jot-select {
	/* Themes / Elementor often force a fixed height + line-height on <select>,
	   which clips the option text. Let the padding define the height instead. */
	box-sizing: border-box;
	height: auto !important;
	min-height: 3rem;
	line-height: 1.5 !important;
	padding-top: 0.6rem !important;
	padding-bottom: 0.6rem !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232c2622' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.9rem center;
	padding-right: 2.4rem;
	cursor: pointer;
}

.jot-select:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* --- Branch cascade row ---------------------------------------------- */
.jot-branch-fields {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	flex-wrap: wrap;
}

.jot-branch-fields .jot-field {
	flex: 1 1 220px;
	min-width: 180px;
}

.jot-arrow {
	flex: 0 0 auto;
	font-size: 1.25rem;
	color: var(--jot-ink);
}

/* --- File upload ------------------------------------------------------ */
.jot-file {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

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

.jot-file-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 1.1rem;
	background: #4a4744;
	color: #fff;
	border-radius: 3px;
	font-family: var(--jot-sans);
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.15s ease;
}

.jot-file-btn:hover {
	background: #333;
}

.jot-file-input:focus + .jot-file-btn,
.jot-file-input:focus-visible + .jot-file-btn {
	background: #333;
	box-shadow: 0 0 0 2px rgba(156, 90, 44, 0.5);
}

.jot-file-name {
	font-family: var(--jot-sans);
	font-size: 0.9rem;
	color: var(--jot-muted);
}

/* --- Field errors ----------------------------------------------------- */
.jot-field-error {
	display: none;
	margin-top: 0.35rem;
	font-family: var(--jot-sans);
	font-size: 0.8rem;
	color: var(--jot-error);
}

.jot-field.has-error .jot-input,
.jot-field.has-error .jot-select {
	border-color: var(--jot-error);
	background: #fbeeee;
}

.jot-field.has-error .jot-field-error {
	display: block;
}

/* --- Honeypot (hidden from humans) ----------------------------------- */
.jot-hp {
	position: absolute !important;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Submit ----------------------------------------------------------- */
.jot-submit {
	display: block;
	margin: 2.25rem auto 0;
	padding: 0.55em 2.8em;
	background: var(--jot-brown);
	color: #fff;
	border: none;
	border-radius: 2px;
	font-family: var(--jot-serif);
	font-style: italic;
	font-size: 1.3rem;
	cursor: pointer;
	transition: background 0.15s ease;
}

.jot-submit:hover {
	background: var(--jot-brown-dark);
}

.jot-submit:focus-visible {
	outline: 3px solid rgba(156, 90, 44, 0.4);
	outline-offset: 2px;
}

.jot-submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* --- Visually hidden -------------------------------------------------- */
.jot-vh {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- Responsive ------------------------------------------------------- */
@media (max-width: 680px) {
	.jot-form-wrap {
		padding: 0 1.25rem 1.75rem;
	}

	.jot-row,
	.jot-row--split {
		flex-direction: column;
		align-items: stretch;
		gap: 0.4rem;
	}

	/*
	 * When rows stack, the flex main axis becomes vertical, so a flex-basis
	 * meant as a column width (e.g. 220px) would become a 220px row HEIGHT.
	 * Reset these children to size by content instead.
	 */
	.jot-control,
	.jot-branch-fields .jot-field {
		flex: 0 0 auto;
		min-width: 0;
	}

	.jot-label {
		min-width: 0;
		padding-top: 0;
	}

	.jot-label--inline {
		text-align: left;
		margin-top: 0.6rem;
	}

	.jot-branch-fields {
		flex-direction: column;
		align-items: stretch;
	}

	.jot-arrow {
		display: none;
	}
}
