/*
 * Compact careers table. Typography and buttons come from the agency theme; colours use its
 * palette presets. Two-line rows on narrow containers, a table from 560px (container query),
 * so it fits a narrow WYSIWYG column or a full-width section.
 */
.oo-careers {
	--oo-navy: var(--wp--preset--color--primary, #122933);
	--oo-green: var(--wp--preset--color--secondary, #2b524d);
	--oo-mist: var(--wp--preset--color--light-gray, #f2f6f4);
	--oo-line: rgba(18, 41, 51, 0.14);
	--oo-muted: rgba(18, 41, 51, 0.68);
	container-type: inline-size;
	color: var(--oo-navy);
}

/* Filters ---------------------------------------------------------------- */

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

.oo-careers__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	align-items: flex-end;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	background: var(--oo-mist);
	border-radius: 10px;
}

.oo-careers__filter {
	display: flex;
	flex: 1 1 11rem;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
	max-width: 20rem;
}

.oo-careers__filter label {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--oo-muted);
}

.oo-careers__filter select {
	width: 100%;
	height: auto;
	margin: 0;
	padding: 0.45rem 2rem 0.45rem 0.7rem;
	font: inherit;
	font-size: 0.9375rem;
	color: var(--oo-navy);
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23122933' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
	border: 1px solid var(--oo-line);
	border-radius: 6px;
	appearance: none;
	cursor: pointer;
}

.oo-careers__filter select:focus-visible,
.oo-careers a:focus-visible {
	outline: 2px solid var(--oo-green);
	outline-offset: 2px;
}

.oo-careers__filter-actions {
	display: flex;
	flex-basis: 100%;
	gap: 1rem;
	align-items: center;
}

.oo-careers__filters--auto .oo-careers__filter-actions {
	display: none;
}

.oo-careers__submit {
	margin: 0;
}

.oo-careers__count {
	margin: 0 0 0.5rem;
	font-size: 0.9375rem;
	color: var(--oo-muted);
}

.oo-careers__count strong {
	color: var(--oo-navy);
}

.oo-careers__empty {
	padding: 1.5rem 1rem;
	text-align: center;
	background: var(--oo-mist);
	border-radius: 10px;
}

/* Shared cell content ------------------------------------------------------ */

.oo-careers__title {
	font-weight: 600;
	line-height: 1.3;
	color: var(--oo-navy);
	text-decoration: none;
}

a.oo-careers__title:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.oo-careers__sub {
	display: block;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.35;
	color: var(--oo-muted);
}

/* Narrow: two-line rows ----------------------------------------------------- */

.oo-careers__table,
.oo-careers__table thead,
.oo-careers__table tbody,
.oo-careers__table thead tr {
	background: transparent;
	border: 0;
}

.oo-careers__table,
.oo-careers__table tbody,
.oo-careers__table tr,
.oo-careers__table th,
.oo-careers__table td {
	display: block;
}

.oo-careers__table {
	width: 100%;
	margin: 0;
	border-top: 1px solid var(--oo-line);
}

.oo-careers__table thead {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.oo-careers__table .oo-careers__row {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 0.6rem;
	align-items: center;
	padding: 0.75rem 0;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--oo-line);
}

.oo-careers__table th,
.oo-careers__table td {
	padding: 0;
	text-align: left;
	background: none;
	border: 0;
}

.oo-careers__table .oo-careers__role {
	flex: 1 1 100%;
}

/* The title link covers the whole row on small screens. */
.oo-careers__table .oo-careers__role a.oo-careers__title::after {
	position: absolute;
	inset: 0;
	content: "";
}

.oo-careers__table .oo-careers__location,
.oo-careers__table .oo-careers__closes {
	font-size: 0.875rem;
	color: var(--oo-muted);
}

.oo-careers__table .oo-careers__location .oo-careers__sub {
	display: inline;
}

.oo-careers__table .oo-careers__location .oo-careers__sub::before {
	content: ", ";
}

.oo-careers__table .oo-careers__type,
.oo-careers__table .oo-careers__apply,
.oo-careers__table td:empty {
	display: none;
}

/* Table from 560px ---------------------------------------------------------- */

@container (min-width: 560px) {
	.oo-careers__table {
		display: table;
		table-layout: fixed;
		border-top: 0;
		border-collapse: collapse;
	}

	/* Column widths in twelfths of the Hallam 12-column grid: Role 4.5 / Location 3.5 / Closes 2 / Apply 2. */
	.oo-careers__col-role {
		width: calc(4.5 / 12 * 100%);
	}

	.oo-careers__col-location {
		width: calc(3.5 / 12 * 100%);
	}

	.oo-careers__col-closes {
		width: calc(2 / 12 * 100%);
	}

	.oo-careers__col-action {
		width: calc(2 / 12 * 100%);
	}

	/* Type stays in the table (so cells never shift) but collapses to zero width below 880px. */
	.oo-careers__col-type {
		width: 0;
	}

	.oo-careers__table thead {
		position: static;
		display: table-header-group;
		width: auto;
		height: auto;
		overflow: visible;
		clip: auto;
	}

	.oo-careers__table tbody {
		display: table-row-group;
	}

	.oo-careers__table tr,
	.oo-careers__table .oo-careers__row {
		position: static;
		display: table-row;
		padding: 0;
	}

	.oo-careers__table th,
	.oo-careers__table td,
	.oo-careers__table td:empty {
		display: table-cell;
		padding: 0.65rem 0.6rem;
		vertical-align: middle;
		border-bottom: 1px solid var(--oo-line);
	}

	.oo-careers__table thead th {
		padding-top: 0.4rem;
		padding-bottom: 0.5rem;
		font-size: 0.8125rem;
		font-weight: 600;
		color: var(--oo-muted);
		border-bottom: 2px solid var(--oo-navy);
	}

	.oo-careers__table th:first-child,
	.oo-careers__table td:first-child {
		padding-left: 0;
	}

	.oo-careers__table .oo-careers__role a.oo-careers__title::after {
		content: none;
	}

	.oo-careers__table .oo-careers__location {
		font-size: inherit;
		color: inherit;
	}

	.oo-careers__table .oo-careers__location .oo-careers__sub {
		display: block;
	}

	.oo-careers__table .oo-careers__location .oo-careers__sub::before {
		content: none;
	}

	.oo-careers__table .oo-careers__closes {
		font-size: 0.875rem;
		white-space: nowrap;
	}

	.oo-careers__closes-label {
		display: none;
	}

	.oo-careers__table .oo-careers__row:hover {
		background-color: var(--oo-mist);
	}

	.oo-careers__table .oo-careers__type,
	.oo-careers__table td.oo-careers__type:empty {
		display: table-cell;
		padding: 0;
		overflow: hidden;
		font-size: 0;
	}

	.oo-careers__table .oo-careers__action {
		padding-right: 0;
		text-align: right;
	}

	/* The theme button keeps its own padding and arrow; only the 180px minimum and bottom margin go. */
	.oo-careers .oo-careers__table .oo-careers__apply {
		display: inline-block;
		width: auto;
		min-width: 0;
		margin: 0;
		white-space: nowrap;
	}
}

@container (min-width: 880px) {
	/* Full width, 12 columns: Role 4 / Location 3 / Type 1.5 / Closes 1.5 / Apply 2. */
	.oo-careers__col-type {
		width: calc(1.5 / 12 * 100%);
	}

	.oo-careers__col-role {
		width: calc(4 / 12 * 100%);
	}

	.oo-careers__col-location {
		width: calc(3 / 12 * 100%);
	}

	.oo-careers__col-closes {
		width: calc(1.5 / 12 * 100%);
	}

	.oo-careers__table .oo-careers__type,
	.oo-careers__table td.oo-careers__type:empty {
		display: table-cell;
		font-size: 0.875rem;
	}
}

/* Pages (added by careers.js; without JavaScript every row shows) ------------- */

.oo-careers__table:focus {
	outline: none;
}

.oo-careers__pages {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	align-items: center;
	justify-content: space-between;
	margin-top: 1rem;
}

.oo-careers__range {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--oo-muted);
}

.oo-careers__page-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	align-items: center;
}

.oo-careers__page {
	min-width: 2.25rem;
	min-height: 2.25rem;
	padding: 0.25rem 0.6rem;
	font: inherit;
	font-size: 0.9375rem;
	color: var(--oo-navy);
	cursor: pointer;
	background: transparent;
	border: 1px solid var(--oo-line);
	border-radius: 6px;
}

.oo-careers__page:hover:not(:disabled) {
	background: var(--oo-mist);
}

.oo-careers__page[aria-current="page"] {
	font-weight: 700;
	background: var(--oo-mist);
	border-color: var(--oo-navy);
	box-shadow: inset 0 -2px 0 var(--oo-navy);
}

.oo-careers__page:disabled {
	cursor: default;
	opacity: 0.4;
}

.oo-careers__page:focus-visible {
	outline: 2px solid var(--oo-green);
	outline-offset: 2px;
}

.oo-careers__gap {
	padding: 0 0.25rem;
	color: var(--oo-muted);
}
