/**
 * Henkilöstöhaku — shortcode [henkilostohaku]
 * Käyttää teeman olemassaolevia dg-contact-card -tyylejä korttien renderöintiin.
 */

.dg-henkilostohaku__form {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: flex-end;
	margin: 0 0 30px 0;
}

.dg-henkilostohaku__field {
	display: flex;
	flex-direction: column;
	flex: 1 1 280px;
	min-width: 0;
}

/* Matchaa Ninja Forms -lomakkeiden ulkoasua (.nf-form-cont input/textarea + label):
   ei reunaviivaa, ei pyöristystä, tausta #ededed, font Archivo 18px, label bold. */
.dg-henkilostohaku__label {
	display: block;
	margin-bottom: 8px;
	font-weight: 700;
	font-size: 18px;
	color: #000;
}

.dg-henkilostohaku__input {
	width: 100%;
	padding: 12.5px 15px;
	border: 0;
	border-radius: 0;
	background-color: #ededed;
	color: #000;
	font-size: 18px;
	font-family: inherit;
	line-height: 1.75;
	box-sizing: border-box;
}

.dg-henkilostohaku__input:focus {
	outline: 2px solid var(--wp--preset--color--primary, #B71C1C);
	outline-offset: 2px;
}

/* type="search" -kentän selainspesifinen tyhjennys-× neutralisoituna
   (oletuksena macOS:n accent-väri = sininen) */
.dg-henkilostohaku__input::-webkit-search-cancel-button,
.dg-hh-combobox__search::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
	height: 16px;
	width: 16px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath stroke='%23666' stroke-width='2' stroke-linecap='round' d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	cursor: pointer;
}

/* --- Combobox (yksikön valitsin) --- */

.dg-hh-combobox {
	position: relative;
	width: 100%;
}

.dg-hh-combobox__toggle {
	width: 100%;
	display: block;
	padding: 12.5px 40px 12.5px 15px;
	border: 0;
	border-radius: 0;
	background-color: #ededed;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 15px center;
	background-size: 16px 12px;
	color: #000;
	font-size: 18px;
	font-family: inherit;
	line-height: 1.75;
	text-align: left;
	cursor: pointer;
	box-sizing: border-box;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dg-hh-combobox__toggle:focus {
	outline: 2px solid var(--wp--preset--color--primary, #B71C1C);
	outline-offset: 2px;
}

.dg-hh-combobox__current {
	display: inline;
}

.dg-hh-combobox__arrow {
	display: none;
}

.dg-hh-combobox__clear {
	position: absolute;
	top: 50%;
	right: 32px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	border-radius: 50%;
}

.dg-hh-combobox__clear[hidden] {
	display: none;
}

.dg-hh-combobox__clear:hover,
.dg-hh-combobox__clear:focus {
	background-color: rgba(0, 0, 0, 0.1);
}

.dg-hh-combobox__clear:focus {
	outline: 2px solid var(--wp--preset--color--primary, #B71C1C);
	outline-offset: 1px;
}

.dg-hh-combobox__clear svg {
	display: block;
}

.dg-hh-combobox__popup {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 50;
	background: #fff;
	border: 1px solid #999;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	max-height: 60vh;
	display: flex;
	flex-direction: column;
}

.dg-hh-combobox__popup[hidden] {
	display: none;
}

.dg-hh-combobox__search-wrap {
	padding: 12px;
	border-bottom: 1px solid #ddd;
	flex-shrink: 0;
}

.dg-hh-combobox__search-label {
	/* Visually hidden — labelin teksti on jo "Yksikkö" toggle-painikkeessa */
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.dg-hh-combobox__search {
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 0;
	background-color: #ededed;
	color: #000;
	font-size: 16px;
	font-family: inherit;
	box-sizing: border-box;
}

.dg-hh-combobox__search:focus {
	outline: 2px solid var(--wp--preset--color--primary, #B71C1C);
	outline-offset: 2px;
}

.dg-hh-combobox__listbox {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	overflow-y: auto;
	flex: 1 1 auto;
}

.dg-hh-combobox__group-label {
	padding: 10px 15px 6px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #666;
	cursor: default;
	user-select: none;
}

.dg-hh-combobox__group-label.is-hidden {
	display: none;
}

.dg-hh-combobox__option {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 15px;
	font-size: 16px;
	color: #000;
	cursor: pointer;
}

.dg-hh-combobox__option.is-hidden {
	display: none;
}

.dg-hh-combobox__option.is-active,
.dg-hh-combobox__option:hover {
	background-color: rgba(183, 28, 28, 0.08);
}

.dg-hh-combobox__option[aria-selected="true"] {
	background-color: rgba(183, 28, 28, 0.15);
	font-weight: 700;
}

.dg-hh-combobox__option--all {
	font-weight: 600;
	border-bottom: 1px solid #eee;
	margin-bottom: 4px;
}

.dg-hh-combobox__count {
	flex-shrink: 0;
	color: #666;
	font-variant-numeric: tabular-nums;
}

.dg-henkilostohaku__help {
	margin: 0 0 20px 0;
	color: #555;
	font-style: italic;
}

.dg-henkilostohaku__status {
	margin: 0 0 20px 0;
	font-weight: 600;
	min-height: 1.5em;
}

.dg-henkilostohaku__results {
	margin: 0 0 30px 0;
}

.dg-henkilostohaku__loadmore-wrap {
	margin: 30px 0 0 0;
}

/* Saavutettavuus: fokustila uudelle kortille kun Näytä lisää klikataan */
.dg-contact-card[tabindex="-1"]:focus {
	outline: 2px solid var(--wp--preset--color--primary, #B71C1C);
	outline-offset: 2px;
}
