/*
 * Team block. Loaded only on pages that use it. Mobile first; desktop from 900px.
 * Source: the builder's ".team" CSS. Look C = 8px photo corners; look F = 28px
 * corners and handwritten names.
 */

.team { padding: 56px 0; }

.team__grid { display: grid; gap: 26px; }
.team__groups { display: grid; gap: 36px; min-width: 0; }
.team__group-title { margin: 0 0 14px; font-size: 1.15rem; line-height: 1.2; }

.team__title { font-size: 1.9rem; line-height: 1.1; }
.team__intro { max-width: var(--intro-w, 90ch); margin: 10px 0 0; color: var(--muted); }
.team__more { margin: 20px 0 0; }

/* Nobody entered yet (the Team page): a short Coming soon message. */
.team__soon { margin: 14px 0 0; font-family: var(--fh); font-size: 1.4rem; font-weight: var(--hw); text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand-text, var(--brand)); }

/* The picture shown in that message (set in the block). Full width, cropped to a
   landscape frame, with the look's photo corners. */
.team__empty-photo { margin: 22px 0 0; overflow: hidden; border-radius: var(--card-r); background: var(--tint); }
.team__empty-img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.look-c .team__empty-photo { border-radius: 8px; }
.look-f .team__empty-photo { border-radius: 28px; }

/* A little room above and around, so a lifted photo or card is never cut off. */
.team__members { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; padding: 4px 0 6px; }

.team__member { margin: 0; }

.team__photo {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	border-radius: var(--card-r);
	background: var(--tint);
}

.team__img { width: 100%; height: 100%; object-fit: cover; }

/* No photo: a tinted tile with the person's initials. */
.team__initials {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: color-mix(in srgb, var(--brand) 12%, var(--surface));
	color: var(--brand-text, var(--brand));
	font-family: var(--fh);
	font-size: 2.4rem;
	font-weight: var(--hw);
}

.team__member figcaption { display: flex; flex-direction: column; padding-top: 8px; line-height: 1.3; }
.team__member small { color: var(--muted); font-size: 13px; }
.team__quals { font-style: italic; }
.team__bio { margin-top: 6px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }

/* ---------- Look C: slightly squared photos ---------- */

.look-c .team__photo { border-radius: 8px; }

/* ---------- Look F: soft photos, handwritten names ---------- */

.look-f .team__photo { border-radius: 28px; }
.look-f .team__name { font-family: var(--fs); font-size: 21px; font-weight: 700; line-height: 1.05; }

/* ---------- Desktop ---------- */

@media (min-width: 900px) {
	.team { padding: 96px 0; }
	.team__title { font-size: 2.9rem; }

	.team--beside .team__grid { grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: center; }
	.team--stacked .team__grid { gap: 32px; }
	.team__members { grid-template-columns: repeat(var(--team-cols, 4), 1fr); gap: 20px 16px; }
	.team--cols-3 { --team-cols: 3; }
	.team--cols-5 { --team-cols: 5; }
	.team--cols-6 { --team-cols: 6; }
	/* Beside the heading there is room for 4 at most. */
	.team--beside.team--cols-5, .team--beside.team--cols-6 { --team-cols: 4; }
	.team--list .team__members { gap: 0 24px; }
}

/* ---------- Ways to show a person ---------- */

/* Hover (Clinic → Look and feel → Card hover): the photo or card moves, never a box around text. */
.team__photo { transition: transform 0.18s ease, box-shadow 0.18s ease; }

@media (hover: hover) {
	body.hov-card-lift .team--tiles .team__member:hover .team__photo,
	body.hov-card-lift .team--round .team__member:hover .team__photo { transform: translateY(-3px); box-shadow: 0 14px 24px -10px color-mix(in srgb, var(--ink) 40%, transparent); }
	body.hov-card-outline .team--tiles .team__member:hover .team__photo,
	body.hov-card-outline .team--round .team__member:hover .team__photo { box-shadow: 0 0 0 2px var(--brand); }
	body.hov-card-none .team__member:hover .team__photo { transform: none; }

	body.hov-card-lift .team--cards .team__member:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent), 0 14px 28px -8px color-mix(in srgb, var(--ink) 38%, transparent); }
	body.hov-card-outline .team--cards .team__member:hover { box-shadow: 0 0 0 2px var(--brand); }
}

@media (prefers-reduced-motion: reduce) {
	.team__photo, .team--cards .team__member { transition: none; }
	body .team__member:hover, body .team__member:hover .team__photo { transform: none; }
}

/* Cards: the whole person on a card. Padding keeps the hover shadow clear of the text. */
.team--cards .team__member { padding: 12px; background: var(--surface); border-radius: var(--card-r); box-shadow: 0 0 0 1px var(--line); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.look-c .team--cards .team__member { border-radius: 10px; }
.look-f .team--cards .team__member { border-radius: 28px; }
.team--cards .team__member figcaption { padding: 10px 2px 2px; }

/* Round photos, no boxes: a circle, centred name and role. */
body .team.team--round .team__photo { aspect-ratio: 1; border-radius: 50%; width: min(100%, 220px); margin: 0 auto; }
.team--round .team__member figcaption { align-items: center; text-align: center; padding-top: 10px; }

/* Names and roles only: simple rows with hairline dividers, no photos or boxes. */
.team--list .team__members { grid-template-columns: 1fr; }
.team--list .team__member { padding: 12px 0; border-bottom: 1px solid var(--line); }
.team--list .team__member figcaption { padding-top: 0; }
@media (min-width: 600px) {
	.team--list .team__members { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
	.team--list .team__members { grid-template-columns: repeat(min(var(--team-cols, 4), 3), 1fr); }
	.team--list.team--beside .team__members { grid-template-columns: 1fr 1fr; }
}

/* ---------- Names-only style: each person in a shape (circle, rounded box or pill) ---------- */
/* Group titles stay plain small headings. Colour comes from team--tone-*. */

.team--shape-circle .team__member,
.team--shape-rounded .team__member,
.team--shape-pill .team__member { border-bottom: 0; transition: transform 0.18s ease, box-shadow 0.18s ease; }

.team--shape-circle .team__member figcaption,
.team--shape-rounded .team__member figcaption,
.team--shape-pill .team__member figcaption { align-items: center; text-align: center; padding: 0; text-wrap: balance; }

.team--shape-rounded .team__member { padding: 14px 18px; border-radius: 18px; }
.team--shape-pill .team__member { padding: 12px 24px; border-radius: 999px; }

/* Circle: a square box with a round edge, the text centred and sized to fit. Two across on a phone. */
.team--shape-circle .team__members { grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.team--shape-circle .team__member {
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	width: min(100%, 220px);
	margin: 0 auto;
	padding: 12%;
	border-radius: 50%;
}
.team--shape-circle .team__name { font-size: 0.95rem; line-height: 1.2; }
.team--shape-circle .team__member small { font-size: 12px; line-height: 1.3; }
.team--shape-circle .team__bio { display: none; } /* a bio does not fit in a circle */

@media (min-width: 900px) {
	.team--shape-circle .team__members { grid-template-columns: repeat(var(--team-cols, 4), 1fr); gap: 24px 16px; }
	.team--shape-circle .team__name { font-size: 1.05rem; }
	.team--shape-circle.team--beside .team__members { grid-template-columns: repeat(3, 1fr); }
}

/* Colours. Default: a light tint of the brand colour. */
.team--tone-tint .team__member { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--ink); }
.team--tone-surface .team__member { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.team--tone-brand .team__member { background: var(--brand); color: var(--on-brand); }
.team--tone-accent .team__member { background: var(--accent); color: var(--on-accent); }
.team--tone-outline .team__member { background: transparent; box-shadow: inset 0 0 0 2px var(--brand); }

.team--tone-brand .team__member small, .team--tone-brand .team__bio { color: var(--on-brand); opacity: 0.85; }
.team--tone-accent .team__member small, .team--tone-accent .team__bio { color: var(--on-accent); opacity: 0.85; }
.team--tone-brand .team__name, .team--tone-accent .team__name { color: inherit; }

@media (hover: hover) {
	body.hov-card-lift :is(.team--shape-circle, .team--shape-rounded, .team--shape-pill) .team__member:hover { transform: translateY(-3px); }
	body.hov-card-lift :is(.team--shape-circle, .team--shape-rounded, .team--shape-pill).team--tone-surface .team__member:hover { box-shadow: 0 0 0 1px var(--line), 0 12px 22px -10px color-mix(in srgb, var(--ink) 40%, transparent); }
	body.hov-card-lift :is(.team--shape-circle, .team--shape-rounded, .team--shape-pill):not(.team--tone-surface):not(.team--tone-outline) .team__member:hover { box-shadow: 0 12px 22px -10px color-mix(in srgb, var(--ink) 40%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
	.team--shape-circle .team__member, .team--shape-rounded .team__member, .team--shape-pill .team__member { transition: none; }
}

/* Custom colour (two colour pickers on the block). */
.team--tone-custom .team__member { background: var(--team-shape-bg, var(--tint)); color: var(--team-shape-fg, var(--ink)); }
.team--tone-custom .team__member small, .team--tone-custom .team__bio { color: inherit; opacity: 0.85; }
.team--tone-custom .team__name { color: inherit; }

/* Room between the shapes whether or not group titles are on (list rows keep their own tight spacing). */
.team--shape-rounded .team__members, .team--shape-pill .team__members { gap: 14px 16px; }
@media (min-width: 900px) {
	.team--shape-rounded .team__members, .team--shape-pill .team__members { gap: 16px 20px; }
}
