/*
 * Heramus Jobs — front-end styles.
 *
 * Deliberately low-specificity and theme-agnostic: single class names, no
 * element resets, and colours driven by --heramus-accent (set from the plugin
 * settings) plus a small set of neutral tokens that follow the visitor's
 * light/dark preference. A theme can override any of it without !important.
 */

.heramus-jobs {
	--hj-accent: var(--heramus-accent, #0b63ce);
	--hj-fg: #16191d;
	--hj-muted: #5a6672;
	--hj-border: #e3e7ec;
	--hj-surface: #fff;
	--hj-surface-alt: #f6f8fa;
	--hj-radius: 10px;

	color: var(--hj-fg);
	max-width: 100%;
}

@media (prefers-color-scheme: dark) {
	.heramus-jobs {
		--hj-fg: #e8ecf1;
		--hj-muted: #9aa7b4;
		--hj-border: #2c333b;
		--hj-surface: #171b20;
		--hj-surface-alt: #1e242b;
	}
}

.heramus-jobs__heading {
	margin: 0 0 1rem;
}

/* ─── Filter bar ───────────────────────────────────────────────────────── */

.heramus-jobs__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	padding: 0.75rem;
	margin-bottom: 1rem;
	background: var(--hj-surface-alt);
	border: 1px solid var(--hj-border);
	border-radius: var(--hj-radius);
}

.heramus-jobs__field {
	flex: 1 1 12rem;
	min-width: 0;
}

.heramus-jobs__field--search {
	flex: 2 1 16rem;
}

.heramus-jobs__filters input[type="search"],
.heramus-jobs__filters select {
	width: 100%;
	box-sizing: border-box;
	padding: 0.5rem 0.65rem;
	font: inherit;
	color: var(--hj-fg);
	background: var(--hj-surface);
	border: 1px solid var(--hj-border);
	border-radius: calc(var(--hj-radius) - 4px);
}

.heramus-jobs__reset {
	color: var(--hj-muted);
	font-size: 0.875rem;
	text-decoration: underline;
}

.heramus-jobs__count {
	color: var(--hj-muted);
	font-size: 0.9rem;
	margin: 0 0 0.75rem;
}

/* ─── Listing ──────────────────────────────────────────────────────────── */

.heramus-jobs__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.heramus-jobs__item {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	background: var(--hj-surface);
	border: 1px solid var(--hj-border);
	border-radius: var(--hj-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.heramus-jobs__item:hover {
	border-color: var(--hj-accent);
	box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

.heramus-jobs__item-main {
	flex: 1 1 22rem;
	min-width: 0;
}

.heramus-jobs__title {
	margin: 0 0 0.35rem;
	font-size: 1.1rem;
	line-height: 1.3;
}

.heramus-jobs__title a {
	color: inherit;
	text-decoration: none;
}

.heramus-jobs__title a:hover,
.heramus-jobs__title a:focus {
	color: var(--hj-accent);
	text-decoration: underline;
}

.heramus-jobs__meta {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.9rem;
	margin: 0 0 0.5rem;
	padding: 0;
	color: var(--hj-muted);
	font-size: 0.875rem;
}

.heramus-jobs__meta-item + .heramus-jobs__meta-item::before {
	content: "·";
	margin-right: 0.9rem;
	/* The separator belongs to the gap, so it never wraps alone. */
	margin-left: -0.55rem;
}

.heramus-jobs__excerpt {
	margin: 0;
	color: var(--hj-muted);
	font-size: 0.925rem;
	line-height: 1.5;
}

.heramus-jobs__tags {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0.6rem 0 0;
	padding: 0;
}

.heramus-jobs__tag {
	padding: 0.15rem 0.55rem;
	font-size: 0.75rem;
	color: var(--hj-muted);
	background: var(--hj-surface-alt);
	border: 1px solid var(--hj-border);
	border-radius: 999px;
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */

.heramus-jobs__button {
	display: inline-block;
	padding: 0.5rem 1.1rem;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--hj-accent);
	text-decoration: none;
	background: transparent;
	border: 1px solid var(--hj-accent);
	border-radius: 999px;
	cursor: pointer;
}

.heramus-jobs__button:hover,
.heramus-jobs__button:focus {
	color: #fff;
	background: var(--hj-accent);
}

.heramus-jobs__button--primary {
	color: #fff;
	background: var(--hj-accent);
}

.heramus-jobs__button--primary:hover,
.heramus-jobs__button--primary:focus {
	filter: brightness(0.92);
}

.heramus-jobs__button--block {
	display: block;
	margin-top: 1rem;
	text-align: center;
}

/* ─── Pagination ───────────────────────────────────────────────────────── */

.heramus-jobs__pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 1.25rem;
}

.heramus-jobs__page {
	padding: 0.35rem 0.7rem;
	font-size: 0.875rem;
	color: var(--hj-fg);
	text-decoration: none;
	border: 1px solid var(--hj-border);
	border-radius: calc(var(--hj-radius) - 4px);
}

.heramus-jobs__page:hover {
	border-color: var(--hj-accent);
	color: var(--hj-accent);
}

.heramus-jobs__page.is-current {
	color: #fff;
	background: var(--hj-accent);
	border-color: var(--hj-accent);
}

/* ─── Single job ───────────────────────────────────────────────────────── */

.heramus-jobs__back {
	margin: 0 0 1rem;
	font-size: 0.9rem;
}

.heramus-jobs__header {
	padding-bottom: 1.25rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid var(--hj-border);
}

.heramus-jobs--single .heramus-jobs__title {
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
	margin-bottom: 0.6rem;
}

.heramus-jobs__columns {
	display: grid;
	gap: 2rem;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	align-items: start;
}

@media (max-width: 782px) {
	.heramus-jobs__columns {
		grid-template-columns: minmax(0, 1fr);
	}
}

.heramus-jobs__body {
	line-height: 1.65;
	overflow-wrap: break-word;
}

.heramus-jobs__body img {
	max-width: 100%;
	height: auto;
}

.heramus-jobs__body table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

.heramus-jobs__aside {
	padding: 1.25rem;
	background: var(--hj-surface-alt);
	border: 1px solid var(--hj-border);
	border-radius: var(--hj-radius);
	position: sticky;
	top: 1.5rem;
}

.heramus-jobs__facts {
	margin: 0;
	font-size: 0.9rem;
}

.heramus-jobs__facts dt {
	color: var(--hj-muted);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.heramus-jobs__facts dd {
	margin: 0.1rem 0 0.9rem;
}

.heramus-jobs__facts dd:last-of-type {
	margin-bottom: 0;
}

/* ─── Empty / error states ─────────────────────────────────────────────── */

.heramus-jobs__empty,
.heramus-jobs--notice {
	padding: 1.5rem;
	color: var(--hj-muted);
	background: var(--hj-surface-alt);
	border: 1px dashed var(--hj-border);
	border-radius: var(--hj-radius);
	text-align: center;
}

.heramus-jobs__empty p:last-child,
.heramus-jobs--notice p:last-child {
	margin-bottom: 0;
}

/* ─── Application form ─────────────────────────────────────────────────── */

.heramus-jobs__alert {
	padding: 0.9rem 1.1rem;
	margin-bottom: 1.25rem;
	border: 1px solid var(--hj-border);
	border-left-width: 4px;
	border-radius: calc(var(--hj-radius) - 4px);
	background: var(--hj-surface-alt);
}

.heramus-jobs__alert--success {
	border-left-color: #1a8a54;
}

.heramus-jobs__alert--error {
	border-left-color: #c0392b;
}

.heramus-jobs__apply-form {
	margin-top: 2.5rem;
	padding: 1.5rem;
	background: var(--hj-surface-alt);
	border: 1px solid var(--hj-border);
	border-radius: var(--hj-radius);
	/* Anchored from the "Apply" buttons; keep the heading clear of sticky headers. */
	scroll-margin-top: 5rem;
}

.heramus-jobs__apply-form > h2 {
	margin: 0 0 1.25rem;
	font-size: 1.35rem;
}

.heramus-jobs__form-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 640px) {
	.heramus-jobs__form-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.heramus-jobs__form-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin: 0;
}

.heramus-jobs__form-field label {
	font-size: 0.875rem;
	font-weight: 600;
}

.heramus-jobs__form-field input,
.heramus-jobs__form-field select,
.heramus-jobs__form-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.55rem 0.7rem;
	font: inherit;
	color: var(--hj-fg);
	background: var(--hj-surface);
	border: 1px solid var(--hj-border);
	border-radius: calc(var(--hj-radius) - 4px);
}

.heramus-jobs__form-field input:focus,
.heramus-jobs__form-field select:focus,
.heramus-jobs__form-field textarea:focus {
	outline: 2px solid var(--hj-accent);
	outline-offset: 1px;
}

.heramus-jobs__form-field--wide {
	margin-top: 1rem;
}

.heramus-jobs__required {
	color: #c0392b;
}

.heramus-jobs__hint {
	font-size: 0.8rem;
	color: var(--hj-muted);
}

.heramus-jobs__consent {
	margin: 1.25rem 0;
	font-size: 0.9rem;
	line-height: 1.5;
}

.heramus-jobs__consent label {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
}

.heramus-jobs__consent input {
	margin-top: 0.25rem;
	flex-shrink: 0;
}

/*
 * The honeypot. Not `display:none` — some bots skip hidden inputs on purpose —
 * but pushed out of view and out of the tab order, so no person meets it.
 */
.heramus-jobs__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
