/*
 * Atomix vacancies: vacancy page and Careers list.
 * Sits inside the trust theme's panel system (.panel, .panel--tint,
 * .panel--white, .panel-row, .doc-list) and uses its tokens, with fallbacks.
 * The "body" prefix on some rules is there to beat the theme's
 * ".brand-trust .panel ul" and ".brand-trust .entry-content > .panel-row".
 * Reading width is capped at about 68 characters on desktop.
 */

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

/* ---------- Logos ---------- */

.av-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.av-logos img { display: block; width: auto; max-width: 9rem; object-fit: contain; }
.av-logos--hero { margin-bottom: 1.25rem; }
.av-logos--hero img { height: 5rem; max-width: 11rem; }
.av-logos--card { margin-bottom: 0.75rem !important; }
.av-logos--card img { height: 3.25rem; max-width: 8rem; }
.av-card__body > .av-logos--card + * { margin-top: 0 !important; }

/* ---------- Header ---------- */

.av-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.75rem;
}
@media (min-width: 64em) {
	.av-hero__grid {
		grid-template-columns: minmax(0, 1.45fr) minmax(19rem, 1fr);
		gap: clamp(2rem, 5vw, 4.5rem);
		align-items: center;
	}
}
body .panel .av-hero__grid > * { margin-top: 0; }
.av-hero__main > * + * { margin-top: 1rem; }
.av-eyebrow {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--primary-dk, #00565E);
}
.av-hero h1 {
	margin: 0.5rem 0 0;
	max-width: 20ch;
	font-size: clamp(2rem, 4.5vw, 3.5rem);
	line-height: 1.06;
}
body .panel ul.av-tags {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1.25rem 0 0;
	padding: 0;
	max-width: none;
}
.av-tag {
	display: inline-block;
	margin: 0;
	padding: 0.25rem 0.625rem;
	border-radius: 2px;
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.4;
	background: #00353A;
	color: #FFFFFF;
}
.av-tag--internal { background: #006871; }
.av-tag--soon { background: #7A3E00; }
.av-tag--always { background: #FFFFFF; color: #00353A; box-shadow: inset 0 0 0 1px #006871; }

.av-hero__card {
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
	border-radius: 16px;
	background: #FFFFFF;
	box-shadow: var(--shadow-rest, 0 1px 2px rgba(0, 53, 58, 0.05), 0 4px 12px rgba(0, 53, 58, 0.05));
}
.av-facts { margin: 0; }
.av-facts div {
	display: grid;
	grid-template-columns: minmax(7rem, auto) minmax(0, 1fr);
	gap: 0.25rem 1rem;
	margin: 0;
	padding: 0.75rem 0;
	border-top: 1px solid var(--border, rgba(16, 38, 42, 0.12));
}
.av-facts div:first-child { padding-top: 0; border-top: 0; }
.av-facts dt {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--ink-mid, #4A6165);
}
.av-facts dd {
	margin: 0;
	font-weight: 600;
	color: #00353A;
}
@media (max-width: 30em) {
	.av-facts div { grid-template-columns: minmax(0, 1fr); }
}
.av-hero__card .av-actions { margin-top: 1.25rem; }
.av-hero__card .av-actions .wp-block-button,
.av-hero__card .av-actions .wp-block-button__link { width: 100%; text-align: center; justify-content: center; }
.av-hero__card .av-howto,
.av-hero__card .av-closed { margin-top: 1.25rem; }

.av-closed {
	margin: 0;
	padding: 1rem 1.25rem;
	border-left: 4px solid #7A3E00;
	background: #FFF7F0;
	font-weight: 600;
}
.av-closed a, .av-back a, .av-howto a { color: var(--link, #00565E); text-underline-offset: 0.18em; }
.av-howto { font-weight: 600; }
.av-howto p { margin: 0; }

/* ---------- Body: main column and side column ---------- */

@media (min-width: 64em) {
	body .entry-content > .panel-row.av-body {
		grid-template-columns: minmax(0, 1.75fr) minmax(19rem, 1fr);
		align-items: start;
	}
}

.av-main h2 { max-width: 68ch; }
.av-prose > *,
.av-safeguarding > * { max-width: 68ch; }
.av-prose > * + * { margin-top: 1rem; }
.av-prose h3 { margin-top: 1.75rem; font-size: 1.25rem; line-height: 1.25; }
.av-prose h4 { margin-top: 1.5rem; font-size: 1.0625rem; }
body .panel .av-prose ul { list-style: disc; padding-left: 1.25rem; }
body .panel .av-prose ol { list-style: decimal; padding-left: 1.25rem; }
.av-prose li + li { margin-top: 0.375rem; }
.av-prose a { color: var(--link, #00565E); text-underline-offset: 0.18em; }
.av-prose img { max-width: 100%; height: auto; }

.av-safeguarding {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--border, rgba(16, 38, 42, 0.12));
}
.av-safeguarding > * + * { margin-top: 1rem; }
body .panel .av-safeguarding h2 { margin-top: 0; font-size: clamp(1.375rem, 2.2vw, 1.75rem); line-height: 1.2; }

.av-side > * + * { margin-top: 1rem; }
body .panel.av-side h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.2; margin-bottom: 0; }
body .panel.av-side > h2:not(:first-child) { margin-top: 2rem; }
body .panel.av-side ul.av-doc-list { grid-template-columns: minmax(0, 1fr); }
.av-side__apply {
	margin-top: 2rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--border, rgba(16, 38, 42, 0.12));
}
.av-side__apply > * + * { margin-top: 1rem; }
.av-side__apply h2 { margin-top: 0; }
.av-back { font-weight: 600; }

.av-doc-desc {
	display: block;
	margin-top: 0.125rem;
	font-size: 0.875rem;
	font-weight: 400;
	color: var(--ink-mid, #4A6165);
}

/* ---------- Careers list ---------- */

.av-head > * { margin: 0; }
.av-head p { max-width: 60ch; }
@media (min-width: 64em) {
	.av-head {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
		gap: 1rem clamp(2rem, 5vw, 4.5rem);
		align-items: end;
	}
	.av-head p { justify-self: start; padding-bottom: 0.35rem; }
}
.av-head + * { margin-top: 1.5rem !important; }

body .panel ul.av-cards {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
	gap: 1rem;
	margin: 1.5rem 0 0;
	padding: 0;
	max-width: none;
}
.av-card {
	position: relative;
	margin: 0;
	padding: 0;
	border-radius: 12px;
	background: #F5F9F9;
	container-type: inline-size;
	transition: background-color 200ms var(--ease-out, ease), box-shadow 240ms var(--ease-out, ease);
}
.av-card[hidden] { display: none !important; }
.panel--tint .av-card { background: #FFFFFF; box-shadow: var(--shadow-rest, 0 1px 2px rgba(0, 53, 58, 0.05)); }
.av-card:hover { background: #EBF3F4; }
.panel--tint .av-card:hover { background: #FFFFFF; box-shadow: var(--shadow-raised, 0 12px 28px rgba(0, 53, 58, 0.12)); }
.av-card:focus-within { outline: 3px solid #006871; outline-offset: 2px; }
.av-card__in {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	height: 100%;
	padding: 1.25rem 1.25rem 1.375rem;
	box-sizing: border-box;
}
body .panel .av-card__body > *,
body .panel .av-card__foot > * { margin: 0; }
.av-card__body > * + * { margin-top: 0.5rem !important; }
.av-card__title { font-size: 1.1875rem; line-height: 1.25; }
.av-card__title a { color: #00353A; text-decoration: none; }
.av-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.av-card__title a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.av-card__title a:focus-visible { outline: none; }
.av-card__meta { font-size: 0.875rem; color: var(--ink-mid, #4A6165); }
.av-card__summary { font-size: 0.9375rem; max-width: 62ch; }
.av-card__foot {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	font-size: 0.875rem;
	font-weight: 700;
	color: #00353A;
}
.av-card__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.av-card__cta {
	margin-left: auto !important;
	padding: 0.5rem 0.875rem;
	border-radius: 2px;
	background: #006871;
	color: #FFFFFF;
	font-size: 0.875rem;
	font-weight: 700;
	white-space: nowrap;
}

/* A card wide enough (a single vacancy, say) lays out as a row:
   the details on the left, the closing date and button on the right. */
@container (min-width: 44rem) {
	.av-card__in {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(13rem, auto);
		gap: 1rem 3rem;
		align-items: center;
		padding: 1.5rem 1.75rem;
	}
	.av-card__foot {
		flex-direction: column;
		align-items: flex-end;
		text-align: right;
		margin-top: 0;
	}
	.av-card__cta { margin-left: 0 !important; }
}

@media (min-width: 48em) {
	body .panel.av-before ul.av-doc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.av-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.av-filter button {
	min-height: 44px;
	padding: 0.5rem 0.875rem;
	border: 1px solid #006871;
	border-radius: 2px;
	background: #FFFFFF;
	color: #00353A;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}
.av-filter button:hover { background: #EBF3F4; }
.av-filter button[aria-pressed="true"] { background: #006871; color: #FFFFFF; }
.av-filter button:focus-visible { outline: 3px solid #00353A; outline-offset: 2px; }
.av-count:empty { display: none; }
.av-count, .av-none, .av-empty { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
	.av-card { transition: none; }
}

/* ---------- Careers header photo ----------
   The image block on the Careers page carries the class is-focus-right.
   On phones the theme puts the text card over the photo, which hides the
   person. For this header only, the photo sits above the title instead,
   framed on the right-hand side where the person is. */
@media (max-width: 47.99rem) {
	.brand-trust .panel--hero-image:has(.is-focus-right) {
		min-height: 0;
		padding-top: 0;
		padding-inline: 1.25rem;
		justify-content: flex-start;
	}
	.brand-trust .panel--hero-image:has(.is-focus-right)::before { display: none; }
	.brand-trust .panel--hero-image:has(.is-focus-right) > .hero-media {
		position: relative;
		inset: auto;
		width: auto;
		margin-inline: -1.25rem !important; /* the theme sets margin 0 !important on groups */
		aspect-ratio: 4 / 3;
	}
	.brand-trust .panel--hero-image:has(.is-focus-right) h1 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
	.brand-trust .hero-media .is-focus-right img { object-position: 72% 25%; }
}

/* ---------- Password-protected vacancy ---------- */
.brand-trust .av-protected .post-password-form p { margin: 0 0 1rem; max-width: 40rem; }
.brand-trust .av-protected .post-password-form label { display: block; font-weight: 600; }
.brand-trust .av-protected .post-password-form input[type="password"] {
	display: block;
	width: 100%;
	max-width: 24rem;
	margin-top: 0.5rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid currentColor;
	border-radius: 2px;
	font: inherit;
	background: #fff;
}
.brand-trust .av-protected .post-password-form input[type="submit"] {
	padding: 0.65rem 1.25rem;
	border: 0;
	border-radius: 2px;
	background: #006871;
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.brand-trust .av-protected .post-password-form input:focus-visible { outline: 3px solid #006871; outline-offset: 2px; }
