/**
 * Job Board (new) — [job_board].
 *
 * Everything is scoped under .jb so the legacy /job-offer archive and its
 * GenerateBlocks cards are untouched. The only unscoped rules are the
 * missing-skills modal, ported from shortcodes/job_offer_list_buttom.php
 * without its GenerateBlocks positioning hacks.
 */

.jb {
	--jb-navy: #1F3864;
	--jb-navy-deep: #0f1e3d;
	--jb-teal: #0E7C7B;
	--jb-teal-soft: #EAF7F5;
	--jb-pink: #E91E63;
	--jb-pink-soft: #FFF0F5;
	--jb-ink: #1A1F2E;
	--jb-muted: #6B7280;
	--jb-line: #E6E8EE;
	--jb-line-strong: #D9DEE8;
	--jb-shadow: 0 18px 45px -28px rgba(15, 30, 61, .35);

	direction: rtl;
	width: min(1180px, 100%);
	margin: 0 auto;
	padding: 28px 28px 52px;
	color: var(--jb-ink);
	font-family: 'Rubik', 'Segoe UI', Arial, sans-serif;
	background: #F2F4F7;
	border-radius: 20px;
}

.jb *,
.jb *::before,
.jb *::after { box-sizing: border-box; }

.jb button,
.jb select,
.jb input { font: inherit; }

.jb button { cursor: pointer; }
button.jb-btn { font-size: 12.5px; font-weight: 700; font-family: 'Rubik', 'Segoe UI', Arial, sans-serif; }
.jb a { text-decoration: none; color: inherit; }

/* --- Hero -------------------------------------------------------------- */

.jb-hero {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 24px;
	margin: -28px -28px 24px;
	padding: 28px 28px 24px;
	background: #fff;
	border-radius: 20px 20px 0 0;
}

.jb-hero h1 {
	margin: 0;
	color: var(--jb-navy);
	font-size: 30px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.02em;
}

.jb-hero p {
	margin: 7px 0 0;
	color: var(--jb-muted);
	font-size: 14px;
}

.jb-hero-note {
	font-size: 12.5px;
	color: var(--jb-muted);
	background: #fff;
	border: 1px solid var(--jb-line);
	padding: 8px 11px;
	border-radius: 999px;
	white-space: nowrap;
}

/* --- Filters ----------------------------------------------------------- */

.jb-filters {
	background: #fff;
	border: 1px solid var(--jb-line);
	border-radius: 18px;
	box-shadow: var(--jb-shadow);
	margin: 0 auto 16px;
	overflow: hidden;
	width: 408.987px;
	max-width: 100%;
}

.jb-filters summary {
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 17px 18px;
	cursor: pointer;
	color: var(--jb-navy);
	font-weight: 700;
	font-size: 15px;
	user-select: none;
}

.jb-filters summary::-webkit-details-marker { display: none; }

.jb-filters-summary-main {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.jb-filters-summary-sub {
	color: var(--jb-muted);
	font-size: 12px;
	font-weight: 500;
}

.jb-filters-arrow {
	width: 34px;
	height: 34px;
	border: 1px solid var(--jb-line);
	border-radius: 10px;
	display: grid;
	place-items: center;
	color: var(--jb-navy);
	background: #FCFCFD;
	flex: 0 0 auto;
}

.jb-filters-arrow svg {
	width: 17px;
	height: 17px;
	transition: transform .22s ease;
}

.jb-filters[open] .jb-filters-arrow svg { transform: rotate(180deg); }

.jb-filters[open] summary { border-bottom: 1px solid var(--jb-line); }

.jb-filters-content { padding: 18px; }

.jb-filters-grid {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.jb-filter { min-width: 0; width: 100%; }

.jb-filter > label,
.jb-filter-label {
	display: block;
	font-size: 12px;
	color: var(--jb-navy);
	font-weight: 700;
	margin: 0 2px 6px;
}

.jb-control {
	width: 100%;
	min-height: 30px;
	border: 1px solid var(--jb-line-strong);
	border-radius: 11px;
	background: #FCFCFD;
	color: var(--jb-ink);
	padding: 0 6px !important;
	outline: none;
	font-size: 14px !important;
}

.jb-control:focus { border-color: var(--jb-teal); background: #fff; }
.jb-control:disabled { color: var(--jb-muted); cursor: not-allowed; }

.jb-toggle {
	min-height: 44px;
	border: 1px solid var(--jb-line-strong);
	background: #FCFCFD;
	border-radius: 11px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 12px;
	gap: 10px;
	font-size: 13px;
}

.jb-switch {
	position: relative;
	width: 38px;
	height: 22px;
	flex: 0 0 auto;
}

.jb-switch input { display: none; }

.jb-switch > span {
	position: absolute;
	inset: 0;
	background: #CFD5DF;
	border-radius: 999px;
	transition: .2s;
}

.jb-switch > span::after {
	content: "";
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	position: absolute;
	top: 3px;
	right: 3px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
	transition: .2s;
}

.jb-switch input:checked + span { background: var(--jb-teal); }
.jb-switch input:checked + span::after { transform: translateX(-16px); }

.jb-search {
	width: 100%;
	min-height: 44px;
	border: none;
	border-radius: 11px;
	padding: 0 20px;
	background: linear-gradient(135deg, var(--jb-pink), #F06292);
	color: #fff;
	font-weight: 700;
	box-shadow: 0 10px 22px -12px rgba(233, 30, 99, .65);
	white-space: nowrap;
	margin-top: 2px;
}

.jb-search:hover { transform: translateY(-1px); }

/* --- Results accordion -------------------------------------------------- */

.jb-results > summary {
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--jb-line);
	border-radius: 18px;
	box-shadow: var(--jb-shadow);
	color: var(--jb-navy);
	font-weight: 700;
	font-size: 15px;
	user-select: none;
}

.jb-results > summary::-webkit-details-marker { display: none; }

.jb-results[open] .jb-filters-arrow svg { transform: rotate(180deg); }

/* --- Results header ---------------------------------------------------- */

.jb-results-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin: 14px 2px 12px;
}

.jb-count { font-size: 14px; color: var(--jb-muted); }
.jb-count b { color: var(--jb-navy); }

.jb-sort {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--jb-muted);
}

.jb-sort select {
	border: 1px solid var(--jb-line);
	background: #fff;
	border-radius: 9px;
	padding: 8px 10px;
	color: var(--jb-navy);
	font-weight: 600;
}

.jb-gate,
.jb-empty {
	background: #fff;
	border: 1px solid var(--jb-line);
	border-radius: 18px;
	padding: 28px 20px;
	text-align: center;
	color: var(--jb-muted);
	font-size: 14px;
}

.jb-gate p { margin: 0; }

/* --- Job card ---------------------------------------------------------- */

.jb-jobs {
	display: flex;
	flex-direction: column;
	gap: 13px;
}

.jb-card {
	background: #fff;
	border: 1px solid var(--jb-line);
	border-radius: 18px;
	padding: 20px;
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) 154px;
	gap: 18px;
	align-items: stretch;
	box-shadow: var(--jb-shadow);
	cursor: pointer;
}
.jb-card .jb-actions { cursor: default; }

.jb-logo {
	width: 78px;
	height: 78px;
	border: 1px solid var(--jb-line);
	border-radius: 14px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	color: var(--jb-navy);
	font-weight: 800;
	font-size: 15px;
	text-transform: uppercase;
}

.jb-logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 8px;
}

.jb-main { min-width: 0; }

.jb-title {
	margin: 0;
	font-size: 20px;
	color: var(--jb-navy-deep);
	line-height: 1.35;
	font-weight: 700;
}

.jb-title a:hover { color: var(--jb-teal); }

.jb-company {
	margin-top: 3px;
	color: var(--jb-navy);
	font-weight: 600;
	font-size: 14px;
}

.jb-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	margin-top: 10px;
	color: var(--jb-muted);
	font-size: 12.5px;
}

.jb-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 11px;
}

.jb-tag {
	background: #F3F5F8;
	color: #4F596D;
	border-radius: 999px;
	padding: 6px 10px;
	font-size: 11.5px;
	font-weight: 600;
}

.jb-tag-field {
	background: var(--jb-teal-soft);
	color: var(--jb-teal);
}

.jb-desc {
	margin: 12px 0 0;
	color: #4C5568;
	font-size: 13.5px;
	line-height: 1.65;
	max-width: 760px;
}

.jb-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 14px;
	flex-wrap: wrap;
}

.jb-published {
	color: var(--jb-muted);
	font-size: 12.5px;
}

.jb-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.jb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 0 13px;
	border-radius: 10px;
	border: 1px solid var(--jb-line);
	background: #fff;
	color: var(--jb-navy);
	font-size: 12.5px;
	font-weight: 700;
}

.jb-btn:hover { border-color: #BAC2CF; }
.jb-btn:disabled { opacity: .6; cursor: default; }

button.jb-icon {
	width: 38px;
	padding: 0;
	font-size: 20.5px;
}

.jb-save.is-saved {
	background: var(--jb-pink-soft);
	color: var(--jb-pink);
	border-color: #F6C6D9;
}

.jb-btn-pink {
	color: var(--jb-pink);
	border-color: #F2B5CD;
	background: #FFF9FB;
}

.jb-full-match { cursor: default; }
.jb-full-match:hover { border-color: #F2B5CD; }

.jb-btn-primary,
a.jb-btn-primary {
	color: #fff;
	background: var(--jb-navy);
	border-color: var(--jb-navy);
}

.jb-btn-primary:hover,
a.jb-btn-primary:hover { background: var(--jb-navy-deep); color: #fff; }

/* --- Fit score --------------------------------------------------------- */

.jb-fit {
	border-right: 1px solid var(--jb-line);
	padding-right: 18px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.jb-ring {
	width: 82px;
	height: 82px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	position: relative;
	background: conic-gradient(var(--jb-fit-color) calc(var(--jb-score) * 1%), #EEF1F5 0);
}

.jb-ring::after {
	content: "";
	position: absolute;
	inset: 7px;
	background: #fff;
	border-radius: 50%;
}

.jb-ring strong {
	position: relative;
	z-index: 1;
	color: var(--jb-navy-deep);
	font-size: 20px;
}

.jb-fit-label {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--jb-fit-color);
}

.jb-fit-sub {
	font-size: 11.5px;
	color: var(--jb-muted);
	text-align: center;
	line-height: 1.45;
}

.jb-fit-breakdown {
	width: 100%;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	margin-top: 2px;
}

.jb-fit-mini {
	border: 1px solid var(--jb-line);
	border-radius: 9px;
	padding: 6px 4px;
	text-align: center;
}

.jb-fit-mini span { display: block; color: var(--jb-muted); font-size: 10.5px; }
.jb-fit-mini b { font-size: 12.5px; color: var(--jb-navy); }

/* --- Pager ------------------------------------------------------------- */

.jb-pager {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	margin-top: 22px;
}

.jb-pager-info {
	font-size: 13px;
	color: var(--jb-muted);
}

/* --- Missing-skills modal ---------------------------------------------- */
/* Ported from shortcodes/job_offer_list_buttom.php, minus the GenerateBlocks
   card-positioning rules that only made sense inside the legacy query loop. */

.jb-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
	direction: rtl;
}

.jb-modal-overlay.active { opacity: 1; pointer-events: auto; }

.missing-skills-modal {
	background: #fff;
	border-radius: 16px;
	width: 90%;
	max-width: 520px;
	max-height: 85vh;
	overflow-y: auto;
	padding: 28px 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
	transform: translateY(20px);
	transition: transform .25s ease;
}

.jb-modal-overlay.active .missing-skills-modal { transform: translateY(0); }

.missing-skills-modal .missing-skill-chip {
	background-color: rgba(33, 150, 243, .1);
	color: #1565C0;
	border: 1px solid rgba(33, 150, 243, .3);
	display: inline-block;
	padding: 2px 8px;
	border-radius: 8px;
	font-size: .9rem;
	font-weight: 600;
}

.missing-skills-modal .text-center     { text-align: center; }
.missing-skills-modal .flex            { display: flex; }
.missing-skills-modal .inline-flex     { display: inline-flex; }
.missing-skills-modal .flex-wrap       { flex-wrap: wrap; }
.missing-skills-modal .items-center    { align-items: center; }
.missing-skills-modal .justify-between { justify-content: space-between; }
.missing-skills-modal .justify-center  { justify-content: center; }
.missing-skills-modal .gap-2           { gap: .5rem; }
.missing-skills-modal .px-5            { padding-left: 1.25rem; padding-right: 1.25rem; }
.missing-skills-modal .py-2            { padding-top: .5rem; padding-bottom: .5rem; }
.missing-skills-modal .pt-3            { padding-top: .75rem; }
.missing-skills-modal .pb-2            { padding-bottom: .5rem; }
.missing-skills-modal .p-1             { padding: .25rem; }
.missing-skills-modal .mb-2            { margin-bottom: .5rem; }
.missing-skills-modal .mb-4            { margin-bottom: 1rem; }
.missing-skills-modal .rounded-lg      { border-radius: .5rem; }
.missing-skills-modal .border-t        { border-top: 1px solid #e5e7eb; }
.missing-skills-modal .border-b        { border-bottom: 1px solid #e5e7eb; }
.missing-skills-modal .border-gray-200 { border-color: #e5e7eb; }
.missing-skills-modal .text-sm         { font-size: .875rem; line-height: 1.25rem; }
.missing-skills-modal .text-lg         { font-size: 1.125rem; line-height: 1.75rem; }
.missing-skills-modal .font-semibold   { font-weight: 600; }
.missing-skills-modal .font-bold       { font-weight: 700; }
.missing-skills-modal .text-black      { color: #000; }
.missing-skills-modal .text-gray-400   { color: #9ca3af; }
.missing-skills-modal .text-gray-700   { color: #374151; }
.missing-skills-modal .text-gray-800   { color: #1f2937; }
.missing-skills-modal .text-blue-600   { color: #2563eb; }
.missing-skills-modal .transition      { transition: all .15s ease; }
.missing-skills-modal .hover\:underline:hover    { text-decoration: underline; }
.missing-skills-modal .hover\:text-red-500:hover { color: #ef4444; }
.missing-skills-modal button { background: none; border: none; cursor: pointer; }
.missing-skills-modal .course-skills-btn-wrapper { display: flex !important; justify-content: center; }

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 980px) {
	.jb-card { grid-template-columns: 74px minmax(0, 1fr); }
	.jb-fit {
		grid-column: 1 / -1;
		border-right: 0;
		border-top: 1px solid var(--jb-line);
		padding: 14px 0 0;
		display: grid;
		grid-template-columns: auto 1fr;
		justify-items: start;
		align-items: center;
	}
	.jb-fit-breakdown { max-width: 260px; }
}

@media (max-width: 640px) {
	.jb { padding-top: 4px; margin-top: 80px; }
	.jb-hero { display: block; }
	.jb-hero-note { display: inline-block; margin-top: 12px; }
	.jb-card { grid-template-columns: 1fr; padding: 16px; }
	.jb-logo { width: 64px; height: 64px; }
	.jb-fit { grid-column: auto; grid-template-columns: 1fr; justify-items: center; text-align: center; }
	.jb-fit-breakdown { margin-left: auto; margin-right: auto; }
	.jb-results-head { align-items: flex-start; flex-direction: column; }
	.jb-bottom { align-items: flex-start; }
	/* Mobile only: Make "Job Details" exactly the same width as
   "What am I missing to get there" above it, using a grid where both
   buttons share the same column (whose width is determined by the wider one),
   without changing the styling/padding of .jb-btn-pink itself. */
	.jb-actions {
		width: 100%;
		display: grid;
		grid-template-columns: auto auto 1fr auto;
		grid-template-rows: auto auto;
		align-items: center;
	}
	.jb-actions .jb-save   { grid-column: 1; grid-row: 1; }
	.jb-actions [data-jb-share] { grid-column: 2; grid-row: 1; }
	.jb-actions .jb-btn-pink,
	.jb-actions .jb-full-match {
		grid-column: 4;
		grid-row: 1;
		justify-self: stretch;
	}
	.jb-actions .jb-btn-primary {
		grid-column: 4;
		grid-row: 2;
		justify-self: stretch;
	}
}

/* ── Share overlay popup ─────────────────────────────────────────────── */

#social-share {
	background: #fff;
	border-radius: 20px;
	padding: 28px 36px 26px;
	box-shadow: 0 20px 50px -16px rgba(15, 30, 61, .38);
	text-align: center;
	direction: rtl;
}

/* כותרת בשורה אחת, מסוגנת */
#social-share .gb-headline-text {
	font-size: 17px !important;
	font-weight: 700 !important;
	color: #1F3864 !important;
	white-space: nowrap;
	margin: 0 0 20px !important;
	font-family: 'Rubik', 'Segoe UI', Arial, sans-serif !important;
	line-height: 1.4;
}

/* רשת האייקונים */
#overlay-container #gp-social-share {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	padding: 0;
	list-style: none;
	margin: 0;
	flex-wrap: nowrap;
}

#overlay-container #gp-social-share li { margin: 0 !important; }

/* גודל אייקון — דסקטופ */
#overlay-container #gp-social-share svg {
	width: 44px;
	height: 44px;
	display: block;
	transition: transform .2s ease, opacity .2s ease;
}

#overlay-container #gp-social-share a:hover svg {
	transform: translateY(-3px);
	opacity: .8;
}

/* מובייל — אייקונים קטנים יותר, כרטיס ממורכז ולא גולש */
@media (max-width: 640px) {
	/* מיקום ומידות — עוקף GenerateBlocks */
	#overlay-container #social-share {
		position: absolute !important;
		left: 50% !important;
		top: 50% !important;
		transform: translate(-50%, -50%) !important;
		width: min(340px, 92vw) !important;
		max-width: none !important;
		box-sizing: border-box !important;
		overflow: hidden;
	}
	/* הקונטיינר הפנימי של GB מקבל רוחב קבוע מה-block editor — מאפסים */
	#social-share > * {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
		padding: 0 !important;
	}
	#social-share { padding: 20px 16px 18px; }
	#social-share .gb-headline-text { font-size: 14px !important; }
	#overlay-container #gp-social-share { gap: 6px; flex-wrap: nowrap; width: 100%; }
	#overlay-container #gp-social-share svg { width: 32px; height: 32px; }
}
