/**
 * Careers page styles — /careers/
 *
 * Figma: 6746:212508 (page) + 6781:285747 (form variant).
 * Sections flow directly (no gaps between them); each section owns its
 * own background colour and top/bottom padding.
 */

.wlre-careers-page {
	display: flex;
	flex-direction: column;
}

.wlre-careers-page .wlre-service-hero {
	padding-top: var(--wlre-space-48);
	padding-bottom: var(--wlre-space-48);
}

/* ---- Intro — white bg, centered text above wide photo ---- */
.wlre-careers-intro {
	background: var(--wlre-color-white);
	padding: var(--wlre-space-64) var(--wlre-space-24);
	display: flex;
	flex-direction: column;
	gap: var(--wlre-space-40);
}

.wlre-careers-intro__inner {
	max-width: 1240px;
	margin: 0 auto;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wlre-space-16);
}

.wlre-careers-intro__copy {
	max-width: 720px;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: var(--wlre-space-16);
}

.wlre-careers-intro__title {
	margin: 0;
	color: var(--wlre-color-text-900);
}

.wlre-careers-intro__lead {
	margin: 0;
	color: var(--wlre-color-neutral-600);
}

/* Wide landscape team photo — agency replaces assets/images/careers-team.jpg */
.wlre-careers-intro__photo-wrap {
	max-width: 1240px;
	width: calc(100% - var(--wlre-space-48));
	margin: 0 auto;
	border-radius: var(--wlre-radius-20);
	overflow: hidden;
}

.wlre-careers-intro__photo {
	width: 100%;
	aspect-ratio: 16 / 5;
	background:
		url('../images/careers/careers-team.webp') center / cover no-repeat,
		var(--wlre-color-neutral-200);
}

/* ---- Pillars — cream bg, numbered cards ---- */
.wlre-careers-pillars {
	background: var(--wlre-color-surface-50);
	padding: var(--wlre-space-80) var(--wlre-space-24);
}

.wlre-careers-pillars__inner {
	max-width: 1240px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: var(--wlre-space-32);
}

.wlre-careers-pillars__heading {
	margin: 0;
	text-align: center;
	color: var(--wlre-color-text-900);
}

.wlre-careers-pillars__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wlre-space-12);
}

.wlre-careers-pillar {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: var(--wlre-space-24);
	background: var(--wlre-color-white);
	border: 1px solid #d0d0d0;
	border-radius: var(--wlre-radius-20);
}

.wlre-careers-pillar__number {
	display: block;
	font-family: var(--wlre-font-heading);
	font-size: var(--wlre-font-size-h5);
	font-weight: 600;
	line-height: 1.2;
	color: var(--wlre-color-neutral-600);
	margin: 0 0 var(--wlre-space-24);
}

.wlre-careers-pillar__title {
	margin: 0 0 var(--wlre-space-12);
	color: var(--wlre-color-text-900);
}

.wlre-careers-pillar__desc {
	margin: 0;
	color: var(--wlre-color-neutral-600);
}

/* ---- Form section — white bg, section heading + centred 800px card ---- */
.wlre-careers-form-section {
	background: var(--wlre-color-white);
	padding: var(--wlre-space-80) var(--wlre-space-24);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wlre-space-32);
	position: relative;
	overflow: hidden;
}

/* Lotus watermark — Figma node 6781:287555, bottom-right corner.
 * inset: top 51.41% / right -13.34% / bottom -6.49% / left 55.07% */
.wlre-careers-form-section::before {
	content: '';
	position: absolute;
	top: 51.41%;
	right: -13.34%;
	bottom: -6.49%;
	left: 55.07%;
	background-image: url('../images/careers-bg-decor.svg');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	pointer-events: none;
	z-index: 0;
}

.wlre-careers-form-section__heading {
	margin: 0;
	text-align: center;
	color: var(--wlre-color-text-900);
	position: relative;
	z-index: 1;
}

.wlre-form-card--careers {
	width: 100%;
	max-width: 800px;
	margin: 0;
	position: relative;
	overflow: hidden;
	z-index: 1;
}

.wlre-form-card--careers .wlre-form-card__heading {
	margin-bottom: var(--wlre-space-32);
	text-align: center;
}

/* Two-up grid for form rows. */
.wlre-form__row--two {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wlre-space-16);
	margin-bottom: var(--wlre-space-20);
}

/* Fixed-height textarea to match Figma 120px. */
.wlre-form__textarea--fixed {
	height: 120px;
	min-height: 120px;
	resize: none;
}

/* Disabled-by-default Comune input. */
.wlre-form__input--disabled,
.wlre-form__input:disabled {
	background: var(--wlre-color-surface-50);
	color: var(--wlre-color-neutral-400);
	cursor: not-allowed;
	border-color: var(--wlre-color-neutral-200);
}

/* CV file — hidden native input (shared rule with forms.css pattern) */
.wlre-form__file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Author display rules must explicitly beat the user-agent [hidden] rule. */
.wlre-form__dropzone[hidden],
.wlre-form__cv-card[hidden] {
	display: none;
}

/* Drag-and-drop upload zone */
.wlre-form__dropzone {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 80px;
	background: var(--wlre-color-white);
	border: 0.5px dashed #999;
	border-radius: var(--wlre-radius-sm);
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.wlre-form__dropzone:hover,
.wlre-form__dropzone:focus-within,
.wlre-form__dropzone.is-dragover {
	border-color: var(--wlre-color-accent-500);
}

.wlre-form__dropzone--error {
	border-color: var(--wlre-color-error-700);
}

.wlre-form__dropzone-icon {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	color: var(--wlre-color-brand-900);
}

.wlre-form__dropzone-icon svg {
	width: 100%;
	height: 100%;
}

.wlre-form__dropzone-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-family: var(--wlre-font-body);
}

.wlre-form__dropzone-row {
	font-size: 12px;
	color: #333;
	line-height: 1.48;
}

.wlre-form__dropzone-link {
	text-decoration: underline;
	color: var(--wlre-color-brand-900);
	font-size: 12px;
	font-weight: 600;
}

.wlre-form__dropzone-hint {
	font-size: 11px;
	color: #999;
	line-height: 1.48;
}

/* === Custom Select === */
.wlre-custom-select {
	position: relative;
}

.wlre-custom-select__native {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	pointer-events: none;
	appearance: none;
}

.wlre-custom-select__trigger {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 52px;
	padding: 14px 24px;
	background: var(--wlre-color-white);
	border: 0.5px solid #666;
	border-radius: var(--wlre-radius-sm);
	cursor: pointer;
	gap: 10px;
	text-align: left;
	font-family: var(--wlre-font-body);
	transition: border-color 0.15s;
}

.wlre-custom-select__trigger:focus-visible {
	outline: 2px solid var(--wlre-color-accent-500);
	outline-offset: 2px;
}

.wlre-custom-select__value {
	flex: 1;
	font-size: 14px;
	line-height: 1.48;
	color: var(--wlre-color-brand-900);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wlre-custom-select__value--placeholder {
	color: #666;
}

.wlre-custom-select__icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	color: var(--wlre-color-brand-900);
	transition: transform 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wlre-custom-select__icon svg {
	width: 100%;
	height: 100%;
}

/* Open state */
.wlre-custom-select.is-open .wlre-custom-select__trigger {
	border: 1px solid var(--wlre-color-brand-900);
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.wlre-custom-select.is-open .wlre-custom-select__icon {
	transform: rotate(180deg);
}

/* Panel */
.wlre-custom-select__panel {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 200;
	list-style: none;
	margin: 0;
	padding: 8px 0;
	background: var(--wlre-color-white);
	border: 1px solid var(--wlre-color-brand-900);
	border-top: none;
	border-bottom-left-radius: var(--wlre-radius-sm);
	border-bottom-right-radius: var(--wlre-radius-sm);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	max-height: 280px;
	overflow-y: auto;
}

.wlre-custom-select__option {
	display: flex;
	align-items: center;
	height: 40px;
	padding: 8px 24px;
	font-family: var(--wlre-font-body);
	font-size: 14px;
	line-height: 1.48;
	color: var(--wlre-color-brand-900);
	cursor: pointer;
}

.wlre-custom-select__option:hover,
.wlre-custom-select__option[aria-selected="true"] {
	background: var(--wlre-color-surface-50);
}

/* Disabled state (Comune before province is selected) */
.wlre-custom-select--disabled .wlre-custom-select__trigger {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* Error state — propagated from hidden native select via :has() */
.wlre-custom-select:has(.wlre-form__select--error) .wlre-custom-select__trigger {
	border-color: var(--wlre-color-error-700);
}

/* === CV Uploaded Card === */
.wlre-form__cv-card {
	width: 100%;
	background: var(--wlre-color-white);
	border: 0.5px solid #d0d0d0;
	border-radius: var(--wlre-radius-md);
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wlre-form__cv-card__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.wlre-form__cv-card__name {
	font-family: var(--wlre-font-body);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.48;
	color: var(--wlre-color-brand-900);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1;
	min-width: 0;
}

.wlre-form__cv-card__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.wlre-form__cv-card__btn {
	display: flex;
	align-items: center;
	gap: 4px;
	font-family: var(--wlre-font-body);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.48;
	color: var(--wlre-color-brand-900);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}

.wlre-form__cv-card__btn:hover {
	opacity: 0.75;
}

.wlre-form__cv-card__btn svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.wlre-form__cv-card__meta {
	margin: 0;
	font-family: var(--wlre-font-body);
	font-size: 12px;
	line-height: 1.48;
	color: #666;
}

/* Submit button: centered 338px pill matching Figma. */
.wlre-careers-form .wlre-form__submit {
	display: block;
	max-width: 338px;
	width: 100%;
	height: 56px;
	margin: var(--wlre-space-8) auto 0;
}

/* === Responsive === */
@media (max-width: 1023px) {
	.wlre-careers-intro {
		padding: var(--wlre-space-64) var(--wlre-space-24);
	}

	.wlre-careers-pillars__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wlre-careers-pillars__heading,
	.wlre-careers-form-section__heading {
		font-size: var(--wlre-font-size-h3);
	}
}

@media (max-width: 767px) {
	/* Hero */
	.wlre-careers-page .wlre-service-hero {
		padding: var(--wlre-space-40) var(--wlre-space-16);
	}

	.wlre-careers-page .wlre-service-hero__heading {
		font-size: 40px;
	}

	/* Intro */
	.wlre-careers-intro {
		padding: var(--wlre-space-40) var(--wlre-space-16);
		gap: var(--wlre-space-20);
	}

	.wlre-careers-intro__inner {
		flex-direction: column;
		gap: var(--wlre-space-20);
	}

	.wlre-careers-intro__title {
		font-size: 32px;
	}

	.wlre-careers-intro__photo-wrap {
		width: 100%;
		border-radius: var(--wlre-radius-lg);
	}

	.wlre-careers-intro__photo {
		aspect-ratio: unset;
		height: 180px;
	}

	/* Pillars */
	.wlre-careers-pillars {
		padding: var(--wlre-space-40) var(--wlre-space-16);
	}

	.wlre-careers-pillars__inner {
		gap: var(--wlre-space-20);
	}

	.wlre-careers-pillars__heading {
		font-size: 32px;
	}

	.wlre-careers-pillars__grid {
		grid-template-columns: 1fr;
		gap: var(--wlre-space-12);
	}

	.wlre-careers-pillar__number {
		font-size: 20px;
	}

	.wlre-careers-pillar__title {
		font-size: 22px;
	}

	.wlre-careers-pillar__desc {
		font-size: var(--wlre-font-size-m);
	}

	/* Form section */
	.wlre-careers-form-section {
		padding: var(--wlre-space-40) var(--wlre-space-16);
		gap: var(--wlre-space-20);
	}

	.wlre-careers-form-section__heading {
		font-size: 32px;
	}

	.wlre-form-card--careers {
		padding: var(--wlre-space-32) var(--wlre-space-20);
	}

	.wlre-form-card--careers .wlre-form-card__heading {
		font-size: 22px;
		margin-bottom: var(--wlre-space-20);
	}

	.wlre-form-card--careers .wlre-form__label {
		font-size: 14px;
	}

	.wlre-form__row--two {
		grid-template-columns: 1fr;
		gap: 0;
		margin-bottom: 0;
	}

	.wlre-careers-form .wlre-form__submit {
		max-width: none;
		width: 100%;
	}

	.wlre-form__dropzone {
		flex-direction: column;
		min-height: 100px;
		gap: 8px;
		padding: 16px;
		text-align: center;
	}
}

@media (min-width: 1024px) {
	.wlre-careers-intro {
		padding: var(--wlre-space-80) 120px;
	}

	.wlre-careers-pillars {
		padding: var(--wlre-space-80) 120px;
	}

	.wlre-careers-form-section {
		padding: var(--wlre-space-80) var(--wlre-space-100);
	}
}
