/**
 * TalentHub Job Listings Styles
 * Styles for job cards, archive, filters, and single job pages
 */

/* ========================================================================
   JOB CARD COMPONENT (Used on homepage and archive)
   ======================================================================== */

.job-card {
	/* Feature #34 — match the homepage .step-card silhouette (same
	   background + radius), but add a 1px primary-coloured accent
	   border so each role picks up the recruiter's brand colour
	   (Andrew's call 2026-05-13). Idle has no shadow — shadow only
	   appears on hover, matching step-card behaviour. */
	background: var(--color-background);
	border: var(--border-width) solid var(--color-primary);
	border-radius: var(--border-radius-lg);
	padding: var(--spacing-lg);
	display: flex;
	flex-direction: column;
	gap: var(--spacing-md);
}

.job-card:hover {
	border-color: var(--color-primary-dark, var(--color-primary));
	box-shadow: var(--shadow-md);
	transform: translateY(-4px);
}

.job-card-header {
	display: flex;
	align-items: flex-start;
	gap: var(--spacing-md);
}

.job-company-logo {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: var(--border-radius);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.job-company-logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.job-company-initial {
	width: 48px;
	height: 48px;
	border-radius: var(--border-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: 700;
	color: var(--color-white);
}

.job-card-title-area {
	flex: 1;
	min-width: 0;
}

.job-card-title {
	/* Feature #34 — match the homepage .step-title rule exactly so the
	   card title reads as part of the same typographic system as the
	   How It Works section (Andrew's call 2026-05-13). Inherits
	   font-family from <h3> via talenthub-typography. */
	margin: 0 0 var(--spacing-sm) 0;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--color-text);
}

.job-card-title a,
.job-card-title .job-card-title-link {
	color: var(--color-text);
	text-decoration: none;
	background: none;
	border: none;
	transition: color 0.2s ease;
}

.job-card-title a:hover,
.job-card-title .job-card-title-link:hover,
.job-card-title a:focus,
.job-card-title .job-card-title-link:focus {
	color: var(--color-text);
	text-decoration: none;
	outline: none;
}

.job-card-company {
	font-size: 0.9375rem;
	color: var(--color-text-light);
	margin: 0;
}

.job-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-md);
	font-size: 0.875rem;
	color: var(--color-text-light);
}

.job-meta-item {
	display: flex;
	align-items: center;
	gap: var(--spacing-xs);
}

.job-meta-icon {
	flex-shrink: 0;
	color: var(--color-text-light);
}

.job-type-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 100px;
	font-size: 0.8125rem;
	font-weight: 500;
	border: 1px solid;
}

.job-type-full_time {
	background: #e3f2fd;
	color: #1976d2;
	border-color: #1976d2;
}

.job-type-part_time {
	background: #f3e5f5;
	color: #7b1fa2;
	border-color: #7b1fa2;
}

.job-type-contract {
	background: #fff3e0;
	color: #f57c00;
	border-color: #f57c00;
}

.job-type-temporary {
	background: #e8f5e9;
	color: #388e3c;
	border-color: #388e3c;
}

.job-card-description {
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--color-text-light);
	margin: 0;
}

.job-card-skills {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-xs);
}

.skill-tag {
	display: inline-block;
	padding: 4px 10px;
	background: var(--color-background);
	border: 1px solid var(--color-border);
	border-radius: 4px;
	font-size: 0.8125rem;
	color: var(--color-text);
	white-space: nowrap;
}

.skill-tag-more {
	color: var(--color-text-light);
	font-weight: 500;
}

.job-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: var(--spacing-sm);
	border-top: 1px solid var(--color-border);
	font-size: 0.875rem;
	color: var(--color-text-light);
}

/* Feature #34 — .job-card-link is now applied alongside .btn-pill so the
   pill primitive owns its shape, padding, and colours. Visual rules live
   under .btn-pill--view in style.css. We keep the class here purely as
   an existence hook for any selectors that target it; the legacy
   underline-link styling is intentionally gone. */
.job-card-link {
	text-decoration: none;
}

/* ========================================================================
   JOB ARCHIVE PAGE
   ======================================================================== */

.job-archive-page {
	padding: var(--spacing-3xl) 0;
	background: var(--color-background);
}

.job-archive-container {
	max-width: var(--container-max-width);
	margin: 0 auto;
	padding: 0 var(--spacing-md);
}

.archive-header {
	text-align: center;
	margin-bottom: var(--spacing-2xl);
}

.archive-title {
	font-size: 2.5rem;
	font-weight: 700;
	margin: 0 0 var(--spacing-sm) 0;
	color: var(--color-text);
}

.archive-count {
	font-size: 1.125rem;
	color: var(--color-text-light);
}

.archive-count strong {
	color: var(--color-primary);
	font-weight: 600;
}

/* Active Filters */
.active-filters {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	padding: var(--spacing-md) var(--spacing-lg);
	margin-bottom: var(--spacing-xl);
	display: flex;
	align-items: center;
	gap: var(--spacing-md);
	flex-wrap: wrap;
}

.active-filters-label {
	font-weight: 600;
	color: var(--color-text);
	white-space: nowrap;
}

.active-filters-tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-sm);
	flex: 1;
}

.filter-tag {
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-xs);
	padding: 6px 12px;
	background: var(--color-primary-light);
	border: 1px solid var(--color-primary);
	border-radius: 100px;
	color: var(--color-primary-dark);
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	transition: all 0.2s ease;
}

.filter-tag:hover {
	background: var(--color-primary);
	color: var(--color-white);
}

.filter-tag-remove {
	font-size: 1.25rem;
	line-height: 1;
	font-weight: 700;
}

.clear-all-filters {
	color: var(--color-error);
	text-decoration: none;
	font-weight: 500;
	font-size: 0.875rem;
	transition: opacity 0.2s ease;
}

.clear-all-filters:hover {
	opacity: 0.8;
}

/* Archive Content Grid */
.archive-content {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: var(--spacing-2xl);
	align-items: start;
}

/* Job Listings Grid */
.job-listings {
	min-width: 0;
}

/* Scoped to .archive-content so the homepage's Featured Opportunities
   grid (3-up 1fr) keeps its own layout when jobs.css is shared. */
.archive-content .jobs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 480px));
	gap: var(--spacing-xl);
	margin-bottom: var(--spacing-2xl);
	justify-content: start;
}

/* Feature #34 — Talent Community card now lives INSIDE .jobs-grid and
   spans every visible column, so its left/right edges line up exactly
   with the row of job cards beneath at any viewport width. */
.archive-content .jobs-grid > .job-card--talent-community {
	grid-column: 1 / -1;
	margin-bottom: 0;
}

/* No Results */
.no-jobs-found {
	text-align: center;
	padding: var(--spacing-3xl) var(--spacing-lg);
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
}

.no-jobs-found h2 {
	font-size: 1.5rem;
	margin: 0 0 var(--spacing-md) 0;
	color: var(--color-text);
}

.no-jobs-found p {
	font-size: 1rem;
	color: var(--color-text-light);
	margin: 0 0 var(--spacing-lg) 0;
}

/* Pagination */
.job-pagination {
	display: flex;
	justify-content: center;
}

.job-pagination .page-numbers {
	display: flex;
	gap: var(--spacing-xs);
	list-style: none;
	margin: 0;
	padding: 0;
}

.job-pagination .page-numbers li {
	margin: 0;
}

.job-pagination a,
.job-pagination span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 var(--spacing-sm);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	color: var(--color-text);
	text-decoration: none;
	font-weight: 500;
	transition: all 0.2s ease;
}

.job-pagination a:hover {
	background: var(--color-primary);
	color: var(--color-white);
	border-color: var(--color-primary);
}

.job-pagination .current {
	background: var(--color-primary);
	color: var(--color-white);
	border-color: var(--color-primary);
}

/* ========================================================================
   JOB FILTERS SIDEBAR
   ======================================================================== */

.job-filters {
	position: sticky;
	top: 100px;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	padding: var(--spacing-lg);
}

.job-filters h3 {
	margin: 0 0 var(--spacing-lg) 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--color-text);
}

.filter-group {
	margin-bottom: var(--spacing-lg);
	padding-bottom: var(--spacing-lg);
	border-bottom: 1px solid var(--color-border);
}

.filter-group:last-of-type {
	border-bottom: none;
	margin-bottom: var(--spacing-md);
	padding-bottom: 0;
}

.filter-group label {
	display: block;
	font-weight: 500;
	margin-bottom: var(--spacing-sm);
	color: var(--color-text);
	font-size: 0.9375rem;
}

.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	font-size: 0.9375rem;
	color: var(--color-text);
	background: var(--color-white);
	transition: border-color 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
	outline: none;
	border-color: var(--color-primary);
}

.filter-checkboxes {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-sm);
}

.filter-checkbox-item {
	display: flex;
	align-items: center;
	gap: var(--spacing-sm);
}

.filter-checkbox-item input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
}

.filter-checkbox-item label {
	margin: 0;
	cursor: pointer;
	font-weight: 400;
	font-size: 0.9375rem;
}

.salary-range {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--spacing-sm);
}

.filter-actions {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-sm);
}

.filter-actions .btn {
	width: 100%;
	justify-content: center;
}

.filter-actions .btn-secondary {
	background: transparent;
	color: var(--color-text-light);
	border-color: var(--color-border);
}

.filter-actions .btn-secondary:hover {
	background: var(--color-background);
	color: var(--color-text);
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
	display: none;
	width: 100%;
	padding: var(--spacing-md);
	background: var(--color-primary);
	color: var(--color-white);
	border: none;
	border-radius: var(--border-radius);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	margin-bottom: var(--spacing-lg);
	transition: background 0.2s ease;
}

.mobile-filter-toggle:hover {
	background: var(--color-primary-dark);
}

/* Mobile Filter Overlay */
.filter-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 998;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.filter-overlay.active {
	opacity: 1;
}

/* ========================================================================
   SINGLE JOB PAGE
   ======================================================================== */

.single-job-page {
	padding: var(--spacing-2xl) 0 var(--spacing-3xl) 0;
	background: var(--color-background);
}

.back-to-jobs-container {
	max-width: var(--container-max-width);
	margin: 0 auto var(--spacing-lg) auto;
	padding: 0 var(--spacing-md);
}

.back-to-jobs-link {
	display: inline-flex;
	align-items: center;
	color: var(--color-text-light);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s ease;
}

.back-to-jobs-link:hover {
	color: var(--color-primary);
}

.single-job-container {
	max-width: var(--container-max-width);
	margin: 0 auto;
	padding: 0 var(--spacing-md);
}

/* Job Header */
.job-header {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	padding: var(--spacing-2xl);
	margin-bottom: var(--spacing-xl);
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--spacing-xl);
}

.job-header-main {
	display: flex;
	gap: var(--spacing-lg);
	flex: 1;
	min-width: 0;
}

.job-company-logo-large {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: var(--border-radius);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.job-company-logo-large img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.job-company-initial-large {
	width: 80px;
	height: 80px;
	border-radius: var(--border-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	font-weight: 700;
	color: var(--color-white);
}

.job-header-info {
	flex: 1;
	min-width: 0;
}

.job-title {
	margin: 0 0 var(--spacing-sm) 0;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--color-text);
}

.job-company-name {
	font-size: 1.25rem;
	color: var(--color-text-light);
	margin: 0;
}

.job-header-actions {
	flex-shrink: 0;
}

/* Job Meta Bar */
.job-meta-bar {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	padding: var(--spacing-lg) var(--spacing-xl);
	margin-bottom: var(--spacing-xl);
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-lg) var(--spacing-xl);
	font-size: 0.9375rem;
	color: var(--color-text-light);
}

/* Job Content Grid */
.job-content-grid {
	display: grid;
	grid-template-columns: 1fr 350px;
	gap: var(--spacing-xl);
	align-items: start;
}

.job-main-content {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	padding: var(--spacing-2xl);
}

.job-description h2,
.job-requirements h2 {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0 0 var(--spacing-lg) 0;
	color: var(--color-text);
}

.job-description {
	margin-bottom: var(--spacing-2xl);
}

.job-description p,
.job-description ul,
.job-description ol {
	margin-bottom: var(--spacing-md);
	line-height: 1.7;
	color: var(--color-text);
}

.job-description ul,
.job-description ol {
	padding-left: var(--spacing-lg);
}

.job-description li {
	margin-bottom: var(--spacing-sm);
}

.job-requirements ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.job-requirements li {
	padding: var(--spacing-md);
	background: var(--color-background);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	margin-bottom: var(--spacing-sm);
}

.job-requirements li:last-child {
	margin-bottom: 0;
}

.job-requirements strong {
	color: var(--color-primary);
	font-weight: 600;
}

/* Job Sidebar */
.job-sidebar {
	position: sticky;
	top: 100px;
}

.job-summary-box {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	padding: var(--spacing-xl);
}

.job-summary-box h3 {
	margin: 0 0 var(--spacing-lg) 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--color-text);
}

.job-summary-list {
	margin: 0 0 var(--spacing-xl) 0;
}

.summary-item {
	padding: var(--spacing-md) 0;
	border-bottom: 1px solid var(--color-border);
}

.summary-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.summary-item dt {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-text-light);
	margin-bottom: var(--spacing-xs);
}

.summary-item dd {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--color-text);
}

.job-skills-sidebar {
	padding-top: var(--spacing-lg);
	margin-top: var(--spacing-lg);
	border-top: 1px solid var(--color-border);
}

.job-skills-sidebar h4 {
	margin: 0 0 var(--spacing-md) 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--color-text);
}

.job-apply-sidebar {
	padding-top: var(--spacing-lg);
	margin-top: var(--spacing-lg);
	border-top: 1px solid var(--color-border);
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

@media (max-width: 1024px) {
	.archive-content {
		grid-template-columns: 1fr;
	}

	/* Filter sidebar becomes an off-canvas drawer.
	   Height uses dvh so iOS Safari's URL bar / bottom toolbar don't
	   hide the drawer's bottom (vh is the device viewport, dvh is the
	   visible viewport — Ticket #51 follow-up). vh stays as a fallback
	   for browsers older than Safari 15.4 / Chrome 108.
	   z-index uses --z-modal so the drawer sits above the site header
	   (which is z-index 1035) — otherwise the drawer's top, including
	   the X close button, hides behind the header on mobile (Ticket #51
	   follow-up). */
	.job-filters-sidebar {
		position: fixed;
		top: 0;
		right: -100%;
		width: 90%;
		max-width: 400px;
		height: 100vh;
		height: 100dvh;
		z-index: var(--z-modal);
		overflow-y: auto;
		transition: right 0.3s ease;
		border-radius: 0;
		border-right: none;
		margin: 0;
	}

	.job-filters-sidebar.is-open {
		right: 0;
		box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
	}

	.job-filters-overlay {
		display: none;
		position: fixed;
		inset: 0;
		background: rgba(15, 23, 42, 0.55);
		z-index: var(--z-modal-backdrop);
	}
	.job-filters-overlay.is-open {
		display: block;
	}

	.filters-toggle-btn {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		padding: 10px 16px;
		border: 1px solid var(--color-border, #e5e7eb);
		border-radius: 8px;
		background: var(--color-white, #fff);
		font-weight: 600;
		cursor: pointer;
		margin-bottom: 16px;
	}

	.job-content-grid {
		grid-template-columns: 1fr;
	}

	.job-sidebar {
		position: static;
	}
}

@media (min-width: 1025px) {
	/* Desktop — drawer infrastructure stays out of the way */
	.filters-toggle-btn { display: none; }
	.job-filters-overlay { display: none; }

	/* Sticky filter sidebar — desktop only; mobile keeps position:fixed
	   so the off-canvas drawer behaves correctly (Ticket #51). */
	.job-filters-sidebar--modern {
		position: sticky;
		top: 100px;
	}
}

@media (max-width: 768px) {
	.archive-content .jobs-grid {
		grid-template-columns: 1fr;
	}

	.archive-title {
		font-size: 2rem;
	}

	.job-header {
		flex-direction: column;
	}

	.job-header-main {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.job-header-actions {
		width: 100%;
	}

	.job-header-actions .btn {
		width: 100%;
	}

	.job-title {
		font-size: 1.5rem;
	}

	.job-meta-bar {
		flex-direction: column;
		gap: var(--spacing-md);
	}

	.job-main-content {
		padding: var(--spacing-lg);
	}

	.job-summary-box {
		padding: var(--spacing-lg);
	}

	.active-filters {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 480px) {
	.job-card {
		padding: var(--spacing-md);
	}

	.job-card-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.job-card-meta {
		flex-direction: column;
		gap: var(--spacing-sm);
	}

	.archive-title {
		font-size: 1.75rem;
	}

	.job-header {
		padding: var(--spacing-lg);
	}
}

/* ========================================================================
   DARK MODE SUPPORT
   ======================================================================== */

@media (prefers-color-scheme: dark) {
	.job-card,
	.job-filters,
	.job-summary-box,
	.job-main-content,
	.active-filters,
	.no-jobs-found {
		background: var(--color-dark-surface);
		border-color: var(--color-dark-border);
	}

	.job-card:hover {
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	}

	.job-company-logo,
	.job-company-logo-large {
		background: var(--color-dark-surface);
		border-color: var(--color-dark-border);
	}

	.skill-tag {
		background: var(--color-dark-bg);
		border-color: var(--color-dark-border);
	}

	.job-requirements li {
		background: var(--color-dark-bg);
		border-color: var(--color-dark-border);
	}

	.job-pagination a,
	.job-pagination span {
		background: var(--color-dark-surface);
		border-color: var(--color-dark-border);
		color: var(--color-dark-text);
	}

	.job-pagination a:hover {
		background: var(--color-primary);
		color: var(--color-white);
	}
}

/* ========== Phase 1 — Job Listings additions ========== */

/* Sort dropdown in archive header */
.archive-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}
.archive-header-text { flex: 1 1 auto; }
.archive-sort {
	display: flex;
	align-items: center;
	gap: 8px;
}
.archive-sort-label {
	font-size: 14px;
	color: var(--color-text-muted, #6b7280);
}
.archive-sort select {
	padding: 6px 10px;
	border: 1px solid var(--color-border, #e5e7eb);
	border-radius: 6px;
	background: var(--color-white, #fff);
	font-size: 14px;
}

/* Job card badge stack — works whether one or two badges */
.job-card-badges {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	align-items: flex-start;
}

/* Work-arrangement badge */
.work-arrangement-badge {
	display: inline-block;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 999px;
	background: #eef2ff;
	color: #3730a3;
	letter-spacing: 0.02em;
}
.work-arrangement-remote { background: #ecfdf5; color: #047857; }
.work-arrangement-hybrid { background: #fef3c7; color: #92400e; }
.work-arrangement-onsite { background: #eef2ff; color: #3730a3; }

/* Already-applied badge on a job card */
.applied-badge {
	display: inline-block;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 700;
	border-radius: 999px;
	background: #dcfce7;
	color: #166534;
	letter-spacing: 0.02em;
}

/* Featured-job badge — visible on cards wherever a job has the featured flag */
.featured-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 700;
	border-radius: 999px;
	background: #fef3c7;
	color: #92400e;
	letter-spacing: 0.02em;
}
.featured-badge-icon { display: block; }

/* ========================================================================
   MODERN FILTER UI (pill toggles + collapsible sections)
   ======================================================================== */

.job-filters-sidebar--modern {
	/* Feature #34 — primary-coloured border to brand the filter
	   sidebar in line with each job card. Sticky positioning lives in
	   the desktop media query below — on tablet/mobile the sidebar is
	   an off-canvas drawer (position: fixed) and sticky would override
	   it, leaving the drawer permanently visible (Ticket #51). */
	background: var(--color-white, #fff);
	border: 1px solid var(--color-primary);
	border-radius: 12px;
	padding: 20px 22px;
}

/* Mobile drawer — extra bottom padding so the Apply Filters button can be
   scrolled clear of browser chrome / the iOS home indicator (Ticket #51
   follow-up — Andrew was hitting Safari's bottom bar instead of the button).
   Must follow the base .job-filters-sidebar--modern rule above so its
   padding-bottom wins over the shorthand `padding`. */
@media (max-width: 1024px) {
	.job-filters-sidebar--modern {
		padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
	}
}

.job-filters-sidebar--modern .filters-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.job-filters-sidebar--modern .filters-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: #111827;
}

.filter-section {
	padding: 14px 0;
	border-bottom: 1px solid var(--color-border, #f3f4f6);
}
.filter-section:last-of-type {
	border-bottom: none;
}

.filter-section-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #6b7280;
	cursor: default;
}
.filter-section-collapsible > .filter-section-label {
	cursor: pointer;
	user-select: none;
	list-style: none;
}
.filter-section-collapsible > .filter-section-label::-webkit-details-marker { display: none; }
.filter-section-collapsible[open] .filter-chevron { transform: rotate(180deg); }
.filter-chevron {
	transition: transform 0.15s;
	color: #9ca3af;
}

.filter-input-wrap {
	position: relative;
}
.filter-input-icon {
	position: absolute;
	left: 11px;
	top: 50%;
	transform: translateY(-50%);
	color: #9ca3af;
	pointer-events: none;
}
.job-filters-sidebar--modern .filter-input,
.job-filters-sidebar--modern .filter-select {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
	color: #111827;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}
.job-filters-sidebar--modern .filter-input:focus,
.job-filters-sidebar--modern .filter-select:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.filter-input-wrap .filter-input { padding-left: 32px; }

.filter-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.filter-pill {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	background: #fff;
	color: #374151;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	user-select: none;
	transition: all 0.15s;
}
.filter-pill:hover {
	border-color: #9ca3af;
	background: #f9fafb;
}
.filter-pill input { display: none; }
.filter-pill.is-active,
.filter-pill:has(input:checked) {
	background: #eff6ff;
	border-color: #3b82f6;
	color: #1e40af;
	font-weight: 600;
}

.filter-salary-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}
.filter-salary-inputs .filter-input {
	flex: 1;
	min-width: 0;
}
.filter-salary-inputs .salary-separator {
	color: #9ca3af;
	font-size: 14px;
}

.job-filters-sidebar--modern .filter-actions {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--color-border, #f3f4f6);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
}

/* Feature #34 — Apply Filters becomes a primary-coloured pill so the
   filter sidebar's main action picks up the same brand language as
   the View Details / Save Job pills on each card. forms.css (which
   normally owns .btn-primary) isn't loaded on /jobs/, so scope the
   pill styling to the filter sidebar to avoid leaking elsewhere. */
.job-filters-sidebar--modern .btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 12px 24px;
	background: var(--color-primary);
	color: #ffffff;
	border: 1px solid var(--color-primary);
	border-radius: 999px;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 2px 8px rgba(var(--color-primary-rgb, 0, 51, 102), 0.18);
}
.job-filters-sidebar--modern .btn-primary:hover,
.job-filters-sidebar--modern .btn-primary:focus {
	background: var(--color-primary-dark, var(--color-primary));
	border-color: var(--color-primary-dark, var(--color-primary));
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(var(--color-primary-rgb, 0, 51, 102), 0.28);
	outline: none;
}

.filter-clear-link {
	text-align: center;
	font-size: 13px;
	color: #6b7280;
	text-decoration: none;
}
.filter-clear-link:hover { color: #111827; text-decoration: underline; }

/* Anonymous Apply page (used when candidate_portal is OFF) */
.anonymous-apply-page {
	padding: 40px 0 80px;
	background: var(--color-background, #f9fafb);
	min-height: calc(100vh - 200px);
}
.anonymous-apply-container {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 16px;
}
.anonymous-apply-header { margin: 16px 0 28px; }
.anonymous-apply-header h1 { margin: 0 0 6px; font-size: 1.85rem; line-height: 1.25; }
.anonymous-apply-meta { margin: 0; color: #6b7280; }
.anonymous-apply-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 18px;
}
.anonymous-apply-form .apply-fieldset {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 20px 24px;
	margin: 0 0 18px;
}
.anonymous-apply-form legend {
	font-weight: 700;
	color: #111827;
	padding: 0 8px;
}
.apply-field { margin-bottom: 16px; }
.apply-field:last-child { margin-bottom: 0; }
.apply-field label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 6px;
	color: #374151;
}
.apply-field .required { color: #dc2626; }
.apply-field input[type="text"],
.apply-field input[type="email"],
.apply-field input[type="number"],
.apply-field input[type="date"],
.apply-field select,
.apply-field textarea,
.apply-field input[type="file"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	box-sizing: border-box;
	font-family: inherit;
}
.apply-field input:focus,
.apply-field select:focus,
.apply-field textarea:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.apply-field-hint {
	margin: 4px 0 0;
	font-size: 12px;
	color: #6b7280;
}
.apply-checkbox-inline {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	font-weight: 400;
}
.apply-consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	color: #4b5563;
	font-size: 14px;
	line-height: 1.5;
}
.apply-consent input { margin-top: 3px; }
.apply-actions {
	margin-top: 8px;
	text-align: right;
}
.anonymous-apply-success,
.anonymous-apply-closed {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 40px 28px;
	text-align: center;
}
.anonymous-apply-success .success-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: #dcfce7;
	color: #166534;
	font-size: 32px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}
.anonymous-apply-success h2,
.anonymous-apply-closed h2 {
	margin: 0 0 8px;
	font-size: 1.5rem;
}

/* Phase 2 — closing-date "Apply by" indicators */
.job-card-apply-by {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 999px;
	background: #fef2f2;
	color: #991b1b;
}
.job-meta-apply-by { color: #92400e; }
.job-meta-apply-by strong { color: #92400e; }

/* Feature #34 — Save toggle is now a .btn-pill (visual rules live in
   style.css under .btn-pill--save / --save-large). The rules below
   handle the Apply button sizing in the single-page header and sidebar;
   .btn-pill--save-large matches the same 14/28px padding so the two
   buttons line up. */
.job-card { position: relative; }

.job-header-actions .apply-job-trigger,
.job-header-actions .applied-state,
.job-apply-sidebar .apply-job-trigger,
.job-apply-sidebar .applied-state {
	box-sizing: border-box;
	font-size: 1.0625rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	white-space: nowrap;
}
.job-header-actions .apply-job-trigger,
.job-header-actions .applied-state {
	width: auto;
	padding: 14px 28px;
	min-width: 160px;
}
.job-apply-sidebar .apply-job-trigger,
.job-apply-sidebar .applied-state {
	width: 100%;
	max-width: 100%;
	padding: 12px 16px;
	font-size: 1rem;
}
.saved-label { display: inline; }

/* Skill tag clickable links */
.skill-tag-link {
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}
.skill-tag-link:hover {
	background: var(--color-primary, #6366f1);
	color: var(--color-white, #fff);
}

/* Applied state button on the single-job page */
.applied-state {
	background: #16a34a !important;
	border-color: #15803d !important;
	color: #fff !important;
}
.applied-state .check-mark {
	font-weight: 700;
	margin-right: 4px;
}

/* ========== Apply modal ========== */

body.th-modal-open { overflow: hidden; }

.th-modal[hidden] { display: none; }
.th-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.th-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}
.th-modal-panel {
	position: relative;
	background: var(--color-white, #fff);
	border-radius: 12px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	max-width: 480px;
	width: calc(100% - 32px);
	padding: 28px 28px 24px;
	outline: none;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
}
.th-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: transparent;
	border: 0;
	font-size: 28px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	padding: 4px 8px;
}
.th-modal-close:hover { color: #111; }
.th-modal-title {
	margin: 0 0 12px;
	font-size: 22px;
	font-weight: 700;
	color: #111827;
}
.th-modal-body {
	margin: 0 0 20px;
	color: #4b5563;
	line-height: 1.5;
}
.th-modal-error {
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fee2e2;
	border-radius: 6px;
	padding: 10px 12px;
}
.th-modal-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
}
.th-modal-actions .btn { min-width: 110px; }
.th-apply-success-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #dcfce7;
	color: #166534;
	font-size: 28px;
	font-weight: 700;
}


/* ─────────────────────────────────────────────────────────────────
 * Talent Community (Feature #32) — pinned hero card on the careers
 * archive + simplified single-listing page styling.
 *
 * Visually inherits the standard .job-card chrome (white background,
 * 1px border, shared radius/padding) so it reads as a card not a
 * callout. Distinction comes from a coloured left accent strip and a
 * pill CTA — same colour family as the homepage banner.
 *
 * Lives outside .jobs-grid in archive-job_listing.php; uses
 * --spacing-xl margin-bottom to match the grid's internal gap so the
 * space between this card and the first live job equals the space
 * between consecutive live jobs.
 * ───────────────────────────────────────────────────────────────── */
.job-card--talent-community {
	border-left: 4px solid var(--color-talent-community, #1e40af);
	margin-bottom: var(--spacing-xl);
}
.job-card-tc-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--spacing-lg);
}
.job-card-tc-content {
	flex: 1;
	min-width: 0;
}
.job-card-tc-badge {
	display: inline-block;
	background: var(--color-talent-community, #1e40af);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 4px 10px;
	border-radius: 4px;
	margin-bottom: var(--spacing-sm);
}
.job-card-tc-title {
	margin: 0 0 var(--spacing-xs) 0;
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.3;
}
.job-card-tc-title a {
	color: var(--color-text);
	text-decoration: none;
	transition: color 0.2s ease;
}
.job-card-tc-title a:hover {
	color: var(--color-talent-community, #1e40af);
}
.job-card-tc-blurb {
	margin: 0;
	color: var(--color-text-muted);
	font-size: 0.9375rem;
	line-height: 1.55;
}
.job-card-tc-cta {
	flex-shrink: 0;
}
/* Card-variant pill: solid Talent Community colour fill, white text.
 * (Banner variant inverts: white fill, banner-coloured text.) */
.job-card-tc-cta .btn-pill {
	background: var(--color-talent-community, #1e40af);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(var(--color-primary-rgb, 30, 64, 175), 0.25);
}
.job-card-tc-cta .btn-pill:hover,
.job-card-tc-cta .btn-pill:focus {
	background: var(--color-talent-community-dark, #1e3a8a);
	color: #ffffff;
	box-shadow: 0 6px 16px rgba(var(--color-primary-rgb, 30, 64, 175), 0.32);
}
@media (max-width: 720px) {
	.job-card-tc-inner {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--spacing-md);
	}
	.job-card-tc-cta .btn-pill { width: 100%; justify-content: center; }
}

/* Single-listing render */
.single-talent-community .job-header--talent-community .job-card-tc-badge {
	margin-bottom: 12px;
}
.single-talent-community .job-content-grid--talent-community {
	display: block;
	max-width: 820px;
}
.single-talent-community .job-content-grid--talent-community .job-main-content {
	max-width: 100%;
}

/* ─────────────────────────────────────────────────────────────────
 * Talent Community single-listing CTA — pill button rendered on the
 * /jobs/express-your-interest-be-part-of-our-talent-community/ page.
 *
 * Filled with --color-talent-community (which aliases --color-primary
 * since ecaf05e + the brand-colour alias commit) and white text, so
 * the button reads as the page's primary action and stays aligned
 * with whatever the recruiter has set under Settings → Brand colours.
 * Variants:
 *   --joined     → success green, non-actionable.
 *   --incomplete → amber "complete your profile" warning state.
 *
 * The base .btn-pill (style.css) handles shape + transitions.
 * ───────────────────────────────────────────────────────────────── */
.talent-community-single__cta {
	background: var(--color-talent-community, #1e40af);
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(var(--color-primary-rgb, 30, 64, 175), 0.28);
}
.talent-community-single__cta:hover,
.talent-community-single__cta:focus {
	background: var(--color-talent-community-dark, #1e3a8a);
	color: #ffffff;
	box-shadow: 0 10px 24px rgba(var(--color-primary-rgb, 30, 64, 175), 0.35);
}
.talent-community-single__cta--joined,
.talent-community-single__cta--joined:hover,
.talent-community-single__cta--joined:focus {
	background: #16a34a;
	color: #ffffff;
	cursor: default;
	box-shadow: none;
	transform: none;
}
.talent-community-single__cta--incomplete,
.talent-community-single__cta--incomplete:hover,
.talent-community-single__cta--incomplete:focus {
	background: #f59e0b;
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(245, 158, 11, 0.30);
}

/* Bottom-of-page apply zone — visual separator from the GDPR copy
 * above so the CTA doesn't crash into the body text. */
.talent-community-single__apply-bottom {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid #e5e7eb;
	text-align: center;
}

/* Recruiter / admin preview note — non-actionable explainer rendered
 * in place of the CTA when an authenticated non-candidate (typically
 * the admin previewing the page) hits the listing. Stops the page
 * looking broken without faking an apply path the user can't take. */
.talent-community-single__preview-note {
	display: inline-block;
	margin: 0;
	padding: 10px 16px;
	background: #f3f4f6;
	border: 1px dashed #9ca3af;
	border-radius: 999px;
	font-size: 0.9rem;
	color: #4b5563;
	font-style: italic;
}

/* Already-joined pill — non-actionable success state (used by JS
 * after a successful join in the apply modal). Kept distinct from
 * the single-page __joined variant because this one is class-mutated
 * onto the original button in-place by scripts.js. */
.btn.talent-community-joined,
.btn.talent-community-joined:hover,
.btn.talent-community-joined:focus {
	cursor: default;
	background: #16a34a;
	color: #fff;
	border-color: #16a34a;
	box-shadow: none;
}
