/*
 * Кар'єра.
 *
 * Two things on one page: the vacancies, and the form that answers them. The
 * vacancies use the same fold as the course programmes — a candidate scans
 * titles and conditions first and reads one of them, exactly as a student
 * scans modules.
 */

.sx-jobs__title {
	margin: 0;
	font-size: var( --sx-title-page );
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.sx-jobs__lead {
	margin: 14px 0 0;
	max-width: 68ch;
	font-size: 1.05rem;
	line-height: 1.6;
	color: var( --sx-text-secondary );
}

.sx-jobs__h2 {
	margin: var( --wp--preset--spacing--60 ) 0 var( --wp--preset--spacing--20 );
	font-size: var( --sx-title-section );
	line-height: 1.15;
	letter-spacing: -0.02em;
	scroll-margin-top: 90px;
}

.sx-jobs__note {
	margin: 0 0 var( --wp--preset--spacing--30 );
	max-width: 68ch;
	color: var( --sx-text-secondary );
	line-height: 1.6;
}

/* ---- Перелік вакансій ---- */

.sx-jobs__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 14px;
}

.sx-jobs__item {
	background: var( --sx-white );
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	/* A vacancy sent as a link should not open under the sticky header. */
	scroll-margin-top: 90px;
}

.sx-jobs__head {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) 1.4rem;
	align-items: start;
	gap: 10px 16px;
	padding: 22px 26px;
	cursor: pointer;
	list-style: none;
}

.sx-jobs__head::-webkit-details-marker {
	display: none;
}

.sx-jobs__head:focus-visible {
	outline: 3px solid var( --sx-brand );
	outline-offset: -3px;
	border-radius: var( --sx-radius-lg );
}

.sx-jobs__name {
	min-width: 0;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: break-word;
}

/* Місто · досвід · тип роботи — the three things scanned before the text. */
.sx-jobs__meta {
	grid-column: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.sx-jobs__tag {
	padding: 4px 11px;
	border-radius: 999px;
	background: var( --sx-surface );
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var( --sx-text-secondary );
}

.sx-jobs__chevron {
	grid-row: 1;
	grid-column: 2;
	justify-self: end;
	margin-top: 0.45em;
	width: 9px;
	height: 9px;
	border-right: 2px solid var( --sx-text-muted );
	border-bottom: 2px solid var( --sx-text-muted );
	transform: translateY( -2px ) rotate( 45deg );
	transition:
		transform var( --sx-transition-base ) var( --sx-ease ),
		border-color var( --sx-transition-fast ) var( --sx-ease );
}

.sx-jobs__fold[open] .sx-jobs__chevron {
	transform: translateY( 2px ) rotate( -135deg );
	border-color: var( --sx-brand );
}

@media ( hover: hover ) {
	.sx-jobs__head:hover .sx-jobs__name {
		color: var( --sx-brand-text );
	}

	.sx-jobs__head:hover .sx-jobs__chevron {
		border-color: var( --sx-brand );
	}
}

/* Padding on the body, not on ::details-content — the wrapper's height is what
   animates, and padding there would not collapse with it. */
.sx-jobs__body {
	padding: 0 26px 24px;
	border-top: 1px solid var( --sx-border );
	padding-top: 20px;
	margin-top: 2px;
}

/* The vacancy text is written in the editor, so style the elements it produces
   rather than classes it will never have. */
.sx-jobs__body > * {
	max-width: 72ch;
}

.sx-jobs__body p {
	margin: 0 0 12px;
	line-height: 1.6;
	color: var( --sx-text-secondary );
}

.sx-jobs__body h3,
.sx-jobs__body h4 {
	margin: 22px 0 10px;
	font-size: 1rem;
	line-height: 1.3;
	color: var( --sx-text );
}

.sx-jobs__body h3:first-child,
.sx-jobs__body h4:first-child,
.sx-jobs__body p:first-child {
	margin-top: 0;
}

.sx-jobs__body ul {
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 8px;
}

.sx-jobs__body ul li {
	position: relative;
	padding-left: 20px;
	line-height: 1.55;
	color: var( --sx-text-secondary );
	overflow-wrap: break-word;
}

.sx-jobs__body ul li::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 0.62em;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var( --sx-brand-200 );
}

.sx-jobs__apply {
	margin: 20px 0 0 !important;
}

@supports ( interpolate-size: allow-keywords ) {
	.sx-jobs__list {
		interpolate-size: allow-keywords;
	}

	.sx-jobs__fold::details-content {
		block-size: 0;
		overflow: hidden;
		transition:
			block-size var( --sx-transition-base ) var( --sx-ease ),
			content-visibility var( --sx-transition-base ) var( --sx-ease ) allow-discrete;
	}

	.sx-jobs__fold[open]::details-content {
		block-size: auto;
	}
}

/* ---- Форма ---- */

.sx-cv {
	position: relative;
	display: grid;
	gap: 18px;
	padding: 28px;
	max-width: 780px;
	border: 1px solid var( --sx-border );
	border-radius: var( --sx-radius-lg );
	background: var( --sx-surface );
}

.sx-cv__grid {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 16px 20px;
}

.sx-cv__field {
	margin: 0;
	min-width: 0;
}

.sx-cv__field label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.8125rem;
	font-weight: 600;
}

.sx-cv__req {
	color: var( --sx-brand );
}

/* Ground, line and focus come from .sx-form--filled in tokens.css, shared with
   the popup and the contacts form. */
.sx-cv__field input,
.sx-cv__field select,
.sx-cv__field textarea {
	width: 100%;
	padding: 11px 14px;
	font: inherit;
	font-size: 0.9375rem;
	color: inherit;
}

.sx-cv__field textarea {
	resize: vertical;
}


/* The file input draws its own button, so give it room rather than the padding
   the text fields use — otherwise the button sits crooked in the box. */
.sx-cv__field input[ type="file" ] {
	padding: 9px 12px;
	font-size: 0.875rem;
	cursor: pointer;
}

.sx-cv__field input[ type="file" ]::file-selector-button {
	margin-right: 12px;
	padding: 7px 14px;
	border: 1px solid var( --sx-border-strong );
	border-radius: var( --sx-radius-btn );
	background: var( --sx-surface );
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var( --sx-text );
	cursor: pointer;
}

.sx-cv__hint {
	display: block;
	margin-top: 6px;
	font-size: 0.8125rem;
	color: var( --sx-text-muted );
}

.sx-cv__consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
}

.sx-cv__consent input {
	margin-top: 3px;
	flex: none;
}

.sx-cv__consent label {
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var( --sx-text-secondary );
}

.sx-cv__consent a {
	color: var( --sx-brand-text );
	text-decoration: underline;
}

.sx-cv__submit {
	margin: 0;
}

/* Off screen rather than display:none — a bot fills what it finds in the
   source, and this field is there to be filled. */
.sx-cv__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.sx-cv__state {
	margin: 0;
	padding: 16px 20px;
	border-radius: var( --sx-radius-lg );
	font-size: 0.9375rem;
	line-height: 1.5;
}

.sx-cv__state--ok {
	border: 1px solid var( --sx-success-100 );
	background: var( --sx-success-50 );
}

.sx-cv__state--err {
	border: 1px solid var( --sx-brand-200 );
	background: var( --sx-brand-50 );
	color: var( --sx-brand-text );
}

@media ( max-width: 780px ) {
	.sx-cv,
	.sx-jobs__head {
		padding: 22px 20px;
	}

	.sx-jobs__body {
		padding: 20px 20px 22px;
	}

	.sx-cv__grid {
		grid-template-columns: minmax( 0, 1fr );
	}

	.sx-jobs__name {
		font-size: 1.05rem;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.sx-jobs__chevron {
		transition: none;
	}

	@supports ( interpolate-size: allow-keywords ) {
		.sx-jobs__fold::details-content {
			transition: none;
		}
	}
}
