/*
 * Collaborator profile (templates/single-ehl_collaborator.html).
 *
 * Template order: breadcrumb, name, content (inside .ehl-profile__intro), photo.
 * The intro wrapper is flattened with `display: contents`, so the four parts
 * are placed directly on one grid:
 *
 *   < 768 px      crumb             stacked: name full width,
 *                 title             photo under the name,
 *                 photo             text underneath
 *                 body
 *
 *   ≥ 768 px      crumb  photo      photo in its own column next to
 *                 title  photo      name and text (the old desktop look)
 *                 body   photo
 *
 * Sizes are the old Drupal ones (node--type-hub-employee, EHL layer).
 */

/* ---- Page frame ---------------------------------------------------------- */

.ehl-profile {
	--ehl-profile-inset: 2rem;
	--ehl-profile-photo: 8.5rem;  /* ≈ 128 px on phones */
	--ehl-profile-text: 42rem;    /* 756 px at 18 px root */
	padding-inline: var(--ehl-profile-inset);
}

@media (min-width: 768px) {
	.ehl-profile {
		--ehl-profile-inset: 3rem;
		--ehl-profile-photo: 10rem;
	}
}

@media (min-width: 1024px) {
	.ehl-profile {
		--ehl-profile-photo: 12.5rem; /* 225 px at 18 px root */
	}
}

/* ---- Grid ---------------------------------------------------------------- */

.ehl-profile .ehl-profile__head {
	display: grid;
	grid-template-areas:
		"crumb"
		"title"
		"photo"
		"body";
	grid-template-columns: minmax(0, 1fr);
	margin: 0;
	max-width: none;
}

.ehl-profile .ehl-profile__intro {
	display: contents;
}

.ehl-profile .ehl-profile__head > *,
.ehl-profile .ehl-profile__intro > * {
	margin: 0;
	max-width: none;
}

.ehl-profile .ehl-profile__back  { grid-area: crumb; }
.ehl-profile .ehl-profile__title { grid-area: title; }
.ehl-profile .ehl-profile__photo { grid-area: photo; }
.ehl-profile .ehl-profile__body  { grid-area: body; }

@media (min-width: 768px) {
	.ehl-profile .ehl-profile__head {
		column-gap: 3rem;
		grid-template-areas:
			"crumb photo"
			"title photo"
			"body  photo";
		grid-template-columns: minmax(0, var(--ehl-profile-text)) var(--ehl-profile-photo);
		grid-template-rows: auto auto 1fr;
	}
}

/* ---- Breadcrumb (one step, styled as the old magenta "Ga terug") --------- */

.ehl-profile .ehl-profile__back {
	color: var(--wp--preset--color--secondary, #d2337d);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 0.2em;
}

.ehl-profile__back ol {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ehl-profile__back a {
	color: inherit;
	padding-left: 1.5rem;
	position: relative;
	text-decoration: none;
}

.ehl-profile__back a:hover,
.ehl-profile__back a:focus-visible {
	text-decoration: underline;
}

/* Feather arrow-left, faint until hover (as on the old site).
   Sits inside the link's padding, so nothing pokes out of the column. */
.ehl-profile__back a::before {
	background-color: currentColor;
	content: "";
	height: 1.25rem;
	left: 0;
	-webkit-mask: var(--ehl-profile-arrow) center / contain no-repeat;
	mask: var(--ehl-profile-arrow) center / contain no-repeat;
	opacity: 0.35;
	position: absolute;
	top: 0;
	transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
	width: 1.25rem;
	--ehl-profile-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E");
}

.ehl-profile__back a:hover::before,
.ehl-profile__back a:focus-visible::before {
	opacity: 1;
	transform: translateX(-0.2rem);
}

@media (prefers-reduced-motion: reduce) {
	.ehl-profile__back a::before {
		transition: none;
	}
}

/* ---- Name ---------------------------------------------------------------- */

.ehl-profile .ehl-profile__title {
	overflow-wrap: break-word;
	padding-bottom: 1.5rem; /* gap to the photo when stacked */
}

@media (min-width: 768px) {
	.ehl-profile .ehl-profile__title {
		padding-bottom: 2.5rem; /* 2rem + the old empty meta line under the name */
	}
}

/* ---- Photo: oval ---------------------------------------------------------- */

.ehl-profile .ehl-profile__photo {
	align-self: start;
	padding-bottom: 2rem; /* gap to the text when stacked */
	width: var(--ehl-profile-photo);
}

.ehl-profile__photo img {
	border-radius: 18.75rem;
	display: block;
	width: 100%;
}

/* ---- Content: the profile sections ---------------------------------------- */

.ehl-profile__body > * {
	margin-block: 0 2rem;
}

.ehl-profile__body > :last-child {
	margin-bottom: 0;
}

.ehl-profile__body > :where(h2, h3) {
	color: var(--wp--preset--color--secondary, #d2337d);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2917;
	margin-bottom: 0.75rem;
}

/* The short description had a little less space under it (1.75em). */
.ehl-profile__body > h2:first-child + p {
	margin-bottom: 1.75em;
}

.ehl-profile__body a {
	color: var(--wp--preset--color--primary, #00857e);
}

.ehl-profile__body a:hover,
.ehl-profile__body a:focus-visible {
	color: var(--wp--preset--color--primary-dark, #005652);
}

.ehl-profile__body ul {
	padding-left: 1.25em;
}

/* ---- Print: no breadcrumb, smaller photo --------------------------------- */

@media print {
	.ehl-profile .ehl-profile__back {
		display: none;
	}

	.ehl-profile {
		--ehl-profile-photo: 6.25rem;
	}
}