/*
 * Postcode Hub page (/{state}/{postcode}/, JFFORUM_Postcode_Hub) - the
 * search box, recent searches, saved jobs, and grid/list job browser
 * sections added above the page's original suburb/forum list. Ported from
 * the retired standalone Find Jobs page (then Local Connect); class names
 * keep their original jffj- prefix since they don't depend on any
 * particular page wrapper class.
 */

/* Full-bleed dark search band, matching the homepage's .jfh-search - this
   section sits nested inside .container/.wpjm-container on the Hub/Search
   Jobs pages, so it needs the standard breakout trick to reach full
   viewport width instead of just the container's. */
.jffj-search {
	position: relative;
	left: 50%;
	width: 100vw;
	margin-left: -50vw;
	padding: 64px 20px 40px;
	background: #032a7f;
}

@media only screen and (min-width: 768px) and (max-width: 990px) {
	.jffj-search .container {
		width: 100%;
		padding: 0;
	}
}

.jffj-search__title {
	margin: 0 0 10px;
	color: #fff;
	font-size: clamp(30px, 4vw, 44px);
	font-weight: 700;
	line-height: 1.1;
	font-family: var(--jfpub-font);
}

.jffj-search__subtitle {
	margin: 0 0 24px;
	color: #cfe0f7;
	font-size: 15px;
}

/* Breadcrumb now sits below the dark search band, in the page's normal flow
   (was previously above it, inside a now-removed page-title header). */
.jffj-breadcrumb-row {
	display: block;
	margin: 18px 0 4px;
	font-size: 16px;
}

.jffj-breadcrumb-row__clear {
	margin-left: 12px;
	font-size: 13px;
	color: #b3261e;
	text-decoration: underline;
}

/* Recent Searches + Saved Jobs share one row so the page doesn't stack two
   nearly-empty sections on top of each other. */
.jffj-history-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	padding: 16px 0;
}

.jffj-history-row .jffj-history {
	padding: 0;
	flex: 1 1 auto;
	min-width: 0;
}

.jffj-history-row .jffj-saved-summary {
	padding: 0;
	flex: 0 0 auto;
}

.jffj-section__title {
	margin: 0 0 14px;
	font-size: 28px;
	font-weight: 700;
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
}

/* ---------- Recent searches ---------- */

.jffj-history {
	padding: 20px 0;
}

.jffj-history__row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.jffj-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px 6px 14px;
	background: var(--jfpub-surface-blue);
	border-radius: 999px;
	font-size: 13px;
}

.jffj-chip__label {
	color: var(--jfpub-navy);
	text-decoration: none;
	font-weight: 500;
	font-size: 17px;
}

.jffj-chip__label:hover {
	text-decoration: underline;
}

.jffj-chip__delete {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	padding: 0;
	background: rgba(11, 38, 104, .08);
	border: 0;
	border-radius: 50%;
	color: var(--jfpub-navy);
	font-size: 11px;
	cursor: pointer;
}

.jffj-chip__delete:hover {
	background: rgba(11, 38, 104, .18);
}

.jffj-history__toggle {
	margin-top: 12px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--jfpub-blue);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
}

.jffj-history__toggle:hover {
	text-decoration: underline;
}

/* ---------- Saved jobs (count + link, not an embedded list - the full
   list lives on the My Bookmarks page, this just points there) ---------- */

.jffj-saved-summary {
	padding: 4px 0 20px;
}

.jffj-saved-summary__link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	background: var(--jfpub-surface-blue);
	border-radius: 999px;
	font-size: 16px;
	font-weight: 600;
	color: var(--jfpub-navy);
	text-decoration: none;
	transition: background-color .15s var(--jfpub-ease);
}

.jffj-saved-summary__link:hover {
	background: #e4edfb;
}

.jffj-saved-summary__link i {
	color: var(--jfpub-blue);
}

.jffj-saved-summary__cta {
	color: var(--jfpub-blue);
	font-weight: 700;
}

/* ---------- Job browser: grid/list toggle + pagination ---------- */

.jffj-results {
	padding: 12px 0 40px;
}

.jffj-results__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.jffj-viewtoggle {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	background: #f1f4f8;
	border-radius: 10px;
}

.jffj-viewtoggle button {
	padding: 6px 14px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--jfpub-muted);
	font-family: var(--jfpub-font);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.jffj-viewtoggle button.jffj-viewtoggle__active {
	background: #fff;
	color: var(--jfpub-navy);
	box-shadow: 0 1px 4px rgba(11, 38, 104, .12);
}

/* Sidebar + results two-column layout (search-jobs.php / postcode-hub.php) */
.jffj-layout {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 28px;
	align-items: start;
}

.jffj-sidebar-groups {
	position: sticky;
	top: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.jffj-category-sidebar {
	padding: 18px;
	background: #fff;
	border: 1px solid rgba(11, 38, 104, .1);
	border-radius: 10px;
}

.jffj-category-sidebar__title {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 700;
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
}

.jffj-category-sidebar__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 600px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(11, 38, 104, .25) transparent;
}

.jffj-category-sidebar__list::-webkit-scrollbar {
	width: 6px;
}

.jffj-category-sidebar__list::-webkit-scrollbar-track {
	background: transparent;
}

.jffj-category-sidebar__list::-webkit-scrollbar-thumb {
	background-color: rgba(11, 38, 104, .25);
	border-radius: 999px;
}

.jffj-category-sidebar__list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 8px;
	border-radius: 6px;
	color: var(--jfpub-muted);
	font-size: 14px;
	text-decoration: none;
}

.jffj-category-sidebar__list a:hover {
	background: var(--jfpub-surface-blue);
	color: var(--jfpub-navy);
}

.jffj-category-sidebar__item--active a {
	background: var(--jfpub-surface-blue);
	color: var(--jfpub-blue);
	font-weight: 700;
}

.jffj-category-sidebar__count {
	font-size: 12px;
	color: var(--jfpub-muted);
	font-variant-numeric: tabular-nums;
}

.jffj-category-sidebar__toggle {
	margin-top: 8px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--jfpub-navy);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
}

/* !important beats the parent theme's own generic `button:hover { background-color:
   #282828; color: #fff }` rule (style.css), which otherwise paints every
   plain <button> on the page dark on hover, including this one. */
.jffj-category-sidebar__toggle:hover {
	background: none !important;
	color: var(--jfpub-navy) !important;
	text-decoration: underline;
}

/* Grid view: 4 columns (50/page, enforced server-side via posts_per_page) */
.jffj-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.jffj-card,
.jffj-row {
	position: relative;
	text-decoration: none;
	background: #fff;
	border: 1px solid rgba(11, 38, 104, .1);
	border-radius: 10px;
	transition: border-color .15s var(--jfpub-ease), box-shadow .15s var(--jfpub-ease), transform .15s var(--jfpub-ease);
}

.jffj-card:hover,
.jffj-row:hover {
	border-color: var(--jfpub-blue);
	box-shadow: 0 8px 20px rgba(11, 38, 104, .1);
}

/* Featured/urgent are real signals, not decoration: featured mirrors WPJM's
   own is_position_featured() flag; urgent means "posted in the last 48h" -
   there is no employer-set urgency field anywhere in this codebase. */
.jffj-card--featured,
.jffj-row--featured {
	background: #fff2e4;
	border-color: #f3cfa0;
}

.jffj-card--urgent,
.jffj-row--urgent {
	background: #fffbe0;
	border-color: #f3e5a0;
}

/* Corner ribbon, floating above everything else in the card/row rather than
   inline with the title - overlaps the top border on purpose (except
   Featured, which gets the extra padding above and sits fully inside). */
.jffj-card__flag,
.jffj-row__flag {
	position: absolute;
	top: -10px;
	left: 16px;
	z-index: 1;
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	box-shadow: 0 2px 6px rgba(11, 38, 104, .18);
}

.jffj-card--featured .jffj-card__flag,
.jffj-row--featured .jffj-row__flag,
.jffj-card--urgent .jffj-card__flag,
.jffj-row--urgent .jffj-row__flag {
	top: 14px;
}

.jffj-card__flag--featured,
.jffj-row__flag--featured {
	background: #f2994a;
	color: #fff;
}

.jffj-card__flag--urgent,
.jffj-row__flag--urgent {
	background: #d9a400;
	color: #fff;
}

.jffj-card__logo,
.jffj-row__logo {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	overflow: hidden;
	border-radius: 8px;
	background: var(--jfpub-surface-blue);
}

.jffj-card__logo img,
.jffj-row__logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.jffj-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	text-align: left;
}

.jffj-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.jffj-card__side {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.jffj-card__title {
	font-size: 19px;
	font-weight: 700;
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
	line-height: 1.35;
}

.jffj-card__meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
}

.jffj-card__company {
	font-size: 14px;
	color: var(--jfpub-muted);
}

.jffj-card__location {
	font-size: 14px;
	color: var(--jfpub-muted);
}

.jffj-card__location i {
	color: var(--jfpub-blue);
}

.jffj-card__salary {
	font-size: 14px;
	font-weight: 700;
	color: var(--jfpub-navy);
}

.jffj-card__salary i {
	color: #1c9a5b;
}

/* !important beats the parent theme's own inline per-term
   `span.{slug} { background-color: #xxx }` rule (wp-job-manager-colors-types.php),
   which sets a dark background with no matching text color and made this
   badge unreadable dark-text-on-dark-bg - same recurring specificity pattern
   documented elsewhere in this project, fixed the same honest way: win on
   purpose instead of hoping for source-order luck. */
.jffj-card__type,
.jffj-row__type {
	align-self: flex-end;
	padding: 3px 10px;
	border: 1px solid #fff;
	border-radius: 999px;
	background: var(--jfpub-surface-blue) !important;
	color: var(--jfpub-blue) !important;
	font-size: 14px;
	font-weight: 700;
}

/* List view: stacked rows, up to 15/page */
.jffj-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.jffj-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 18px;
}

/* Featured rows/cards get extra top room so the ribbon sits fully inside
   the card instead of just overlapping the border like the urgent/default
   ribbon does. Declared after the base .jffj-card/.jffj-row padding rules
   above so it isn't reset back to their shorthand `padding`. */
.jffj-row--featured,
.jffj-card--featured,
.jffj-row--urgent,
.jffj-card--urgent {
	padding-top: 55px;
}

.jffj-row__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.jffj-row__side {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	text-align: right;
}

.jffj-row__title {
	font-size: 19px;
	font-weight: 700;
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
}

.jffj-row__meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
}

.jffj-row__company,
.jffj-row__location {
	font-size: 15px;
	color: var(--jfpub-muted);
}

.jffj-row__location i {
	color: var(--jfpub-blue);
}

.jffj-row__salary {
	font-size: 14px;
	font-weight: 700;
	color: var(--jfpub-navy);
}

.jffj-row__salary i {
	color: #1c9a5b;
}

.jffj-list__empty {
	padding: 24px;
	color: var(--jfpub-muted);
	text-align: center;
}

.jffj-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 24px;
}

.jffj-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid rgba(11, 38, 104, .12);
	color: var(--jfpub-navy);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.jffj-pagination .page-numbers.current {
	background: var(--jfpub-blue);
	border-color: var(--jfpub-blue);
	color: #fff;
}

.jffj-pagination .page-numbers:not(.current):hover {
	background: var(--jfpub-surface-blue);
}

/* ---------- Back button, single job listing page only (initBackButton() in postcode-hub-jobs.js) ---------- */

#titlebar .jffj-job-back {
	position: absolute;
	left: 0;
	top: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 38px;
	background: #07b1e5;
	border-radius: 10px;
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	text-decoration: none;
	margin-bottom: 20px;
}

#titlebar .jffj-job-back:hover {
	background: #0596c4;
	color: #fff;
}

/* ---------- "More jobs in {suburb}" on the single job listing page ---------- */

.jffj-related-jobs {
	margin: 24px 0;
	padding: 20px;
	background: #fff;
	border: 1px solid rgba(11, 38, 104, .1);
	border-radius: 10px;
}

.jffj-related-jobs h4 {
	margin: 0 0 14px;
	font-size: 20px;
	font-weight: 700;
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
}

.jffj-related-jobs .jffj-list {
	margin-bottom: 14px;
}

.jffj-related-jobs__link {
	display: inline-block;
	color: var(--jfpub-blue);
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
}

.jffj-related-jobs__link:hover {
	text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
	.jffj-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 900px) {
	.jffj-layout {
		display: flex;
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.jffj-sidebar-groups {
		position: static;
	}
}

@media (max-width: 767px) {
	.jffj-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.jffj-results__header {
		flex-direction: column;
		align-items: flex-start;
	}

	.jffj-row {
		flex-wrap: wrap;
	}

	.jffj-row__side {
		align-items: flex-start;
		text-align: left;
	}
}

@media (max-width: 480px) {
	.jffj-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Ported from the retired Local Connect page: breadcrumb
   suburb chips (informational only, no per-item link) ---------- */

.jflocal-connect__breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; padding: 18px 20px; border-radius: 16px; background: #fff; box-shadow: 0 12px 30px -22px rgba(15,23,42,.24); }
.jflocal-connect__crumb { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #f1f4f8; color: #4b5563; font-size: 13px; font-weight: 600; white-space: nowrap; }
.jflocal-connect__crumb--label { background: none; padding: 6px 4px 6px 0; color: #667085; font-weight: 700; }

/* ---------- "Explore more in this area" satellite-card row - the hub's
   extensibility point: everything that isn't the core search+results loop
   (Businesses, Community, and any future addition) is an outward link
   card here, never an embedded data section. Adding a new one is one more
   get_template_part('template-parts/hub-satellite-card', ...) call. ---------- */

.jfh-hub-satellites {
	margin: 32px 0 8px;
}

.jfh-hub-satellites__title {
	margin-bottom: 14px;
}

.jfh-hub-satellites__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px;
}

.jfh-satellite-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid rgba(11, 38, 104, .1);
	border-radius: 14px;
	text-decoration: none;
	transition: border-color .15s var(--jfpub-ease), box-shadow .15s var(--jfpub-ease), transform .15s var(--jfpub-ease);
}

.jfh-satellite-card:hover {
	border-color: var(--jfpub-blue);
	box-shadow: 0 8px 20px rgba(11, 38, 104, .1);
	transform: translateY(-2px);
}

.jfh-satellite-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex: 0 0 auto;
	border-radius: 10px;
	background: var(--jfpub-surface-blue);
	color: var(--jfpub-blue);
	font-size: 16px;
}

.jfh-satellite-card__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

.jfh-satellite-card__title {
	font-size: 20px;
	font-weight: 700;
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
}

.jfh-satellite-card__desc {
	font-size: 12px;
	color: var(--jfpub-muted);
}

.jfh-satellite-card__arrow {
	flex: 0 0 auto;
	color: var(--jfpub-blue);
	font-size: 40px;
}
