/* ------------------------------------------------------------------
   Jobs page of Taallem France: search, filters, tiles, and the CV assistant.
   Loaded after pays.css, on that page only. Every colour is a token of
   pays.css, so the page follows the light and the dark theme.
   ------------------------------------------------------------------ */

/* The photo on top of each tab. */
.tab-banner {
	position: relative;
	height: clamp(9rem, 20vw, 14rem);
	overflow: hidden;
	border-radius: 4px;
	background: var(--surface-2);
}

.tab-banner img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tab-banner::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to right, rgb(3 7 18 / 0.78), rgb(3 7 18 / 0.2) 60%, transparent);
}

.tab-banner-text {
	position: absolute;
	bottom: 1.25rem;
	left: clamp(1rem, 3vw, 2rem);
	z-index: 1;
}

.tab-banner-name {
	color: #fff;
	font-family: var(--serif);
	font-size: clamp(1.9rem, 4.2vw, 3rem);
	line-height: 1.05;
}

.tab-banner-meta {
	margin-top: 0.3rem;
	color: rgb(255 255 255 / 0.9);
	font-size: 0.95rem;
}

/* ---------- offers: search, kinds, list or tiles ---------- */

.job-tools {
	margin-top: 1.5rem;
}

.job-tools[hidden],
.job-group[hidden],
.job-none[hidden] {
	display: none;
}

.job-search {
	position: relative;
	max-width: 36rem;
}

.job-search svg {
	position: absolute;
	top: 50%;
	left: 0.95rem;
	fill: none;
	stroke: var(--muted);
	stroke-width: 1.8;
	stroke-linecap: round;
	transform: translateY(-50%);
	pointer-events: none;
}

.job-search input[type='search'] {
	width: 100%;
	padding: 0.8rem 1rem 0.8rem 2.75rem;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: var(--field);
	color: var(--ink);
	font: 500 1rem var(--sans);
}

.job-search input[type='search']:focus-visible {
	border-color: var(--fill);
	outline: 2px solid var(--fill);
	outline-offset: 1px;
}

.job-tools .list-tools {
	margin-bottom: 0.75rem;
}

[data-job-count] {
	color: var(--muted);
	font-size: 0.9rem;
}

.job-group .sub {
	margin-top: 1.75rem;
}

.group-note {
	margin: -0.4rem 0 0.75rem;
}

.job-kind {
	display: none;
	color: rgb(255 255 255 / 0.85);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.list.is-cards .job-kind {
	display: block;
}

/* Tiles: a flat colour by kind of offer, white text. */
.list.is-cards .item[data-kind='job'] {
	--tile: #1d4ed8;
}

/* Most offers are remote jobs: four blues in turn, so the wall of tiles is not one flat colour. */
.list.is-cards .item[data-kind='job']:nth-child(4n + 2) {
	--tile: #4338ca;
}

.list.is-cards .item[data-kind='job']:nth-child(4n + 3) {
	--tile: #0369a1;
}

.list.is-cards .item[data-kind='job']:nth-child(4n + 4) {
	--tile: #1e3a8a;
}

.list.is-cards .item[data-kind='phd'] {
	--tile: #6d28d9;
}

.list.is-cards .item[data-kind='postdoc'] {
	--tile: #0f766e;
}

.list.is-cards .item[data-kind='study'] {
	--tile: #b45309;
}

.list.is-cards .item[data-kind='internship'] {
	--tile: #be185d;
}

.list.is-cards .item[data-kind='research'] {
	--tile: #334155;
}

.list.is-cards .meta a {
	color: inherit;
	text-decoration: none;
}

.list.is-cards .job-salary {
	align-self: flex-start;
	margin-top: auto;
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
	background: rgb(255 255 255 / 0.18);
	color: #fff;
	font-weight: 500;
}

.job-none {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

/* ---------- CV assistant ---------- */

.cv-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

.cv-steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
	gap: 0.6rem;
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
}

.cv-step {
	--edge: #f97316;
	display: grid;
	gap: 0.35rem;
	align-content: start;
	padding: 1.1rem;
	border: 1px solid var(--line);
	border-top: 4px solid var(--edge);
	border-radius: 4px;
	background: var(--surface);
	color: var(--body);
	font-size: 0.93rem;
}

.cv-step:nth-child(2) {
	--edge: #3b82f6;
}

.cv-step:nth-child(3) {
	--edge: #10b981;
}

.cv-step-number {
	color: var(--muted);
	font-family: var(--serif);
	font-size: 1.6rem;
	line-height: 1;
}

.cv-step-title {
	color: var(--ink);
	font-size: 1.02rem;
	font-weight: 600;
}

.cv {
	margin-top: 1.25rem;
}

.cv[hidden],
.cv-results[hidden],
.cv-more[hidden] {
	display: none;
}

.cv-drop {
	display: grid;
	gap: 0.5rem;
	justify-items: center;
	padding: clamp(1.5rem, 5vw, 3rem) 1.25rem;
	border: 2px dashed var(--line-2);
	border-radius: 8px;
	background: var(--surface);
	text-align: center;
	transition: border-color 0.15s, background-color 0.15s;
}

.cv-drop.is-over {
	border-color: var(--fill);
	background: var(--surface-2);
}

.cv-drop-icon {
	fill: none;
	stroke: var(--accent);
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cv-drop-title {
	color: var(--ink);
	font-size: 1.2rem;
	font-weight: 600;
}

.cv-drop .btn {
	margin-top: 0.5rem;
}

.cv-paste {
	margin-top: 1rem;
}

.cv-paste summary {
	color: var(--accent);
	font-weight: 500;
	cursor: pointer;
}

.cv-paste textarea {
	display: block;
	width: 100%;
	margin: 0.75rem 0;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--line-2);
	border-radius: 4px;
	background: var(--field);
	color: var(--ink);
	font: 400 0.95rem/1.5 var(--sans);
	resize: vertical;
}

.cv-privacy {
	margin-top: 1rem;
	padding-left: 0.9rem;
	border-left: 3px solid var(--green);
}

[data-cv-status]:not(:empty) {
	margin-top: 1rem;
	color: var(--ink);
	font-weight: 500;
}

.cv-matches {
	display: grid;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cv-match {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
	padding: 1.1rem 1.25rem;
	border: 1px solid var(--line);
	border-left: 4px solid var(--fill);
	border-radius: 4px;
	background: var(--surface);
}

.cv-rank {
	color: var(--muted);
	font-family: var(--serif);
	font-size: 2rem;
	line-height: 1;
}

.cv-match-body {
	display: grid;
	gap: 0.35rem;
}

.cv-common {
	color: var(--body);
	font-size: 0.9rem;
}

/* How close the offer is to the CV, next to the best one: a plain bar, no figure. */
.cv-bar {
	height: 6px;
	max-width: 22rem;
	overflow: hidden;
	border-radius: 4px;
	background: var(--surface-2);
}

.cv-bar span {
	display: block;
	height: 100%;
	border-radius: 4px;
	background: var(--fill);
}

.cv-match .text-link {
	justify-self: start;
	margin-top: 0.2rem;
}

.cv-more {
	margin-top: 1rem;
	color: var(--ink);
	font-weight: 500;
}

.cv + .note {
	margin-top: 1.25rem;
}

.cv-premium {
	margin-top: 2rem;
}

.cv-premium-list {
	display: grid;
	gap: 0.4rem;
	padding-left: 1.2rem;
	color: var(--body);
}

@media (max-width: 520px) {
	.cv-match {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.4rem;
	}
}

/* ---------- right to left (Arabic pages) ---------- */

html[dir='rtl'] .tab-banner::after {
	background: linear-gradient(to left, rgb(3 7 18 / 0.78), rgb(3 7 18 / 0.2) 60%, transparent);
}

html[dir='rtl'] .tab-banner-text {
	right: clamp(1rem, 3vw, 2rem);
	left: auto;
}

html[dir='rtl'] .job-search svg {
	right: 0.95rem;
	left: auto;
}

html[dir='rtl'] .job-search input[type='search'] {
	padding: 0.8rem 2.75rem 0.8rem 1rem;
}

html[dir='rtl'] .cv-privacy {
	padding-right: 0.9rem;
	padding-left: 0;
	border-right: 3px solid var(--green);
	border-left: 0;
}

html[dir='rtl'] .cv-match {
	border-right: 4px solid var(--fill);
	border-left: 1px solid var(--line);
}

html[dir='rtl'] .cv-premium-list {
	padding-right: 1.2rem;
	padding-left: 0;
}

html[dir='rtl'] .job-kind {
	text-transform: none;
}

/* Offers are mostly written in English: each title keeps its own direction. */
html[dir='rtl'] .item-title {
	unicode-bidi: plaintext;
}
