/*
 * Project Marketplace / Task browsing pages (workscout-freelancer's own
 * [tasks] shortcode - /tasks-full-page/, /task-grid-layout/,
 * /task-list-layout/). This shortcode still renders the vendor plugin's own
 * unstyled-since-purchase markup (plain grey sidebar, teal vendor buttons,
 * no card elevation) while the rest of the site's browse/search surfaces
 * (Search Jobs - see .jffj-row in postcode-hub-jobs.css, Business Directory,
 * Community) were already redesigned around the --jfpub-* token set. This
 * file re-skins that same existing vendor DOM with the same tokens/card
 * conventions - no template overrides, no markup changes, so vendor updates
 * to workscout-freelancer keep working.
 *
 * 2026-09-15 - CSS-only revamp, matching card treatment 1:1 with
 * .jffj-row/.jffj-card (postcode-hub-jobs.css): white card, soft navy
 * border, blue border+shadow on hover, navy title, muted meta, blue accent
 * pills. Scoped via has_shortcode() in functions.php, so any future page
 * embedding [tasks] gets this automatically.
 */

.full-page-container-v2 {
	background: var(--jfpub-canvas);
}

/* ---------- Page heading ---------- */

.full-page-content-inner-v2 > .page-title {
	margin: 0 0 18px;
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
	font-size: 24px;
	font-weight: 700;
}

/* ---------- Sidebar filters ---------- */

.full-page-sidebar-v2 {
	background: var(--jfpub-canvas);
	border-right: 1px solid var(--jfpub-border);
}

.sidebar-container-v2 {
	padding: 20px 18px;
}

.sidebar-widget {
	margin: 0 0 20px;
	padding: 0 0 20px;
	border-bottom: 1px solid var(--jfpub-border);
}

.sidebar-widget:last-child {
	border-bottom: 0;
}

.sidebar-widget h4 {
	margin: 0 0 12px;
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .02em;
}

.sidebar-widget h4 label {
	text-transform: none;
	letter-spacing: 0;
	font-weight: 600;
}

.sidebar-widget input[type="text"],
.sidebar-widget input[type="search"] {
	width: 100%;
	height: 42px;
	padding: 0 14px;
	border: 1px solid var(--jfpub-border);
	border-radius: 8px;
	background: #fff;
	color: var(--jfpub-ink);
	font-family: var(--jfpub-font);
	font-size: 14px;
	transition: border-color .15s var(--jfpub-ease), box-shadow .15s var(--jfpub-ease);
}

.sidebar-widget input[type="text"]:focus,
.sidebar-widget input[type="search"]:focus {
	outline: none;
	border-color: var(--jfpub-blue);
	box-shadow: 0 0 0 3px rgba(7, 177, 229, .15);
}

.sidebar-widget .select2-container .select2-selection--multiple {
	border: 1px solid var(--jfpub-border) !important;
	border-radius: 8px !important;
	min-height: 42px;
}

/* Skills / category tag checkboxes - recolour the vendor's plain grey
   .tag pills into the same light-blue chip used sitewide for filters
   (matches .jffj-chip in postcode-hub-jobs.css). */
.tags-container {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tags-container .tag {
	position: relative;
}

.tags-container .tag label {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid var(--jfpub-border);
	border-radius: 999px;
	background: #fff;
	color: var(--jfpub-muted);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .15s var(--jfpub-ease), background-color .15s var(--jfpub-ease), color .15s var(--jfpub-ease);
}

.tags-container .tag label:hover {
	border-color: var(--jfpub-blue);
	color: var(--jfpub-blue);
}

.tags-container .tag input:checked + label {
	border-color: var(--jfpub-blue);
	background: var(--jfpub-surface-blue);
	color: var(--jfpub-blue);
}

/* Fixed Price / Hourly Rate toggle checkboxes sit inside their own <h4> in
   the vendor markup - style the label like a real toggle chip instead of a
   bare browser checkbox next to a heading. */
.widget_range_filter > h4 {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.widget_range_filter > h4 input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--jfpub-blue);
}

.sidebar-search-button-container {
	padding: 0 18px 20px;
}

.sidebar-search-button-container .button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 46px;
	border: 0;
	border-radius: 8px;
	background: var(--jfpub-blue) !important;
	color: #fff !important;
	font-family: var(--jfpub-font);
	font-size: 15px;
	font-weight: 700;
	transition: background-color .15s var(--jfpub-ease);
}

.sidebar-search-button-container .button:hover {
	background: var(--jfpub-blue-hover) !important;
}

/* ---------- Task cards ---------- */

.full-page-content-container-v2 {
	background: var(--jfpub-canvas);
}

/* The sidebar-filter layout leaves too little width here for a real
   multi-column tile grid (titles/meta/price all got crushed - tested at
   this page's actual ~840px content width). Full-width rows, like the
   Search Jobs page's own .jffj-row, read far better in this space and keep
   this page visually consistent with it - so "grid" and "list" style
   variants both render as the same single-column row list. */
.tasks-list-container,
.tasks-list-container.tasks-grid-layout {
	display: flex !important;
	flex-direction: column;
	flex-wrap: nowrap;
	width: 100% !important; /* vendor's grid layout sets calc(100% + 30px) to offset its own card right-margins */
	gap: 12px;
}

/* compact-list (task-list-layout page) wraps everything in one big
   white/shadowed/rounded box (vendor _tasks-list-layout.scss) and flattens
   each row to border-radius:0 + zebra-stripes even rows - the opposite of
   "many individual white cards with gaps" every other view here uses.
   Strip the outer frame, restore each row as its own card. */
.tasks-list-container.compact-list {
	background: transparent !important;
	box-shadow: none !important;
	border-radius: 0 !important;
}

.tasks-list-container.compact-list .task-listing {
	border-radius: 10px !important;
	margin-bottom: 0 !important;
	box-shadow: none !important;
}

/* Vendor's own .tasks-grid-layout .task-listing sets width:calc(50% - 30px)
   + a right-margin (specificity 0,3,0, beats a plain .task-listing rule) -
   the whole point of the single-column-row layout above is one full-width
   row, so this has to win outright. */
.tasks-list-container.tasks-grid-layout .task-listing {
	width: 100% !important;
	margin: 0 !important;
}

/* Vendor's grid-layout SCSS (_tasks-grid-layout.scss) forces
   flex-direction:column + align-items:center + justify-content:center on
   this same selector, which centred both children as a group instead of a
   details-left/price-right row - !important on the four properties it
   actually contests is enough, no need to fight every declaration. */
.task-listing {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 16px;
	width: 100%;
	padding: 16px 18px;
	background: #fff !important; /* compact-list's vendor SCSS zebra-stripes even rows to #fafafa - every row's white here, no striping */
	border: 1px solid rgba(11, 38, 104, .1);
	border-radius: 10px;
	text-decoration: none;
	transition: border-color .15s var(--jfpub-ease), box-shadow .15s var(--jfpub-ease);
}

.task-listing-details {
	display: block !important; /* vendor sets display:flex; align-items:center here too, which vertically centred the single description child oddly */
	flex: 1 1 auto;
	min-width: 0;
	padding: 0 !important;
}

/* Featured tasks - vendor draws these with a gold border (!important, see
   workscout/style.css ~L27255) and a small floating star badge
   (.listing-badge) with no visual relation to the rest of this revamp.
   Matches the same "featured" treatment already used for job cards
   (.jffj-row--featured in postcode-hub-jobs.css) instead: cream background,
   soft amber border, corner ribbon. */
.task-listing.task-listing-featured {
	position: relative;
	background: #fff2e4 !important;
	border-color: #f3cfa0 !important;
	padding-top: 34px;
}

.task-listing-featured .listing-badge {
	/* Vendor's base .listing-badge (workscout/style.css) is a 66x66 box
	   rotated 45deg with left+right BOTH unset-from-auto (float:left,
	   right:-33px) - with width left at auto that stretched this to ~830px
	   before rotating, producing a huge diagonal band across the whole
	   card. Reset every one of those instead of only the properties this
	   badge is supposed to visually differ on. */
	position: absolute;
	top: 14px;
	left: 16px;
	right: auto;
	float: none;
	transform: none;
	width: auto;
	height: auto;
	line-height: normal;
	padding: 3px 10px;
	border-radius: 999px;
	background: #f2994a;
	color: #fff;
	font-size: 0;
	box-shadow: 0 2px 6px rgba(11, 38, 104, .18);
}

.task-listing-featured .listing-badge::after {
	content: "Featured";
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
}

.task-listing-featured .listing-badge i {
	display: none;
}

/* Old vendor demo tasks carry an emoji character baked into the title
   (e.g. "Food Delivery Mobile Application 📱") - WordPress renders it as an
   <img> pulled from s.w.org, which this site's CSP blocks (img-src doesn't
   allow s.w.org), leaving a visible broken-image icon. Hiding rather than
   trying to loosen the CSP for one decorative glyph. */
.task-listing-title img.emoji {
	/* WP core prints its own img.emoji{display:inline!important} in
	   wp_head - has to be beaten with !important too. */
	display: none !important;
}

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

.task-listing-title {
	margin: 0 0 8px;
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
}

.task-icons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 14px;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
}

.task-icons li {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--jfpub-muted);
	font-size: 13.5px;
}

.task-icons li i {
	color: var(--jfpub-blue);
}

.task-tags span {
	display: inline-block;
	padding: 3px 10px;
	border: 1px solid rgba(7, 177, 229, .4);
	border-radius: 999px;
	background: var(--jfpub-surface-blue);
	color: var(--jfpub-blue);
	font-size: 13px;
	font-weight: 700;
}

.task-listing-bid {
	flex: 0 0 auto;
	background: transparent; /* vendor's plain .task-listing-bid sets #f8f8f8 - unset here since .task-listing itself is already the white card */
}

/*
 * 2026-09-17 fix: the rules above never actually won on this page. The
 * vendor's OWN grid-layout-scoped selectors
 * (.tasks-list-container.tasks-grid-layout .task-listing-bid[-inner],
 * workscout/style.css ~L30723) carry higher specificity (0,3,0 vs. this
 * file's plain 0,1,0) and this page's real container carries BOTH
 * "tasks-list-container" and "tasks-grid-layout" classes regardless of
 * which of the three dedicated pages/layouts is showing - confirmed live:
 * computed style showed flex-grow:1, a stretched #f8f8f8 box, and a
 * squished 45%-wide/100%-tall button, none of which trace to any rule in
 * this file. Matching that specificity (repeating the vendor's own
 * compound selector) rather than reaching for !important everywhere.
 */
.tasks-list-container.tasks-grid-layout .task-listing-bid {
	flex: 0 0 auto;
	background: transparent;
	padding: 0;
	display: flex;
}

.tasks-list-container.tasks-grid-layout .task-listing-bid-inner {
	padding: 0;
}

.tasks-list-container.tasks-grid-layout .task-listing-bid-inner .task-offers {
	position: static;
	flex: 0 0 auto;
}

.tasks-list-container.tasks-grid-layout .task-listing-bid-inner .button {
	height: auto;
	width: auto;
}

.task-listing-bid-inner {
	display: flex;
	align-items: center;
	gap: 18px;
}

.task-offers {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	text-align: right;
	white-space: nowrap;
}

.task-offers strong {
	color: var(--jfpub-navy);
	font-family: var(--jfpub-font);
	font-size: 16px;
	font-weight: 700;
}

.task-offers span {
	color: var(--jfpub-muted);
	font-size: 12.5px;
}

.task-listing-bid .button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border-radius: 8px;
	background: var(--jfpub-blue) !important;
	color: #fff !important;
	font-family: var(--jfpub-font);
	font-size: 14px;
	font-weight: 700;
	transition: background-color .15s var(--jfpub-ease), transform .15s var(--jfpub-ease);
}

.task-listing-bid .button:hover {
	background: var(--jfpub-blue-hover) !important;
	transform: translateY(-1px);
}

.task-listing-bid .button i {
	display: none; /* vendor's sliding-arrow icon; the button restyle drops the slide animation it was built for */
}

@media (max-width: 640px) {
	.task-listing {
		flex-wrap: wrap;
	}

	.task-listing-bid {
		flex: 1 1 100%;
		padding-top: 14px;
		border-top: 1px solid var(--jfpub-border);
	}

	.task-listing-bid-inner {
		justify-content: space-between;
	}

	.task-offers {
		align-items: flex-start;
		text-align: left;
	}
}
