/**
 * LNTA Team — staff grid and Quick Overview modal.
 * Colours, columns and photo shape come in as custom properties set on the
 * .lnta-team wrapper by the shortcode, so several grids can differ on a page.
 */

.lnta-team {
	--lnta-team-accent: #c8102e;
	--lnta-team-cols: 3;
	--lnta-team-ratio: 1 / 1;
	--lnta-team-fit: cover;
	--lnta-team-ink: #14181f;
	--lnta-team-muted: #5b6472;
	--lnta-team-surface: #ffffff;
	--lnta-team-line: #e6e9ef;
	--lnta-team-radius: 14px;
	--lnta-team-gap: 28px;
	/* Columns actually in play at this width — the lead row measures its
	   cards against this so they match the grid below at every breakpoint. */
	--lnta-team-eff-cols: var(--lnta-team-cols);
	/* Lead card size relative to one column — a touch larger, so seniority
	   reads at a glance without the card becoming a different component. */
	--lnta-team-lead-scale: 1.2;

	box-sizing: border-box;
}

.lnta-team *,
.lnta-team *::before,
.lnta-team *::after,
.lnta-team-modal *,
.lnta-team-modal *::before,
.lnta-team-modal *::after {
	box-sizing: border-box;
}

.lnta-team__grid {
	display: grid;
	grid-template-columns: repeat(var(--lnta-team-cols), minmax(0, 1fr));
	gap: var(--lnta-team-gap);
	align-items: stretch;
}

/*
 * Lead row: the first member(s) sit alone above the rest, centred, at exactly
 * the width one card would occupy in the grid below — so the hierarchy reads
 * without the top card looking like a different component.
 */
.lnta-team .lnta-team__grid--lead {
	grid-template-columns: repeat(
		var(--lnta-team-lead, 1),
		calc(
			(100% - (var(--lnta-team-eff-cols) - 1) * var(--lnta-team-gap)) /
			var(--lnta-team-eff-cols) * var(--lnta-team-lead-scale, 1)
		)
	);
	justify-content: center;
	margin-bottom: var(--lnta-team-gap);
}

.lnta-team__group-title {
	margin: 2.5rem 0 1.25rem;
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--lnta-team-ink);
	text-align: center;
}

.lnta-team__grid + .lnta-team__group-title,
.lnta-team__group-title:first-child {
	margin-top: 0;
}

/* ---------- Card ---------- */

.lnta-team__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	text-align: center;
}

.lnta-team__surface {
	width: 100%;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	background: var(--lnta-team-surface);
	border-radius: var(--lnta-team-radius);
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lnta-team--soft .lnta-team__surface {
	box-shadow: 0 2px 12px rgba(16, 24, 40, 0.08);
}

.lnta-team--soft .lnta-team__card:hover .lnta-team__surface {
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
}

.lnta-team--bordered .lnta-team__surface {
	border: 1px solid var(--lnta-team-line);
}

.lnta-team--flat .lnta-team__surface {
	background: transparent;
}

.lnta-team__media {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: var(--lnta-team-ratio);
	background: #ffffff;
	overflow: hidden;
}

.lnta-team__media img,
.lnta-team__photo {
	width: 100%;
	height: 100%;
	object-fit: var(--lnta-team-fit);
	object-position: center top;
	display: block;
}

.lnta-team__initials {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	border-radius: 50%;
	background: #eef1f6;
	color: var(--lnta-team-muted);
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.lnta-team__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	padding: 18px 16px 20px;
}

/*
 * Positions wrap onto two lines for some titles, which would otherwise leave
 * each card's icon row at a different height. Pushing the row down aligns it
 * across the whole grid, and the buttons below the cards line up with it.
 */
.lnta-team__body .lnta-team__social {
	margin-top: auto;
	padding-top: 14px;
}

.lnta-team__name {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.3;
	font-weight: 700;
	color: var(--lnta-team-ink);
}

.lnta-team__position {
	margin: 6px 0 0;
	font-size: 1rem;
	line-height: 1.45;
	color: var(--lnta-team-muted);
}

.lnta-team__dept {
	margin: 4px 0 0;
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--lnta-team-accent);
	font-weight: 600;
}

/* ---------- Social icons ---------- */

.lnta-team__social,
.lnta-team-modal__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 16px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.lnta-team__social li,
.lnta-team-modal__links li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lnta-team__social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	color: var(--lnta-team-ink, #14181f);
	text-decoration: none;
	box-shadow: none;
	transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.lnta-team__social-link svg {
	width: 18px;
	height: 18px;
	display: block;
}

.lnta-team__social-link:hover,
.lnta-team__social-link:focus-visible {
	color: var(--lnta-team-accent, #c8102e);
	background: rgba(200, 16, 46, 0.08);
	transform: translateY(-1px);
}

.lnta-team__sr,
.lnta-team .screen-reader-text,
.lnta-team-modal .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Quick Overview button ---------- */

.lnta-team__button {
	appearance: none;
	margin: 16px 0 0;
	padding: 11px 24px;
	border: 0;
	border-radius: 6px;
	background: var(--lnta-team-accent);
	color: #ffffff;
	font-size: 0.98rem;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition: filter 0.2s ease, transform 0.2s ease;
}

.lnta-team__button:hover {
	filter: brightness(0.9);
	transform: translateY(-1px);
}

.lnta-team__button:focus-visible,
.lnta-team__social-link:focus-visible {
	outline: 3px solid var(--lnta-team-accent, #c8102e);
	outline-offset: 3px;
}

/* ---------- Modal ---------- */

.lnta-team-modal {
	--lnta-team-accent: #c8102e;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.lnta-team-modal[hidden] {
	display: none;
}

.lnta-team-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 15, 28, 0.62);
	backdrop-filter: blur(2px);
	animation: lnta-team-fade 0.2s ease;
}

.lnta-team-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 880px;
	max-height: 88vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(10, 15, 28, 0.35);
	animation: lnta-team-rise 0.25s ease;
}

.lnta-team-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #14181f;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(10, 15, 28, 0.18);
}

.lnta-team-modal__close svg {
	width: 18px;
	height: 18px;
}

.lnta-team-modal__close:hover {
	color: var(--lnta-team-accent);
}

.lnta-team-modal__member {
	display: grid;
	grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
	gap: 0;
}

.lnta-team-modal__media {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f4f6fa;
	min-height: 100%;
}

.lnta-team-modal__media img {
	width: 100%;
	height: 100%;
	max-height: 420px;
	object-fit: cover;
	object-position: center top;
	display: block;
}

.lnta-team-modal__text {
	padding: 34px 32px 28px;
}

.lnta-team-modal__name {
	margin: 0;
	font-size: 1.6rem;
	line-height: 1.25;
	font-weight: 700;
	color: #14181f;
}

.lnta-team-modal__position {
	margin: 6px 0 0;
	font-size: 1.05rem;
	color: #5b6472;
}

.lnta-team-modal__dept {
	margin: 10px 0 0;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lnta-team-accent);
}

.lnta-team-modal__summary {
	margin: 16px 0 0;
	font-size: 1.02rem;
	font-weight: 600;
	color: #2c3442;
	border-left: 3px solid var(--lnta-team-accent);
	padding-left: 12px;
}

.lnta-team-modal__bio {
	margin-top: 16px;
	color: #2c3442;
	line-height: 1.65;
}

.lnta-team-modal__bio p:first-child {
	margin-top: 0;
}

.lnta-team-modal__links {
	justify-content: flex-start;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid #e6e9ef;
}

.lnta-team-modal__nav {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	padding: 0 20px 18px;
}

.lnta-team-modal__nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid #e6e9ef;
	border-radius: 50%;
	background: #ffffff;
	color: #14181f;
	cursor: pointer;
}

.lnta-team-modal__nav-btn:hover:not([disabled]) {
	border-color: var(--lnta-team-accent);
	color: var(--lnta-team-accent);
}

.lnta-team-modal__nav-btn[disabled] {
	opacity: 0.4;
	cursor: default;
}

.lnta-team-modal__nav-btn svg {
	width: 20px;
	height: 20px;
}

.lnta-team-modal__counter {
	font-size: 0.85rem;
	color: #5b6472;
}

.lnta-team-modal__nav[hidden] {
	display: none;
}

body.lnta-team-modal-open {
	overflow: hidden;
}

@keyframes lnta-team-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes lnta-team-rise {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.lnta-team {
		--lnta-team-eff-cols: min(var(--lnta-team-cols), 2);
	}

	.lnta-team__grid {
		grid-template-columns: repeat(min(var(--lnta-team-cols), 2), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.lnta-team {
		--lnta-team-gap: 20px;
		--lnta-team-eff-cols: 1;
	}

	/* One column, so the lead card cannot be made wider — the deputies are
	   inset slightly instead, which keeps the hierarchy legible on a phone
	   without anything overflowing the viewport. */
	.lnta-team .lnta-team__grid--lead {
		grid-template-columns: minmax(0, 1fr);
	}

	.lnta-team .lnta-team__grid:not(.lnta-team__grid--lead) {
		grid-template-columns: minmax(0, 86%);
		justify-content: center;
	}

	/*
	 * Touch targets: 30px icons are comfortable with a mouse but below the
	 * 44px minimum a finger needs, so they grow on small screens. The gap
	 * tightens to keep a full row of icons on one line inside the card.
	 */
	.lnta-team__body .lnta-team__social {
		gap: 8px;
	}

	.lnta-team__social-link {
		width: 44px;
		height: 44px;
	}

	.lnta-team__button {
		padding: 13px 26px;
	}

	.lnta-team-modal__close,
	.lnta-team-modal__nav-btn {
		width: 44px;
		height: 44px;
	}

	.lnta-team__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.lnta-team-modal {
		padding: 12px;
	}

	.lnta-team-modal__member {
		grid-template-columns: minmax(0, 1fr);
	}

	.lnta-team-modal__media img {
		max-height: 300px;
	}

	.lnta-team-modal__text {
		padding: 24px 20px 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lnta-team__surface,
	.lnta-team__button,
	.lnta-team__social-link,
	.lnta-team-modal__backdrop,
	.lnta-team-modal__dialog {
		transition: none;
		animation: none;
	}

	.lnta-team--soft .lnta-team__card:hover .lnta-team__surface,
	.lnta-team__button:hover {
		transform: none;
	}
}

/* The single-member shortcode is a callout, not a grid. */
.lnta-team--single .lnta-team__grid {
	max-width: 340px;
	margin: 0 auto;
}

/*
 * Grid heading. The colour is set explicitly rather than left to inherit, for
 * the same reason as the icon rules below.
 */
.lnta-team .lnta-team__heading {
	margin: 0 0 1.75rem;
	color: var(--lnta-team-ink, #14181f);
	font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.05rem);
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
	text-wrap: balance;
}

/*
 * Themes and page builders often ship a blanket rule such as
 * ".elementor * { color: #fff }". A rule that matches the <svg> directly beats
 * the colour it would otherwise inherit from the link, so the icons vanish
 * against a white card. These selectors are specific enough to win that back.
 */
.lnta-team .lnta-team__social-link svg,
.lnta-team .lnta-team__social-link svg path,
.lnta-team-modal .lnta-team__social-link svg,
.lnta-team-modal .lnta-team__social-link svg path,
.lnta-team-modal .lnta-team-modal__close svg,
.lnta-team-modal .lnta-team-modal__close svg path,
.lnta-team-modal .lnta-team-modal__nav-btn svg,
.lnta-team-modal .lnta-team-modal__nav-btn svg path {
	color: inherit;
	fill: currentColor;
}
