/* HUJI Jobs Search — RTL, accessible, brand-aligned (v1.1) */
.hjs {
	--hjs-primary: #6c1f5e;
	--hjs-primary-dark: #4f1244;
	--hjs-primary-soft: rgba(108, 31, 94, .08);
	--hjs-ink: #20232e;
	--hjs-muted: #717786;
	--hjs-line: #e7e3ee;
	--hjs-bg: #faf9fc;
	--hjs-card: #ffffff;
	--hjs-radius: 16px;
	--hjs-shadow: 0 1px 2px rgba(20,23,46,.05);
	--hjs-shadow-lg: 0 16px 38px rgba(20,23,46,.13);
	direction: rtl;
	text-align: right;
	/* Match the site's font (Elementor kit uses Rubik) for visual consistency */
	font-family: "Rubik", "Heebo", "Assistant", -apple-system, "Segoe UI", Arial, sans-serif;
	color: var(--hjs-ink);
	max-width: 1200px;
	margin-inline: auto;
	padding-bottom: 40px;
}
.hjs *, .hjs *::before, .hjs *::after { box-sizing: border-box; }
.hjs-hidden { display: none !important; }

/* ---------- Filters panel ---------- */
.hjs__filters {
	background: var(--hjs-bg);
	border: 1px solid var(--hjs-line);
	border-radius: var(--hjs-radius);
	padding: 22px;
	margin-bottom: 20px;
	box-shadow: var(--hjs-shadow);
}
.hjs__label { display: block; font-size: 13px; font-weight: 700; color: var(--hjs-primary); margin-bottom: 7px; }

.hjs__search-line { margin-bottom: 18px; }
.hjs__search-box { position: relative; }
.hjs__search-icon {
	position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%);
	color: var(--hjs-muted); pointer-events: none;
}
.hjs__input {
	width: 100%; height: 50px;
	padding-inline: 46px 16px;
	font-size: 16px; color: var(--hjs-ink); font-family: inherit;
	background: #fff; border: 1.5px solid var(--hjs-line); border-radius: 12px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.hjs__input::placeholder { color: #9aa0ad; }

.hjs__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
}

/* ---------- Combobox ---------- */
.hjs-combo { position: relative; min-width: 0; }
.hjs-combo__toggle {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	width: 100%; height: 48px; padding: 0 14px;
	font-size: 15px; font-family: inherit; color: var(--hjs-ink);
	background: #fff; border: 1.5px solid var(--hjs-line); border-radius: 11px;
	cursor: pointer; text-align: start;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.hjs-combo__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9aa0ad; }
.hjs-combo__value.is-set { color: var(--hjs-ink); font-weight: 700; }
.hjs-combo__caret { color: var(--hjs-primary); flex: none; transition: transform .18s ease; }
.hjs-combo.is-open .hjs-combo__caret { transform: rotate(180deg); }
.hjs-combo.is-open .hjs-combo__toggle { border-color: var(--hjs-primary); box-shadow: 0 0 0 3px var(--hjs-primary-soft); }

.hjs-combo__panel {
	position: absolute; z-index: 40; inset-inline: 0; top: calc(100% + 6px);
	background: #fff; border: 1px solid var(--hjs-line); border-radius: 12px;
	box-shadow: var(--hjs-shadow-lg); padding: 8px; overflow: hidden;
}
.hjs-combo__search {
	width: 100%; height: 40px; padding: 0 12px; margin-bottom: 6px;
	font-size: 14px; font-family: inherit;
	border: 1.5px solid var(--hjs-line); border-radius: 9px; color: var(--hjs-ink);
}
.hjs-combo__list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.hjs-combo__option {
	padding: 9px 12px; border-radius: 8px; cursor: pointer;
	font-size: 14.5px; line-height: 1.3; display: flex; justify-content: space-between; gap: 8px;
}
.hjs-combo__option:hover, .hjs-combo__option.is-active { background: var(--hjs-primary-soft); }
.hjs-combo__option[aria-selected="true"] { color: var(--hjs-primary); font-weight: 800; background: var(--hjs-primary-soft); }
.hjs-combo__opt-count { color: var(--hjs-muted); font-size: 12.5px; flex: none; }
.hjs-combo__option[aria-selected="true"] .hjs-combo__opt-count { color: var(--hjs-primary); }
.hjs-combo__empty { padding: 14px 12px; color: var(--hjs-muted); font-size: 14px; text-align: center; }

/* ---------- Reset (sits as a grid cell in the filter row, bottom-aligned) ---------- */
.hjs__reset-cell { display: flex; align-items: flex-end; }
.hjs__reset {
	height: 46px; padding: 0 24px;
	font-size: 15px; font-weight: 700; font-family: inherit;
	color: var(--hjs-primary); background: #fff;
	border: 1.5px solid var(--hjs-primary); border-radius: 999px; cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.hjs__reset:hover { background: var(--hjs-primary); color: #fff; }

/* focus visibility */
.hjs__input:focus, .hjs-combo__toggle:focus-visible, .hjs-combo__search:focus,
.hjs__reset:focus-visible, .hjs__more:focus-visible, .hjs-card__title-link:focus-visible {
	outline: 3px solid var(--hjs-primary-soft); outline-offset: 2px; border-color: var(--hjs-primary);
}
.hjs-card:focus-within { box-shadow: var(--hjs-shadow-lg); border-color: #d6cee3; }

/* ---------- Count ---------- */
.hjs__count { font-size: 15px; font-weight: 700; color: var(--hjs-muted); margin: 6px 2px 18px; }

/* ---------- Results grid ---------- */
.hjs__results { min-height: 140px; }
.hjs__grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px;
}
.hjs.is-loading .hjs__results { opacity: .45; transition: opacity .15s ease; pointer-events: none; }

/* ---------- Card (whole card clickable via stretched title link) ---------- */
.hjs-card {
	position: relative;
	display: flex; flex-direction: column; gap: 10px;
	background: var(--hjs-card);
	border: 1px solid var(--hjs-line);
	border-radius: var(--hjs-radius);
	padding: 22px;
	box-shadow: var(--hjs-shadow);
	transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.hjs-card::before {
	content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px;
	background: var(--hjs-primary); opacity: 0; transition: opacity .16s ease;
	border-radius: var(--hjs-radius) var(--hjs-radius) 0 0;
}
.hjs-card:hover { transform: translateY(-4px); box-shadow: var(--hjs-shadow-lg); border-color: #d6cee3; }
.hjs-card:hover::before { opacity: 1; }
/* kill any theme link styling inside the card */
.hjs-card a { text-decoration: none !important; box-shadow: none !important; }

.hjs-card__head { display: flex; align-items: center; gap: 12px; min-height: 50px; }
.hjs-card__logo { flex: none; height: 50px; display: flex; align-items: center; }
.hjs-card__logo img { max-height: 50px; max-width: 130px; width: auto; object-fit: contain; }
.hjs-card__logo-fallback {
	display: grid; place-items: center; width: 50px; height: 50px;
	background: var(--hjs-primary-soft); color: var(--hjs-primary); border-radius: 12px;
}
.hjs-card__employer { font-size: 13.5px; color: var(--hjs-muted); font-weight: 600; line-height: 1.3; }

.hjs-card__title { margin: 2px 0 0; font-size: 18px; font-weight: 800; line-height: 1.38; }
.hjs-card__title-link {
	color: var(--hjs-ink) !important;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* stretched link → whole card is clickable, but only ONE link per card */
.hjs-card__title-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hjs-card:hover .hjs-card__title-link { color: var(--hjs-primary) !important; }

.hjs-card__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--hjs-muted); }
.hjs-card__metaitem { display: inline-flex; align-items: center; gap: 5px; }
.hjs-card__metaitem svg { color: var(--hjs-primary); opacity: .8; }

.hjs-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.hjs-card__scope {
	font-size: 12.5px; font-weight: 700; color: var(--hjs-primary);
	background: var(--hjs-primary-soft); padding: 5px 12px; border-radius: 999px;
}
.hjs-card__cta {
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 14px; font-weight: 800; color: var(--hjs-primary);
}
.hjs-card__cta svg { transition: transform .16s ease; }
.hjs-card:hover .hjs-card__cta svg { transform: translateX(-3px); }

/* ---------- Empty / load more ---------- */
.hjs__empty {
	text-align: center; padding: 56px 16px; font-size: 16px; color: var(--hjs-muted);
	background: var(--hjs-bg); border: 1px dashed var(--hjs-line); border-radius: var(--hjs-radius);
}
.hjs__more-wrap { text-align: center; margin: 28px 0 6px; min-height: 24px; }
.hjs__more {
	padding: 13px 38px; font-size: 15px; font-weight: 800; font-family: inherit;
	color: #fff; background: var(--hjs-primary);
	border: none; border-radius: 999px; cursor: pointer;
	transition: background .15s ease, transform .1s ease;
}
.hjs__more:hover { background: var(--hjs-primary-dark); }
.hjs__more:active { transform: scale(.98); }
.hjs__spinner {
	display: inline-block; width: 26px; height: 26px; vertical-align: middle;
	border: 3px solid var(--hjs-line); border-top-color: var(--hjs-primary);
	border-radius: 50%; animation: hjs-spin .7s linear infinite;
}
@keyframes hjs-spin { to { transform: rotate(360deg); } }
.hjs__noscript { color: #b00020; font-weight: 700; }

/* ---------- Defensive contrast (override theme's aggressive <button> styling) ---------- */
.hjs .hjs-combo__toggle,
.hjs .hjs-combo__toggle:hover,
.hjs .hjs-combo__toggle:focus,
.hjs .hjs-combo__toggle:active {
	background-color: #fff !important;
	color: var(--hjs-ink) !important;
}
.hjs .hjs__more,
.hjs .hjs__more:hover,
.hjs .hjs__more:focus { color: #fff !important; }
.hjs .hjs__reset { background-color: #fff !important; color: var(--hjs-primary) !important; }
.hjs .hjs__reset:hover { background-color: var(--hjs-primary) !important; color: #fff !important; }
/* keep the placeholder text clear of the search icon (theme may strip the padding) */
.hjs .hjs__input { padding-inline-start: 50px !important; padding-inline-end: 16px !important; }

@media (max-width: 600px) {
	.hjs__filters { padding: 16px; }
	.hjs__grid { grid-template-columns: 1fr; }
	.hjs__reset { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.hjs-card, .hjs-card__cta svg, .hjs-combo__caret, .hjs__spinner, .hjs__input, .hjs-combo__toggle { transition: none; animation: none; }
}
