/*--------------------------------------------------------------
# Careers — Classic Polo
#
# Everything is scoped to .cp-careers so nothing leaks into the rest
# of the site. Colour tokens alias the Customizer variables, so brand
# changes made in Appearance > Customize flow through to this page.
--------------------------------------------------------------*/

.cp-careers {
	--cp-navy  : var( --primarycolor, #0f2a5f );
	--cp-blue  : var( --secondarycolor, #1f4ed8 );
	--cp-gold  : var( --tertiarycolor, #f2b705 );
	--cp-ink   : #1c1c1c;
	--cp-muted : #5b6472;
	--cp-rule  : var( --bordercolor, #e5e7eb );
	--cp-paper : #ffffff;

	--cp-gutter : clamp( 20px, 5vw, 64px );
	--cp-wrap   : 1240px;

	color: var( --cp-ink );
	background: var( --cp-paper );
}

.cp-careers .cp-wrap {
	max-width: var( --cp-wrap );
	margin-inline: auto;
	padding-inline: var( --cp-gutter );
}

/* Type roles ---------------------------------------------------- */

.cp-careers .cp-display {
	font-size: clamp( 2.25rem, 5.4vw, 4.25rem );
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.02;
	color: var( --cp-ink );
}

.cp-careers .cp-section-title {
	font-size: clamp( 1.5rem, 2.6vw, 2.25rem );
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: var( --cp-ink );
}

/* Spec labels and eyebrows are data, so they take the mono face. */
.cp-careers .cp-eyebrow,
.cp-careers .cp-spec dt {
	font-family: var( --monofont );
	font-size: 0.6875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var( --cp-muted );
}

.cp-careers p {
	line-height: 1.75;
	color: var( --cp-muted );
}

.cp-careers .cp-lede {
	font-size: clamp( 1rem, 1.4vw, 1.1875rem );
	max-width: 46ch;
	margin-top: 18px;
}

/* Stitch line — the seam that separates sections ----------------- */

.cp-careers .cp-stitch {
	height: 1px;
	border: 0;
	margin: 0;
	background-image: repeating-linear-gradient(
		to right,
		currentColor 0 7px,
		transparent 7px 14px
	);
	color: var( --cp-rule );
}

/* Hero — the headline sits inside a pattern piece ---------------- */

.cp-careers .cp-hero {
	padding-block: clamp( 48px, 7vw, 96px );
}

.cp-careers .cp-hero__grid {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	gap: clamp( 32px, 5vw, 72px );
	align-items: center;
}

/* No featured image set — the pattern piece takes the full width. */
.cp-careers .cp-hero__grid--solo {
	grid-template-columns: minmax( 0, 760px );
}

.cp-careers .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.cp-careers .cp-panel {
	position: relative;
	padding: clamp( 28px, 4vw, 52px );
	border: 2px dashed var( --cp-gold );
	/* The cut-line is drawn on load; see the reveal animation below. */
	clip-path: inset( 0 0 0 0 );
}

.cp-careers .cp-panel__notch {
	position: absolute;
	top: -7px;
	left: clamp( 28px, 4vw, 52px );
	width: 12px;
	height: 12px;
	background: var( --cp-gold );
	transform: rotate( 45deg );
}

.cp-careers .cp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 32px;
}

.cp-careers .cp-hero__figure {
	margin: 0;
}

.cp-careers .cp-hero__figure img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 460px;
	object-fit: cover;
}

.cp-careers .cp-hero__caption {
	margin-top: 10px;
	font-size: 0.6875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var( --cp-muted );
}

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

.cp-careers .cp-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 26px;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	border: 1px solid transparent;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.cp-careers .cp-btn--solid {
	background: var( --cp-navy );
	color: #fff;
}

.cp-careers .cp-btn--solid:hover {
	background: var( --cp-blue );
}

.cp-careers .cp-btn--ghost {
	border-color: var( --cp-rule );
	color: var( --cp-ink );
}

.cp-careers .cp-btn--ghost:hover {
	border-color: var( --cp-navy );
}

.cp-careers .cp-btn--gold {
	background: var( --cp-gold );
	color: var( --cp-ink );
}

.cp-careers .cp-btn--gold:hover {
	background: #ffc927;
}

/* Ground — what the work is actually like ------------------------ */

.cp-careers .cp-ground {
	padding-block: clamp( 48px, 6vw, 84px );
}

.cp-careers .cp-ground__grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: clamp( 24px, 3.5vw, 48px );
	margin-top: 40px;
}

.cp-careers .cp-ground__item {
	padding-top: 20px;
	border-top: 2px solid var( --cp-ink );
}

.cp-careers .cp-ground__item h3 {
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin-bottom: 10px;
	color: var( --cp-ink );
}

.cp-careers .cp-ground__item p {
	font-size: 0.9375rem;
}

/* Open roles — the spec sheet (signature element) ---------------- */

.cp-careers .cp-roles {
	padding-block: clamp( 48px, 6vw, 84px );
	scroll-margin-top: 24px;
}

.cp-careers .cp-roles__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 8px;
}

.cp-careers .cp-roles__count {
	font-family: var( --monofont );
	font-size: 0.6875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var( --cp-muted );
}

.cp-careers .cp-role {
	padding-block: 30px;
	border-bottom: 1px solid var( --cp-rule );
}

.cp-careers .cp-role:first-of-type {
	border-top: 2px solid var( --cp-ink );
}

.cp-careers .cp-role__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}

.cp-careers .cp-role__title {
	font-size: clamp( 1.125rem, 1.9vw, 1.5rem );
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
	color: var( --cp-ink );
}

.cp-careers .cp-role__ref {
	display: block;
	font-family: var( --monofont );
	margin-bottom: 6px;
	font-size: 0.6875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var( --cp-gold );
}

.cp-careers .cp-role__apply {
	font-size: 0.9375rem;
	font-weight: 500;
	color: var( --cp-blue );
	text-decoration: none;
	white-space: nowrap;
}

.cp-careers .cp-role__apply:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.cp-careers .cp-role .cp-stitch {
	margin-block: 20px;
}

/* The spec grid — department / location / experience / engagement */

.cp-careers .cp-spec {
	display: grid;
	/* Openings carry three fields by default and up to five when experience
	   and engagement are filled in, so the track count follows the content. */
	grid-template-columns: repeat( auto-fit, minmax( 150px, 1fr ) );
	gap: 20px 24px;
	margin: 0;
}

.cp-careers .cp-spec > div {
	min-width: 0;
}

.cp-careers .cp-spec dt {
	margin-bottom: 6px;
}

.cp-careers .cp-spec dd {
	margin: 0;
	font-variant-numeric: tabular-nums;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var( --cp-ink );
}

/* Role description, folded away until asked for ------------------ */

.cp-careers .cp-role__more {
	margin-top: 20px;
}

.cp-careers .cp-role__more summary {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 0.8125rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var( --cp-blue );
	list-style: none;
}

.cp-careers .cp-role__more summary::-webkit-details-marker {
	display: none;
}

.cp-careers .cp-role__more summary::after {
	content: "+";
	font-size: 1rem;
	line-height: 1;
	letter-spacing: 0;
}

.cp-careers .cp-role__more[open] summary::after {
	content: "\2212"; /* minus */
}

.cp-careers .cp-role__body {
	margin-top: 14px;
	max-width: 68ch;
}

.cp-careers .cp-role__body p + p {
	margin-top: 14px;
}

.cp-careers .cp-role__body ul,
.cp-careers .cp-role__body ol {
	margin: 14px 0 0;
	padding-left: 20px;
	color: var( --cp-muted );
	line-height: 1.75;
}

/* Empty state — an invitation, not a dead end -------------------- */

.cp-careers .cp-empty {
	padding: clamp( 32px, 4vw, 56px );
	border: 2px dashed var( --cp-rule );
	text-align: center;
}

.cp-careers .cp-empty h3 {
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin-bottom: 10px;
	color: var( --cp-ink );
}

.cp-careers .cp-empty p {
	max-width: 48ch;
	margin-inline: auto;
}

.cp-careers .cp-empty .cp-btn {
	margin-top: 24px;
}

/* Apply ---------------------------------------------------------- */

.cp-careers .cp-apply {
	background: var( --cp-navy );
	color: #fff;
	padding-block: clamp( 48px, 6vw, 84px );
}

.cp-careers .cp-apply .cp-section-title,
.cp-careers .cp-apply .cp-eyebrow {
	color: #fff;
}

.cp-careers .cp-apply p {
	color: rgba( 255, 255, 255, 0.78 );
	max-width: 52ch;
	margin-top: 14px;
}

.cp-careers .cp-apply .cp-actions {
	margin-top: 28px;
}

/* Application popup ---------------------------------------------- */

.cp-dialog {
	width: min( 560px, calc( 100vw - 32px ) );
	max-height: calc( 100vh - 48px );
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.cp-dialog::backdrop {
	background: rgba( 15, 42, 95, 0.55 );
}

.cp-dialog__panel {
	position: relative;
	max-height: calc( 100vh - 48px );
	overflow-y: auto;
	padding: clamp( 24px, 4vw, 40px );
	background: #fff;
	border-top: 3px solid var( --cp-gold );
	font-family: inherit;
}

.cp-dialog__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	line-height: 1;
	color: var( --cp-muted );
	background: none;
	border: 0;
	cursor: pointer;
}

.cp-dialog__close:hover {
	color: var( --cp-ink );
}

.cp-dialog__title {
	margin: 6px 0 0;
	font-size: clamp( 1.25rem, 2.4vw, 1.625rem );
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
	color: var( --cp-ink );
}

.cp-dialog__note {
	margin-top: 8px;
	font-size: 0.8125rem;
}

/* Gravity Forms, brought onto the page's type and colour system.
   Scoped by the wrapper ID on purpose: Gravity Forms 2.9 ships selectors as
   specific as (0,17,1), and one ID outranks any number of classes without
   !important. The wrapper also lets one rule set cover every role dialog. */

#cp-apply-forms .gform_wrapper {
	margin-top: 22px;
}

#cp-apply-forms .gform_wrapper form,
#cp-apply-forms .gform_wrapper .gform_fields {
	margin: 0;
}

#cp-apply-forms .gform_wrapper .gfield {
	margin-bottom: 18px;
}

#cp-apply-forms .gform_wrapper .gfield_label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.6875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var( --cp-muted );
}

#cp-apply-forms .gform_wrapper .gfield_required {
	color: var( --cp-gold );
	margin-left: 2px;
}

#cp-apply-forms .gform_wrapper input[type="text"],
#cp-apply-forms .gform_wrapper input[type="email"],
#cp-apply-forms .gform_wrapper input[type="tel"],
#cp-apply-forms .gform_wrapper textarea {
	width: 100%;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 0.9375rem;
	color: var( --cp-ink );
	background: #fff;
	border: 1px solid var( --cp-rule );
	border-radius: 0;
	transition: border-color 0.2s ease;
}

#cp-apply-forms .gform_wrapper input[type="text"]:focus,
#cp-apply-forms .gform_wrapper input[type="email"]:focus,
#cp-apply-forms .gform_wrapper input[type="tel"]:focus,
#cp-apply-forms .gform_wrapper textarea:focus {
	border-color: var( --cp-navy );
	outline: 2px solid var( --cp-gold );
	outline-offset: 1px;
}

/* The resume field: a click box, echoing the pattern-piece outline. */
#cp-apply-forms .gform_wrapper .ginput_container_fileupload {
	padding: 22px 18px;
	text-align: center;
	border: 2px dashed var( --cp-rule );
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

#cp-apply-forms .gform_wrapper .ginput_container_fileupload:hover {
	border-color: var( --cp-gold );
	background: rgba( 242, 183, 5, 0.05 );
}

#cp-apply-forms .gform_wrapper .ginput_container_fileupload input[type="file"] {
	width: 100%;
	font-family: inherit;
	font-size: 0.875rem;
	color: var( --cp-muted );
	cursor: pointer;
}

#cp-apply-forms .gform_wrapper .gfield_description {
	margin-top: 6px;
	font-size: 0.75rem;
	color: var( --cp-muted );
}

#cp-apply-forms .gform_wrapper .gform_footer {
	margin: 24px 0 0;
	padding: 0;
}

#cp-apply-forms .gform_wrapper .gform_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 15px 26px;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1;
	color: #fff;
	background: var( --cp-navy );
	border: 1px solid transparent;
	border-radius: 0;
	cursor: pointer;
	transition: background-color 0.25s ease;
}

#cp-apply-forms .gform_wrapper .gform_button:hover {
	background: var( --cp-blue );
}

#cp-apply-forms .gform_wrapper .validation_message,
#cp-apply-forms .gform_wrapper .gform_validation_errors {
	margin-top: 8px;
	padding: 10px 12px;
	font-size: 0.8125rem;
	color: #8a1c1c;
	background: #fdf2f2;
	border: 1px solid #f3c9c9;
}

#cp-apply-forms .gform_confirmation_message {
	padding: 8px 0;
	font-size: 1rem;
	color: var( --cp-ink );
}

@media screen and ( max-width: 560px ) {
	.cp-dialog {
		width: calc( 100vw - 20px );
	}
}

/* Focus — visible on every interactive element -------------------- */

.cp-careers a:focus-visible,
.cp-careers button:focus-visible {
	outline: 3px solid var( --cp-gold );
	outline-offset: 3px;
}

.cp-careers .cp-apply a:focus-visible {
	outline-color: var( --cp-gold );
}

/* The one motion moment: the cut-line draws itself on load --------- */

@keyframes cp-cut {
	from { clip-path: inset( 0 100% 0 0 ); }
	to   { clip-path: inset( 0 0 0 0 ); }
}

@keyframes cp-rise {
	from { opacity: 0; transform: translateY( 14px ); }
	to   { opacity: 1; transform: none; }
}

.cp-careers .cp-panel {
	animation: cp-cut 0.9s cubic-bezier( 0.22, 0.61, 0.36, 1 ) both;
}

.cp-careers .cp-panel > *:not(.cp-panel__notch) {
	animation: cp-rise 0.6s ease-out both;
	animation-delay: 0.45s;
}

.cp-careers .cp-panel__notch {
	animation: cp-rise 0.4s ease-out both;
	animation-delay: 0.85s;
}

@media ( prefers-reduced-motion: reduce ) {
	.cp-careers .cp-panel,
	.cp-careers .cp-panel > *,
	.cp-careers .cp-panel__notch {
		animation: none;
		clip-path: none;
		opacity: 1;
		transform: none;
	}
}

/* Responsive ------------------------------------------------------ */

@media screen and ( max-width: 1024px ) {
	.cp-careers .cp-ground__grid {
		grid-template-columns: repeat( 2, 1fr );
	}

	.cp-careers .cp-spec {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media screen and ( max-width: 860px ) {
	.cp-careers .cp-hero__grid {
		grid-template-columns: 1fr;
	}

	.cp-careers .cp-hero__figure {
		order: -1;
	}

	.cp-careers .cp-hero__figure img {
		max-height: 280px;
	}
}

@media screen and ( max-width: 560px ) {
	.cp-careers .cp-ground__grid {
		grid-template-columns: 1fr;
	}

	.cp-careers .cp-role__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.cp-careers .cp-actions .cp-btn {
		flex: 1 1 100%;
		justify-content: center;
	}
}
