/* Henkilöstö — loaded via wp_enqueue_style (NOT css/frontend.css).
   BB auto-bundles frontend.css into a stale layout cache; keep that file empty. */

.mh-henkilosto {
	--mh-henkilosto-photo: 7.5rem;
	--mh-henkilosto-col-gap: 1.5rem;
	width: 100%;
	font-family: var(--font-body, MontserratVariable, sans-serif);
	color: var(--color-text, #000);
}

/* Beat theme: body.bb-page .mh-bb-content .fl-builder-content h2 { margin-bottom: 20px } */
body.bb-page .mh-bb-content .fl-builder-content h2.mh-henkilosto__heading,
body.bb-page .mh-bb-content h2.mh-henkilosto__heading,
h2.mh-henkilosto__heading,
.mh-henkilosto__heading {
	margin-top: 0 !important;
	margin-bottom: 50px !important;
	font-family: inherit;
	font-size: var(--heading-2-size, 1.75rem);
	font-weight: var(--font-bold, 700);
	line-height: var(--heading-2-leading, 1.3);
	letter-spacing: -0.01em;
	color: inherit;
}

/* Reset theme ul/li padding & use gap for vertical rhythm */
body.bb-page .mh-bb-content .mh-henkilosto__grid,
.mh-bb-content .mh-henkilosto__grid,
.mh-henkilosto__grid {
	display: grid;
	grid-template-columns: 1fr;
	column-gap: var(--mh-henkilosto-col-gap);
	row-gap: 0;
	margin: 0 !important;
	padding: 0 !important;
	padding-inline-start: 0 !important;
	list-style: none !important;
}

body.bb-page .mh-bb-content .mh-henkilosto li.mh-henkilosto__person,
.mh-bb-content .mh-henkilosto__person,
li.mh-henkilosto__person,
.mh-henkilosto__person {
	display: grid;
	grid-template-columns: var(--mh-henkilosto-photo) minmax(0, 1fr);
	gap: 0.75rem 1rem;
	align-items: start;
	margin: 0 0 50px !important;
	padding: 0 !important;
	min-width: 0;
	list-style: none !important;
}

.mh-henkilosto__media {
	position: relative;
	width: var(--mh-henkilosto-photo);
	aspect-ratio: 1 / 1;
	flex-shrink: 0;
	overflow: hidden;
	background: var(--color-surface-subtle, #f9fafb);
	border: none;
	box-shadow: none;
}

.mh-henkilosto__media::before,
.mh-henkilosto__media::after {
	content: none !important;
	display: none !important;
	width: 0 !important;
	background: none !important;
}

.mh-henkilosto__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	border: none;
}

.mh-henkilosto__photo--placeholder {
	background:
		linear-gradient(135deg, var(--color-surface-subtle, #f9fafb) 0%, var(--color-border, #e5e7eb) 100%);
}

.mh-henkilosto__info {
	display: flex;
	flex-direction: column;
	gap: 0.28rem;
	min-width: 0;
	padding: 0;
}

.mh-bb-content .mh-henkilosto__info p,
.mh-henkilosto__info p,
.mh-henkilosto__name,
.mh-henkilosto__role,
.mh-henkilosto__focus,
.mh-henkilosto__phone,
.mh-henkilosto__email {
	margin: 0;
	padding: 0;
	font-family: inherit;
	line-height: 1.25;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.mh-henkilosto__name-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.4rem 0.75rem;
	min-width: 0;
}

.mh-henkilosto__name {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: var(--text-lg, 1.125rem);
	font-weight: var(--font-bold, 700);
	letter-spacing: -0.01em;
	color: inherit;
}

.mh-henkilosto__flags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.3rem;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	flex: 0 0 auto;
}

.mh-henkilosto__flag {
	display: inline-flex;
	margin: 0 !important;
	padding: 0;
	list-style: none;
	line-height: 0;
}

.mh-henkilosto__flag-svg {
	display: block;
	width: 1.35rem;
	height: 0.9rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 2px;
	overflow: hidden;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}

.mh-henkilosto__flag-svg svg {
	display: block;
	width: 100%;
	height: 100%;
}

p.mh-henkilosto__role,
.mh-henkilosto__role {
	font-size: 14px;
	font-weight: var(--font-normal, 400);
	font-style: italic;
	color: inherit;
}

p.mh-henkilosto__focus,
.mh-henkilosto__focus {
	font-size: var(--text-md, 1.0625rem);
	font-weight: 500;
	line-height: 140%;
	color: inherit;
}

p.mh-henkilosto__phone,
p.mh-henkilosto__email,
.mh-henkilosto__phone,
.mh-henkilosto__email {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 14px;
	font-weight: var(--font-normal, 400);
	text-decoration: none;
}

.mh-bb-content .mh-henkilosto__info p.mh-henkilosto__phone,
p.mh-henkilosto__phone {
	margin-top: 10px !important;
}

.mh-henkilosto__icon {
	display: inline-flex;
	flex-shrink: 0;
	width: 0.95em;
	height: 0.95em;
	color: inherit;
}

.mh-henkilosto__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.mh-henkilosto p a,
.mh-henkilosto__phone a,
.mh-henkilosto__email a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.mh-henkilosto__phone a:hover,
.mh-henkilosto__phone a:focus-visible,
.mh-henkilosto__email a:hover,
.mh-henkilosto__email a:focus-visible {
	color: var(--color-muted, #6b7280);
	text-decoration: none;
	outline: none;
}

@media (min-width: 640px) {
	.mh-henkilosto {
		--mh-henkilosto-photo: 8.75rem;
	}

	.mh-henkilosto__person {
		gap: 0.85rem 1.25rem;
		align-items: center;
	}
}

/* Tablet: 2 columns — match base selector specificity */
@media (min-width: 768px) {
	body.bb-page .mh-bb-content .mh-henkilosto__grid,
	.mh-bb-content .mh-henkilosto__grid,
	.mh-henkilosto__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		--mh-henkilosto-col-gap: 2rem;
	}

	.mh-henkilosto {
		--mh-henkilosto-photo: 8.5rem;
	}
}

/* Desktop: 3 columns (or module setting) */
@media (min-width: 1024px) {
	body.bb-page .mh-bb-content .mh-henkilosto__grid,
	.mh-bb-content .mh-henkilosto__grid,
	.mh-henkilosto__grid {
		grid-template-columns: repeat(var(--mh-henkilosto-columns, 3), minmax(0, 1fr));
		--mh-henkilosto-col-gap: 4rem;
	}

	.mh-henkilosto {
		--mh-henkilosto-photo: 6.25rem;
	}

	.mh-henkilosto__person {
		gap: 1.15rem 1.35rem;
	}

	.mh-henkilosto__info {
		gap: 0.35rem;
	}

	.mh-henkilosto__name {
		font-size: var(--text-lg, 1.125rem);
	}
}

@media (min-width: 1280px) {
	body.bb-page .mh-bb-content .mh-henkilosto__grid,
	.mh-bb-content .mh-henkilosto__grid,
	.mh-henkilosto__grid {
		--mh-henkilosto-col-gap: 5rem;
	}

	.mh-henkilosto {
		--mh-henkilosto-photo: 6.75rem;
	}

	.mh-henkilosto__person {
		gap: 1.25rem 1.5rem;
	}
}

@media (max-width: 379.98px) {
	.mh-henkilosto {
		--mh-henkilosto-photo: 5.75rem;
	}

	.mh-henkilosto__person {
		gap: 0.6rem 0.75rem;
	}

	.mh-henkilosto__name {
		font-size: var(--text-base, 1rem);
	}

	.mh-henkilosto__role,
	.mh-henkilosto__focus {
		font-size: var(--text-sm, 0.875rem);
	}
}
