/* Job board — WWR-style card and filter layout. Loads after WPJM's frontend.css. */

.wwr-job-card {
	list-style: none;
	position: relative;
}

.wwr-job-card__inner {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 1em;
}

/*
 * Hover/featured backgrounds moved from the link (where WPJM's frontend.css puts them) to the whole
 * card, since the link is now just the title (see content-job_listing.php).
 */
.wwr-job-card:hover,
.wwr-job-card:focus-within {
	background-color: #fcfcfc;
}

.wwr-job-card.job_position_featured {
	background-color: #fefee5;
}

.wwr-job-card.job_position_featured:hover,
.wwr-job-card.job_position_featured:focus-within {
	background-color: #fefed8;
}

/*
 * Undo WPJM's frontend.css card-link styles (ul.job_listings li.job_listing a: display:block,
 * 1em/2em padding, position:relative, overflow:hidden), which now match the title and skill links
 * inside the card. Same selector specificity, and this stylesheet loads after frontend.css. The
 * background needs !important: WPJM's featured-job rule adds a class and still outranks this.
 */
ul.job_listings li.wwr-job-card a {
	display: inline;
	padding: 0;
	position: static;
	overflow: visible;
	line-height: inherit;
	background: none !important;
}

.wwr-job-card__link {
	color: inherit;
	text-decoration: none;
}

/* Stretches the title link over the whole card, so clicking anywhere on it opens the job. */
.wwr-job-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

/*
 * !important needed here, including on width/height: WPJM's frontend.css has a more specific
 * selector (ul.job_listings li.job_listing a img.company_logo — more type selectors, same class
 * count) that still matches this markup, since the <li> keeps the stock "job_listing" post class
 * alongside the new "wwr-job-card" one, and its 42px width/height otherwise wins the cascade.
 */
.wwr-job-card__logo img.company_logo {
	position: static !important;
	float: none !important;
	left: auto !important;
	margin: 0 !important;
	width: 96px !important;
	height: 96px !important;
	object-fit: contain;
}

/*
 * Single job page company box: WPJM's frontend.css absolutely positions the 3em (~48px) logo and
 * clears it with matching margin-left/padding-left on .name/.tagline. Bumping the logo to 96px
 * (to match the /jobs archive) breaks that pixel-matched clearance, so instead of patching the
 * offsets we replace the whole scheme with flexbox — the same pattern used for .wwr-job-card__link
 * above. No theme template override exists for this page, so this targets the plugin's own markup.
 */
.single_job_listing .company {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

.single_job_listing .company img.company_logo {
	position: static !important;
	float: none !important;
	left: auto !important;
	width: 96px !important;
	height: 96px !important;
	object-fit: contain;
	flex: 0 0 auto;
}

/*
 * margin:0 overrides WPJM's frontend.css `.company_header{margin:0 0 1em}`: that bottom-only
 * margin is part of the flex item's outer box for align-items:center purposes, so it skewed the
 * header (and the name text inside it) above the logo's true vertical center. The .company gap
 * already provides spacing before .company_video, so the margin is redundant here anyway.
 */
.single_job_listing .company .company_header {
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.single_job_listing .company .name,
.single_job_listing .company .tagline {
	margin-left: 0 !important;
	padding-left: 0 !important;
}

/*
 * WPJM's frontend.css sets the company name at the body's base font size (17px here).
 * Bumped up so it reads as the company identity next to the logo, not body copy.
 */
.single_job_listing .company .name {
	font-size: 1.3em;
}

.single_job_listing .company .company_video {
	flex: 1 1 100%;
}

.wwr-job-card__body {
	flex: 1;
	min-width: 0;
}

.wwr-job-card__title {
	margin: 0 0 4px;
}

.wwr-job-card__subline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	color: #666;
	font-size: 0.9em;
}

.wwr-job-card__subline > * + *::before {
	content: "\00B7";
	margin-right: 6px;
	color: #999;
}

.wwr-job-card__company {
	font-weight: 600;
	color: inherit;
}

/* Links to the location's landing page; z-index lifts it above the card's title-link overlay. */
ul.job_listings li.wwr-job-card .wwr-job-card__location a {
	position: relative;
	z-index: 1;
	color: inherit;
}

.wwr-job-card__company:empty,
.wwr-job-card__location:empty {
	display: none;
}

/* ul. prefix: outranks Kadence's `.single-content ul { padding-left: 2em }` on the [jobs] page. */
ul.wwr-job-card__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.wwr-job-card__chip {
	border-radius: 999px;
	background: #eef1f5;
	color: #333;
	font-size: 0.8em;
	line-height: 1.6;
}

/* Skill chips link to the skill's landing page; z-index lifts them above the card's title-link overlay. */
.wwr-job-card__chip a,
ul.job_listings li.wwr-job-card .wwr-job-card__chip a {
	display: block;
	position: relative;
	z-index: 1;
	padding: 3px 10px;
	border-radius: inherit;
	color: inherit;
	text-decoration: none;
}

/* !important: beats the card links' `background: none !important` reset above. */
.wwr-job-card__chip a:hover,
.wwr-job-card__chip a:focus {
	background: #dde3ea !important;
}

/*
 * WWR-style search bar: a single white pill/bar (keywords | location | button) instead of
 * WPJM's boxed grey filter panel. frontend.css's .job_filters{background:#eee} and
 * .search_jobs{padding:1em} are overridden below at equal specificity, which is enough since
 * this stylesheet loads after frontend.css in the cascade (no !important needed there).
 */
.wwr-job-filters {
	max-width: 700px;
	margin: 0 auto;
	background: none;
}

.wwr-job-filters .search_jobs {
	padding: 0;
}

.wwr-job-filters__row {
	display: flex !important;
	flex-wrap: wrap;
	align-items: stretch;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.08 );
	overflow: hidden;
}

/*
 * !important on float/width/padding: WPJM's frontend.css targets these same wrapper divs
 * (.job_filters .search_jobs div.search_keywords / div.search_location) with float+percentage
 * widths at higher selector specificity than a single class here can reach.
 */
.wwr-job-filters__field {
	float: none !important;
	width: auto !important;
	padding: 12px 18px !important;
	display: flex;
	align-items: center;
	gap: 10px;
}

.wwr-job-filters__icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: #999;
}

.wwr-job-filters__field--keywords {
	flex: 1 1 auto;
	min-width: 160px;
}

.wwr-job-filters__field--location {
	flex: 0 1 220px;
	min-width: 140px;
	border-left: 1px solid #e2e2e2;
}

.wwr-job-filters__field input[type="text"] {
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	padding: 0;
	font-size: 15px;
}

/*
 * Kadence's global.min.css gives every focused text input a drop shadow and border colour, which
 * shows up as an odd box around these borderless inputs. Strip it, and show focus on the whole
 * field instead so keyboard users can still see where they are.
 */
.wwr-job-filters__field input[type="text"]:focus {
	background: transparent;
	border: none;
	outline: none;
	box-shadow: none;
}

.wwr-job-filters__field:focus-within {
	background: #f7f8fa;
}

.wwr-job-filters__submit {
	padding: 0 !important;
	flex: 0 0 auto;
}

/*
 * Colors intentionally omitted here: input[type="submit"] already matches Kadence's global
 * button selector (button, .button, input[type=submit], etc. in global.min.css), which sets
 * background/color/hover from the site's Buttons colors (Appearance > Customize > Buttons,
 * defaulting to the Global Palette's Accent color) — so this button follows that setting
 * automatically instead of hardcoding a color that would drift from the rest of the site.
 */
.wwr-job-filters__submit input[type="submit"] {
	height: 100%;
	min-height: 48px;
	border: none;
	font-weight: 600;
	padding: 0 28px;
	cursor: pointer;
}

/*
 * The "Showing X of Y jobs / RSS / Reset" strip WPJM appends after the filter row — restyled to
 * sit quietly under the new pill bar instead of its default grey box.
 */
.wwr-job-filters .showing_jobs {
	background: none !important;
	border-top: none !important;
	padding: 8px 4px !important;
	font-size: 0.8em;
	color: #888;
}

@media ( max-width: 600px ) {
	.wwr-job-filters__row {
		flex-direction: column;
		border-radius: 12px;
	}

	/*
	 * In a column the flex-basis applies to height, so the desktop basis (220px on location)
	 * would make that field 220px tall. Let each field size to its content instead.
	 */
	.wwr-job-filters__field {
		flex: 0 0 auto;
		min-width: 0;
	}

	.wwr-job-filters__field--location {
		border-left: none;
		border-top: 1px solid #e2e2e2;
	}

	.wwr-job-filters__submit input[type="submit"] {
		width: 100%;
		padding: 14px;
	}
}

.wwr-lang-switcher {
	font-size: 0.85em;
	white-space: nowrap;
}

.wwr-lang-switcher__inner {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.wwr-lang-switcher a {
	display: inline;
	width: auto;
	opacity: 0.6;
}

.wwr-lang-switcher a.wwr-lang-switcher__active {
	opacity: 1;
	font-weight: 700;
	text-decoration: none;
}

/* 404 page: centers the message and the link home. */
.kadence-not-found .entry-content-wrap {
	text-align: center;
}
