/* ── WP Career Board — Shared Frontend Components ──────────────────────── */

/* ── Theme Isolation Reset ────────────────────────────────────────────── */

/*
 * The selectors here match BOTH Free (.wp-block-wp-career-board-*) AND
 * Pro (.wp-block-wcb-*) block wrappers. The double-selector pattern
 * keeps theme-isolation behaviour identical across both plugins so a
 * customer running Free-only or Free+Pro gets the same defensive reset.
 */

[class*="wp-block-wp-career-board"],
[class*="wp-block-wcb-"] {
	font-family: inherit;
	font-size: var(--wcb-text-base);
	line-height: var(--wcb-leading-normal);
	color: var(--wcb-contrast);
	box-sizing: border-box;
}

[class*="wp-block-wp-career-board"] *,
[class*="wp-block-wp-career-board"] *::before,
[class*="wp-block-wp-career-board"] *::after,
[class*="wp-block-wcb-"] *,
[class*="wp-block-wcb-"] *::before,
[class*="wp-block-wcb-"] *::after {
	box-sizing: inherit;
}

[class*="wp-block-wp-career-board"] ul,
[class*="wp-block-wp-career-board"] ol,
[class*="wp-block-wcb-"] ul,
[class*="wp-block-wcb-"] ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

/*
 * Theme isolation: strip the theme's anchor underline from .wcb-btn states.
 * Do NOT reset `color` here — it would inherit the wrapper's --wcb-contrast
 * and override every .wcb-btn--variant color (specificity 0,2,0 vs 0,1,0).
 */
[class*="wp-block-wp-career-board"] .wcb-btn,
[class*="wp-block-wp-career-board"] .wcb-btn:hover,
[class*="wp-block-wp-career-board"] .wcb-btn:visited,
[class*="wp-block-wcb-"] .wcb-btn,
[class*="wp-block-wcb-"] .wcb-btn:hover,
[class*="wp-block-wcb-"] .wcb-btn:visited {
	text-decoration: none;
}

[class*="wp-block-wp-career-board"] h1,
[class*="wp-block-wp-career-board"] h2,
[class*="wp-block-wp-career-board"] h3,
[class*="wp-block-wp-career-board"] h4,
[class*="wp-block-wcb-"] h1,
[class*="wp-block-wcb-"] h2,
[class*="wp-block-wcb-"] h3,
[class*="wp-block-wcb-"] h4 {
	font-family: inherit;
	margin: 0;
	padding: 0;
}

/* ── Lucide Icon Sizing ──────────────────────────────────────────────── */

[data-lucide] {
	width: var(--wcb-icon-md);
	height: var(--wcb-icon-md);
	stroke-width: var(--wcb-icon-stroke);
	flex-shrink: 0;
}

.wcb-icon--xs { width: var(--wcb-icon-xs); height: var(--wcb-icon-xs); }
.wcb-icon--sm { width: var(--wcb-icon-sm); height: var(--wcb-icon-sm); }
.wcb-icon--lg { width: var(--wcb-icon-lg); height: var(--wcb-icon-lg); }
.wcb-icon--xl { width: var(--wcb-icon-xl); height: var(--wcb-icon-xl); }
.wcb-icon--2xl { width: var(--wcb-icon-2xl); height: var(--wcb-icon-2xl); }

/* ── Badges ──────────────────────────────────────────────────────────── */

.wcb-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--wcb-space-xs);
	padding: 2px var(--wcb-space-sm);
	font-family: inherit;
	font-size: var(--wcb-text-xs);
	font-weight: var(--wcb-font-semibold);
	line-height: var(--wcb-leading-normal);
	border-radius: var(--wcb-radius-sm);
	white-space: nowrap;
	vertical-align: middle;
}

.wcb-badge--success  { background: var(--wcb-success-bg); color: var(--wcb-success); }
.wcb-badge--warning  { background: var(--wcb-warning-bg); color: var(--wcb-warning); }
.wcb-badge--danger   { background: var(--wcb-danger-bg);  color: var(--wcb-danger); }
.wcb-badge--info     { background: var(--wcb-info-bg);    color: var(--wcb-info); }
.wcb-badge--muted    { background: var(--wcb-bg-subtle, #f3f4f6); color: var(--wcb-text-secondary); }
.wcb-badge--featured { background: var(--wcb-warning-bg);  color: var(--wcb-warning-fg); }

.wcb-badge [data-lucide] {
	width: var(--wcb-icon-xs);
	height: var(--wcb-icon-xs);
}

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

.wcb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wcb-space-sm);
	height: 40px;
	padding: 0 var(--wcb-space-lg);
	font-family: inherit;
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-medium);
	line-height: 1;
	border-radius: var(--wcb-radius-md);
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: all var(--wcb-transition-fast);
	min-width: 44px;
	min-height: 44px;
}

.wcb-btn:hover { text-decoration: none; }

.wcb-btn:focus-visible {
	outline: 2px solid var(--wcb-primary);
	outline-offset: 2px;
}

.wcb-btn:active { transform: scale(0.97); }

.wcb-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* Primary */
.wcb-btn--primary {
	background: var(--wcb-primary);
	color: var(--wcb-on-primary, #fff);
	border-color: var(--wcb-primary);
}

.wcb-btn--primary:hover {
	background: var(--wcb-primary-dark);
	border-color: var(--wcb-primary-dark);
	color: var(--wcb-on-primary, #fff);
}

/* Secondary */
.wcb-btn--secondary {
	background: var(--wcb-base);
	color: var(--wcb-contrast);
	border-color: var(--wcb-border);
}

.wcb-btn--secondary:hover {
	background: var(--wcb-bg-hover);
	color: var(--wcb-contrast);
}

/* Ghost */
.wcb-btn--ghost {
	background: transparent;
	color: var(--wcb-primary);
	border: none;
}

.wcb-btn--ghost:hover {
	background: var(--wcb-bg-hover);
}

/* Danger */
.wcb-btn--danger {
	background: var(--wcb-base);
	color: var(--wcb-danger);
	border-color: var(--wcb-danger);
}

.wcb-btn--danger:hover {
	background: var(--wcb-danger);
	color: var(--wcb-on-primary, #fff);
}

/* Sizes */
.wcb-btn--sm {
	height: 32px;
	min-height: 32px;
	font-size: var(--wcb-text-sm);
	padding: 0 var(--wcb-space-md);
}

.wcb-btn--lg {
	height: 48px;
	min-height: 48px;
	font-size: var(--wcb-text-md);
	padding: 0 var(--wcb-space-2xl);
}

.wcb-btn--full { width: 100%; }

/* Icon-only */
.wcb-btn--icon { width: 40px; padding: 0; }
.wcb-btn--icon.wcb-btn--sm { width: 32px; }
.wcb-btn--icon.wcb-btn--lg { width: 48px; }

/* Button with Lucide icon */
.wcb-btn [data-lucide] {
	width: var(--wcb-icon-sm);
	height: var(--wcb-icon-sm);
	flex-shrink: 0;
}

/* ── Form Fields ─────────────────────────────────────────────────────── */

.wcb-field {
	width: 100%;
	height: 44px;
	padding: var(--wcb-space-md) var(--wcb-space-lg);
	font-family: inherit;
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-normal);
	line-height: var(--wcb-leading-normal);
	color: var(--wcb-contrast);
	background: var(--wcb-base);
	border: 1.5px solid var(--wcb-border);
	border-radius: var(--wcb-radius-md);
	transition: border-color var(--wcb-transition-fast), box-shadow var(--wcb-transition-fast);
	appearance: none;
	-webkit-appearance: none;
}

.wcb-field:focus {
	outline: 2px solid transparent;
	border-color: var(--wcb-primary);
	box-shadow: var(--wcb-shadow-focus);
}

.wcb-field::placeholder {
	color: var(--wcb-text-tertiary);
}

.wcb-field:disabled {
	background: var(--wcb-bg-subtle);
	color: var(--wcb-text-tertiary);
	cursor: not-allowed;
}

textarea.wcb-field {
	height: auto;
	min-height: 100px;
	resize: vertical;
}

select.wcb-field {
	padding-right: 2.5rem;
	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='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right var(--wcb-space-md) center;
	background-size: 16px;
}

/* Error state */
.wcb-field--error {
	border-color: var(--wcb-danger);
}

.wcb-field--error:focus {
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Label */
.wcb-label {
	display: block;
	font-family: inherit;
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-medium);
	color: var(--wcb-contrast);
	margin-bottom: var(--wcb-space-xs);
}

/* Helper text */
.wcb-helper {
	font-size: var(--wcb-text-xs);
	color: var(--wcb-text-secondary);
	margin-top: var(--wcb-space-xs);
}

/* Error message */
.wcb-error-msg {
	font-size: var(--wcb-text-xs);
	color: var(--wcb-danger);
	margin-top: var(--wcb-space-xs);
}

/* ── Empty State ─────────────────────────────────────────────────────── */

.wcb-empty-state {
	text-align: center;
	padding: var(--wcb-space-4xl) var(--wcb-space-xl);
}

.wcb-empty-state__icon {
	display: block;
	width: var(--wcb-icon-2xl);
	height: var(--wcb-icon-2xl);
	color: var(--wcb-text-tertiary);
	margin: 0 auto var(--wcb-space-lg);
	stroke-width: 1.5;
}

.wcb-empty-state__title {
	font-family: inherit;
	font-size: var(--wcb-text-lg);
	font-weight: var(--wcb-font-semibold);
	color: var(--wcb-contrast);
	margin: 0 0 var(--wcb-space-sm);
}

.wcb-empty-state__desc {
	font-family: inherit;
	font-size: var(--wcb-text-base);
	color: var(--wcb-text-secondary);
	margin: 0 0 var(--wcb-space-xl);
	max-width: 360px;
	margin-inline: auto;
}

/* ── Grid Layouts ────────────────────────────────────────────────────── */

.wcb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: var(--wcb-space-xl);
}

.wcb-grid--compact {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	gap: var(--wcb-space-lg);
}

.wcb-grid--2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wcb-space-lg);
}

@media (max-width: 640px) {
	.wcb-grid { grid-template-columns: 1fr; }
	.wcb-grid--compact { grid-template-columns: 1fr; }
	.wcb-grid--2col { grid-template-columns: 1fr; }
}

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

.wcb-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--wcb-space-xs);
	padding: var(--wcb-space-xl) 0;
}

.wcb-pagination__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 var(--wcb-space-sm);
	font-family: inherit;
	font-size: var(--wcb-text-sm);
	font-weight: var(--wcb-font-medium);
	color: var(--wcb-text-secondary);
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--wcb-radius-md);
	cursor: pointer;
	text-decoration: none;
	transition: all var(--wcb-transition-fast);
}

.wcb-pagination__btn:hover {
	background: var(--wcb-bg-hover);
	color: var(--wcb-contrast);
	text-decoration: none;
}

.wcb-pagination__btn--active {
	background: var(--wcb-primary);
	color: var(--wcb-on-primary, #fff);
	border-color: var(--wcb-primary);
}

.wcb-pagination__btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ── Loading — Skeleton Shimmer ──────────────────────────────────────── */

.wcb-skeleton {
	background: linear-gradient(90deg, var(--wcb-bg-subtle) 25%, var(--wcb-bg-hover) 50%, var(--wcb-bg-subtle) 75%);
	background-size: 200% 100%;
	animation: wcb-shimmer 1.5s ease-in-out infinite;
	border-radius: var(--wcb-radius-sm);
}

@keyframes wcb-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ── Loading — Spinner ───────────────────────────────────────────────── */

.wcb-spin {
	animation: wcb-spin 1s linear infinite;
}

@keyframes wcb-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* ── Form Primitives — shared across blocks ──────────────────────────── */

/*
 * `.wcb-field-*` is the canonical form-primitive set. Every block that renders
 * a label + input pair (registration, dashboard profile, post-a-job, candidate
 * profile, etc.) uses these classes. Defining them globally — scoped under
 * the WCB block wrappers — means a page with only ONE block enqueued still
 * gets the full set, fixing the historical bug where the registration page
 * rendered raw browser-default inputs because only `employer-dashboard/style.css`
 * carried the rules.
 *
 * Block-specific layout overrides (e.g. dashboard wraps two field-groups in a
 * 2-col `.wcb-field-row` grid that should NOT apply on registration) live
 * inside that block's stylesheet, scoped under the block's root class.
 */

[class*="wp-block-wp-career-board"] .wcb-field-group,
[class*="wp-block-wcb-"] .wcb-field-group {
	display: flex;
	flex-direction: column;
	gap: var(--wcb-space-xs);
	margin-bottom: var(--wcb-space-xl);
}

[class*="wp-block-wp-career-board"] .wcb-field-row,
[class*="wp-block-wcb-"] .wcb-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wcb-space-lg);
}

@media (max-width: 600px) {

	[class*="wp-block-wp-career-board"] .wcb-field-row,
	[class*="wp-block-wcb-"] .wcb-field-row {
		grid-template-columns: 1fr;
	}
}

[class*="wp-block-wp-career-board"] .wcb-field-label,
[class*="wp-block-wcb-"] .wcb-field-label {
	display: block;
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-semibold);
	color: var(--wcb-contrast);
}

[class*="wp-block-wp-career-board"] .wcb-field-hint,
[class*="wp-block-wcb-"] .wcb-field-hint {
	font-weight: var(--wcb-font-normal);
	color: var(--wcb-text-tertiary);
	font-size: var(--wcb-text-sm);
	margin-inline-start: var(--wcb-space-xs);
}

[class*="wp-block-wp-career-board"] .wcb-field-input,
[class*="wp-block-wcb-"] .wcb-field-input {
	width: 100%;
	min-height: 44px;
	padding: var(--wcb-space-sm) var(--wcb-space-md);
	border: 1.5px solid var(--wcb-border);
	border-radius: var(--wcb-radius-md);
	font-size: var(--wcb-text-md);
	font-family: inherit;
	color: var(--wcb-contrast);
	background: var(--wcb-base);
	transition: border-color var(--wcb-transition-fast);
	box-sizing: border-box;
}

[class*="wp-block-wp-career-board"] .wcb-field-input:focus,
[class*="wp-block-wcb-"] .wcb-field-input:focus {
	outline: 2px solid transparent;
	border-color: var(--wcb-primary);
	box-shadow: var(--wcb-shadow-focus);
}

[class*="wp-block-wp-career-board"] .wcb-field-textarea,
[class*="wp-block-wcb-"] .wcb-field-textarea {
	resize: vertical;
	line-height: 1.6;
}

[class*="wp-block-wp-career-board"] .wcb-field-select,
[class*="wp-block-wcb-"] .wcb-field-select {
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right var(--wcb-space-md) center;
	appearance: none;
	padding-inline-end: 2.5rem;
}

[dir="rtl"] [class*="wp-block-wp-career-board"] .wcb-field-select,
[dir="rtl"] [class*="wp-block-wcb-"] .wcb-field-select {
	background-position: left var(--wcb-space-md) center;
}

/* ── Panel — shared dashboard / detail panel structure ──────────────── */

/*
 * Used by candidate-dashboard, employer-dashboard, job-single. Block-specific
 * panel TITLE styling (font sizes vary between dashboards and job-single)
 * stays in each block's own stylesheet — only the truly identical wrappers
 * are hoisted here.
 */

.wcb-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--wcb-space-lg) var(--wcb-space-xl);
	border-bottom: 1px solid var(--wcb-border);
}

.wcb-panel-body {
	padding: 2.5rem var(--wcb-space-3xl);
}

/* ── Account-settings rows — shared by candidate + employer dashboards ─
 *
 * Both dashboards use the same `wcb-settings-row` markup pattern (label
 * column + control column inside a `.wcb-panel`). Originally the rules
 * lived only in candidate-dashboard/styles/views.css, so the employer
 * dashboard's Settings tab rendered as plain stacked text. Hoisted to
 * frontend-components.css so the look stays consistent across every
 * future settings panel that opts into the same markup.
 *
 * Closes Basecamp 9862907821.
 */

.wcb-settings-row {
	display: grid;
	grid-template-columns: 160px 1fr;
	align-items: start;
	padding: var(--wcb-space-lg) var(--wcb-space-xl);
	border-bottom: 1px solid var(--wcb-border);
}

.wcb-settings-row:last-child {
	border-bottom: none;
}

.wcb-settings-row-label {
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-semibold);
	color: var(--wcb-text-primary);
	padding-top: 3px;
}

.wcb-settings-row-control {
	display: flex;
	align-items: center;
	gap: var(--wcb-space-md);
	font-size: var(--wcb-text-base);
	color: var(--wcb-text-secondary);
}

@media (max-width: 640px) {
	.wcb-settings-row {
		grid-template-columns: 1fr;
		gap: var(--wcb-space-sm);
	}
}

/* ── Checkbox label — shared custom-field primitive ─────────────────────
 *
 * Used by the shared FormCustomFields renderer's `checkbox` field type so a
 * custom checkbox renders consistently inside every form that embeds it
 * (job, company, resume, application). The job-form blocks also define this
 * locally for their built-in toggles; this shared copy is what makes the
 * custom-field checkbox styled in the other form contexts too.
 */
.wcb-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: var(--wcb-space-sm);
	cursor: pointer;
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-medium);
	color: var(--wcb-contrast, #0f172a);
	user-select: none;
}

.wcb-checkbox-label input[type="checkbox"] {
	width: var(--wcb-icon-md);
	height: var(--wcb-icon-md);
	cursor: pointer;
	flex-shrink: 0;
	accent-color: var(--wcb-primary, #2563eb);
	margin: 0;
}

/* ── Radio group — shared custom-field primitive ───────────────────────
 *
 * Used by the FormCustomFields renderer's `radio` field type. The group
 * stacks its options; each .wcb-radio-label is the same inline input+text
 * pattern as .wcb-checkbox-label so the two read consistently.
 */
.wcb-radio-group {
	display: flex;
	flex-direction: column;
	gap: var(--wcb-space-xs);
}

.wcb-radio-label {
	display: inline-flex;
	align-items: center;
	gap: var(--wcb-space-sm);
	cursor: pointer;
	font-size: var(--wcb-text-base);
	color: var(--wcb-contrast, #0f172a);
	user-select: none;
}

.wcb-radio-label input[type="radio"] {
	width: var(--wcb-icon-md);
	height: var(--wcb-icon-md);
	cursor: pointer;
	flex-shrink: 0;
	accent-color: var(--wcb-primary, #2563eb);
	margin: 0;
}

/* ── Multiselect group — shared custom-field primitive ─────────────────
 *
 * Used by the FormCustomFields renderer's `multiselect` field type. Stacks
 * its checkbox options; each option reuses .wcb-checkbox-label so the
 * single-checkbox and multiselect types read consistently.
 */
.wcb-multiselect-group {
	display: flex;
	flex-direction: column;
	gap: var(--wcb-space-xs);
}

/* ── Load More — shared across archive blocks ───────────────────────── */

/*
 * Layout primitive only - the button itself inherits the unified
 * .wcb-cbtn--ghost system from wcb-ui.css so the visual contract matches
 * the in-card View Job / View Profile / View Company CTAs. The wrap is
 * hidden via display:none until state.hasMore flips wcb-shown on.
 *
 * Used by job-listings, company-archive (and any future archive block).
 */

.wcb-load-more-wrap {
	display: none;
	justify-content: center;
	width: 100%;
	margin-top: var(--wcb-space-2xl);
}

.wcb-load-more-wrap.wcb-shown {
	display: flex;
}

/*
 * Label visibility - only one of the two spans is visible at a time.
 * Selector strength matches the [class*="wp-block-wp-career-board"] cascade
 * elsewhere so theme `.entry-content button > span` rules can't override.
 */
.wcb-load-more-btn .wcb-load-more-loading,
[class*="wp-block-wp-career-board"] .wcb-load-more-btn .wcb-load-more-loading {
	display: none;
}

.wcb-load-more-btn .wcb-load-more-loading.wcb-shown,
[class*="wp-block-wp-career-board"] .wcb-load-more-btn .wcb-load-more-loading.wcb-shown {
	display: inline;
}

/* ── Visibility Utilities — global ───────────────────────────────────── */

/*
 * `.wcb-hidden` is the canonical "hide via Interactivity API" toggle —
 * `data-wp-class--wcb-hidden="state.foo"` adds the class when state.foo
 * is truthy. Defined here once so every block doesn't redefine it.
 */
.wcb-hidden {
	display: none !important;
}

.wcb-shown {
	display: block;
}

/* ── Screen Reader Only ──────────────────────────────────────────────── */

.wcb-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── Listings Header / Search / Sort — shared archive primitives ──────── */

/*
 * Used by every WCB archive-style block: job-listings (Free), resume-archive
 * (Pro), company-archive. Originally lived only in `blocks/job-listings/
 * style.css`, which made the search input collapse to ~50 px on the
 * resume-archive page (the Pro block doesn't enqueue job-listings's CSS).
 * Hoisted here so any block carrying these classes renders correctly.
 */

[class*="wp-block-wp-career-board"] .wcb-listings-header,
[class*="wp-block-wcb-"] .wcb-listings-header {
	display: flex;
	flex-direction: column;
	gap: var(--wcb-space-md);
	margin-block-start: var(--wcb-space-2xl);
	margin-block-end: var(--wcb-space-2xl);
}

@media (max-width: 640px) {

	[class*="wp-block-wp-career-board"] .wcb-listings-header,
	[class*="wp-block-wcb-"] .wcb-listings-header {
		margin-block-start: var(--wcb-space-lg);
	}
}

[class*="wp-block-wp-career-board"] .wcb-search-sort-row,
[class*="wp-block-wcb-"] .wcb-search-sort-row {
	display: flex;
	align-items: center;
	gap: var(--wcb-space-md);
	flex-wrap: wrap;
	/* Breathing room before the toolbar / archive-layout so the search
	 * bar doesn't crash into the results count. Matches the spacing used
	 * by `.wcb-ca-search-row` on Companies. */
	margin-bottom: var(--wcb-space-2xl);
}

[class*="wp-block-wp-career-board"] .wcb-search-wrap,
[class*="wp-block-wcb-"] .wcb-search-wrap {
	position: relative;
	flex: 1 1 240px;
	min-width: 240px;
}

[class*="wp-block-wp-career-board"] .wcb-search-icon,
[class*="wp-block-wcb-"] .wcb-search-icon {
	position: absolute;
	inset-inline-start: var(--wcb-space-md);
	top: 50%;
	transform: translateY(-50%);
	z-index: 1;
	color: var(--wcb-text-tertiary, var(--wp--preset--color--wcb-muted));
	pointer-events: none;
	display: flex;
	align-items: center;
}

[class*="wp-block-wp-career-board"] .wcb-listings-search,
[class*="wp-block-wcb-"] .wcb-listings-search {
	width: 100%;
	min-height: 44px;
	padding: var(--wcb-space-sm) var(--wcb-space-md);
	padding-inline-start: 2.25rem;
	border: 1.5px solid var(--wcb-border);
	border-radius: var(--wcb-radius-md);
	font-size: var(--wcb-text-base);
	line-height: 1.5;
	color: var(--wcb-contrast);
	background: var(--wcb-base);
	font-family: inherit;
	transition: border-color var(--wcb-transition-fast);
	box-sizing: border-box;
}

[class*="wp-block-wp-career-board"] .wcb-listings-search:focus,
[class*="wp-block-wcb-"] .wcb-listings-search:focus {
	outline: 2px solid transparent;
	border-color: var(--wcb-primary);
	box-shadow: var(--wcb-shadow-focus);
}

[class*="wp-block-wp-career-board"] .wcb-sort-select,
[class*="wp-block-wcb-"] .wcb-sort-select {
	min-height: 44px;
	padding: var(--wcb-space-sm) var(--wcb-space-md);
	width: auto;
	max-width: 220px;
	border: 1.5px solid var(--wcb-border);
	border-radius: var(--wcb-radius-md);
	font-size: var(--wcb-text-base);
	color: var(--wcb-contrast);
	background: var(--wcb-base);
	cursor: pointer;
}

/* ── Canonical toolbar (results count + view switcher) ─────────────────
 * Shared across Find Jobs, Companies, Find Candidates so the count sits
 * inline-start and the view switcher sits inline-end, with identical
 * spacing on all three archives. */
[class*="wp-block-wp-career-board"] .wcb-listings-toolbar,
[class*="wp-block-wcb-"] .wcb-listings-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wcb-space-lg);
	margin-bottom: var(--wcb-space-xl);
	flex-wrap: wrap;
}

[class*="wp-block-wp-career-board"] .wcb-toolbar-start,
[class*="wp-block-wcb-"] .wcb-toolbar-start {
	display: flex;
	align-items: center;
	gap: var(--wcb-space-md);
	flex-wrap: wrap;
}

[class*="wp-block-wp-career-board"] .wcb-results-count,
[class*="wp-block-wcb-"] .wcb-results-count {
	font-size: var(--wcb-text-sm);
	color: var(--wcb-text-secondary, var(--wp--preset--color--wcb-muted));
	font-weight: var(--wcb-font-medium);
	margin: 0;
	flex: 0 0 auto;
}

[class*="wp-block-wp-career-board"] .wcb-view-switcher,
[class*="wp-block-wcb-"] .wcb-view-switcher {
	display: inline-flex;
	gap: 2px;
	background: var(--wcb-surface, var(--wp--preset--color--wcb-surface));
	border-radius: var(--wcb-radius-sm);
	padding: 2px;
	flex-shrink: 0;
}

[class*="wp-block-wp-career-board"] .wcb-view-switcher .wcb-layout-btn,
[class*="wp-block-wcb-"] .wcb-view-switcher .wcb-layout-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wcb-space-3xl);
	height: 30px;
	padding: 0;
	border: none;
	background: transparent;
	border-radius: var(--wcb-space-xs);
	color: var(--wcb-text-secondary);
	cursor: pointer;
	transition: background var(--wcb-transition-fast), color var(--wcb-transition-fast);
}

[class*="wp-block-wp-career-board"] .wcb-view-switcher .wcb-layout-btn svg,
[class*="wp-block-wcb-"] .wcb-view-switcher .wcb-layout-btn svg {
	display: block;
	visibility: visible;
	width: var(--wcb-space-lg);
	height: var(--wcb-space-lg);
	flex-shrink: 0;
}

[class*="wp-block-wp-career-board"] .wcb-view-switcher .wcb-layout-btn:hover,
[class*="wp-block-wcb-"] .wcb-view-switcher .wcb-layout-btn:hover {
	background: var(--wcb-border);
	color: var(--wcb-contrast);
}

[class*="wp-block-wp-career-board"] .wcb-view-switcher .wcb-layout-btn.wcb-active,
[class*="wp-block-wcb-"] .wcb-view-switcher .wcb-layout-btn.wcb-active {
	background: var(--wcb-base);
	color: var(--wcb-primary);
	box-shadow: var(--wcb-shadow-sm);
}

/* ── Canonical hero bookmark / save button ─────────────────────────────
 * Shared across the 3 single pages (Find Jobs, Companies, Find
 * Candidates) so a customer's Save affordance is the same shape in the
 * same spot on every single-page hero. */
[class*="wp-block-wp-career-board"] .wcb-bookmark-hero-btn,
[class*="wp-block-wcb-"] .wcb-bookmark-hero-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--wcb-space-xs);
	padding: var(--wcb-space-sm) var(--wcb-space-lg);
	border: 1.5px solid var(--wcb-border, #e2e8f0);
	border-radius: var(--wcb-radius-md);
	background: var(--wcb-base, #fff);
	color: var(--wcb-text-secondary);
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-medium);
	font-family: inherit;
	cursor: pointer;
	transition: border-color var(--wcb-transition-snappy), color var(--wcb-transition-snappy), background var(--wcb-transition-snappy);
	white-space: nowrap;
}

[class*="wp-block-wp-career-board"] .wcb-bookmark-hero-btn:hover,
[class*="wp-block-wcb-"] .wcb-bookmark-hero-btn:hover {
	border-color: var(--wcb-primary, #2563eb);
	color: var(--wcb-primary, #2563eb);
	background: var(--wcb-info-bg-soft);
}

[class*="wp-block-wp-career-board"] .wcb-bookmark-hero-btn.wcb-bookmarked,
[class*="wp-block-wcb-"] .wcb-bookmark-hero-btn.wcb-bookmarked {
	border-color: var(--wcb-primary, #2563eb);
	color: var(--wcb-primary, #2563eb);
	background: var(--wcb-bg-subtle);
}

[class*="wp-block-wp-career-board"] .wcb-bookmark-hero-btn:disabled,
[class*="wp-block-wcb-"] .wcb-bookmark-hero-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

[class*="wp-block-wp-career-board"] .wcb-bookmark-hero-btn svg,
[class*="wp-block-wcb-"] .wcb-bookmark-hero-btn svg {
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
}

/* ── Canonical Container — `.wcb-archive-shell` only ──────────────────── */

/*
 * The canonical max-width lives on `.wcb-archive-shell` (defined below) —
 * the wrapper produced by `templates/archive-wcb_*.php` and
 * `templates/page-wcb-fullwidth.php`. Blocks themselves carry NO width or
 * margin opinion at this layer — when a block is dropped into a sidebar
 * widget area, a Gutenberg group, an Elementor section, or any other
 * customer-built layout, it inherits whatever container it lives in.
 *
 * Width is therefore set in exactly one place per page (the body-level
 * shell) instead of being repeated on every block selector — which is what
 * the user explicitly asked for: "nothing related to block widget as that
 * should use whatever body have".
 */

/* ── Archive Shell — full-width container for plugin archive templates ─── */

/*
 * Shipped via templates/archive-wcb_company.php and archive-wcb_job.php so
 * the Companies / Jobs grids render at full content width regardless of
 * which theme is active. The shell sits inside `get_header()`/`get_footer()`
 * so the theme's brand chrome is preserved, but the content column is
 * unconstrained by theme archive sidebar layouts.
 */

/*
 * `!important` on max-width / margin is intentional — Astra and several
 * other themes ship `#primary { max-width: 100% }` at higher specificity
 * (1,0,0) than a single class selector (0,1,0) and the template emits
 * `id="primary"` so the shell can integrate with theme conventions. We
 * still want the canonical 1280 px container to win deterministically,
 * so we override at the property level rather than chasing IDs.
 */
.wcb-archive-shell {
	width: 100%;
	max-width: var(--wcb-container-max-width, 1280px) !important;
	margin: 0 auto !important;
	padding: var(--wcb-space-2xl) var(--wcb-space-lg);
	box-sizing: border-box;
}

.wcb-archive-main {
	width: 100%;
}

@media (max-width: 768px) {

	.wcb-archive-shell {
		padding: var(--wcb-space-xl) var(--wcb-space-md);
	}
}

/* ── Theme-Button Defence — Global ────────────────────────────────────── */

/*
 * "Starter" themes like Hello Elementor (used as a base for Elementor-built
 * sites) ship default `button { border: 1px solid; color: var(--ele-pink) }`
 * styling that leaks onto our role="tab" buttons, sidebar nav items, and
 * card "View all" buttons — every interactive element gets a magenta border
 * and pink text. Same issue on bare-Genesis-child themes. This rule strips
 * the theme defaults from buttons that are clearly nav-style (no .wcb-btn
 * class — those have their own deliberate borders).
 */

[class*="wp-block-wp-career-board"] button[role="tab"],
[class*="wp-block-wp-career-board"] .wcb-nav-item,
[class*="wp-block-wp-career-board"] .wcb-tab,
[class*="wp-block-wp-career-board"] .wcb-panel-link,
[class*="wp-block-wp-career-board"] .wcb-card-link,
[class*="wp-block-wcb-"] button[role="tab"],
[class*="wp-block-wcb-"] .wcb-nav-item,
[class*="wp-block-wcb-"] .wcb-tab,
[class*="wp-block-wcb-"] .wcb-panel-link,
[class*="wp-block-wcb-"] .wcb-card-link {
	border: none;
	background: transparent;
	color: inherit;
	font: inherit;
}

[class*="wp-block-wp-career-board"] .wcb-card-action,
[class*="wp-block-wp-career-board"] .wcb-link,
[class*="wp-block-wcb-"] .wcb-card-action,
[class*="wp-block-wcb-"] .wcb-link {
	border: none;
	background: transparent;
	color: var(--wcb-primary);
}

/* ── Theme-Link Defence — Global ─────────────────────────────────────── */

/*
 * Many WordPress themes ship `entry-content a { text-decoration: underline }`
 * at higher specificity than a single class selector, which makes nav-style
 * links inside our blocks (card titles, sidebar tabs, role-picker cards,
 * dashboard menu items) render with theme-default underlines and theme-default
 * blue. The component-specific stylesheets each set `text-decoration: none`
 * on these elements but a single-class selector loses the cascade against
 * `entry-content a`. Here we win by raising specificity via the block-wrapper
 * scope — same trick used for the WPDS button isolation reset above.
 *
 * Tested against: Reign, BuddyX, BuddyX Pro, Astra, Twenty Twenty-Four, GeneratePress.
 */

/*
 * `!important` on text-decoration is intentional — Storefront, Astra,
 * Twenty Twenty-Four, and several other themes ship rules at equal or
 * higher specificity (`.entry-content a`, `.site-main a:not(.button)`,
 * `body .content-area a`) that load AFTER our component sheet and win
 * the cascade by source order. This is the same pattern we use on
 * `.wcb-cp-job-title a` for the same reason.
 */

[class*="wp-block-wp-career-board"] .wcb-job-card a,
[class*="wp-block-wp-career-board"] .wcb-cp-job-title a,
[class*="wp-block-wp-career-board"] .wcb-card-title a,
[class*="wp-block-wp-career-board"] .wcb-listing-title a,
[class*="wp-block-wp-career-board"] [role="tab"],
[class*="wp-block-wp-career-board"] .wcb-role-card,
[class*="wp-block-wp-career-board"] .wcb-sidebar a,
[class*="wp-block-wp-career-board"] .wcb-nav-item,
[class*="wp-block-wcb-"] .wcb-job-card a,
[class*="wp-block-wcb-"] .wcb-cp-job-title a,
[class*="wp-block-wcb-"] .wcb-card-title a,
[class*="wp-block-wcb-"] .wcb-listing-title a,
[class*="wp-block-wcb-"] [role="tab"],
[class*="wp-block-wcb-"] .wcb-role-card,
[class*="wp-block-wcb-"] .wcb-sidebar a,
[class*="wp-block-wcb-"] .wcb-nav-item {
	text-decoration: none !important;
	box-shadow: none;
}

[class*="wp-block-wp-career-board"] .wcb-job-card a:hover,
[class*="wp-block-wp-career-board"] .wcb-cp-job-title a:hover,
[class*="wp-block-wp-career-board"] .wcb-card-title a:hover,
[class*="wp-block-wp-career-board"] .wcb-listing-title a:hover,
[class*="wp-block-wcb-"] .wcb-job-card a:hover,
[class*="wp-block-wcb-"] .wcb-cp-job-title a:hover,
[class*="wp-block-wcb-"] .wcb-card-title a:hover,
[class*="wp-block-wcb-"] .wcb-listing-title a:hover {
	text-decoration: underline;
}

/* ── Focus Visible — Global ──────────────────────────────────────────── */

[class*="wp-block-wp-career-board"] a:focus-visible,
[class*="wp-block-wp-career-board"] button:focus-visible,
[class*="wp-block-wp-career-board"] [role="button"]:focus-visible,
[class*="wp-block-wp-career-board"] input:focus-visible,
[class*="wp-block-wp-career-board"] select:focus-visible,
[class*="wp-block-wp-career-board"] textarea:focus-visible {
	outline: 2px solid var(--wcb-primary);
	outline-offset: 2px;
}

/* ── Reduced Motion — Global ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {

	.wcb-skeleton { animation: none; }
	.wcb-spin { animation: none; }

	[class*="wp-block-wp-career-board"] *,
	[class*="wp-block-wp-career-board"] *::before,
	[class*="wp-block-wp-career-board"] *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
