/**
 * Hire Developers page: softlance/hire-* blocks (inc/hire-developers.php).
 * Built on ds.css tokens and the shared .ab-* section styles (sections.css).
 *
 * Contents: shared · engagement models · roles · comparison · form · FAQ ·
 * editor · responsive
 */

/* ─── Shared ──────────────────────────────────────────────────────────── */
.hr-note {
	max-width: 46rem;
	margin: clamp(1.5rem, 3vw, 2rem) auto 0;
	font-size: 0.875rem;
	line-height: 1.6;
	text-align: center;
	color: var(--ds-muted);
}

.hr-note a { color: var(--ds-blue); }

[id="engagement-models"],
[id="hire-form"] { scroll-margin-top: 6rem; }

/* ─── Engagement models ───────────────────────────────────────────────── */
.hr-models__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.25rem;
	align-items: stretch;
}

.hr-model {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.75rem 1.5rem 1.5rem;
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-r-lg);
	background: #fff;
	box-shadow: var(--ds-shadow-sm);
	transition: border-color 0.2s var(--ds-ease), box-shadow 0.2s var(--ds-ease), transform 0.2s var(--ds-ease);
}

.hr-model:hover {
	border-color: var(--ds-blue-200);
	box-shadow: var(--ds-shadow);
	transform: translateY(-2px);
}

.hr-model.is-featured {
	border: 2px solid var(--ds-blue);
	box-shadow: var(--ds-shadow-lg);
}

.hr-model .ds-h4 { margin: 0; }

.hr-model__badge { margin: 0; }

.hr-model.is-featured .hr-model__badge {
	background: var(--ds-blue);
	color: #fff;
}

.hr-model__text {
	margin: 0;
	min-height: 3em;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--ds-text);
}

.hr-model__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.375rem;
	margin: 0.25rem 0 0;
	padding-block: 1rem;
	border-block: 1px solid var(--ds-line);
}

.hr-model__amount {
	font-size: clamp(1.625rem, 2.4vw, 2rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--ds-ink);
}

.hr-model__unit {
	font-size: 0.9375rem;
	color: var(--ds-muted);
}

.hr-model__features {
	flex: 1;
	margin-block: 0.5rem 0.75rem;
}

.hr-model__features li { font-size: 0.875rem; }

.hr-model__btn { margin-top: auto; }

/* ─── Roles ───────────────────────────────────────────────────────────── */
.hr-roles__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.875rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hr-role__link {
	display: flex;
	align-items: center;
	gap: 1rem;
	height: 100%;
	padding: 1rem 1.25rem;
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-r);
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: border-color 0.2s var(--ds-ease), background-color 0.2s var(--ds-ease), box-shadow 0.2s var(--ds-ease);
}

.hr-role__link:hover,
.hr-role__link:focus-visible {
	border-color: var(--ds-blue-300);
	background: var(--ds-blue-50);
	box-shadow: var(--ds-shadow-sm);
}

.hr-role__link:focus-visible { outline: none; box-shadow: var(--ds-ring); }

.hr-role__link .ds-iconbox { flex: none; }

.hr-role__body {
	display: grid;
	gap: 0.125rem;
	flex: 1;
	min-width: 0;
}

.hr-role__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--ds-ink);
}

.hr-role__stack {
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--ds-muted);
}

.hr-role__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	flex: none;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ds-blue);
}

.hr-role__cta .ds-icon {
	width: 1rem;
	height: 1rem;
	transition: transform 0.2s var(--ds-ease);
}

.hr-role__link:hover .hr-role__cta .ds-icon { transform: translateX(3px); }

/* ─── Comparison ──────────────────────────────────────────────────────── */
.hr-compare__wrap {
	overflow-x: auto;
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-r-lg);
	background: #fff;
	box-shadow: var(--ds-shadow-sm);
}

.hr-compare__wrap:focus-visible { outline: none; box-shadow: var(--ds-ring); }

.hr-compare__table {
	width: 100%;
	min-width: 40rem;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.hr-compare__table th,
.hr-compare__table td {
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--ds-line);
	text-align: left;
	vertical-align: top;
	line-height: 1.5;
}

.hr-compare__table tbody tr:last-child > * { border-bottom: 0; }

.hr-compare__table thead th {
	background: var(--ds-blue-50);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ds-muted);
}

.hr-compare__table tbody th {
	width: 22%;
	font-weight: 600;
	color: var(--ds-ink);
}

.hr-compare__table td { color: var(--ds-text); }

.hr-compare__table .is-us {
	background: var(--ds-blue-100);
	font-weight: 600;
	color: var(--ds-ink);
}

.hr-compare__table thead .is-us {
	background: var(--ds-blue);
	color: #fff;
}

/* ─── Form ────────────────────────────────────────────────────────────── */
.hr-form__inner {
	display: grid;
	grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
	gap: clamp(2rem, 5vw, 4rem);
	align-items: start;
}

.hr-form__copy {
	position: sticky;
	top: 7rem;
}

.hr-form__copy .ds-checks { margin-top: 1.5rem; }

.hr-form__contact {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--ds-line);
}

.hr-form__contact a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 600;
	color: var(--ds-ink);
	text-decoration: none;
}

.hr-form__contact a:hover { color: var(--ds-blue); }

.hr-form__contact .ds-icon {
	width: 1.125rem;
	height: 1.125rem;
	color: var(--ds-blue);
}

.hr-form__card {
	padding: clamp(1.5rem, 3vw, 2.25rem);
	box-shadow: var(--ds-shadow-lg);
}

.hr-form__card .ds-h4 { margin: 0; }

.hr-form__roles {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.hr-form__roles legend {
	margin-bottom: 0.625rem;
	padding: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ds-ink);
}

.hr-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.hr-chip { position: relative; cursor: pointer; }

.hr-chip input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.hr-chip span {
	display: inline-block;
	padding: 0.4375rem 0.8125rem;
	border: 1px solid var(--ds-line-strong);
	border-radius: 999px;
	background: #fff;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--ds-text);
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.hr-chip:hover span { border-color: var(--ds-blue-300); }

.hr-chip input:checked + span {
	border-color: var(--ds-blue);
	background: var(--ds-blue);
	color: #fff;
}

.hr-chip input:focus-visible + span { box-shadow: var(--ds-ring); }

.hr-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.hr-form__form label span[aria-hidden] { color: var(--ds-blue); }

.hr-form__form .ds-form__note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	margin: 0;
}

.hr-form__form .ds-form__note .ds-icon { width: 0.875rem; height: 0.875rem; }

/* Red is reserved for errors. */
.hr-form__form .ds-form__message.is-error {
	border: 1px solid #f5c2c2;
	background: #fdf2f2;
	color: #b42318;
}

.hr-form__success {
	display: grid;
	justify-items: center;
	gap: 0.75rem;
	padding-block: 2rem;
	text-align: center;
}

.hr-form__success:focus { outline: none; }

/* display:grid above would otherwise override the hidden attribute. */
.hr-form__form[hidden],
.hr-form__success[hidden] { display: none; }

.hr-form__success p { margin: 0; color: var(--ds-text); }

/* ─── FAQ ─────────────────────────────────────────────────────────────── */
.hr-faq__inner {
	display: grid;
	grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
	gap: clamp(2rem, 5vw, 4rem);
	align-items: start;
}

.hr-faq__list { display: grid; gap: 0.75rem; }

.hr-faq__item {
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-r);
	background: #fff;
	transition: border-color 0.2s var(--ds-ease);
}

.hr-faq__item[open] { border-color: var(--ds-blue-200); }

.hr-faq__item summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.125rem 1.25rem;
	font-weight: 600;
	color: var(--ds-ink);
	cursor: pointer;
	list-style: none;
}

.hr-faq__item summary::-webkit-details-marker { display: none; }

.hr-faq__item summary:focus-visible { outline: none; box-shadow: var(--ds-ring); border-radius: var(--ds-r); }

.hr-faq__icon {
	position: relative;
	flex: none;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: var(--ds-blue-100);
}

.hr-faq__icon::before,
.hr-faq__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0.625rem;
	height: 2px;
	border-radius: 2px;
	background: var(--ds-blue);
	transform: translate(-50%, -50%);
	transition: transform 0.2s var(--ds-ease);
}

.hr-faq__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.hr-faq__item[open] .hr-faq__icon::after { transform: translate(-50%, -50%) rotate(0deg); }

.hr-faq__item p {
	margin: 0;
	padding: 0 1.25rem 1.25rem;
	line-height: 1.65;
	color: var(--ds-text);
}

/* ─── Tech logo strip ─────────────────────────────────────────────────── */
.hr-logos {
	padding-block: clamp(1.75rem, 3vw, 2.5rem);
	border-bottom: 1px solid var(--ds-line);
	background: #fff;
}

.hr-logos__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem 2rem;
}

.hr-logos__label {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ds-muted);
}

.hr-logos__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hr-logos__item {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.625rem 1rem 0.625rem 0.75rem;
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-r);
	background: var(--ds-blue-50);
	transition: border-color 0.2s var(--ds-ease), transform 0.2s var(--ds-ease);
}

.hr-logos__item:hover {
	border-color: var(--ds-blue-200);
	transform: translateY(-2px);
}

.hr-logos__item .hr-logo {
	width: 1.75rem;
	height: 1.75rem;
	object-fit: contain;
}

.hr-logos__name {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ds-ink);
	white-space: nowrap;
}

/* ─── Skills with logos ───────────────────────────────────────────────── */
.hr-tech__inner {
	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
	align-items: start;
	gap: clamp(2rem, 5vw, 4.5rem);
}

.hr-tech .ab-head { margin-bottom: 0; }

.hr-tech__groups { display: grid; margin: 0; }

.hr-tech__group {
	display: grid;
	grid-template-columns: 9rem minmax(0, 1fr);
	gap: 1rem;
	padding: 1.25rem 0;
	border-top: 1px solid var(--ds-line);
}

.hr-tech__group:last-child { border-bottom: 1px solid var(--ds-line); }

.hr-tech__group dd { margin: 0; }

.hr-tech__label {
	margin: 0;
	padding-top: 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ds-muted);
}

.hr-tech__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hr-tech__chips .ds-chip.has-logo { padding-left: 0.625rem; }

.hr-chip-logo {
	flex: none;
	width: 1rem;
	height: 1rem;
	object-fit: contain;
}

/* Role cards on the hub: stack logo in place of the line icon. */
.hr-role__logo { background: var(--ds-blue-50); }
.hr-role__logo .hr-logo { width: 1.375rem; height: 1.375rem; object-fit: contain; }

/* ─── Editor ──────────────────────────────────────────────────────────── */
.hr-faq__item.is-editing { padding: 1rem 1.25rem; }
.hr-faq__item.is-editing .hr-faq__a { margin-top: 0.5rem; }

.hr-compare__editor-head,
.hr-compare__editor-row {
	display: grid;
	grid-template-columns: 1.2fr repeat(3, 1fr);
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--ds-line);
}

.hr-compare__editor-head { font-weight: 600; background: var(--ds-blue-50); }
.hr-compare__editor-head .is-us { color: var(--ds-blue); }

.hr-roles__foot {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1rem;
}

.hr-model .components-base-control { font-size: 0.75rem; }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
	.hr-models__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.hr-form__inner,
	.hr-faq__inner,
	.hr-tech__inner { grid-template-columns: minmax(0, 1fr); }
	.hr-logos__inner { justify-content: flex-start; }
	.hr-form__copy { position: static; }
}

@media (max-width: 720px) {
	.hr-roles__grid { grid-template-columns: minmax(0, 1fr); }

	/* Comparison: one card per row on phones. */
	.hr-compare__wrap { overflow: visible; border: 0; background: none; box-shadow: none; }
	.hr-compare__table { min-width: 0; }
	.hr-compare__table thead { display: none; }
	.hr-compare__table,
	.hr-compare__table tbody,
	.hr-compare__table tr,
	.hr-compare__table th,
	.hr-compare__table td { display: block; width: auto; }
	.hr-compare__table tr {
		margin-bottom: 0.875rem;
		border: 1px solid var(--ds-line);
		border-radius: var(--ds-r);
		background: #fff;
		overflow: hidden;
	}
	.hr-compare__table tbody th { width: auto; padding: 0.875rem 1rem; background: var(--ds-blue-50); }
	.hr-compare__table td {
		display: flex;
		justify-content: space-between;
		gap: 1rem;
		padding: 0.625rem 1rem;
		text-align: right;
	}
	.hr-compare__table td::before {
		content: attr(data-label);
		font-weight: 500;
		text-align: left;
		color: var(--ds-muted);
	}
	.hr-compare__table tbody tr:last-child > * { border-bottom: 1px solid var(--ds-line); }
	.hr-compare__table tr > :last-child { border-bottom: 0 !important; }
}

@media (max-width: 600px) {
	.hr-tech__group { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
	.hr-tech__label { padding-top: 0; }
	.hr-logos__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 0.5rem; }
	.hr-logos__item { padding: 0.5rem 0.75rem; }
	.hr-logos__name { font-size: 0.875rem; white-space: normal; }
	.hr-models__grid,
	.hr-form__grid { grid-template-columns: minmax(0, 1fr); }
	.hr-model__text { min-height: 0; }
	.hr-role__cta span,
	.hr-role__cta { font-size: 0; gap: 0; }
	.hr-role__cta .ds-icon { width: 1.125rem; height: 1.125rem; }
}
