/*
 * MiraeLaw Team page — Team Member grid
 *
 * The whole grid is rendered server-side by the [miraelaw_team_grid]
 * shortcode (inc/team/class-team-grid.php) — not Elementor widgets, so
 * every rule below (including typography/color) is load-bearing. Values are
 * taken from design-system.css tokens wherever an exact match exists; the
 * few that don't (serial 12px, name 24px, summary/link 14.5px + 1.55 line
 * height, image 4:5 ratio) are noted inline.
 */

.ml-team-grid-root {
	background: var( --ml-background );
}

.ml-team-grid-inner {
	max-width: var( --ml-container-width );
	margin: 0 auto;
	/* Same local fluid section-padding cap already used by Our Offices and
	   What Clients Say (56px–88px) — not a shared token since no other
	   section uses this exact cap. */
	padding: clamp( 3.5rem, 8vw, 5.5rem ) 24px;
}

/* Borders form one continuous box with single-width internal dividers,
   matching the source design's own technique (confirmed against its
   computed styles) and already established for the Our Offices grid: the
   grid container supplies the outer top and left edges; each card supplies
   only its own right and bottom edge. */
.ml-team-grid {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 0;
	border-top: 1px solid var( --ml-primary );
	border-left: 1px solid var( --ml-primary );
}

.ml-team-card {
	display: flex;
	flex-direction: column;
	background: var( --ml-background );
	border-right: 1px solid var( --ml-primary );
	border-bottom: 1px solid var( --ml-primary );
	transition: background-color var( --ml-transition-base );
}

.ml-team-card:hover {
	background: var( --ml-surface );
}

.ml-team-card-photo-link {
	display: block;
}

.ml-team-card-photo,
.ml-team-card-photo-placeholder {
	display: block;
	width: 100%;
	/* Measured pixel ratio (307×383 ≈ 0.80) rather than the source markup's
	   own reported aspect-ratio (3/2), which didn't match its actual
	   rendered dimensions. */
	aspect-ratio: 4 / 5;
	object-fit: cover;
	/* All seven source portraits share the same raw 2:3 dimensions but were
	   shot with different headroom/zoom, so a plain center crop (the
	   object-position default) crops each one differently. Biasing the crop
	   upward is the standard fix for a headshot grid built from photos that
	   weren't shot to a single specced crop: it consistently favors keeping
	   the head/face and trims the excess torso below instead, which reads
	   as aligned across the grid even though the sources aren't identical. */
	object-position: 50% 20%;
}

.ml-team-card-photo-placeholder {
	background: var( --ml-surface-hover );
}

.ml-team-card-body {
	display: flex;
	flex-direction: column;
	gap: var( --ml-spacing-2xs );
	padding: 22px 24px 24px;
	flex-grow: 1;
}

.ml-team-card-serial {
	font-family: var( --ml-font-mono );
	/* No shared token matches this exact size. */
	font-size: 12px;
	font-weight: 400;
	color: var( --ml-accent );
}

.ml-team-card-name {
	margin: 0;
	font-family: var( --ml-font-heading );
	/* No shared token matches this exact size (--ml-text-xl is 22px, this is
	   measured at 24px — same as --ml-text-2xl, coincidentally). */
	font-size: 24px;
	font-weight: 600;
	line-height: var( --ml-leading-snug );
	color: var( --ml-primary );
}

.ml-team-card-title {
	font-family: var( --ml-font-mono );
	font-size: var( --ml-text-2xs );
	font-weight: 400;
	letter-spacing: var( --ml-tracking-wider );
	text-transform: uppercase;
	color: var( --ml-tertiary );
}

.ml-team-card-summary {
	margin: 0;
	font-family: var( --ml-font-body );
	/* No shared token matches this exact size/line-height pair (14.5px at a
	   1.55 ratio — between --ml-leading-normal(1.5) and
	   --ml-leading-comfortable(1.6)). */
	font-size: 14.5px;
	line-height: 1.55;
	color: var( --ml-neutral-600 );
}

.ml-team-card-link {
	/* Pins to the bottom of the flex column regardless of summary length —
	   same mechanism already used for Testimonial and Office cards. */
	margin-top: auto;
	padding-top: 10px;
	/* Text-only height (10px top padding + 21.75px line-height = 31.75px)
	   is under the 44px WCAG touch-target minimum on every card, on every
	   breakpoint. Added bottom padding closes the gap without touching
	   font size, color, or the card's own visual rhythm. */
	padding-bottom: 13px;
	font-family: var( --ml-font-body );
	font-size: 14.5px;
	font-weight: 700;
	color: var( --ml-secondary );
	text-decoration: underline;
	transition: color var( --ml-transition-base );
}

.ml-team-card-link:hover,
.ml-team-card-link:focus-visible {
	color: var( --ml-accent );
}

.ml-team-card-link:focus-visible {
	outline: 3px solid var( --ml-accent );
	outline-offset: 2px;
}

@media ( max-width: 1024px ) {
	.ml-team-grid {
		grid-template-columns: repeat( 3, 1fr );
	}
}

@media ( max-width: 768px ) {
	.ml-team-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 600px ) {
	.ml-team-grid {
		grid-template-columns: 1fr;
	}

	.ml-team-grid-inner {
		padding: clamp( 3rem, 8vw, 3.5rem ) 24px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.ml-team-card,
	.ml-team-card-link {
		transition: none;
	}
}
