/*
 * Job archive, single job and [rfi_jobs] shortcode.
 * Layout, sizes and colours follow the original River Advice site;
 * fonts are inherited from the theme.
 */

.rfi-archive,
.rfi-single,
.rfi-jobs {
	--rfi-ink: #000;
	--rfi-accent: #86c2f6;
	--rfi-pill: #111;
	--rfi-navy: #023f76;
	--rfi-search-ink: rgba(0, 0, 0, 0.35);
	--rfi-gap: clamp(2.5rem, 6vw, 7.5rem);

	color: var(--rfi-ink);
	font-family: inherit;
	font-size: 18px;
	line-height: 1.5;
}

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

/* Hero (archive) */

.rfi-hero {
	height: 70vh;
	background-repeat: no-repeat;
	background-size: cover;
	background-position: 50% 20%;
}

/* Spacing is set by the plugin, not by the theme's section padding. */

.l-section.rfi-section {
	padding-block: 0;
}

/* Archive */

.rfi-archive {
	padding-block: clamp(2rem, 4vw, 4rem) var(--rfi-gap);
}

.rfi-archive--hero {
	padding-block-start: 0;
}

.rfi-search {
	position: relative;
	margin-block-end: clamp(3rem, 6vw, 6.25rem);
}

/* With a hero image, the search card overlaps its bottom edge. */
.rfi-archive--hero .rfi-search {
	z-index: 1;
	margin-block-start: calc(-1 * clamp(2.5rem, 7vw, 6.5rem));
}

.rfi-search .rfi-search__box {
	display: flex;
	align-items: center;
	gap: clamp(0.75rem, 2vw, 1.75rem);
	padding: clamp(1.25rem, 3.5vw, 3.125rem);
	background: #fff;
	border: 0;
	border-radius: 0;
	box-shadow: 0 12px 16px rgba(0, 0, 0, 0.1);
}

.rfi-search .rfi-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--rfi-search-ink);
	font-family: inherit;
	font-size: clamp(1.375rem, 4.2vw, 3.75rem);
	font-weight: 700;
	letter-spacing: -0.035em;
	line-height: 1.4;
}

.rfi-search .rfi-search__input::placeholder {
	color: var(--rfi-ink);
	font-weight: 700;
	opacity: 0.4;
}

.rfi-search .rfi-search__icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	color: var(--rfi-ink);
}

.rfi-search .rfi-search__icon svg {
	width: clamp(1.75rem, 3vw, 2.1875rem);
	height: clamp(1.75rem, 3vw, 2.1875rem);
}

.rfi-archive__title,
.rfi-single__title {
	margin: 0;
	color: var(--rfi-ink);
	font-family: inherit;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1;
	word-break: break-word;
}

.rfi-archive__title {
	margin-block-end: 0.3em;
	font-size: clamp(4.25rem, 12vw, 11.875rem);
}

.rfi-results[aria-busy="true"] {
	opacity: 0.5;
}

.rfi-empty {
	margin: 0;
}

/* Departments (accordion) */

.rfi-department {
	border-bottom: 1px solid var(--rfi-ink);
}

.rfi-department:first-of-type {
	border-top: 1px solid var(--rfi-ink);
}

.rfi-department__title {
	margin: 0;
	font-size: inherit;
	line-height: inherit;
}

.rfi-department .rfi-department__toggle {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 1em 70px 1em 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: var(--rfi-ink);
	cursor: pointer;
	font-family: inherit;
	font-size: clamp(2.5rem, 5vw, 3.75rem);
	font-weight: 700;
	letter-spacing: -0.035em;
	line-height: 1.1;
	text-align: left;
	text-transform: none;
}

.rfi-collapser {
	position: absolute;
	top: 50%;
	right: 0;
	width: 35px;
	height: 35px;
	transform: translateY(-50%);
}

.rfi-collapser::before,
.rfi-collapser::after {
	content: "";
	position: absolute;
	top: calc(50% - 1px);
	left: 0;
	width: 35px;
	height: 2px;
	background: var(--rfi-ink);
	transition: transform 0.4s;
}

.rfi-collapser::after {
	transform: rotate(90deg);
}

.rfi-collapser.is-open::after {
	transform: rotate(0deg);
}

/*
 * The panel animates its height through grid rows (0fr to 1fr). A closed panel
 * is also hidden from keyboard and screen readers once the transition ended.
 */

.rfi-department__panel {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows 0.4s ease, visibility 0s linear 0.4s;
}

.rfi-department__panel.is-open {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows 0.4s ease, visibility 0s;
}

.rfi-department__inner {
	min-height: 0;
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.rfi-department__panel,
	.rfi-department__panel.is-open,
	.rfi-collapser::before,
	.rfi-collapser::after,
	.rfi-funnel .rfi-funnel__option,
	.rfi-job {
		transition: none;
	}
}

/* Jobs */

.rfi-job {
	position: relative;
	display: block;
	padding: 3em 0 3em 1em;
	border-bottom: 1px solid var(--rfi-ink);
	transition: padding 0.4s;
}

.rfi-job:last-child {
	border-bottom: 0;
}

.rfi-job,
.rfi-job:hover,
.rfi-job:focus {
	color: var(--rfi-ink);
	text-decoration: none;
}

.rfi-job::before {
	content: "";
	position: absolute;
	top: 3.5em;
	left: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--rfi-accent);
	opacity: 0;
	transition: opacity 0.4s;
}

.rfi-job:hover,
.rfi-job:focus {
	padding-left: 3em;
}

.rfi-job:hover::before,
.rfi-job:focus::before {
	opacity: 1;
	transition-delay: 0.4s;
}

.rfi-job__title {
	margin: 0 0 15px;
	color: var(--rfi-ink);
	font-family: inherit;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.rfi-job__type,
.rfi-job__location {
	margin: 0 0 15px;
	color: var(--rfi-ink);
}

.rfi-job__location {
	margin-bottom: 0;
}

.rfi-job__location::before {
	content: "";
	position: relative;
	top: 5px;
	display: inline-block;
	width: 24px;
	height: 24px;
	margin-right: 5px;
	background: var(--rfi-ink);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Single job */

.rfi-single {
	padding-block: clamp(2rem, 4vw, 4rem) var(--rfi-gap);
}

.rfi-single__title {
	font-size: clamp(3.5rem, 6vw, 5rem);
}

.rfi-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 2rem;
	margin: var(--rfi-gap) 0;
}

.rfi-meta__item dt {
	margin: 0 0 0.5em;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.rfi-meta__item dd {
	margin: 0;
}

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

.rfi-pills .rfi-pill {
	margin: 0;
	padding: 0.4em 1em;
	border-radius: 48px;
	background: var(--rfi-pill);
	color: #fff;
	font-size: 16px;
	line-height: 1.2;
	list-style: none;
}

.rfi-single__body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	padding-top: 2rem;
	border-top: 1px solid var(--rfi-ink);
}

.rfi-single__heading {
	margin: 0 0 0.5em;
	color: var(--rfi-ink);
	font-family: inherit;
	font-size: clamp(2.5rem, 5vw, 3.75rem);
	font-weight: 700;
	letter-spacing: -0.035em;
	line-height: 1.1;
}

.rfi-single__apply {
	text-align: center;
}

.rfi-single .rfi-apply {
	display: inline-block;
	padding: 0.9em 2em;
	border-radius: 48px;
	background: var(--rfi-pill);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.4s, color 0.4s;
}

.rfi-single .rfi-apply:hover,
.rfi-single .rfi-apply:focus {
	background: var(--rfi-accent);
	color: var(--rfi-ink);
}

.rfi-single .rfi-apply--navy {
	background: var(--rfi-navy);
}

/* Nationality funnel */

.rfi-funnel__question {
	margin: 0 0 1.5rem;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.rfi-funnel__options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 220px));
	gap: 1.5rem;
	justify-content: center;
}

.rfi-funnel .rfi-funnel__option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 1rem;
	border: 1px solid transparent;
	border-radius: 12px;
	background: #fff;
	box-shadow: none;
	color: var(--rfi-ink);
	cursor: pointer;
	font: inherit;
	letter-spacing: 0;
	text-transform: none;
	transition: all 0.4s ease-out;
}

.rfi-funnel .rfi-funnel__option:hover,
.rfi-funnel .rfi-funnel__option:focus-visible {
	border-color: var(--rfi-navy);
	background: #f3f8fd;
	box-shadow: 0 10px 24px rgba(2, 63, 118, 0.12);
	transform: translateY(-3px);
}

.rfi-funnel .rfi-funnel__option:focus-visible {
	outline: 2px solid var(--rfi-navy);
	outline-offset: 3px;
}

.rfi-funnel__icon {
	width: 70%;
	max-width: 120px;
	height: auto;
	color: var(--rfi-navy);
}

.rfi-funnel__step:focus {
	outline: none;
}

.rfi-funnel__title {
	margin: 0 0 1rem;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.rfi-funnel__step--declined p {
	margin: 0 0 1.5rem;
}

@media (min-width: 992px) {
	.rfi-single__body {
		grid-template-columns: 1fr 1fr;
		gap: 3rem;
	}
}

@media (max-width: 992px) {
	.rfi-archive__title,
	.rfi-single__title {
		line-height: 0.88;
	}
}
