/*
 * Baseline for the single-job widgets: Job Header, Apply Button, Salary, Job Facts
 * and Job Breadcrumbs. Just enough to lay each one out before a control is touched.
 *
 * Every rule sits inside :where() - zero specificity - so any Elementor style control
 * or theme rule overrides it without !important. Loaded only on pages containing one
 * of these widgets, via JobDetailWidget::get_style_depends().
 */

:where(.smjf-job-header__title) {
	margin: 0 0 0.35em;
}

:where(.smjf-job-header__metas) {
	display: flex;
	flex-wrap: wrap;
	justify-content: var(--smjf-justify, flex-start);
	gap: 0.25em 0.5em;
}

:where(.smjf-job-header__meta + .smjf-job-header__meta)::before {
	content: "·";
	margin-right: 0.5em;
}

:where(.smjf-job-apply__link) {
	display: inline-block;
	padding: 0.75em 1.5em;
	text-decoration: none;
}

:where(.smjf-job-salary) {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5em;
}

:where(.smjf-job-salary__label) {
	font-weight: 600;
}

.smjf-job-facts {
	margin: 0;
	padding: 0;
}

:where(.smjf-job-facts) {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

:where(.smjf-job-facts__row) {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1em;
	padding: 0.6em 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

:where(.smjf-job-facts__label) {
	font-weight: 600;
}

.smjf-job-facts__label,
.smjf-job-facts__value {
	margin: 0;
}

:where(.smjf-job-facts__value) {
	text-align: right;
}

/* Breadcrumbs ----------------------------------------------------------------
 *
 * The list reset uses plain class selectors, not :where(). A theme's element rules
 * (Astra: `ol { margin: 0 0 1.5em 3em; list-style: decimal }`) outrank a zero-
 * specificity reset, which put an indent and "1. 2. 3." numbering on the trail. One
 * class still loses to Elementor's own control CSS, so every panel setting wins. */

.smjf-breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}

.smjf-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.smjf-breadcrumbs__item {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.smjf-breadcrumbs__item::marker {
	content: none;
}

:where(.smjf-breadcrumbs__link) {
	display: inline-flex;
	align-items: center;
	text-decoration: var(--smjf-crumb-underline, none);
}

:where(.smjf-breadcrumbs__link:hover),
:where(.smjf-breadcrumbs__link:focus-visible) {
	text-decoration: var(--smjf-crumb-underline-hover, underline);
}

:where(.smjf-breadcrumbs__current) {
	min-width: 0;
	overflow: var(--smjf-crumb-current-overflow, visible);
	white-space: var(--smjf-crumb-current-space, normal);
	text-overflow: ellipsis;
	font-weight: 600;
}

:where(.smjf-breadcrumbs__separator) {
	display: inline-flex;
	align-items: center;
	margin: 0 0.5em;
	opacity: 0.55;
	line-height: 1;
}

:where(.smjf-breadcrumbs__separator svg),
:where(.smjf-breadcrumbs__home-icon svg) {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

:where(.smjf-breadcrumbs__home-icon) {
	display: inline-flex;
	margin-right: 0.35em;
}

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

:where(.smjf-editor-notice) {
	padding: 0.75em 1em;
	border: 1px dashed rgba(0, 0, 0, 0.3);
	font-size: 0.875em;
}

/* Full Job Detail ------------------------------------------------------------ */

:where(.smjf-full) {
	display: flex;
	flex-direction: column;
	gap: 2em;
}

:where(.smjf-full__main),
:where(.smjf-full__aside) {
	display: flex;
	flex-direction: column;
	gap: 1.5em;
	min-width: 0;
}

:where(.smjf-full__heading) {
	margin: 0 0 0.5em;
}

:where(.smjf-full__aside) {
	padding: 1.5em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
}

:where(.smjf-job-image__img) {
	display: block;
	width: 100%;
	height: auto;
}

:where(.smjf-job-recruiter) {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
}

:where(.smjf-job__expired) {
	margin: 0 0 1.5em;
	padding: 0.75em 1em;
	border-left: 4px solid currentColor;
}

/* Sidebar: side by side from tablet up, stacked on phones with the panel first,
   since it carries salary and the apply button. */
@media (min-width: 768px) {
	:where(.smjf-full--sidebar) {
		flex-direction: var(--smjf-side-direction, row);
		align-items: flex-start;
	}

	:where(.smjf-full--sidebar .smjf-full__main) {
		flex: 1 1 auto;
	}

	:where(.smjf-full--sidebar .smjf-full__aside) {
		flex: 0 0 32%;
	}
}

@media (max-width: 767px) {
	:where(.smjf-full--sidebar .smjf-full__aside) {
		order: -1;
	}
}

/* Related Jobs --------------------------------------------------------------- */

:where(.smjf-related__heading) {
	margin: 0 0 1.25em;
}

:where(.smjf-related__empty) {
	margin: 0;
}
