/* Leadership Team Grid — front end
 * Fonts and heading styles are inherited from the theme (Astra / Elementor globals),
 * so the grid picks up the site's typography automatically.
 */

.ltg-grid {
	--ltg-cols: 3;
	--ltg-cols-tablet: 2;
	--ltg-cols-mobile: 1;
	--ltg-gap: 40px;
	--ltg-ease: cubic-bezier(.2, .7, .2, 1);
	display: grid;
	grid-template-columns: repeat(var(--ltg-cols), minmax(0, 1fr));
	column-gap: var(--ltg-gap);
	row-gap: var(--ltg-row-gap, 48px);
	margin: 0 auto;
}

@media (max-width: 1024px) {
	.ltg-grid { grid-template-columns: repeat(var(--ltg-cols-tablet), minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.ltg-grid {
		grid-template-columns: repeat(var(--ltg-cols-mobile), minmax(0, 1fr));
		row-gap: var(--ltg-row-gap-mobile, 32px);
	}
}

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

.ltg-card {
	position: relative;
	margin: 0;
	transition: transform .35s var(--ltg-ease), box-shadow .35s var(--ltg-ease);
}

/* Photo area */
.ltg-media {
	position: relative;
	width: 100%;
	isolation: isolate;
}

.ltg-bg {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	overflow: hidden;
	background: var(--ltg-bg, #0052CC);
	z-index: 0;
}

.ltg-pattern {
	position: absolute;
	inset: 0;
	background-image: var(--ltg-pattern);
	background-size: cover;
	background-position: center;
	opacity: 0;
	transform: scale(1.06);
	transition: opacity .45s var(--ltg-ease), transform .6s var(--ltg-ease);
}

.ltg-media .ltg-photo {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	max-width: none;
	transition: transform .5s var(--ltg-ease), filter .5s var(--ltg-ease);
}

/* Cut-out: transparent PNG, head breaks out above the coloured square */
.ltg-media--cutout { aspect-ratio: 5 / 6; }
.ltg-media--cutout .ltg-bg { height: 83.333%; } /* = a perfect square of the card width */
.ltg-media--cutout .ltg-photo {
	position: absolute;
	inset: 0;
	height: 100%;
	object-fit: contain;
	object-position: center bottom;
	transform-origin: center bottom;
}

/* Standard: ordinary photo fills a square */
.ltg-media--standard { aspect-ratio: 1 / 1; overflow: hidden; }
.ltg-media--standard .ltg-bg { top: 0; }
.ltg-media--standard .ltg-photo {
	position: absolute;
	inset: 0;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

/* If a grid mixes cut-outs and regular photos, give regular photos the same
   head-room band so names line up across a row (not needed in one column). */
@media (min-width: 601px) {
	.ltg-has-cutout .ltg-media--standard { margin-top: 20%; }
}

/* Name + title — use the theme's h3 styles; only spacing is set here */
.ltg-card .ltg-name,
.ltg-modal .ltg-name {
	margin: 1.1em 0 .35em;
	color: var(--ltg-name-color, inherit);
	line-height: 1.2;
}

.ltg-name .ltg-open {
	all: unset;
	cursor: pointer;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
}
/* Make the whole card clickable */
.ltg-name .ltg-open::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}
.ltg-name .ltg-open:focus-visible { outline: none; }
.ltg-card:has(.ltg-open:focus-visible) {
	outline: 2px solid var(--ltg-link-color, var(--ast-global-color-0, var(--e-global-color-accent, currentColor)));
	outline-offset: 6px;
}

.ltg-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.ltg-card > :last-child { margin-bottom: 0; }

.ltg-title {
	margin: 0;
	color: var(--ltg-title-color, inherit);
	font-size: .95em;
	line-height: 1.45;
	opacity: .85;
}
.ltg-title-upper .ltg-title {
	text-transform: uppercase;
	letter-spacing: .1em;
	font-size: .72em;
	font-weight: 500;
}

/* ---------- Rollover effects ---------- */

.ltg-has-bio { cursor: pointer; }

@media (hover: hover) {
	/* Pattern appears behind the person */
	.ltg-hover-pattern .ltg-card:hover .ltg-pattern,
	.ltg-hover-pattern_zoom .ltg-card:hover .ltg-pattern {
		opacity: var(--ltg-pattern-opacity, 1);
		transform: scale(1);
	}
	/* Zoom */
	.ltg-hover-zoom .ltg-card:hover .ltg-photo,
	.ltg-hover-pattern_zoom .ltg-card:hover .ltg-photo,
	/* With standard (opaque) photos the pattern can't show through, so zoom instead */
	.ltg-hover-pattern .ltg-card:hover .ltg-media--standard .ltg-photo {
		transform: scale(1.04);
	}
	/* Lift */
	.ltg-hover-lift .ltg-card:hover { transform: translateY(-6px); }
	.ltg-hover-lift .ltg-card:hover .ltg-bg { box-shadow: 0 18px 40px -18px rgba(9, 30, 66, .45); }
	.ltg-hover-lift .ltg-bg { transition: box-shadow .35s var(--ltg-ease); overflow: hidden; }
	/* Grayscale */
	.ltg-hover-grayscale .ltg-photo { filter: grayscale(1); }
	.ltg-hover-grayscale .ltg-card:hover .ltg-photo { filter: none; }
}
/* Keyboard users get the same effect */
.ltg-hover-pattern .ltg-card:focus-within .ltg-pattern,
.ltg-hover-pattern_zoom .ltg-card:focus-within .ltg-pattern {
	opacity: var(--ltg-pattern-opacity, 1);
	transform: scale(1);
}

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

html.ltg-modal-open { overflow: hidden; }

.ltg-modal {
	width: min(var(--ltg-modal-width, 920px), calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 48px);
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #fff;
	color: inherit;
	font: inherit;
	box-shadow: 0 24px 60px -12px rgba(9, 30, 66, .35);
	overflow: auto;
	overscroll-behavior: contain;
}
.ltg-modal::backdrop {
	background: var(--ltg-overlay, rgba(9, 30, 66, .6));
}
.ltg-modal[open] { animation: ltg-in .3s var(--ltg-ease, ease) both; }
.ltg-modal[open]::backdrop { animation: ltg-fade .3s ease both; }

@keyframes ltg-in {
	from { opacity: 0; transform: translateY(12px) scale(.98); }
	to   { opacity: 1; transform: none; }
}
@keyframes ltg-fade { from { opacity: 0; } to { opacity: 1; } }

.ltg-modal-inner {
	position: relative;
	padding: clamp(28px, 4.5vw, 48px);
}

.ltg-modal-content {
	display: grid;
	grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
	gap: clamp(24px, 3.5vw, 40px);
	align-items: start;
}

.ltg-modal-aside .ltg-name { margin-top: .9em; }

.ltg-modal-bio { line-height: 1.65; }
/* With a cut-out headshot, line the text up with the top of the coloured box */
.ltg-modal-bio--cutout { padding-top: 8%; }
.ltg-modal-bio > *:first-child { margin-top: 0; }
.ltg-modal-bio > *:last-child { margin-bottom: 0; }
.ltg-modal-bio a,
.ltg-links a {
	color: var(--ltg-link-color, var(--ast-global-color-0, var(--e-global-color-accent, inherit)));
}

.ltg-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin-top: 1.1em;
	font-size: .9em;
}
.ltg-icon-link { display: inline-flex; line-height: 0; opacity: .7; }
.ltg-icon-link:hover, .ltg-icon-link:focus-visible { opacity: 1; }
.ltg-icon-link svg rect { fill: var(--ltg-name-color, currentColor); }
.ltg-text-link { text-decoration: none; }
.ltg-text-link:hover, .ltg-text-link:focus-visible { text-decoration: underline; }

.ltg-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #6b778c;
	cursor: pointer;
	box-shadow: none;
}
.ltg-close:hover, .ltg-close:focus-visible {
	background: rgba(9, 30, 66, .07);
	color: #172b4d;
}

@media (max-width: 700px) {
	.ltg-modal-content { grid-template-columns: 1fr; }
	.ltg-modal-aside { max-width: 300px; }
	.ltg-modal-bio { padding-top: 0; }
	.ltg-modal { max-height: calc(100dvh - 24px); }
}

@media (prefers-reduced-motion: reduce) {
	.ltg-card, .ltg-pattern, .ltg-media .ltg-photo { transition: none; }
	.ltg-modal[open], .ltg-modal[open]::backdrop { animation: none; }
}

.ltg-empty {
	padding: 1em;
	border: 1px dashed currentColor;
	opacity: .7;
}
