/*
 * Careers Portal
 *
 * Colours come from the settings page and are written onto the .cp container's style attribute,
 * which outranks any stylesheet. The defaults below use :where() so they have no specificity and can
 * never win over the saved colours, whatever order caching or optimisation plugins load CSS in.
 *
 * Buttons, links and form fields use .cp:not(#cp-none) to outrank theme and page builder rules
 * (Elementor kits, for example) without !important.
 */

:where(.cp) {
	--cp-accent: #1f3cdb;
	--cp-on-accent: #fff;
	--cp-hero: #0b1f99;
	--cp-on-hero: #fff;
	--cp-highlight: #f2dca0;
	--cp-on-highlight: #0b1f99;
	--cp-strength: 0.8;
	--cp-focus: center;
	--cp-danger: #c4320a;
	--cp-radius: 8px;
	--cp-line: rgba(127, 127, 127, 0.28);
	--cp-line-strong: rgba(127, 127, 127, 0.45);
	--cp-muted: inherit;
	--cp-tint: rgba(127, 127, 127, 0.06);
	--cp-tint-strong: rgba(127, 127, 127, 0.14);
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
	:where(.cp) {
		--cp-line: color-mix(in srgb, currentColor 16%, transparent);
		--cp-line-strong: color-mix(in srgb, currentColor 34%, transparent);
		--cp-muted: color-mix(in srgb, currentColor 68%, transparent);
		--cp-tint: color-mix(in srgb, currentColor 4%, transparent);
		--cp-tint-strong: color-mix(in srgb, currentColor 9%, transparent);
	}
}

.cp {
	margin-block: 1.5rem;
	line-height: 1.55;
	/* Layout responds to the width of the column the shortcode sits in, not the screen. */
	container: cp / inline-size;
}

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

.cp [hidden] {
	display: none !important;
}

.cp :focus-visible {
	outline: 2px solid var(--cp-accent);
	outline-offset: 2px;
}

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

/* ---------- Links ---------- */

.cp:not(#cp-none) a {
	color: var(--cp-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.cp:not(#cp-none) .cp-hero a:not(.cp-button),
.cp:not(#cp-none) .cp-apply.is-modal .cp-apply__head a {
	color: var(--cp-highlight);
}

/* ---------- Buttons ---------- */

.cp:not(#cp-none) .cp-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	min-height: 3rem;
	margin: 0;
	padding: 0.75rem 1.4rem;
	border: 1px solid var(--cp-accent);
	border-radius: var(--cp-radius);
	background: var(--cp-accent);
	color: var(--cp-on-accent);
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-decoration: none;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	transition: box-shadow 0.15s ease;
}

.cp:not(#cp-none) .cp-button:hover,
.cp:not(#cp-none) .cp-button:focus {
	border-color: var(--cp-accent);
	background: var(--cp-accent);
	color: var(--cp-on-accent);
	text-decoration: none;
	box-shadow: 0 0 0 4px rgba(127, 127, 127, 0.25);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--cp-accent) 24%, transparent);
}

.cp:not(#cp-none) .cp-button--hero,
.cp:not(#cp-none) .cp-button--hero:hover,
.cp:not(#cp-none) .cp-button--hero:focus {
	border-color: var(--cp-highlight);
	background: var(--cp-highlight);
	color: var(--cp-on-highlight);
}

.cp:not(#cp-none) .cp-button--hero:hover,
.cp:not(#cp-none) .cp-button--hero:focus {
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--cp-highlight) 35%, transparent);
}

.cp:not(#cp-none) .cp-button[disabled] {
	opacity: 0.65;
	box-shadow: none;
	cursor: progress;
}

.cp .cp-button[aria-busy="true"]::before {
	content: "";
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: cp-spin 0.8s linear infinite;
}

@keyframes cp-spin {
	to {
		transform: rotate(360deg);
	}
}

.cp .cp-applied {
	display: inline-flex;
	align-items: center;
	min-height: 3rem;
	color: var(--cp-accent);
	font-weight: 600;
}

.cp .cp-hero .cp-applied {
	color: var(--cp-highlight);
}

/* ---------- Banner ---------- */

.cp .cp-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin: 0 0 2rem;
	padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 5vw, 4rem);
	border-radius: 16px;
	background-color: var(--cp-hero);
	color: var(--cp-on-hero);
}

.cp .cp-hero--full {
	margin-inline: calc(50% - 50vw);
	border-radius: 0;
}

html:has(.cp-hero--full) {
	overflow-x: clip;
}

.cp .cp-hero__img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	object-fit: cover;
	object-position: var(--cp-focus);
	animation: cp-settle 1.6s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

.cp .cp-hero.is-duotone .cp-hero__img {
	filter: grayscale(1) contrast(1.08);
}

/* The banner colour laid over the photo. Without a photo it is solid. */
.cp .cp-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--cp-hero);
	opacity: var(--cp-strength);
}

.cp .cp-hero.no-image::before {
	opacity: 1;
}

/* With a photo: a soft shade at the bottom keeps the figures readable. Without one: contour lines. */
.cp .cp-hero.has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent 55%);
	pointer-events: none;
}

.cp .cp-hero.no-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: currentColor;
	opacity: 0.13;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='160' viewBox='0 0 640 160'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.3'%3E%3Cpath d='M0 20C107 11 213 29 320 20S533 29 640 20'/%3E%3Cpath d='M0 60C107 46 213 74 320 60S533 74 640 60'/%3E%3Cpath d='M0 100C107 93 213 107 320 100S533 107 640 100'/%3E%3Cpath d='M0 140C107 128 213 152 320 140S533 152 640 140'/%3E%3C/g%3E%3C/svg%3E") center bottom / 640px 160px repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='160' viewBox='0 0 640 160'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.3'%3E%3Cpath d='M0 20C107 11 213 29 320 20S533 29 640 20'/%3E%3Cpath d='M0 60C107 46 213 74 320 60S533 74 640 60'/%3E%3Cpath d='M0 100C107 93 213 107 320 100S533 107 640 100'/%3E%3Cpath d='M0 140C107 128 213 152 320 140S533 152 640 140'/%3E%3C/g%3E%3C/svg%3E") center bottom / 640px 160px repeat;
	pointer-events: none;
}

@keyframes cp-settle {
	from {
		transform: scale(1.06);
	}
	to {
		transform: scale(1);
	}
}

.cp .cp-hero__inner {
	position: relative;
	max-width: 72rem;
	margin: 0 auto;
}

.cp--list .cp-hero__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.cp .cp-hero__back {
	margin: 0 0 2rem;
	font-size: 0.9375rem;
}

.cp .cp-hero__back a::before {
	content: "\2039\00a0";
}

.cp .cp-hero__eyebrow {
	margin: 0 0 0.75rem;
	color: var(--cp-highlight);
	font-size: 1rem;
	font-weight: 500;
}

.cp h2.cp-hero__title {
	max-width: 22ch;
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: clamp(2rem, 1.2rem + 3.2vw, 3.4rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.015em;
	text-transform: none;
	text-wrap: balance;
}

.cp .cp-hero__intro {
	max-width: 52ch;
	margin: 1rem 0 0;
	font-size: 1.0625rem;
	opacity: 0.88;
}

.cp .cp-hero__intro + p {
	margin: 2rem 0 0;
}

.cp .cp-hero__meta {
	margin: 1rem 0 0;
	font-size: 1.0625rem;
	opacity: 0.9;
}

/* Figures, in the style of a "numbers" section: big value, small highlight-coloured label. */
.cp .cp-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
	gap: 1.5rem 2rem;
	width: 100%;
	max-width: 46rem;
	margin: clamp(2rem, 4vw, 3rem) auto 0;
	padding: 0;
}

.cp .cp-stat {
	display: flex;
	flex-direction: column-reverse;
	align-items: center;
	margin: 0;
}

.cp .cp-stat dd {
	margin: 0;
	font-size: clamp(2.6rem, 2rem + 2.6vw, 4rem);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.02em;
}

.cp .cp-stat dt {
	margin: 0.6rem 0 0;
	color: var(--cp-highlight);
	font-size: 0.975rem;
	font-weight: 500;
}

.cp .cp-stat.is-urgent dd {
	color: var(--cp-highlight);
}

.cp .cp-hero__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 2rem;
	margin-top: clamp(2rem, 4vw, 3rem);
	padding-top: 1.75rem;
	border-top: 1px solid var(--cp-line-strong);
}

.cp .cp-stats--job {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem clamp(2rem, 5vw, 4rem);
	width: auto;
	max-width: none;
	margin: 0;
}

.cp .cp-stats--job .cp-stat {
	align-items: flex-start;
}

/* ---------- Search bar on the banner ---------- */

.cp .cp-hero .cp-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	width: 100%;
	max-width: 58rem;
	margin: clamp(2rem, 4vw, 3rem) auto 0;
	padding: 0.5rem;
	border-radius: 14px;
	background: #fff;
	color: #141826;
	box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
	text-align: left;
}

.cp .cp-filters__field {
	flex: 1 1 9.5rem;
	min-width: 0;
}

.cp .cp-filters__field--search {
	flex: 2 1 15rem;
}

.cp .cp-filters__actions {
	display: flex;
	flex: none;
	align-items: center;
	gap: 0.75rem;
}

.cp:not(#cp-none) .cp-filters__clear {
	padding: 0 0.5rem;
	color: var(--cp-accent);
	font-size: 0.9375rem;
}

/* ---------- Form fields ---------- */

.cp:not(#cp-none) input[type="text"],
.cp:not(#cp-none) input[type="search"],
.cp:not(#cp-none) input[type="email"],
.cp:not(#cp-none) input[type="tel"],
.cp:not(#cp-none) input[type="url"],
.cp:not(#cp-none) select {
	width: 100%;
	min-height: 3rem;
	margin: 0;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--cp-line-strong);
	border-radius: var(--cp-radius);
	background-color: transparent;
	color: inherit;
	font: inherit;
	font-size: 1rem;
	line-height: 1.3;
	box-shadow: none;
}

.cp:not(#cp-none) .cp-filters input[type="search"],
.cp:not(#cp-none) .cp-filters select {
	border-color: #dfe3ec;
	background-color: #f5f6fa;
	color: #141826;
}

.cp select option {
	color: initial;
}

.cp:not(#cp-none) input:focus,
.cp:not(#cp-none) select:focus {
	border-color: var(--cp-accent);
}

.cp:not(#cp-none) input[type="file"] {
	width: 100%;
	margin: 0;
	padding: 0.6rem;
	border: 1px dashed var(--cp-line-strong);
	border-radius: var(--cp-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.9375rem;
}

.cp input[type="file"]::file-selector-button {
	margin-right: 0.75rem;
	padding: 0.45rem 0.9rem;
	border: 1px solid var(--cp-line-strong);
	border-radius: var(--cp-radius);
	background: var(--cp-tint);
	color: inherit;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

/* ---------- Count and notices ---------- */

.cp .cp-count {
	margin: 0 0 0.75rem;
	color: var(--cp-muted);
	font-size: 0.9375rem;
}

.cp .cp-notice {
	margin: 1rem 0;
	padding: 0.9rem 1.1rem;
	border-left: 3px solid var(--cp-line-strong);
	background: var(--cp-tint);
}

.cp .cp-notice--error {
	border-left-color: var(--cp-danger);
}

.cp .cp-notice--success {
	border-left-color: var(--cp-accent);
}

/* ---------- Job list ---------- */

.cp .cp-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--cp-line);
}

.cp .cp-row {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--cp-line);
}

.cp .cp-row::before {
	content: none;
}

.cp:not(#cp-none) .cp-row__link {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 12rem;
	gap: 1.5rem;
	padding: 1.4rem 1rem;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.cp:not(#cp-none) .cp-row__link:hover {
	background: var(--cp-tint);
	box-shadow: inset 4px 0 0 var(--cp-accent);
}

.cp .cp-row__link:hover .cp-row__title {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.cp .cp-row__main {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
}

.cp .cp-row__dept {
	color: var(--cp-accent);
	font-size: 0.875rem;
	font-weight: 600;
}

.cp h3.cp-row__title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: 1.3rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
}

.cp .cp-facts-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	font-size: 0.9375rem;
}

.cp .cp-facts-inline span + span::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 0.9em;
	margin: 0 0.65em;
	background: var(--cp-line-strong);
	vertical-align: -0.1em;
}

.cp .cp-hero__meta.cp-facts-inline {
	font-size: 1.0625rem;
}

.cp .cp-row__excerpt {
	max-width: 62ch;
	margin-top: 0.15rem;
	color: var(--cp-muted);
	font-size: 0.9375rem;
}

/* The deadline column: its rule turns accent-coloured when a role closes within a week. */
.cp .cp-when {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.15rem;
	padding-left: 1.25rem;
	border-left: 1px solid var(--cp-line);
}

.cp .cp-when__main {
	font-weight: 600;
	line-height: 1.3;
}

.cp .cp-when__date {
	color: var(--cp-muted);
	font-size: 0.875rem;
}

.cp .cp-when.is-urgent {
	padding-left: calc(1.25rem - 2px);
	border-left: 3px solid var(--cp-accent);
}

.cp .cp-when.is-urgent .cp-when__main {
	color: var(--cp-accent);
}

/* ---------- Job page ---------- */

.cp .cp-job {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
	gap: clamp(2rem, 5vw, 4.5rem);
	align-items: start;
}

.cp .cp-job__body {
	max-width: 68ch;
	min-width: 0;
}

.cp .cp-job__body h3 {
	margin: 2.25rem 0 0.75rem;
	padding: 0;
	color: inherit;
	font-size: 1.2rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
}

.cp .cp-job__body h3:first-child {
	margin-top: 0;
}

.cp .cp-job__body p {
	margin: 0 0 1em;
}

.cp .cp-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cp .cp-tags li {
	margin: 0;
	padding: 0.35rem 0.8rem;
	border: 1px solid var(--cp-line-strong);
	border-radius: 999px;
	font-size: 0.9375rem;
	line-height: 1.3;
}

.cp .cp-tags li::before {
	content: none;
}

.cp .cp-job__aside {
	position: sticky;
	top: 2rem;
}

.cp .cp-applycard {
	padding: 1.5rem;
	border: 1px solid var(--cp-line);
	border-top: 4px solid var(--cp-hero);
	border-radius: 14px;
	background: var(--cp-tint);
}

.cp .cp-applycard__label {
	margin: 0;
	color: var(--cp-muted);
	font-size: 0.875rem;
}

.cp .cp-applycard__date {
	margin: 0.2rem 0 0;
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.25;
}

.cp .cp-applycard__left {
	margin: 0.25rem 0 0;
	color: var(--cp-muted);
	font-size: 0.9375rem;
}

.cp .cp-applycard__left.is-urgent {
	color: var(--cp-accent);
	font-weight: 600;
}

.cp:not(#cp-none) .cp-button--block {
	width: 100%;
	margin-top: 1.25rem;
}

.cp:not(#cp-none) .cp-copy {
	display: block;
	width: 100%;
	margin: 0.75rem 0 0;
	padding: 0.5rem;
	border: 0;
	background: none;
	color: var(--cp-accent);
	font: inherit;
	font-size: 0.9375rem;
	text-decoration: underline;
	text-underline-offset: 0.18em;
	box-shadow: none;
	cursor: pointer;
}

/* ---------- Application form ---------- */

/*
 * Before the script moves the form into the modal it is kept off the page, so it does not flash.
 * If the script never runs, following an "Apply for this role" link still shows it in place.
 */
.cp-js .cp > .cp-apply {
	display: none;
}

.cp-js .cp > .cp-apply:target {
	display: block;
}

.cp .cp-apply {
	margin-top: 2.5rem;
	padding: clamp(1.25rem, 3vw, 2.25rem);
	border-top: 3px solid var(--cp-accent);
	background: var(--cp-tint);
	scroll-margin-top: 2rem;
}

.cp .cp-apply__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.cp .cp-apply__job {
	margin: 0 0 0.15rem;
	color: var(--cp-muted);
	font-size: 0.9375rem;
}

.cp h2.cp-apply__title {
	margin: 0 0 0.25rem;
	padding: 0;
	color: inherit;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
}

.cp .cp-apply__intro {
	margin: 0 0 1.5rem;
	color: var(--cp-muted);
	font-size: 0.9375rem;
}

.cp .cp-form {
	margin: 0;
}

.cp .cp-fieldset {
	min-width: 0;
	margin: 0 0 1.75rem;
	padding: 0;
	border: 0;
}

.cp .cp-fieldset legend {
	margin: 0 0 0.75rem;
	padding: 0;
	font-size: 1.0625rem;
	font-weight: 600;
}

.cp .cp-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem 1.25rem;
}

@media (min-width: 640px) {
	.cp .cp-grid {
		grid-template-columns: 1fr 1fr;
	}

	.cp .cp-field--wide {
		grid-column: 1 / -1;
	}
}

.cp .cp-field {
	min-width: 0;
}

.cp:not(#cp-none) .cp-field > label {
	display: block;
	margin: 0 0 0.3rem;
	color: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
}

.cp .cp-req {
	color: var(--cp-danger);
	font-weight: 400;
}

.cp .cp-hint {
	margin: -0.1rem 0 0.4rem;
	color: var(--cp-muted);
	font-size: 0.875rem;
}

.cp .cp-fieldset > .cp-hint {
	margin: -0.4rem 0 0.9rem;
}

.cp .cp-error {
	margin: 0.35rem 0 0;
	color: var(--cp-danger);
	font-size: 0.875rem;
	font-weight: 600;
}

.cp:not(#cp-none) .cp-field.has-error input {
	border-color: var(--cp-danger);
	border-style: solid;
}

.cp .cp-field--check {
	margin: 0 0 1.5rem;
}

.cp:not(#cp-none) .cp-check {
	display: flex;
	gap: 0.7rem;
	align-items: flex-start;
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 400;
	cursor: pointer;
}

.cp .cp-check input {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	margin: 0.2rem 0 0;
	accent-color: var(--cp-accent);
}

.cp .cp-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cp .cp-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
}

.cp .cp-form__status {
	flex: 1 1 100%;
	margin: 0;
	padding: 0.8rem 1rem;
	border-left: 3px solid var(--cp-line-strong);
	background: var(--cp-tint);
	font-size: 0.9375rem;
}

.cp .cp-form__status.is-error {
	border-left-color: var(--cp-danger);
}

.cp .cp-success {
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 3px solid var(--cp-accent);
}

.cp .cp-success p {
	margin: 0 0 1rem;
}

.cp .cp-success__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
}

.cp .cp-success:focus {
	outline: none;
}

/* ---------- Modal ---------- */

html.cp-modal-open {
	overflow: hidden;
}

.cp .cp-modal {
	box-sizing: border-box;
	width: min(46rem, calc(100vw - 2rem));
	max-width: none;
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: var(--cp-surface, #fff);
	color: inherit;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

.cp .cp-modal[open] {
	display: flex;
	flex-direction: column;
	animation: cp-modal-in 200ms ease-out;
}

.cp .cp-modal::backdrop {
	background: rgba(6, 10, 30, 0.66);
	animation: cp-fade-in 200ms ease-out;
}

@keyframes cp-modal-in {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.985);
	}
}

@keyframes cp-fade-in {
	from {
		opacity: 0;
	}
}

.cp .cp-apply.is-modal {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

/* The modal header is a small version of the banner: same photo, same colour. */
.cp .cp-apply.is-modal .cp-apply__head {
	position: relative;
	isolation: isolate;
	flex: none;
	overflow: hidden;
	padding: 1.5rem 1.5rem 1.35rem;
	background: var(--cp-hero);
	color: var(--cp-on-hero);
}

.cp .cp-apply.is-modal .cp-apply__head::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	background-image: var(--cp-hero-image, none);
	background-position: var(--cp-focus);
	background-size: cover;
}

.cp--duotone .cp-apply.is-modal .cp-apply__head::before {
	filter: grayscale(1) contrast(1.08);
}

.cp .cp-apply.is-modal .cp-apply__head::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--cp-hero);
	opacity: var(--cp-strength);
}

.cp .cp-apply.is-modal .cp-apply__job {
	color: var(--cp-highlight);
	font-weight: 500;
}

.cp .cp-apply.is-modal h2.cp-apply__title {
	margin: 0;
	font-size: 1.6rem;
}

.cp .cp-apply.is-modal .cp-apply__body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 1.5rem 1.5rem 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* The submit button stays in view at the bottom of the modal while the form scrolls. */
.cp .cp-apply.is-modal .cp-form__actions {
	position: sticky;
	bottom: 0;
	z-index: 1;
	margin: 0 -1.5rem;
	padding: 1rem 1.5rem 1.25rem;
	border-top: 1px solid var(--cp-line);
	background: var(--cp-surface, #fff);
}

.cp .cp-apply.is-modal .cp-success {
	margin-bottom: 1.5rem;
}

.cp:not(#cp-none) .cp-apply__close {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	min-height: 0;
	margin: -0.4rem -0.6rem 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	box-shadow: none;
	cursor: pointer;
}

.cp:not(#cp-none) .cp-apply__close:hover {
	background: rgba(255, 255, 255, 0.16);
}

.cp .cp-apply__close[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}

.cp .cp-apply__close svg {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.cp .cp-hero__img,
	.cp .cp-modal[open],
	.cp .cp-modal::backdrop {
		animation: none;
	}

	.cp .cp-button[aria-busy="true"]::before {
		animation: none;
		border-right-color: currentColor;
		opacity: 0.5;
	}
}

/* ---------- Narrow columns ---------- */

/*
 * Container queries: a 1400px screen with a 500px content column gets the narrow layout.
 * Browsers without container queries use the media queries further down.
 */
@container cp (max-width: 860px) {
	.cp-job {
		grid-template-columns: 1fr !important;
	}

	.cp-job__aside {
		position: static !important;
		max-width: 26rem;
	}
}

@container cp (max-width: 620px) {
	.cp-hero .cp-filters {
		flex-direction: column;
	}

	.cp-filters__field,
	.cp-filters__field--search,
	.cp-filters__actions {
		flex: 1 1 auto !important;
	}

	.cp-filters__actions {
		flex-direction: column;
		align-items: stretch !important;
	}

	.cp-filters__actions .cp-button,
	.cp-hero__foot .cp-button {
		width: 100%;
	}

	.cp-hero__foot {
		flex-direction: column;
		align-items: stretch !important;
	}

	.cp-stats {
		grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)) !important;
		gap: 1.25rem 1rem !important;
	}

	.cp-row__link {
		grid-template-columns: 1fr !important;
		gap: 0.75rem !important;
		padding-inline: 0.5rem !important;
	}

	.cp-when {
		flex-direction: row !important;
		flex-wrap: wrap;
		align-items: baseline !important;
		justify-content: flex-start !important;
		gap: 0.25rem 0.6rem !important;
		padding: 0.5rem 0 0 !important;
		border-left: 0 !important;
		border-top: 1px solid var(--cp-line);
	}

	.cp-when.is-urgent {
		border-top: 2px solid var(--cp-accent);
	}
}

/* Fallback for browsers without container queries, and the phone-only modal sheet. */
@media (max-width: 860px) {
	.cp .cp-job {
		grid-template-columns: 1fr;
	}

	.cp .cp-job__aside {
		position: static;
	}
}

@media (max-width: 639px) {
	.cp .cp-hero {
		border-radius: 12px;
	}

	.cp .cp-hero--full {
		border-radius: 0;
	}

	.cp .cp-stats {
		grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
		gap: 1.25rem 1rem;
	}

	.cp .cp-hero .cp-filters {
		flex-direction: column;
	}

	.cp .cp-filters__field,
	.cp .cp-filters__field--search,
	.cp .cp-filters__actions {
		flex: 1 1 auto;
	}

	.cp:not(#cp-none) .cp-filters__actions .cp-button,
	.cp:not(#cp-none) .cp-hero__foot .cp-button {
		width: 100%;
	}

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

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

	.cp:not(#cp-none) .cp-row__link {
		grid-template-columns: 1fr;
		gap: 0.75rem;
		padding-inline: 0.5rem;
	}

	.cp .cp-when {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: baseline;
		justify-content: flex-start;
		gap: 0.25rem 0.6rem;
		padding: 0.5rem 0 0;
		border-left: 0;
		border-top: 1px solid var(--cp-line);
	}

	.cp .cp-when.is-urgent {
		padding-left: 0;
		border-left: 0;
		border-top: 2px solid var(--cp-accent);
	}

	/* The modal becomes a full-screen sheet on phones. */
	.cp .cp-modal {
		width: 100%;
		height: 100%;
		height: 100dvh;
		max-height: 100%;
		max-height: 100dvh;
		margin: 0;
		border-radius: 0;
	}

	.cp .cp-apply.is-modal .cp-apply__head {
		padding: 1.1rem 1.1rem 1rem;
	}

	.cp .cp-apply.is-modal .cp-apply__body {
		padding: 1rem 1.1rem 0;
	}

	.cp .cp-apply.is-modal .cp-form__actions {
		margin: 0 -1.1rem;
		padding: 0.85rem 1.1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
	}

	.cp:not(#cp-none) .cp-form__actions .cp-button--submit {
		width: 100%;
	}
}
