/**
 * The team member profile, above the bio.
 *
 * Paired with templates/single-homewood_team.html and the
 * [homewood_team_profile] shortcode.
 *
 * @package homewood_theme
 */

.hw-profile {
	--hw-profile-label: var(--wp--preset--color--sage, #4b5649);
	--hw-profile-ink: var(--wp--preset--color--ink, #252b23);
	--hw-profile-rule: var(--wp--preset--color--bronze, #896d44);

	--hw-profile-photo: 430px;
	--hw-profile-label-col: 9rem;

	margin-block-end: 2.5rem;
}

/* -- Name, details and photo ---------------------------------------------- */

/*
 * No grid: the photo is floated out of here and everything after it — the name
 * and details, the heading, and the bio in the block below — runs around it.
 * The wrapper is left in place because the shortcode emits it and because it is
 * what the float is escaping from.
 */
.hw-profile__masthead {
	display: block;
}

.hw-profile__intro {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.hw-profile__name {
	margin: 0;
	font-size: var(--wp--preset--font-size--h1, 3.25rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--hw-profile-ink);
}

.hw-profile__position {
	margin: 10px 0 0 0 ;
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--hw-profile-ink);
}

.hw-profile__details {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin: 2.25rem 0 0;
}

.hw-profile__row {
	display: grid;
	grid-template-columns: minmax(0, var(--hw-profile-label-col)) minmax(0, 1fr);
	column-gap: 4.5rem;
	align-items: start;
}

.hw-profile__row dt {
	color: var(--hw-profile-label);
	line-height: 1.45;
}

.hw-profile__row dd {
	margin: 0;
	color: var(--hw-profile-ink);
	line-height: 1.45;
}

.hw-profile__row a {
	color: inherit;
	text-decoration: none;
}

.hw-profile__row a:hover,
.hw-profile__row a:focus-visible {
	color: var(--hw-profile-rule);
	text-decoration: underline;
}

/* The areas sit apart from the contact rows, and stack one per line. */
.hw-profile__row--areas {
	margin-top: 1.5rem;
}

.hw-profile__area {
	display: block;
}

/* Locked to 430px: the photo is a fixed measure, not a share of the width. */
.hw-profile__figure {
	float: right;
	width: var(--hw-profile-photo);
	margin: 0 0 1.5rem clamp(1.5rem, 4vw, 3rem);
}

/*
 * Height from the file, not from a ratio written here. The homewood-portrait
 * size is a hard crop at 480x620, so every photo arrives the same shape and
 * there is nothing left for an aspect-ratio to correct — and none to impose
 * on a photo that somehow misses the crop.
 */
.hw-profile__photo {
	display: block;
	width: 100%;
	height: auto;
	border: 2px solid var(--hw-profile-rule);
	border-radius: 5px;
}

/* -- Lead-in to the bio --------------------------------------------------- */

.hw-profile__about {
	margin: 1.75rem 0 0;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--hw-profile-ink);
}

/* -- The bio itself ------------------------------------------------------- */

/*
 * The theme sets a tight 1.3 globally, which suits headings and short blocks.
 * A profile is several hundred words of running text, so it is loosened here
 * and nowhere else.
 *
 * No measure of its own any more. A paragraph held to 68ch sat entirely to the
 * left of the photo and never reached it, so there was nothing for the text to
 * wrap around; the column the template puts this in is what bounds it now.
 */
.hw-profile-page .wp-block-post-content p {
	line-height: 1.5;
}

.hw-profile-page {
	padding: 1.25em 6em 4.25em 6em;
	margin:0px!important;
}
@media (max-width: 1300px) {
	.hw-profile-page {
		padding-left:40px;
		padding-right:40px;
	}
}

/* -- Narrow --------------------------------------------------------------- */

/*
 * Below this the photo stops being something the text runs around and becomes
 * the top of the page. Dropping the float is the whole move: the shortcode
 * emits the figure before .hw-profile__intro precisely so that an unfloated
 * photo lands above the name on its own, with no reordering needed.
 *
 * 430px of photo plus the gap leaves too little beside it for a line of text
 * to be worth wrapping much before here.
 */
@media (max-width: 1120px) {
	.hw-profile__figure {
		float: none;
		width: 100%;
		max-width: var(--hw-profile-photo);
		margin: 0 0 2rem;
	}
}

@media (max-width: 50rem) {
	.hw-profile__row {
		grid-template-columns: minmax(0, 1fr);
		column-gap: 0;
		row-gap: 0.125rem;
	}

	.hw-profile__row + .hw-profile__row {
		margin-top: 0.75rem;
	}
}
