/**
 * Careers form.
 *
 * Field, grid and step styling come from the donations stylesheet, which every
 * PHWO form shares. Only what is specific to this form lives here: the two
 * route cards, the file inputs and the review timeline.
 */

/* --------------------------------------------------------------- Route */

.phwo-route {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 14px;
	margin: 0 0 22px;
}

.phwo-route-option {
	position: relative;
	display: block;
	padding: 18px 18px 18px 52px;
	border: 1px solid rgba(20, 38, 43, 0.16);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.phwo-route-option:hover {
	border-color: var(--phwo-color-primary, #0d5c63);
}

.phwo-route-option input {
	position: absolute;
	top: 21px;
	left: 20px;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--phwo-color-primary, #0d5c63);
}

.phwo-route-option:has(input:checked) {
	border-color: var(--phwo-color-primary, #0d5c63);
	background: rgba(13, 92, 99, 0.04);
	box-shadow: 0 0 0 1px var(--phwo-color-primary, #0d5c63);
}

.phwo-route-option input:focus-visible {
	outline: 2px solid var(--phwo-color-accent, #e8a33d);
	outline-offset: 3px;
}

.phwo-route-body strong {
	display: block;
	font-size: 1.05rem;
	margin-bottom: 4px;
	color: var(--phwo-color-ink, #14262b);
}

.phwo-route-body span {
	display: block;
	font-size: 0.9rem;
	line-height: 1.5;
	color: rgba(20, 38, 43, 0.7);
}

/* ---------------------------------------------------------- Conditional */

/* The [hidden] attribute is how the script switches routes; some resets
   override it, so make it stick. */
.phwo-careers-form .phwo-when[hidden] {
	display: none !important;
}

.phwo-careers-stage {
	margin-top: 18px;
	padding: 14px 16px;
	border-left: 3px solid var(--phwo-color-accent, #e8a33d);
	background: rgba(232, 163, 61, 0.08);
	border-radius: 0 6px 6px 0;
}

/* --------------------------------------------------------------- Files */

.phwo-field.phwo-file input[type="file"] {
	width: 100%;
	padding: 12px;
	border: 1px dashed rgba(20, 38, 43, 0.28);
	border-radius: 8px;
	background: rgba(20, 38, 43, 0.02);
	font-size: 0.92rem;
	cursor: pointer;
}

.phwo-field.phwo-file input[type="file"]:focus-visible {
	outline: 2px solid var(--phwo-color-accent, #e8a33d);
	outline-offset: 2px;
}

.phwo-field.phwo-file input[type="file"]::file-selector-button {
	margin-right: 12px;
	padding: 7px 14px;
	border: 0;
	border-radius: 6px;
	background: var(--phwo-color-primary, #0d5c63);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

/* -------------------------------------------------------------- Layout */

@media (max-width: 640px) {
	.phwo-route-option {
		padding: 16px 16px 16px 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.phwo-route-option {
		transition: none;
	}
}

/* ------------------------------------------------- Route switching
   The cache plugin delays JavaScript until the first interaction, so the
   show/hide is done in CSS: the conditional sections are hidden until a route
   is chosen, and :has() reveals the matching one the instant the radio is
   ticked. Wrapped in @supports so a browser without :has() simply shows both
   sections and the applicant fills in the half that applies — the server
   validates against the route they actually picked either way. */
@supports selector(:has(*)) {
	.phwo-careers-form .phwo-when {
		display: none;
	}

	.phwo-careers-form:has([data-phwo-route][value="job"]:checked) [data-phwo-when="job"],
	.phwo-careers-form:has([data-phwo-route][value="internship"]:checked) [data-phwo-when="internship"] {
		display: block;
	}
}
