/* ──────────────────────────────────────────────────────────────────────────
   Team Grid block
   Porcelain section + centered header + responsive grid of clean member cards
   (rounded headshot, name, role, grey rounded-square "+"). Clicking "+" opens a
   right-side docked bio panel (navy): photo on top, name/role/bio/LinkedIn, with
   prev/next at the bottom. Tokens only — no raw hex.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Section shell ── */
.uw-team {
	position: relative;
	overflow: hidden;
	color: var(--wp--preset--color--deep-navy);
}
.uw-team--bg-porcelain { background: var(--wp--preset--color--porcelain); }
.uw-team--bg-white { background: var(--wp--preset--color--white); }
.uw-team--bg-parchment { background: var(--wp--preset--color--parchment); }
.uw-team-inner {
	position: relative;
	z-index: 1;
	padding-top: clamp(76px, 8vw, 80px);
	padding-bottom: clamp(76px, 8vw, 80px);
}
.uw-team--no-top-pad .uw-team-inner { padding-top: 0; }
.uw-team--no-bottom-pad .uw-team-inner { padding-bottom: 0; }

/* ── Decorative background swooshes (white, porcelain section only) ── */
.uw-team__deco {
	position: absolute;
	pointer-events: none;
	z-index: 0;
}
.uw-team--layout-tabs .uw-team__deco { display: none; }
.uw-team__deco svg { display: block; }
.uw-team__deco--top {
	top: 0;
	left: 0;
	width: min(30vw, 464px);
}
.uw-team__deco--bottom {
	bottom: 0;
	right: 0;
	width: min(20vw, 340px);
}
.uw-team__deco--top svg,
.uw-team__deco--bottom svg {
	width: 100%;
	height: auto;
}
/* ── Section header ── */
.uw-team__header {
	max-width: 760px;
	margin: 0 auto clamp(2.5rem, 5vw, 4rem);
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.uw-team__heading {
	margin: 0;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-size: clamp(44px, 5.5vw, var(--wp--preset--font-size--heading-3));
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--wp--preset--color--deep-navy);
	text-wrap: balance;
}
.uw-team__intro {
	margin: 0;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: clamp(16px, 1.5vw, var(--wp--preset--font-size--body-small));
	line-height: 1.55;
	color: color-mix(in srgb, var(--wp--preset--color--deep-navy) 80%, transparent);
	text-wrap: balance;
}
.uw-team__intro p { margin: 0 0 1rem; }
.uw-team__intro p:last-child { margin-bottom: 0; }

/* ── Inline editing: heading + intro + eyebrow as inner blocks ─────────────────
   Nothing above is retargeted. The InnerBlocks wrapper IS
   <div class="uw-team__header">, so .uw-team__header still styles the wrapper
   and .uw-team__heading / .uw-team__intro now match the core/heading and
   core/paragraph directly. On the Tabs layout the wrapper is
   <div class="uw-team__header uw-team__header--split"> and holds two
   core/groups wearing .uw-team__header-heading-col and
   .uw-team__header-intro-col, so the split rules below are unchanged too.

   Spacing is unchanged, which is the subtle part. Legacy DOM:
   .uw-team__header > h2 + div.uw-team__intro > p, p — the header's 1rem flex gap
   separates the heading from the intro block, and `.uw-team__intro p` supplies
   1rem between the paragraphs. Inline DOM: .uw-team__header > h2 + p + p — every
   paragraph is now a flex item, so the same 1rem gap does both jobs, and
   `.uw-team__intro { margin: 0 }` above zeroes the UA margins. The
   `.uw-team__intro p` rules stay: the legacy branch still emits
   div.uw-team__intro > p.

   Editor bridge. In the canvas ACF nests the blocks inside
   .block-editor-inner-blocks > .block-editor-block-list__layout, which would sit
   between .uw-team__header and its flex children; on the front end the blocks
   are direct children. display: contents makes both DOMs lay out identically. */
.uw-team__header > .block-editor-inner-blocks,
.uw-team__header > .block-editor-inner-blocks > .block-editor-block-list__layout,
/* Both header columns space their children with `gap`, as the legacy column divs
   did. Core blocks also arrive carrying the editor's default block margin, so
   without this the heading sits 24px lower than it should and every gap between
   intro paragraphs is the gap PLUS 24px. */
.uw-team__header-heading-col > :is(.uw-team__eyebrow, .uw-team__heading),
.uw-team__header-intro-col > .uw-team__intro { margin-block: 0; }

.uw-team__header-heading-col > .block-editor-inner-blocks,
.uw-team__header-heading-col > .block-editor-inner-blocks > .block-editor-block-list__layout,
.uw-team__header-intro-col > .block-editor-inner-blocks,
.uw-team__header-intro-col > .block-editor-inner-blocks > .block-editor-block-list__layout { display: contents; }

/* An untouched template placeholder serializes as an empty element. An empty
   <h2> is a WCAG violation, and an empty paragraph would still consume a 1rem
   flex gap that the legacy markup — which omitted the element entirely — never
   drew. The contenteditable guard keeps this off the editor canvas, where an
   empty block has to stay visible and clickable. */
.uw-team__heading:empty:not([contenteditable]),
.uw-team__intro:empty:not([contenteditable]),
.uw-team__eyebrow:empty:not([contenteditable]) { display: none; }

/* Both placeholders untouched, or every inner block deleted. The legacy render
   omitted .uw-team__header entirely when both fields were empty, and the header
   carries `margin: 0 auto clamp(2.5rem, 5vw, 4rem)`, so a present-but-empty
   header is up to 64px of visible drift. In the canvas the sole element child is
   .block-editor-inner-blocks, which is never :empty, so the header stays visible
   and clickable there. Left unqualified so it also covers
   .uw-team__header--split, where its children are either the legacy columns or
   the two column groups — non-empty elements in both cases, so it never matches
   there and the split header's own guard below does that job instead. */
.uw-team__header:not(:has(> :not(:empty))) { display: none; }

/* Inline unitedway/button after the intro: the header / intro column already
   space their children with `gap`, so drop the flow-layout margin the block
   would otherwise add on top of it (same fix Page Links uses). */
.uw-team__header > .uw-button,
.uw-team__header-intro-col > .uw-button { margin-block: 0; }

/* ── Split header (Tabs layout only — eyebrow + heading left, intro right) ── */
.uw-team__header--split {
	max-width: none;
	text-align: left;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: clamp(1.5rem, 4vw, 4rem);
}
.uw-team__header-heading-col {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	flex: 1 1 420px;
}
.uw-team__header-intro-col {
	flex: 1 1 380px;
	max-width: 620px;
	/* Inline path: each intro paragraph is its own flex item, and
	   `.uw-team__intro { margin: 0 }` above zeroes the margins core's flow
	   layout would otherwise give them, so the gap does the 1rem the legacy
	   `.uw-team__intro p { margin: 0 0 1rem }` did. Legacy path: one child,
	   full-width either way, so nothing moves. */
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.uw-team__header--split .uw-team__heading { text-align: left; }
.uw-team__header--split .uw-team__intro { text-align: left; }
.uw-team__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-weight: 600;
	font-size: 20px;
	line-height: 1;
	text-transform: uppercase;
	color: var(--wp--preset--color--deep-navy);
}
/* The red dot is decoration, not copy. On the inline path the eyebrow is a
   core/paragraph and cannot carry a child element, so the dot is drawn here
   instead — an editor cannot delete it, and no character is typed for it. The
   guard keeps it off the legacy branch, which still emits the real
   .uw-team__eyebrow-dot span below; the two boxes are identical, so whichever
   one draws, the pixels are the same. */
.uw-team__eyebrow:not(:has(> .uw-team__eyebrow-dot))::before {
	content: "";
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--wp--preset--color--red);
	flex: none;
}
.uw-team__eyebrow-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--wp--preset--color--red);
	flex: none;
}

/* Split header with nothing written in it. The legacy branch omitted the whole
   element when eyebrow, title and intro were all empty, and the header carries
   `margin: 0 auto clamp(2.5rem, 5vw, 4rem)`, so a present-but-empty split
   header is up to 64px of drift. The `.uw-team__header:not(:has(...))` guard
   further up cannot do this job: it looks one level down, and this header's own
   children are the two column groups, which are never :empty. In
   the canvas the sole child is .block-editor-inner-blocks and its child is the
   block list, never :empty either, so the header stays visible and clickable
   there. */
.uw-team__header--split:not(:has(> * > :not(:empty))) { display: none; }

/* ── Tabs (Tabs layout only) ── */
.uw-team__tabs {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 14px;
	padding: 6px;
	background: #F1F0ED;
	border: none;
	border-radius: 50px;
	margin: 0 0 clamp(2rem, 4vw, 3rem);
}
.uw-team__tab {
	position: relative;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-weight: 600;
	font-size: 20px;
	padding: 12px 24px;
	border-radius: 999px;
	border: none;
	background: transparent;
	color: var(--wp--preset--color--deep-navy);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
} 
/*.uw-team__tab:not(:last-child) { border-right: 1px dashed color-mix(in srgb, var(--wp--preset--color--deep-navy) 14%, transparent); }*/
.uw-team__tab:not(:first-child):before {
    content: '';
    border-right: 1px dashed  color-mix(in srgb, var(--wp--preset--color--deep-navy) 14%, transparent);
    position: absolute;
    width: 1px;
    height: 40px;
    left: -5px;
    top: 4px;
}
.uw-team__tab:hover { background: color-mix(in srgb, var(--wp--preset--color--deep-navy) 6%, transparent); }
.uw-team__tab.is-active {
	background: var(--wp--preset--color--cobalt-blue);
	color: var(--wp--preset--color--white);
	border: none;
}
.uw-team__tab.is-active:hover { background: var(--wp--preset--color--cobalt-blue); }
.uw-team__tab-panel[hidden] { display: none; }
.uw-team__tab-panel { padding-bottom: 30px; }

/* ── Card grid ── */
.uw-team__grid {
	--cols: 4;
	display: grid;
	grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
	gap: clamp(1.25rem, 1.6vw, 24px);
}

/* ── Card (white card, photo + text inset with padding — Figma 1664-22245) ── */
.uw-team__card {
	display: flex;
	flex-direction: column;
	cursor: pointer;
	background: var(--wp--preset--color--white);
	border-radius: 20px;
	padding: 16px 16px 20px;
	transition: box-shadow 0.2s ease;
	justify-content: space-between;
}
.uw-team--bg-porcelain .uw-team__card,
.uw-team--bg-white .uw-team__card {
	background: var(--wp--preset--color--parchment);
}
.uw-team__card:hover {
	box-shadow: 0 8px 24px color-mix(in srgb, var(--wp--preset--color--deep-navy) 14%, transparent);
}
.uw-team__card-photo-wrap {
	aspect-ratio: 322 / 280;
	overflow: hidden;
	border-radius: 14px;
	background: color-mix(in srgb, var(--wp--preset--color--deep-navy) 8%, transparent);
	transition: box-shadow 0.2s ease;
}
.uw-team__card-photo,
.uw-team__card-photo-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}
.uw-team__card:hover .uw-team__card-photo {
	transform: scale(1.03);
}
.uw-team__card-photo-placeholder {
	width: 100%;
	height: 100%;
	background: color-mix(in srgb, var(--wp--preset--color--deep-navy) 10%, transparent);
}
.uw-team__card.is-selected .uw-team__card-photo-wrap {
	box-shadow: 0 0 0 3px var(--wp--preset--color--cobalt-blue);
}

/* ── Card body ── */
.uw-team__card-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 20px 0 0;
}
.uw-team__card-name {
	margin: 0;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-size: 30px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.015em;
	color: var(--wp--preset--color--deep-navy);
}
.uw-team__card-role {
	margin: 0;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 16px;
	line-height: 1.4;
	color: color-mix(in srgb, var(--wp--preset--color--deep-navy) 75%, transparent);
}
.uw-team__card-company {
	margin: 0;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 16px;
	line-height: 1.4;
	/* #6C6C88 passes AA on white; the old 55% navy (#7B7B97) was 4.09:1. */
	color: #6C6C88;
}

/* ── Card open "+" button (grey rounded square, in flow) ── */
.uw-team__card-open {
	margin-top: 20px;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--wp--preset--color--parchment);
	color: var(--wp--preset--color--deep-navy); 
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.15s ease, color 0.15s ease;
	border: none;
}
.uw-team--bg-porcelain .uw-team__card-open,
.uw-team--bg-white .uw-team__card-open {
	background: var(--wp--preset--color--white);
}
.uw-team__card-open:hover,
.uw-team__card.is-selected .uw-team__card-open {
	background: var(--wp--preset--color--cobalt-blue);
	color: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--cobalt-blue);
}
.uw-team__plus-icon { width: 20px; height: 20px; display: block; }

/* hidden bio data (read by JS only) */
.uw-team__bio { display: none; }

/* ──────────────────────────────────────────────────────────────────────────
   Text-only listing (Text only layout) — name/title/company, no photo/popup
   ────────────────────────────────────────────────────────────────────────── */
.uw-team__text-grid {
	--cols: 4;
	display: grid;
	grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
	gap: clamp(1.5rem, 2vw, 2.5rem) clamp(1.25rem, 1.6vw, 24px);
}
/* Grid layout: members without a photo render below the photo cards. */
.uw-team__grid + .uw-team__text-grid {
	margin-top: clamp(1.5rem, 2vw, 2.5rem);
}
.uw-team__text-item {
	border-top: 3px solid var(--wp--preset--color--cobalt-blue);
	padding-top: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.uw-team__text-name {
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--deep-navy);
}
.uw-team__text-role {
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 16px;
	line-height: 1.4;
	color: color-mix(in srgb, var(--wp--preset--color--deep-navy) 75%, transparent);
}
.uw-team__text-company {
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 16px;
	line-height: 1.4;
	color: #6C6C88; /* AA on white; was 55% navy (#7B7B97), 4.09:1. */
}

/* ──────────────────────────────────────────────────────────────────────────
   Bio panel — docked to the right, full height, slides in
   ────────────────────────────────────────────────────────────────────────── */
.uw-team__lightbox {
	position: fixed;
	inset: 0;
	z-index: 9000;
	display: flex;
	justify-content: flex-end;
}
.uw-team__lightbox[hidden] { display: none; }

/* Bio panel is a front-end-only interaction — force it off in the editor
   (covers both the iframed canvas and any non-iframed editor context),
   regardless of the hidden attribute's runtime state. */
.editor-styles-wrapper .uw-team__lightbox,
.block-editor-page .uw-team__lightbox {
	display: none !important;
}
.editor-styles-wrapper .uw-team__card-open,
.block-editor-page .uw-team__card-open {
	pointer-events: none;
}
.uw-team__lb-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .7);
	cursor: pointer;
}
.uw-team__lb-panel {
	position: relative;
	z-index: 1;
	width: min(560px, 100vw);
	height: 100%;
	max-height: 100vh;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--deep-navy);
	animation: uw-team-slide 0.28s ease;
}
@keyframes uw-team-slide {
	from { transform: translateX(40px); opacity: 0; }
	to   { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.uw-team__lb-panel { animation: none; }
}

.uw-team__lb-close {
	position: absolute;
	top: 24px;
	right: calc(min(560px, 100vw) + 16px);
	z-index: 2;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--cobalt-blue);
	color: var(--wp--preset--color--white);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.15s ease;
}
.uw-team__lb-close:hover { background: var(--wp--preset--color--deep-navy); }
.uw-team__close-icon { width: 18px; height: 18px; display: block; }

/* panel content stacks vertically: photo → text */
.uw-team__lb-inner {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	flex: 1;
	padding: 1.5rem 1.5rem 0;
}
.uw-team__lb-photo-col { width: 100%; }
.uw-team__lb-photo-slot {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 12px;
	overflow: hidden;
	background: color-mix(in srgb, var(--wp--preset--color--deep-navy) 8%, transparent);
}
.uw-team__lb-photo,
.uw-team__lb-photo-slot img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.uw-team__lb-content-col {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.uw-team__lb-name {
	margin: 0;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-size: clamp(26px, 3vw, 32px);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--wp--preset--color--deep-navy);
}
.uw-team__lb-role {
	margin: 0;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 15px;
	color: color-mix(in srgb, var(--wp--preset--color--deep-navy) 75%, transparent);
}
.uw-team__lb-company {
	margin: 0;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 14px;
	color: #6C6C88; /* AA on white; was 55% navy (#7B7B97), 4.09:1. */
}
.uw-team__lb-bio {
	margin-top: 0.75rem;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 16px;
	line-height: 1.6;
	color: color-mix(in srgb, var(--wp--preset--color--deep-navy) 88%, transparent);
}
.uw-team__lb-bio p { margin: 0 0 0.75rem; }

/* social */
.uw-team__lb-social { margin-top: 1rem; }
.uw-team__bio-social-link,
.uw-team__lb-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 100px;
	background: #F6F5F2;
	color: var(--wp--preset--color--deep-navy);
	text-decoration: none;
	transition: background 0.15s ease;
}
.uw-team__bio-social-link span,
.uw-team__lb-social a span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}
.uw-team__bio-social-link:hover,
.uw-team__lb-social a:hover { background: var(--wp--preset--color--cobalt-blue); color: var(--wp--preset--color--white); }
.uw-team__social-icon { width: 20px; height: 20px; display: block; }

/* prev / next at the bottom */
.uw-team__lb-nav {
	display: flex;
	margin-top: auto;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--deep-navy) 14%, transparent);
}
.uw-team__lb-prev,
.uw-team__lb-next {
	flex: 1;
	height: 72px;
	background: none;
	border: none;
	border-radius: 0;
	color: var(--wp--preset--color--deep-navy);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.15s ease;
}
.uw-team__lb-prev { border-right: 1px solid color-mix(in srgb, var(--wp--preset--color--deep-navy) 14%, transparent); }
.uw-team__lb-prev:hover,
.uw-team__lb-next:hover { background: color-mix(in srgb, var(--wp--preset--color--deep-navy) 5%, transparent); }
.uw-team__arrow-icon { width: 14px; height: 14px; display: block; }

/* ── Responsive ── */
@media (max-width: 1024px) {
	.uw-team__grid,
	.uw-team__text-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.uw-team__header--split { flex-direction: column; }
	.uw-team-inner { padding-top: 50px; padding-bottom: 50px; }

}
@media (max-width: 767px) {
	.uw-team__header-heading-col {
		gap: 10px;
    	flex: 0;
	}
	.uw-team__header-intro-col { flex: 0; }
	.uw-team__grid,
	.uw-team__text-grid { grid-template-columns: 1fr; }
	.uw-team__lb-panel { width: 80vw; }
	/* No overlay gutter left at full-width — dock the close button inline over the photo instead. */
	.uw-team__lb-close { right: auto; left: 10px; }
	.uw-team__deco--top { width: 50vw; }
	.uw-team__deco--bottom { width: 40vw; }
	/* No dashed divider between tabs on mobile. */
	.uw-team__tab:not(:first-child):before { display: none; }
}
