/* ==========================================================================
   Block: Team Grid (acf/team) — Figma "RDV Updates", Frame 9 (grid) and
   Frame 5 (pop-up). Desktop values below are measured off the 1728 frame,
   where the grid is 1340 wide: exactly the Section's inner container.

   No phone frame exists for either. Ours: two across below 768, and the
   pop-up stacks (photo, then the panel tucked under it).

   Type: names in Oxanium as in the Figma (the theme's heading face since
   2026-10-21; a Font Library font before that); the pop-up's
   Plus Jakarta Sans became Oxanium + Roboto (Dmitriy, 2026-10-06), so the
   site carries no extra family for one pop-up.
   ========================================================================== */

.team--block {
	--team-name-font: var(--wp--preset--font-family--oxanium, "Oxanium", sans-serif);
	--team-photo-radius: 12px;
}

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

.team--grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px var(--theme-content-padding);
	margin: 0;
	padding: 0;
	list-style: none;
}

.team--member {
	position: relative; /* the name button's ::after covers the card */
	margin: 0;
	padding: 0;
}

/* Rounded per the Figma; the block's Chamfered style cuts it instead. The
   shape is on the wrapper so the hover zoom happens inside it. */
.team--photo {
	position: relative;
	aspect-ratio: 430.66 / 411.8;
	overflow: hidden;
	border-radius: var(--team-photo-radius);
	background-color: rgba(0, 0, 0, 0.06);
}

.team--image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 0;
	transition: transform 0.5s ease;
}

.team--name {
	margin: 14px 0 0;
	font-family: var(--team-name-font);
	font-size: 20px;
	font-weight: 400;
	line-height: 1.04;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

/* Reset the UA/reboot button down to plain heading text. */
.team--open {
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-align: left;
	text-transform: inherit;
	cursor: pointer;
}

/* The whole card is the target; the LinkedIn link sits above it. */
.team--open::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.team--block .team--open:focus-visible {
	outline: none;
}

.team--block .team--open:focus-visible::after {
	outline: 2px solid currentColor;
	outline-offset: 6px;
}

.team--role {
	margin: 0;
	font-size: 14px;
	line-height: 1.28;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.team--linkedin {
	position: relative;
	z-index: 2;
	display: inline-flex;
	margin-top: 6px;
	color: inherit;
	vertical-align: top;
	transition: color 0.2s ease;
}

.team--linkedin svg {
	display: block;
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.team--linkedin:hover {
	color: var(--rdv-red);
}

.team--linkedin:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* The zoom says "click me", so only cards that open a pop-up get it. */
@media (hover: hover) {
	.team--block:not(.team--no-popup) .team--member:hover .team--image {
		transform: scale(1.04);
	}
}

.team--empty {
	margin: 0;
	padding: 40px;
	border: 1px dashed currentColor;
	text-align: center;
}

/* Scroll reveal: each card is its own unit (team.php stamps data-reveal).
   reveal.js staggers the cards of a row as they enter together, so there is
   no per-row delay to set here. */

@media (min-width: 768px) {
	.team--grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 50px 20px;
	}

	.team--name {
		margin-top: 18px;
		font-size: 22px;
	}

	.team--role {
		font-size: 15px;
	}
}

/* Figma: photo, 24px, name (28/29.12), title flush beneath (18/23.04), 8px,
   the 22px LinkedIn icon; 24px between columns and 60px between rows. */
@media (min-width: 992px) {
	.team--grid {
		gap: 60px 24px;
	}

	.team--name {
		margin-top: 24px;
		font-size: 24px;
	}

	.team--role {
		font-size: 16px;
	}

	.team--linkedin {
		margin-top: 8px;
	}

	.team--linkedin svg {
		width: 22px;
		height: 22px;
	}
}

@media (min-width: 1200px) {
	.team--name {
		font-size: 28px;
	}

	.team--role {
		font-size: 18px;
	}
}

/* ---- Pop-up -------------------------------------------------------------- */

/* The <dialog> is a transparent, full-viewport scroll box. The wash is its
   ::backdrop (Figma: cream at 93%), which sits in the top layer above the
   fixed header, so the whole page is covered. A click on the dialog itself
   (outside the content) closes it: see team.js. */
.team--dialog {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	/* Vertical scroll only. The open animation starts the panel 40px to the
	   right, past the dialog's edge on narrower screens, and with overflow-y
	   auto the x axis would scroll too: a horizontal scrollbar flashed for
	   the length of the snap (10px of overflow at 1280). Nothing at rest is
	   ever wider than the dialog. */
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* reset.min.css (a Bootstrap 4 reboot) sets dialog{display:block}, which
   outranks the browser's own dialog:not([open]){display:none} and paints
   every closed pop-up over the page. Hide them again explicitly. */
.team--dialog:not([open]) {
	display: none;
}

.team--dialog[open] {
	display: flex;
}

.team--dialog::backdrop {
	background-color: rgba(239, 237, 230, 0.93);
}

/* Centred while it fits; auto margins drop to 0 once it doesn't, so a tall
   pop-up scrolls from its top instead of being cut off above it. */
.team--dialog-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(620px + 2 * var(--theme-content-padding));
	margin: auto;
	padding: 12px var(--theme-content-padding) 32px;
}

/* 44px target around the 18px Figma glyph. Its glyph's right edge lines up
   with the panel's, 20px above it (Figma: 13px of the 20 is the button's
   own padding). */
.team--close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0 -13px 7px auto;
	padding: 0;
	border: 0;
	background: none;
	color: #313131;
	cursor: pointer;
	transition: color 0.2s ease;
}

.team--close svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.team--close:hover {
	color: var(--rdv-red);
}

.team--dialog-body {
	display: grid;
}

/* The ::before holds the photo at its Figma shape (705 x 674); padding %
   resolves against the width. */
.team--dialog-photo {
	position: relative;
	z-index: 1;
	overflow: hidden;
	border-radius: var(--team-photo-radius);
	background-color: #d9d9d9;
}

.team--dialog-photo::before {
	content: "";
	display: block;
	padding-top: 95.6%;
}

.team--dialog-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 0;
}

/* Phones: the panel tucks 48px up under the photo, as on desktop it runs
   behind the photo's right half. */
.team--dialog-panel {
	display: flex;
	flex-direction: column;
	margin-top: -48px;
	padding: 72px 20px 28px;
	background-color: #313131;
	clip-path: var(--rdv-chamfer-shape);
}

.team--dialog-name {
	margin: 0;
	color: inherit;
	font-family: var(--team-name-font);
	font-size: 26px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.03em;
}

.team--dialog-role {
	margin: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.03em;
}

.team--dialog-bio {
	margin-top: 13px;
	font-size: 16px;
	line-height: 21px;
	letter-spacing: -0.01em;
}

.team--dialog-bio > * {
	margin: 0;
}

/* Figma separates paragraphs with one empty 21px line. */
.team--dialog-bio > * + * {
	margin-top: 21px;
}

.team--dialog-bio a {
	color: inherit;
	text-decoration: underline;
}

.team--dialog-bio a:hover {
	color: var(--wp--preset--color--gold);
}

.team--dialog-bio ul,
.team--dialog-bio ol {
	padding-left: 1.2em;
}

/* Pinned to the foot of the panel, as in the Figma, when the bio is short. */
.team--dialog-experience {
	margin-top: auto;
	padding-top: 32px;
}

.team--dialog-label {
	margin: 0;
	color: inherit;
	font-family: var(--wp--preset--font-family--roboto, "Roboto", sans-serif);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.03em;
}

.team--dialog-logos {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px 32px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.team--dialog-logos li {
	margin: 0;
}

/* A set height, so an SVG with no intrinsic size still lays out, and wide
   wordmarks are capped by width instead; contain keeps their shape inside the
   capped box. Sized for logos trimmed to their ink: the Figma's marks are
   Boeing 187 x 43 (height-bound) and Lockheed Martin 216 x 33 (width-bound). */
.team--dialog-logo {
	display: block;
	width: auto;
	height: 34px;
	max-width: 175px;
	object-fit: contain;
	object-position: 0 50%;
}

/* Desktop: Figma Frame 5. The photo (705) overlaps the panel (1121), which
   starts 213px in from the photo's left edge, so three tracks: the photo
   spans the first two, the panel the last two. Its left padding clears the
   shared track (492/1121 of its width) plus the Figma's 38px gutter. */
@media (min-width: 992px) {
	.team--dialog-wrap {
		max-width: calc(1334px + 2 * var(--theme-content-padding));
		padding-top: 24px;
		padding-bottom: 40px;
	}

	.team--dialog-body {
		grid-template-columns: 213fr 492fr 629fr;
	}

	.team--dialog-photo {
		grid-area: 1 / 1 / 2 / 3;
	}

	/* The panel is always exactly as tall as the photo, as in the Figma: size
	   containment keeps its copy out of the row height, and a bio longer than
	   the room left scrolls inside the panel while the name stays on top and
	   the logos at the foot. Letting the panel grow instead stretched the
	   photo, and cover-cropped it into a close-up of the face (1.8x at 1024). */
	.team--dialog-panel {
		grid-area: 1 / 2 / 2 / 4;
		contain: size;
		margin-top: 0;
		padding: 39px 47px 42px calc(43.89% + 38px);
	}

	.team--dialog-head,
	.team--dialog-experience {
		flex-shrink: 0;
	}

	/* The box reaches 24px into the panel's right padding, so its scrollbar
	   sits clear of the text and the text keeps the Figma's 544px. */
	.team--dialog-bio {
		flex: 0 1 auto;
		min-height: 0;
		margin-right: -24px;
		padding-right: 24px;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
	}

	.team--dialog-bio:focus-visible {
		outline: 2px solid #fff;
		outline-offset: 4px;
	}

	.team--dialog-name {
		font-size: 32px;
	}

	.team--dialog-role {
		font-size: 18px;
	}

}

/* The Figma's logo size from 1200 up; narrower, the text column is too tight
   for two of them on one row, and a second row eats the bio's room. */
@media (min-width: 1200px) {
	.team--dialog-logos {
		gap: 24px 50px;
		margin-top: 21px;
	}

	.team--dialog-logo {
		height: 43px;
		max-width: 222px;
	}
}

/* ---- Chamfered style ------------------------------------------------------ */

.team--block.is-style-chamfered .team--photo,
.team--block.is-style-chamfered .team--dialog-photo {
	border-radius: 0;
	clip-path: var(--rdv-chamfer-photo-shape);
}

/* ---- Motion ---------------------------------------------------------------
   The wash and the pop-up fade in, and the photo and panel start 40px apart
   and close together on the site's reveal curve (--rdv-snap-ease in
   style.css), stopping dead with no recoil — Dapper read the recoil as a
   bounce (2026-10-07). Closing is a plain fade (team.js waits for it).
   Under reduced motion, none of it: open and close are cuts. */

@media (prefers-reduced-motion: no-preference) {
	.team--dialog[open],
	.team--dialog[open]::backdrop {
		animation: team-fade-in 250ms ease-out;
	}

	.team--dialog-photo {
		--team-snap-from: -40px;
	}

	.team--dialog-panel {
		--team-snap-from: 40px;
	}

	.team--dialog[open] .team--dialog-photo,
	.team--dialog[open] .team--dialog-panel {
		animation: team-snap var(--rdv-snap-ms, 500ms) var(--rdv-snap-ease, ease-in) both;
	}

	.team--dialog.is-closing,
	.team--dialog.is-closing::backdrop {
		animation: team-fade-out 200ms ease-in forwards;
	}
}

@keyframes team-fade-in {
	from { opacity: 0; }
}

@keyframes team-snap {
	from { transform: translateX(var(--team-snap-from, 0)); }
}

@keyframes team-fade-out {
	to { opacity: 0; }
}

/* Page scroll is held while a pop-up is open; team.js pads out the vanished
   scrollbar so the page does not shift under the wash. */
html.team--modal-open {
	overflow: hidden;
	padding-right: var(--team-scrollbar, 0px);
}
