/*
 * 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;
}

.rp-container {
	max-width: var(--rp-content-width);
	margin-inline: auto;
	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: flex-end;
	gap: 1rem;
	margin-block-end: var(--rp-gap);
}

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

.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);
}

.rp-application-form {
	display: grid;
	gap: 1rem;
}

.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;
	}
}
