/**
 * OeSystem Job Board — scoped public component styles.
 *
 * Thrive Theme Builder owns the surrounding page; this plugin owns only the
 * .oesystem-job-board component. Every rule below is scoped to the
 * .oesystem-job-board class prefix, there are no resets and no bare element
 * selectors outside the scope, and typography inherits from the theme.
 *
 * Tokens are drawn from the live joinustoday.ca Thrive theme (IUOE 955
 * brand): CTA red #ea3024, black banner, body grey #6a6b6c, hairline grey
 * #e6e6e6, light surface #f8f8f8. The accent here is #d02417 — the brand
 * red deepened just enough to pass WCAG AA (4.5:1) against white for the
 * small bold text it colors; the theme's own #ea3024 only reaches 4.25:1.
 */

.oesystem-job-board {
	--oejb-accent: #d02417;
	--oejb-accent-dark: #a81c11;
	--oejb-on-accent: #ffffff;
	--oejb-border: #e6e6e6;
	/*
	 * Form-control boundaries: the input/select fill is the same white as the
	 * page, so the border is the ONLY indicator of the control's extent and
	 * must meet WCAG 2.1 SC 1.4.11 (non-text contrast, >= 3:1 on #ffffff).
	 * #6a6b6c is the theme's body grey at 5.4:1 against white. The lighter
	 * --oejb-border stays for decorative row/separator borders, which are
	 * redundant with layout.
	 */
	--oejb-control-border: #6a6b6c;
	--oejb-muted: #5b5c5d;
	--oejb-surface: #ffffff;
	--oejb-tint: #f8f8f8;
	/* Light wash of the accent red for the details-bar hover/open state. */
	--oejb-tint-accent: #f9e9e7;
	--oejb-radius: 5px;
	display: block;
	max-width: 100%;
}

/* The hidden attribute must always win, even on elements given a display. */
.oesystem-job-board [hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------- Notices */

.oesystem-job-board__notice,
.oesystem-job-board__empty,
.oesystem-job-board__no-results {
	margin: 0 0 1rem;
	padding: 0.75em 1em;
	border-left: 4px solid var(--oejb-accent);
	background: var(--oejb-tint);
	border-radius: 0 var(--oejb-radius) var(--oejb-radius) 0;
}

/* Meaning is carried by the bold text prefix and wording, never color alone. */
.oesystem-job-board__notice-prefix {
	font-weight: 700;
}

/* ------------------------------------------------------------ Board intro */

/* The how-to-bid sentence shown at the top of the board, above the
 * controls. The link inherits the theme's own text-link styling on
 * purpose: it is an inline sentence link, not a button like the CTA. */
.oesystem-job-board__intro {
	margin: 0 0 1rem;
}

/* --------------------------------------------------------------- Controls */

.oesystem-job-board__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.75rem;
	align-items: flex-end;
	margin: 0 0 1.25rem;
	padding: 0;
	border: 0;
}

.oesystem-job-board__control {
	flex: 1 1 11rem;
	min-width: 9rem;
}

.oesystem-job-board__control--search {
	flex: 2 1 16rem;
}

.oesystem-job-board__controls label {
	display: block;
	margin: 0 0 0.25em;
	font-weight: 600;
}

.oesystem-job-board__controls input[type="search"],
.oesystem-job-board__controls select {
	display: block;
	width: 100%;
	padding: 0.5em 0.6em;
	border: 1px solid var(--oejb-control-border);
	border-radius: var(--oejb-radius);
	background: var(--oejb-surface);
	color: inherit;
	font: inherit;
}

.oesystem-job-board__clear {
	flex: 0 0 auto;
	padding: 0.55em 1.1em;
	border: 1px solid var(--oejb-accent);
	border-radius: var(--oejb-radius);
	background: var(--oejb-accent);
	color: var(--oejb-on-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.oesystem-job-board__clear:hover {
	background: var(--oejb-accent-dark);
	border-color: var(--oejb-accent-dark);
}

/* Clear visible keyboard focus on every interactive element. */
.oesystem-job-board input:focus-visible,
.oesystem-job-board select:focus-visible,
.oesystem-job-board button:focus-visible,
.oesystem-job-board summary:focus-visible {
	outline: 2px solid var(--oejb-accent);
	outline-offset: 2px;
}

/* A mouse click must not leave a lingering focus ring on the row (some
   themes outline summary:focus); keyboard focus keeps its ring above. */
.oesystem-job-board summary:focus:not(:focus-visible) {
	outline: none;
}

/* ------------------------------------------------------------------ Count */

.oesystem-job-board__count {
	margin: 0 0 1rem;
	color: var(--oejb-muted);
	font-weight: 600;
}

/* ------------------------------------------------------------------- List */

/*
 * One full-width row per job. The list carries the frame; rows separate
 * with hairline borders. overflow: hidden keeps row hover fills inside the
 * rounded frame corners.
 */
.oesystem-job-board__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--oejb-border);
	border-radius: var(--oejb-radius);
	background: var(--oejb-surface);
	overflow: hidden;
}

.oesystem-job-board__item {
	margin: 0;
	border-bottom: 1px solid var(--oejb-border);
}

.oesystem-job-board__item:last-child {
	border-bottom: 0;
}

/* --------------------------------------------------------------- Row */

/*
 * The whole row is the <summary>: headline + subline on the left, the
 * positions badge / posted date / toggle affordance on the right, and the
 * clamped description excerpt across the full width underneath.
 */
.oesystem-job-board__summary {
	list-style: none;
	cursor: pointer;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.2rem 1rem;
	padding: 0.85rem 1.15rem;
}

.oesystem-job-board__summary::-webkit-details-marker {
	display: none;
}

.oesystem-job-board__summary::marker {
	content: "";
}

.oesystem-job-board__summary:hover,
.oesystem-job-board__job[open] > .oesystem-job-board__summary {
	background: var(--oejb-tint);
}

.oesystem-job-board__headline {
	grid-column: 1;
	margin: 0;
	font-size: 1.02em;
	line-height: 1.3;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2rem 0.6rem;
	overflow-wrap: break-word;
	min-width: 0;
}

.oesystem-job-board__title {
	font-weight: 700;
	color: var(--oejb-accent);
}

.oesystem-job-board__employer {
	font-weight: 600;
	font-size: 0.9em;
}

.oesystem-job-board__subline {
	grid-column: 1;
	color: var(--oejb-muted);
	font-size: 0.88em;
	overflow-wrap: break-word;
	min-width: 0;
}

.oesystem-job-board__aside {
	grid-column: 2;
	grid-row: 1 / span 2;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.3rem;
	font-size: 0.85em;
	color: var(--oejb-muted);
	white-space: nowrap;
}

.oesystem-job-board__qty {
	background: var(--oejb-accent);
	color: var(--oejb-on-accent);
	font-weight: 700;
	padding: 0.1em 0.65em;
	border-radius: 999px;
}

/*
 * The open/close affordance: a slim full-width footer bar bleeding to the
 * row edges (negative margins cancel the summary padding), so the labeled
 * target spans the whole row on every device.
 */
.oesystem-job-board__toggle {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75em;
	margin: 0.6rem -1.15rem -0.85rem;
	padding: 0.4em 1.15rem;
	background: var(--oejb-tint);
	border-top: 1px solid var(--oejb-border);
	color: var(--oejb-accent);
	font-weight: 600;
	font-size: 0.88em;
	white-space: normal;
}

.oesystem-job-board__summary:hover .oesystem-job-board__toggle,
.oesystem-job-board__job[open] > .oesystem-job-board__summary .oesystem-job-board__toggle {
	background: var(--oejb-tint-accent);
}

.oesystem-job-board__toggle::after {
	content: " ▾";
}

.oesystem-job-board__job[open] .oesystem-job-board__toggle::after {
	content: " ▴";
}

.oesystem-job-board__toggle-close,
.oesystem-job-board__job[open] .oesystem-job-board__toggle-open {
	display: none;
}

.oesystem-job-board__job[open] .oesystem-job-board__toggle-close {
	display: inline;
}

/* Description excerpt: clamped to two lines closed, hidden when the full
   record (which repeats the description in full) is open. */
.oesystem-job-board__excerpt {
	grid-column: 1 / -1;
	color: var(--oejb-muted);
	font-size: 0.88em;
	margin-top: 0.1rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: break-word;
	min-width: 0;
}

.oesystem-job-board__job[open] .oesystem-job-board__excerpt {
	display: none;
}

/* Narrow screens: single column, with the badge/date running horizontally
   under the text instead of down the right edge. */
@media (max-width: 559px) {
	.oesystem-job-board__summary {
		grid-template-columns: minmax(0, 1fr);
	}

	.oesystem-job-board__aside {
		grid-column: 1;
		grid-row: auto;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.3rem 0.8rem;
		margin-top: 0.15rem;
	}

	/* Comfortable phone tap height for the footer bar (>= 44px). */
	.oesystem-job-board__toggle {
		min-height: 44px;
	}
}

/* The expanded full record (the footer bar above it provides the visual
   separation, so no border of its own). */
.oesystem-job-board__full {
	padding: 0.75rem 1.15rem 1.15rem;
}

/* -------------------------------------------------- Label / value rows */

.oesystem-job-board__details {
	margin: 0;
}

.oesystem-job-board__row {
	padding: 0.15em 0;
}

.oesystem-job-board__row dt {
	display: inline;
	font-weight: 600;
}

.oesystem-job-board__row dt::after {
	content: ":";
}

.oesystem-job-board__row dd {
	display: inline;
	margin: 0 0 0 0.35em;
	overflow-wrap: break-word;
}

/* Wide screens: align detail labels and values in a two-column grid. */
@media (min-width: 560px) {
	.oesystem-job-board__details .oesystem-job-board__row {
		display: grid;
		grid-template-columns: 12em minmax(0, 1fr);
		gap: 0 1em;
		padding: 0.3em 0;
	}

	.oesystem-job-board__details .oesystem-job-board__row dt,
	.oesystem-job-board__details .oesystem-job-board__row dd {
		display: block;
		margin: 0;
	}
}

/* --------------------------------------------------------- Call to action */

/*
 * The public registration link styled as a solid accent button.
 *
 * The CTA is the one <a> the board styles, and the Thrive theme styles
 * page links with ID-based selectors (e.g. "#tve_editor a ...") that
 * outrank any class selector regardless of order. The button's defining
 * properties therefore carry !important — scoped to this class only — so
 * the control renders as a button in the live theme, not as a themed
 * text link.
 */
.oesystem-job-board__cta-row {
	margin: 0.75em 0 0;
}

.oesystem-job-board__cta {
	display: inline-block !important;
	padding: 0.55em 1.1em !important;
	border: 1px solid var(--oejb-accent) !important;
	border-radius: var(--oejb-radius) !important;
	background: var(--oejb-accent) !important;
	color: var(--oejb-on-accent) !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	text-align: center !important;
	text-decoration: none !important;
	cursor: pointer;
}

.oesystem-job-board__cta:hover,
.oesystem-job-board__cta:focus {
	background: var(--oejb-accent-dark) !important;
	border-color: var(--oejb-accent-dark) !important;
	color: var(--oejb-on-accent) !important;
}

/* Same visible keyboard focus as the other interactive elements. */
.oesystem-job-board__cta:focus-visible {
	outline: 2px solid var(--oejb-accent);
	outline-offset: 2px;
}

/* Standalone CTA shown on the empty and unavailable states. */
.oesystem-job-board__cta-row--standalone {
	margin-top: 1rem;
	text-align: center;
}

/* ------------------------------------------------------------ Job details */

.oesystem-job-board__sublist {
	margin: 0.25em 0 0;
	padding-left: 1.25em;
	list-style: disc;
}

.oesystem-job-board__sublist li {
	margin: 0 0 0.25em;
}
