/*
 * Recruiting Platform front-end styles.
 *
 * Section 19: inherit the theme rather than impose a design. That means no
 * font-family, no colour that is not derived from a custom property, and no
 * reset. Anything that is not laid out here falls through to whatever the
 * theme already does, which is why a job page on a heavily styled theme still
 * looks like it belongs there.
 *
 * Every value a customer might want to change is a custom property, so
 * adapting the look is a few lines in the theme's own CSS rather than a fork
 * of this file.
 */

:root {
	--rp-primary-color: #1a56db;
	--rp-text-color: inherit;
	--rp-muted-color: #6b7280;
	--rp-background-color: transparent;
	--rp-surface-color: rgba(0, 0, 0, 0.03);
	--rp-border-color: rgba(0, 0, 0, 0.12);
	--rp-button-color: var(--rp-primary-color);
	--rp-button-text-color: #ffffff;
	--rp-border-radius: 8px;
	--rp-content-width: 48rem;
	--rp-gap: 1.5rem;
}

/*
 * Only the two full-page templates use this, never the shortcode. That is what
 * makes the padding safe: those templates hang their own <main> straight in the
 * theme's wrapper, so nothing above, below or beside them supplies any room,
 * and the page ends up flush against the theme's title bar and its footer with
 * the text running into both screen edges on a phone. Embedded in somebody's
 * page the surrounding content area already has padding, and a second helping
 * would show up as a step.
 */
.rp-container {
	box-sizing: border-box;
	max-width: var(--rp-content-width);
	margin-inline: auto;
	padding-block: clamp(2rem, 5vw, 3.5rem);
	padding-inline: clamp(1rem, 4vw, 2rem);
	color: var(--rp-text-color);
	background: var(--rp-background-color);
}

/* Images ------------------------------------------------------------------
 *
 * Every one of these is an attachment in the site's own media library, so the
 * srcset and the intrinsic dimensions come from WordPress. All this has to do
 * is give them a shape and stop them overflowing - hence the aspect ratios and
 * object-fit, rather than fixed heights that would letterbox somebody's
 * carefully chosen photograph.
 */

.rp-archive-media,
.rp-job-media {
	margin: 0 0 var(--rp-gap);
	overflow: hidden;
	border-radius: var(--rp-border-radius);
}

.rp-archive-image,
.rp-job-image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 22rem;
	object-fit: cover;
}

.rp-archive-image {
	aspect-ratio: 16 / 5;
}

/* Single job ------------------------------------------------------------- */

.rp-job-header {
	margin-block-end: var(--rp-gap);
}

.rp-job-expired {
	padding: 0.75rem 1rem;
	border: 1px solid var(--rp-border-color);
	border-radius: var(--rp-border-radius);
	background: var(--rp-surface-color);
	color: var(--rp-muted-color);
}

.rp-job-lead {
	font-size: 1.125em;
	color: var(--rp-muted-color);
}

.rp-job-meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rp-gap);
	margin: 0 0 var(--rp-gap);
	padding: 1rem;
	border: 1px solid var(--rp-border-color);
	border-radius: var(--rp-border-radius);
	background: var(--rp-surface-color);
}

.rp-job-meta-item dt {
	margin: 0;
	font-size: 0.8125em;
	color: var(--rp-muted-color);
}

.rp-job-meta-item dd {
	margin: 0.125rem 0 0;
	font-weight: 600;
}

.rp-job-section-title {
	margin-block: var(--rp-gap) 0.5rem;
}

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

.rp-job-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 1rem;
	margin-block-end: var(--rp-gap);
}

/*
 * Themes put a bottom margin on form controls, and flexbox aligns margin
 * boxes rather than the boxes anybody can see. On one customer's site that was
 * 20px under each control and another 5px under each label, so the button sat
 * 25px below a row it belonged to while the CSS here said the two were aligned.
 *
 * Hence the reset rather than another alignment rule: what is being corrected
 * is space the theme added, and no amount of align-items reaches it. Stretch
 * and the row of its own then do the rest - the fields become as tall as each
 * other, which puts the labels on one line even when the theme gives a select
 * and a text input different heights.
 */
.rp-job-filters .rp-field,
.rp-job-filters .rp-input,
.rp-job-filters .rp-select,
.rp-job-filters .rp-button {
	margin: 0;
}

.rp-job-filters .rp-field {
	display: grid;
	grid-template-rows: auto 1fr;
}

.rp-job-filters .rp-button {
	align-self: end;
}

.rp-field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	flex: 1 1 12rem;
}

/*
 * A search box and a dropdown with six entries do not get better by being five
 * hundred pixels wide. Without a ceiling the two of them divide the whole
 * content width between themselves and shove the button against the far edge,
 * which reads as three unrelated things rather than one bar. Inside the
 * application form the same class still fills its column, which is right
 * there - an address field wants the room.
 */
.rp-job-filters .rp-field {
	max-width: 20rem;
}

.rp-field-label {
	font-size: 0.8125em;
	color: var(--rp-muted-color);
}

.rp-field-hint {
	margin: 0.25rem 0 0;
	font-size: 0.8125em;
	color: var(--rp-muted-color);
}

.rp-input,
.rp-select,
.rp-textarea,
.rp-file {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--rp-border-color);
	border-radius: var(--rp-border-radius);
	background: var(--rp-background-color);
	color: inherit;
	font: inherit;
}

.rp-textarea {
	resize: vertical;
}

.rp-job-list {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rp-jobs--cards .rp-job-list {
	grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.rp-job-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem;
	border: 1px solid var(--rp-border-color);
	border-radius: var(--rp-border-radius);
	background: var(--rp-surface-color);
}

/*
 * The picture sits flush against the card's own edge, so the padding has to
 * move from the card onto the parts inside it. Only when there is one - a
 * text-only card keeps the simpler arrangement above.
 */
.rp-job-card--with-media {
	padding: 0 0 1.25rem;
	overflow: hidden;
}

.rp-job-card--with-media > *:not(.rp-job-card-media) {
	margin-inline: 1.25rem;
}

.rp-job-card-media {
	display: block;
	margin-block-end: 0.75rem;
}

.rp-job-card-image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.rp-jobs--list .rp-job-card {
	border-inline: 0;
	border-block-start: 0;
	border-radius: 0;
	background: transparent;
	padding-inline: 0;
}

/*
 * In a list the picture is a thumbnail beside the text rather than a banner
 * above it, because a row of full-width photographs stacked vertically is not
 * a list any more - it is a very tall page.
 */
.rp-jobs--list .rp-job-card--with-media {
	display: grid;
	grid-template-columns: minmax(0, 8rem) minmax(0, 1fr);
	column-gap: 1rem;
	padding-block: 1.25rem;
}

.rp-jobs--list .rp-job-card--with-media > *:not(.rp-job-card-media) {
	grid-column: 2;
	margin-inline: 0;
}

.rp-jobs--list .rp-job-card-media {
	grid-row: 1 / -1;
	margin-block-end: 0;
}

.rp-jobs--list .rp-job-card-image {
	aspect-ratio: 4 / 3;
	border-radius: var(--rp-border-radius);
}

.rp-job-card-title {
	margin: 0;
	font-size: 1.125em;
}

.rp-job-card-link {
	color: inherit;
	text-decoration: none;
}

.rp-job-card-link:hover,
.rp-job-card-link:focus-visible {
	color: var(--rp-primary-color);
	text-decoration: underline;
}

.rp-job-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.875em;
	color: var(--rp-muted-color);
}

.rp-job-card-meta-item:not(:last-child)::after {
	content: "·";
	margin-inline-start: 0.5rem;
}

.rp-job-card-excerpt {
	margin: 0;
	color: var(--rp-muted-color);
}

.rp-jobs-empty {
	color: var(--rp-muted-color);
}

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

.rp-button {
	display: inline-block;
	padding: 0.625rem 1.25rem;
	border: 0;
	border-radius: var(--rp-border-radius);
	background: var(--rp-button-color);
	color: var(--rp-button-text-color);
	font: inherit;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.rp-button:hover,
.rp-button:focus-visible {
	filter: brightness(0.92);
	color: var(--rp-button-text-color);
}

.rp-button[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.rp-button--card {
	align-self: flex-start;
	margin-block-start: auto;
}

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

.rp-application {
	margin-block-start: calc(var(--rp-gap) * 2);
	padding-block-start: var(--rp-gap);
	border-block-start: 1px solid var(--rp-border-color);
}

/*
 * Six columns, because six divides by two and by three and a form only ever
 * wants halves and thirds. The row is there whether or not anybody uses it -
 * a field that says nothing spans the lot and looks exactly as it did before.
 */
.rp-application-form {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 1rem;
}

.rp-application-form > * {
	grid-column: 1 / -1;
}

/*
 * Narrow screens get the single column back, by simply not applying any of
 * this. Half a line on a phone is not half a form, it is two columns too
 * narrow to read, and the person choosing the width in the dashboard is not
 * looking at a phone when they choose it.
 */
@media (min-width: 40em) {
	.rp-application-form .rp-field--w-half {
		grid-column: span 3;
	}

	.rp-application-form .rp-field--w-third {
		grid-column: span 2;
	}
}

.rp-choice-group {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.rp-choice {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.rp-required {
	color: #b32d2e;
}

.rp-application-privacy {
	margin: 0;
	font-size: 0.875em;
	color: var(--rp-muted-color);
}

.rp-application-status:empty {
	display: none;
}

.rp-application-status {
	margin: 0;
	padding: 0.75rem 1rem;
	border-radius: var(--rp-border-radius);
	background: var(--rp-surface-color);
}

.rp-application-status[data-state="error"] {
	color: #b32d2e;
}

/*
 * The honeypot. Moved off-screen rather than display:none, because some bots
 * skip fields that are not rendered, which is exactly the behaviour we are
 * trying to catch.
 */
.rp-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
	.rp-button {
		transition: filter 120ms ease-in-out;
	}
}

/* Page sections ------------------------------------------------------------
 *
 * The blocks a careers page is built from, beyond the vacancies. Same rule as
 * everything above: no font, no colour that is not a custom property, and
 * nothing that would look imposed on a theme that already has opinions. What
 * these rules do is arrange - a grid here, a rhythm there - because
 * arrangement is the part a theme cannot guess and the part that makes a page
 * of blocks read as a page rather than as a stack.
 */

.rp-section + .rp-section {
	margin-block-start: calc(var(--rp-gap) * 2);
}

.rp-section-title {
	margin: 0 0 0.5rem;
}

.rp-section-intro {
	margin-block-end: var(--rp-gap);
	max-width: 60ch;
	color: var(--rp-muted-color);
}

.rp-section-intro > :first-child {
	margin-block-start: 0;
}

.rp-section-intro > :last-child {
	margin-block-end: 0;
}

/* Benefits ---------------------------------------------------------------- */

.rp-benefits {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: var(--rp-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.rp-benefit {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem;
	border: 1px solid var(--rp-border-color);
	border-radius: var(--rp-border-radius);
	background: var(--rp-surface-color);
}

/*
 * A fixed square, not the image's own shape. These sit in a grid of equal
 * tiles, and one portrait icon among six square ones pushes its whole row
 * taller than the rest.
 */
.rp-benefit-image {
	display: block;
	width: 3rem;
	height: 3rem;
	object-fit: contain;
	object-position: left center;
}

.rp-benefit-title {
	margin: 0;
	font-size: 1.0625em;
}

.rp-benefit-text {
	color: var(--rp-muted-color);
}

.rp-benefit-text > :first-child,
.rp-stat-label > :first-child,
.rp-step-text > :first-child,
.rp-voice-quote > :first-child {
	margin-block-start: 0;
}

.rp-benefit-text > :last-child,
.rp-stat-label > :last-child,
.rp-step-text > :last-child,
.rp-voice-quote > :last-child {
	margin-block-end: 0;
}

/* Gallery ----------------------------------------------------------------- */

.rp-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rp-gallery-figure {
	margin: 0;
}

/*
 * One shape for every picture in the grid. Photographs from a phone arrive in
 * both orientations, and a gallery that honours each one is a staircase.
 */
.rp-gallery-image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--rp-border-radius);
}

.rp-gallery-caption {
	margin-block-start: 0.375rem;
	font-size: 0.875em;
	color: var(--rp-muted-color);
}

/* FAQ --------------------------------------------------------------------- */

.rp-faq {
	margin: 0;
	padding: 0;
	list-style: none;
	border-block-start: 1px solid var(--rp-border-color);
}

.rp-faq-item {
	border-block-end: 1px solid var(--rp-border-color);
}

.rp-faq-question {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 0.875rem;
	cursor: pointer;
	font-weight: 600;
	/*
	 * The browser's own arrow is replaced rather than kept, because Safari
	 * puts it inline where it interferes with the flex layout above. The
	 * substitute is a text glyph in the content, which inherits the colour and
	 * needs no image.
	 */
	list-style: none;
}

.rp-faq-question::-webkit-details-marker {
	display: none;
}

.rp-faq-question::after {
	content: "+";
	flex: none;
	font-weight: 400;
	color: var(--rp-muted-color);
}

.rp-faq-details[open] .rp-faq-question::after {
	content: "−";
}

.rp-faq-answer {
	padding-block-end: 1rem;
	max-width: 70ch;
	color: var(--rp-muted-color);
}

.rp-faq-answer > :first-child {
	margin-block-start: 0;
}

/* Numbers ----------------------------------------------------------------- */

.rp-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: var(--rp-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.rp-stat {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.rp-stat-eyebrow {
	font-size: 0.8125em;
	color: var(--rp-muted-color);
}

/*
 * Lining figures of the same width, so a column of numbers lines up instead
 * of shimmying. The size is relative, so a theme with larger body text gets
 * proportionally larger numbers rather than a fixed 40 pixels.
 *
 * Size and weight, not the accent colour. The accent is chosen to be seen
 * against a small link, and reaching for it here puts a customer's pale brand
 * green on white at forty pixels, where it reads as faded rather than as
 * emphasis. Inheriting is also this stylesheet's own rule, and the number is
 * already the largest thing in its block.
 */
.rp-stat-figure {
	font-size: 2.25em;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums lining-nums;
	color: var(--rp-text-color);
}

.rp-stat-label {
	color: var(--rp-muted-color);
}

/* Voices ------------------------------------------------------------------ */

.rp-voices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
	gap: var(--rp-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.rp-voice-figure {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin: 0;
	height: 100%;
	padding: 1.25rem;
	border: 1px solid var(--rp-border-color);
	border-radius: var(--rp-border-radius);
	background: var(--rp-surface-color);
}

.rp-voice-image {
	display: block;
	width: 3.5rem;
	height: 3.5rem;
	object-fit: cover;
	border-radius: 50%;
}

.rp-voice-quote {
	margin: 0;
	/* Pushes the attribution to the bottom edge, so cards in a row agree. */
	flex: 1;
}

.rp-voice-by {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	font-size: 0.875em;
}

.rp-voice-name {
	font-weight: 600;
}

.rp-voice-role {
	color: var(--rp-muted-color);
}

/* Steps ------------------------------------------------------------------- */

/*
 * Numbered by a counter rather than by the list marker, because the marker
 * cannot be placed in the circle below without leaving the flow. The counter
 * still comes from the document order, so moving a step renumbers it.
 */
.rp-steps {
	counter-reset: rp-step;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: var(--rp-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.rp-step {
	counter-increment: rp-step;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.rp-step::before {
	content: counter(rp-step);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--rp-button-color);
	color: var(--rp-button-text-color);
	font-weight: 700;
	font-variant-numeric: lining-nums;
}

.rp-step-title {
	margin: 0;
	font-size: 1.0625em;
}

.rp-step-text {
	color: var(--rp-muted-color);
}
