/**
 * Careers page (page-careers.php).
 *
 * Every rule is scoped to .qehs-careers / .qehs-careers-* / .qehs-job-*
 * so nothing here affects another page. Uses the existing QEHS tokens;
 * the few page-local values are the soft tints sampled from the approved
 * Careers design.
 */

.qehs-careers {
	--qehs-careers-hero-bg: #F0F8FF;
	--qehs-careers-card-border: #E8ECF0;
	--qehs-careers-body: #3C4654;
	--qehs-careers-tag-bg: #E3F0FB;
	--qehs-careers-tag-text: #1B5FA8;
	--qehs-careers-cta-bg: #E0EFFD;
	--qehs-careers-green-tint: #F4FAF1;
	--qehs-careers-green-soft: #E4F2DA;

	background-color: var(--qehs-background);
	overflow-x: clip;
}

.qehs-careers [hidden] {
	display: none !important;
}

/* ---------------- Shared ---------------- */

.qehs-careers-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--qehs-space-sm);
	margin-bottom: var(--qehs-space-lg);
	font-size: 0.9rem;
	color: var(--qehs-text);
}

.qehs-careers-breadcrumb a {
	display: inline-block;
	margin-block: -8px;
	padding-block: 8px;
	color: var(--qehs-secondary);
	font-weight: 600;
	text-decoration: none;
}

.qehs-careers-breadcrumb a:hover,
.qehs-careers-breadcrumb a:focus-visible {
	text-decoration: underline;
}

.qehs-careers-breadcrumb span[aria-current] {
	font-weight: 600;
}

.qehs-careers-section-title {
	margin: 0 0 var(--qehs-space-sm);
	font-size: 1.85rem;
	font-weight: 800;
	line-height: 1.2;
	color: var(--qehs-primary);
}

.qehs-careers-section-intro {
	margin: 0;
	max-width: 760px;
	font-size: 1.02rem;
	line-height: 1.6;
	color: var(--qehs-careers-body);
}

.qehs-careers-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 var(--qehs-space-lg);
	border: 1px solid var(--qehs-secondary);
	border-radius: 6px;
	background-color: var(--qehs-secondary);
	color: #FFFFFF;
	font-size: 0.95rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.qehs-careers-button:hover,
.qehs-careers-button:focus-visible {
	border-color: var(--qehs-success);
	background-color: var(--qehs-success);
	color: #FFFFFF;
}

.qehs-careers-button svg {
	transition: transform 0.15s ease;
}

.qehs-careers-button:hover svg,
.qehs-careers-button:focus-visible svg {
	transform: translateX(3px);
}

.qehs-careers-button--outline {
	background-color: var(--qehs-background);
	color: var(--qehs-secondary);
}

.qehs-careers-button--outline:hover,
.qehs-careers-button--outline:focus-visible {
	border-color: var(--qehs-secondary);
	background-color: var(--qehs-secondary);
	color: #FFFFFF;
}

.qehs-careers-notice {
	margin: 0 0 var(--qehs-space-md);
	padding: var(--qehs-space-sm) var(--qehs-space-md);
	border-radius: var(--qehs-radius-md);
	background-color: var(--qehs-warning-tint);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--qehs-text);
}

/* ---------------- Hero ---------------- */

.qehs-careers-hero {
	position: relative;
	min-height: 400px;
	background-color: var(--qehs-careers-hero-bg);
	overflow: hidden;
}

.qehs-careers-hero__inner {
	position: static;
	padding-block: var(--qehs-space-lg) var(--qehs-space-2xl);
}

.qehs-careers-hero__text {
	position: relative;
	z-index: 1;
	/* Scales with the viewport so the text never runs into the
	   illustration at any width in the two-column layout. */
	max-width: min(560px, 40vw);
}

.qehs-careers-hero__title {
	margin: 0 0 var(--qehs-space-md);
	font-size: clamp(2.1rem, 3.4vw, 3.1rem);
	font-weight: 800;
	line-height: 1.12;
	color: var(--qehs-primary);
}

.qehs-careers-hero__title span {
	display: block;
	color: var(--qehs-secondary);
}

.qehs-careers-hero__body {
	margin: 0 0 var(--qehs-space-lg);
	font-size: 1.05rem;
	line-height: 1.65;
	color: var(--qehs-careers-body);
}

/* Anchored to the hero's bottom-right edge, natural ratio always kept. */
.qehs-careers-hero__illustration {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	width: 54%;
	height: 100%;
	pointer-events: none;
}

.qehs-careers-hero__illustration img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
}

/* ---------------- Why Work With Us ---------------- */

.qehs-careers-why {
	padding-top: var(--qehs-space-xl);
}

.qehs-careers-benefits {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin: var(--qehs-space-lg) 0 0;
	padding: 0;
	list-style: none;
}

.qehs-careers-benefit {
	--qehs-careers-tone: var(--qehs-secondary);
	--qehs-careers-tone-tint: var(--qehs-careers-green-soft);
	--qehs-careers-tone-card: var(--qehs-careers-green-tint);

	padding: var(--qehs-space-lg);
	border: 1px solid color-mix(in srgb, var(--qehs-careers-tone) 18%, transparent);
	border-radius: 10px;
	background-color: var(--qehs-careers-tone-card);
	text-align: center;
}

.qehs-careers-benefit--blue {
	--qehs-careers-tone: var(--qehs-accent-blue-alt);
	--qehs-careers-tone-tint: var(--qehs-accent-blue-alt-tint);
	--qehs-careers-tone-card: #F6FBFE;
}

.qehs-careers-benefit--purple {
	--qehs-careers-tone: var(--qehs-accent-purple);
	--qehs-careers-tone-tint: var(--qehs-accent-purple-tint);
	--qehs-careers-tone-card: #FAF8FD;
}

.qehs-careers-benefit--orange {
	--qehs-careers-tone: var(--qehs-accent-orange);
	--qehs-careers-tone-tint: var(--qehs-accent-orange-tint);
	--qehs-careers-tone-card: #FFFBF8;
}

.qehs-careers-benefit__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin-bottom: var(--qehs-space-md);
	border-radius: 50%;
	background-color: var(--qehs-careers-tone-tint);
	color: var(--qehs-careers-tone);
}

.qehs-careers-benefit__title {
	margin: 0 0 var(--qehs-space-sm);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--qehs-text);
}

.qehs-careers-benefit__text {
	margin: 0;
	font-size: 0.93rem;
	line-height: 1.55;
	color: var(--qehs-careers-body);
}

/* ---------------- Open Positions ---------------- */

.qehs-careers-positions {
	padding-top: var(--qehs-space-xl);
	scroll-margin-top: var(--qehs-space-md);
}

.qehs-careers-positions:focus {
	outline: none;
}

.qehs-careers-positions__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--qehs-space-lg);
	margin-bottom: var(--qehs-space-lg);
}

.qehs-careers-filters {
	display: flex;
	flex-shrink: 0;
	gap: var(--qehs-space-md);
}

.qehs-careers-filter select {
	width: 180px;
	height: 46px;
	padding: 0 38px 0 var(--qehs-space-md);
	border: 1px solid var(--qehs-careers-card-border);
	border-radius: var(--qehs-radius-md);
	background-color: var(--qehs-background);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23707070' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-position: right 14px center;
	background-repeat: no-repeat;
	color: var(--qehs-text);
	font-family: inherit;
	font-size: 0.9rem;
	appearance: none;
	cursor: pointer;
}

.qehs-careers-filter select:focus-visible {
	border-color: var(--qehs-secondary);
	outline: 2px solid color-mix(in srgb, var(--qehs-secondary) 35%, transparent);
	outline-offset: 1px;
}

.qehs-careers-list {
	display: grid;
	gap: var(--qehs-space-md);
	align-content: start;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qehs-job-card {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) auto;
	gap: var(--qehs-space-lg);
	align-items: start;
	padding: var(--qehs-space-lg);
	border: 1px solid var(--qehs-careers-card-border);
	border-radius: 10px;
	background-color: var(--qehs-background);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.qehs-job-card:hover {
	border-color: color-mix(in srgb, var(--qehs-secondary) 35%, var(--qehs-careers-card-border));
	box-shadow: var(--qehs-shadow-sm);
}

.qehs-job-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	border-radius: 50%;
}

.qehs-job-icon--blue {
	background-color: var(--qehs-accent-blue-alt-tint);
	color: var(--qehs-accent-blue-alt);
}

.qehs-job-icon--purple {
	background-color: var(--qehs-accent-purple-tint);
	color: var(--qehs-accent-purple);
}

.qehs-job-icon--teal {
	background-color: var(--qehs-accent-teal-tint);
	color: var(--qehs-accent-teal);
}

.qehs-job-icon--green {
	background-color: var(--qehs-careers-green-soft);
	color: var(--qehs-success);
}

.qehs-job-icon--orange {
	background-color: var(--qehs-accent-orange-tint);
	color: var(--qehs-accent-orange);
}

.qehs-job-card__title {
	margin: 2px 0 var(--qehs-space-sm);
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--qehs-primary);
}

.qehs-job-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 0;
	margin: 0 0 var(--qehs-space-sm);
	padding: 0;
	list-style: none;
	font-size: 0.88rem;
	color: var(--qehs-text-muted);
}

.qehs-job-meta li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.qehs-job-meta li + li::before {
	content: "";
	width: 1px;
	height: 14px;
	margin: 0 14px;
	background-color: var(--qehs-border);
}

.qehs-job-meta svg {
	flex-shrink: 0;
	color: var(--qehs-text-muted);
}

.qehs-job-card__text {
	margin: 0;
	max-width: 620px;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--qehs-careers-body);
}

.qehs-job-card__side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: var(--qehs-space-lg);
	max-width: 400px;
}

.qehs-job-tags {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qehs-job-tags li {
	padding: 4px 12px;
	border-radius: 5px;
	background-color: var(--qehs-careers-tag-bg);
	color: var(--qehs-careers-tag-text);
	font-size: 0.8rem;
	font-weight: 500;
	white-space: nowrap;
}

.qehs-careers-empty {
	padding: var(--qehs-space-xl) var(--qehs-space-lg);
	border: 1px dashed var(--qehs-careers-card-border);
	border-radius: 10px;
	text-align: center;
}

.qehs-careers-empty p {
	margin: 0 0 var(--qehs-space-sm);
	font-weight: 700;
	color: var(--qehs-primary);
}

.qehs-careers-empty__reset {
	min-height: 36px;
	padding: 0 var(--qehs-space-md);
	border: none;
	background: none;
	color: var(--qehs-secondary);
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

/* Pagination */

.qehs-careers-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--qehs-space-sm);
	margin-top: var(--qehs-space-lg);
}

.qehs-careers-pagination__pages {
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qehs-careers-pagination__step,
.qehs-careers-pagination__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--qehs-careers-card-border);
	border-radius: var(--qehs-radius-md);
	background-color: var(--qehs-background);
	color: var(--qehs-primary);
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.qehs-careers-pagination__step:hover:not(:disabled),
.qehs-careers-pagination__page:hover:not(.is-active) {
	border-color: var(--qehs-secondary);
	color: var(--qehs-secondary);
}

.qehs-careers-pagination__page.is-active {
	border-color: var(--qehs-secondary);
	background-color: var(--qehs-secondary);
	color: #FFFFFF;
	cursor: default;
}

.qehs-careers-pagination__step:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.qehs-careers-pagination button:focus-visible {
	outline: 2px solid var(--qehs-secondary);
	outline-offset: 2px;
}

/* ---------------- CV CTA ---------------- */

.qehs-careers-cta {
	padding-block: var(--qehs-space-xl) var(--qehs-space-2xl);
}

.qehs-careers-cta__box {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-lg);
	padding: var(--qehs-space-lg) var(--qehs-space-xl);
	border-radius: 12px;
	background-color: var(--qehs-careers-cta-bg);
}

.qehs-careers-cta__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background-color: var(--qehs-accent-blue-alt);
	color: #FFFFFF;
}

.qehs-careers-cta__text {
	flex: 1;
	min-width: 0;
}

.qehs-careers-cta__text h2 {
	margin: 0 0 6px;
	font-size: 1.4rem;
	font-weight: 800;
	color: var(--qehs-primary);
}

.qehs-careers-cta__text p {
	margin: 0;
	max-width: 640px;
	font-size: 0.98rem;
	line-height: 1.6;
	color: var(--qehs-careers-body);
}

.qehs-careers-cta .qehs-careers-button {
	flex-shrink: 0;
	min-width: 200px;
	min-height: 50px;
}

/* ---------------- Job detail view ---------------- */

.qehs-careers-detail {
	padding-block: var(--qehs-space-lg) var(--qehs-space-2xl);
	background: linear-gradient(to bottom, var(--qehs-careers-hero-bg) 0, var(--qehs-careers-hero-bg) 220px, var(--qehs-background) 220px);
}

.qehs-careers-detail__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	margin-bottom: var(--qehs-space-lg);
	color: var(--qehs-secondary);
	font-weight: 700;
	text-decoration: none;
}

.qehs-careers-detail__back:hover,
.qehs-careers-detail__back:focus-visible {
	text-decoration: underline;
}

.qehs-careers-detail__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: var(--qehs-space-xl);
	align-items: start;
}

.qehs-careers-detail__main {
	padding: var(--qehs-space-xl);
	border: 1px solid var(--qehs-careers-card-border);
	border-radius: 12px;
	background-color: var(--qehs-background);
}

.qehs-careers-detail__head {
	display: flex;
	align-items: flex-start;
	gap: var(--qehs-space-lg);
	margin-bottom: var(--qehs-space-md);
}

.qehs-careers-detail__title {
	margin: 4px 0 var(--qehs-space-sm);
	font-size: clamp(1.6rem, 2.6vw, 2.2rem);
	font-weight: 800;
	line-height: 1.2;
	color: var(--qehs-primary);
}

.qehs-careers-detail__main .qehs-job-tags {
	justify-content: flex-start;
	margin-bottom: var(--qehs-space-lg);
}

.qehs-careers-detail__subtitle {
	margin: var(--qehs-space-lg) 0 var(--qehs-space-sm);
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--qehs-primary);
}

.qehs-careers-detail__main p {
	margin: 0;
	line-height: 1.7;
	color: var(--qehs-careers-body);
}

.qehs-careers-detail__facts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--qehs-space-md);
	margin: 0;
}

.qehs-careers-detail__facts div {
	padding: var(--qehs-space-md);
	border-radius: var(--qehs-radius-md);
	background-color: var(--qehs-background-alt);
	border: 1px solid var(--qehs-careers-card-border);
}

.qehs-careers-detail__facts dt {
	margin-bottom: 4px;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--qehs-text-muted);
}

.qehs-careers-detail__facts dd {
	margin: 0;
	font-weight: 700;
	color: var(--qehs-primary);
}

.qehs-careers-apply-card {
	position: sticky;
	top: var(--qehs-space-lg);
	padding: var(--qehs-space-lg);
	border: 1px solid var(--qehs-careers-card-border);
	border-radius: 12px;
	background-color: var(--qehs-careers-cta-bg);
}

.qehs-careers-apply-card h2 {
	margin: 0 0 var(--qehs-space-sm);
	font-size: 1.2rem;
	font-weight: 800;
	color: var(--qehs-primary);
}

.qehs-careers-apply-card p {
	margin: 0 0 var(--qehs-space-md);
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--qehs-careers-body);
}

.qehs-careers-apply-card p a {
	color: var(--qehs-secondary);
	font-weight: 600;
	text-decoration: underline;
	overflow-wrap: anywhere;
}

.qehs-careers-apply-card .qehs-careers-button {
	width: 100%;
}

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

@media (max-width: 1340px) {
	.qehs-careers-hero__illustration {
		width: 50%;
	}
}

@media (max-width: 1200px) {
	.qehs-careers-filter select {
		width: 160px;
	}
}

/* Filters wrap under the heading; job card side moves below the body. */
@media (max-width: 1100px) {
	.qehs-careers-positions__head {
		flex-direction: column;
		align-items: flex-start;
	}

	.qehs-careers-filters {
		width: 100%;
	}

	.qehs-careers-filter {
		flex: 1;
	}

	.qehs-careers-filter select {
		width: 100%;
	}

	.qehs-job-card {
		grid-template-columns: 64px minmax(0, 1fr);
	}

	.qehs-job-card__side {
		grid-column: 2;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		max-width: none;
		gap: var(--qehs-space-md);
	}

	.qehs-job-tags {
		justify-content: flex-start;
	}
}

/* Hero stacks: text first, then the illustration. */
@media (max-width: 1024px) {
	.qehs-careers-hero {
		min-height: 0;
	}

	.qehs-careers-hero__inner {
		padding-bottom: var(--qehs-space-md);
	}

	.qehs-careers-hero__text {
		max-width: 640px;
	}

	.qehs-careers-hero__illustration {
		position: static;
		width: min(100%, 720px);
		height: auto;
		margin-left: auto;
	}

	.qehs-careers-hero__illustration img {
		width: 100%;
	}

	.qehs-careers-benefits {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.qehs-careers-detail__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.qehs-careers-apply-card {
		position: static;
	}
}

@media (max-width: 768px) {
	.qehs-careers-filters {
		flex-direction: column;
	}

	.qehs-careers-cta__box {
		flex-direction: column;
		align-items: flex-start;
		padding: var(--qehs-space-lg);
	}

	.qehs-careers-cta .qehs-careers-button {
		width: 100%;
		min-width: 0;
	}

	.qehs-careers-detail__facts {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 560px) {
	.qehs-careers-section-title {
		font-size: 1.5rem;
	}

	.qehs-careers-hero__body {
		font-size: 1rem;
	}

	.qehs-careers-hero__text .qehs-careers-button {
		width: 100%;
	}

	.qehs-careers-benefits {
		grid-template-columns: minmax(0, 1fr);
	}

	.qehs-job-card {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--qehs-space-md);
		padding: var(--qehs-space-md);
	}

	.qehs-job-icon {
		width: 52px;
		height: 52px;
	}

	/* Department / Location / Work type as a stacked list, so a divider
	   never starts a wrapped line. */
	.qehs-job-meta {
		flex-direction: column;
		gap: 6px;
	}

	.qehs-job-meta li + li::before {
		display: none;
	}

	.qehs-job-card__side {
		grid-column: 1;
		flex-direction: column;
		align-items: stretch;
	}

	.qehs-job-card__button {
		width: 100%;
	}

	.qehs-job-tags li {
		white-space: normal;
	}

	.qehs-careers-pagination__step {
		padding: 0 10px;
	}

	.qehs-careers-detail__main {
		padding: var(--qehs-space-lg);
	}

	.qehs-careers-detail__head {
		flex-direction: column;
		gap: var(--qehs-space-md);
	}
}

@media (prefers-reduced-motion: reduce) {
	.qehs-careers *,
	.qehs-careers *::before,
	.qehs-careers *::after {
		transition: none !important;
	}
}

/* Careers managed in wp-admin: a full job description written in the editor
   (detail page). Plain paragraphs, lists and sub-headings only; same colours
   and type as the rest of the detail card. */
.qehs-careers-detail__main .qehs-careers-detail__content {
	line-height: 1.7;
	color: var(--qehs-careers-body);
}

.qehs-careers-detail__main .qehs-careers-detail__content > * {
	margin: 0;
}

.qehs-careers-detail__main .qehs-careers-detail__content > * + * {
	margin-top: var(--qehs-space-md);
}

.qehs-careers-detail__main .qehs-careers-detail__content h2,
.qehs-careers-detail__main .qehs-careers-detail__content h3,
.qehs-careers-detail__main .qehs-careers-detail__content h4 {
	margin-top: var(--qehs-space-lg);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--qehs-primary);
}

.qehs-careers-detail__main .qehs-careers-detail__content > h2:first-child,
.qehs-careers-detail__main .qehs-careers-detail__content > h3:first-child,
.qehs-careers-detail__main .qehs-careers-detail__content > h4:first-child {
	margin-top: 0;
}

.qehs-careers-detail__main .qehs-careers-detail__content ul,
.qehs-careers-detail__main .qehs-careers-detail__content ol {
	padding-left: 1.25em;
}

.qehs-careers-detail__main .qehs-careers-detail__content li + li {
	margin-top: 6px;
}

.qehs-careers-detail__main .qehs-careers-detail__content a {
	color: var(--qehs-secondary);
	font-weight: 600;
	text-decoration: underline;
}
