/* ==========================================================================
   Modern Team – front end
   All sizing is driven by CSS variables set per display:
   --mdt-cols  max columns          --mdt-n      columns for this group
   --mdt-min   smallest card width  --mdt-gap    spacing
   --mdt-accent / --mdt-frame / --mdt-frame-w / --mdt-radius
   ========================================================================== */

.mdt {
	--mdt-max: 300px;
	--mdt-text: #1f2937;
	--mdt-muted: #6b7280;
	--mdt-card: #ffffff;
	--mdt-line: rgba(15, 23, 42, 0.08);
	--mdt-ph-bg: #eef1f5;
	--mdt-ph-fg: #a3acb9;
	--mdt-ph-hair: #7d8796;
	--mdt-ph-bg: color-mix(in srgb, var(--mdt-accent) 10%, #eef1f5);
	--mdt-ph-fg: color-mix(in srgb, var(--mdt-accent) 30%, #a3acb9);
	--mdt-ph-hair: color-mix(in srgb, var(--mdt-accent) 35%, #6b7484);
	box-sizing: border-box;
	color: var(--mdt-text);
	/* Own text size so a theme's tiny root font can't shrink it. */
	font-size: var(--mdt-fs, 16px);
	line-height: 1.5;
	padding-block: var(--mdt-space, 48px);
	margin-block: 0;
	clear: both;
}
@media (max-width: 520px) {
	/* A touch smaller on phones, never below 14px. */
	.mdt { font-size: max(14px, calc(var(--mdt-fs, 16px) * 0.92)); padding-block: calc(var(--mdt-space, 48px) * 0.7); }
}
.mdt *, .mdt *::before, .mdt *::after { box-sizing: border-box; }

/* ---------- Group headings ---------- */
.mdt-group + .mdt-group { margin-top: calc(var(--mdt-gap) * 2 + 1.5em); }
.mdt .mdt-group-title {
	margin: 0 0 0.35em;
	font-size: clamp(1.5em, 1.3em + 1vw, 2em);
	line-height: 1.2;
	color: inherit;
}
.mdt .mdt-group-title::after {
	content: "";
	display: block;
	width: 48px;
	height: 4px;
	margin-top: 0.45em;
	border-radius: 4px;
	background: var(--mdt-accent);
}
.mdt-align-center .mdt-group-title::after { margin-inline: auto; }
.mdt .mdt-group-desc { margin: 0 0 1.25em; color: var(--mdt-muted); max-width: 65ch; }
.mdt-align-center .mdt-group-title,
.mdt-align-center .mdt-group-desc { text-align: center; margin-inline: auto; }
.mdt-group-title + .mdt-grid { margin-top: 1.25em; }

/* ---------- Grid: never wider than its people, never squashed ---------- */
.mdt .mdt-grid {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	display: grid;
	gap: var(--mdt-gap);
	grid-template-columns: repeat(
		auto-fill,
		minmax(min(100%, max(var(--mdt-min), (100% - (var(--mdt-n) - 1) * var(--mdt-gap)) / var(--mdt-n))), 1fr)
	);
	max-width: calc(var(--mdt-n) * var(--mdt-max) + (var(--mdt-n) - 1) * var(--mdt-gap));
}
.mdt-align-left .mdt-grid { margin-inline: 0; }
@media (max-width: 520px) {
	/* Two across on phones for most layouts. */
	.mdt .mdt-grid {
		gap: min(var(--mdt-gap), 14px);
		grid-template-columns: repeat(auto-fill, minmax(min(100%, max(min(var(--mdt-min), 140px), (100% - (var(--mdt-n) - 1) * 14px) / var(--mdt-n))), 1fr));
	}
	.mdt-layout-list .mdt-grid { grid-template-columns: 1fr; }
	.mdt-layout-compact .mdt-grid { gap: 12px; }
	.mdt .mdt-card { padding: 10px 10px 14px; }
	.mdt .mdt-name { font-size: 0.98em; }
	.mdt .mdt-bio { font-size: 0.85em; }
	.mdt-layout-compact .mdt-card { width: calc(50% - 6px); }
}

/* ---------- Card ---------- */
.mdt .mdt-card {
	position: relative;
	margin: 0;
	padding: 14px 14px 18px;
	display: flex;
	flex-direction: column;
	border-radius: var(--mdt-radius);
	background: var(--mdt-card);
	box-shadow: 0 1px 2px var(--mdt-line), 0 0 0 1px var(--mdt-line);
	transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease;
}
.mdt-align-center .mdt-card { text-align: center; }
.mdt-align-left .mdt-card { text-align: left; }

.mdt .mdt-body { padding-top: 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mdt .mdt-name { margin: 0; font-size: 1.15em; line-height: 1.25; color: inherit; font-weight: 700; }
.mdt .mdt-role { margin: 0; font-size: 0.95em; font-weight: 600; color: var(--mdt-accent); line-height: 1.3; }
.mdt .mdt-bio { margin: 6px 0 0; font-size: 0.95em; line-height: 1.5; color: var(--mdt-muted); }
.mdt .mdt-contact { margin: 8px 0 0; display: flex; flex-direction: column; gap: 2px; font-size: 0.88em; }
.mdt .mdt-contact a { color: inherit; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.mdt .mdt-more {
	align-self: center;
	margin-top: auto;
	padding: 6px 14px;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: var(--mdt-accent);
	font: inherit;
	font-size: 0.85em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.mdt .mdt-bio + .mdt-more, .mdt .mdt-role + .mdt-more, .mdt .mdt-contact + .mdt-more { margin-top: 12px; }
.mdt-align-left .mdt-more { align-self: flex-start; }
.mdt .mdt-more:hover, .mdt .mdt-more:focus-visible { background: var(--mdt-accent); color: #fff; border-color: var(--mdt-accent); }
.mdt .mdt-more:focus-visible, .mdt .mdt-close:focus-visible { outline: 3px solid var(--mdt-accent); outline-offset: 2px; }

/* ---------- Photo box: every image the same shape ---------- */
.mdt .mdt-media { position: relative; }
.mdt .mdt-photo {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	border-radius: var(--mdt-radius);
	background: var(--mdt-ph-bg);
	isolation: isolate;
}
.mdt-shape-square .mdt-photo { aspect-ratio: 1; border-radius: 0; }
.mdt-shape-rounded .mdt-photo { aspect-ratio: 1; border-radius: calc(var(--mdt-radius) * 1.5); }
.mdt-shape-circle .mdt-photo { aspect-ratio: 1; border-radius: 50%; }
.mdt-shape-landscape .mdt-photo { aspect-ratio: 4 / 3; }

.mdt .mdt-photo img,
.mdt .mdt-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
}
.mdt .mdt-photo img {
	object-fit: cover;
	object-position: 50% 20%;
	transition: transform 0.6s cubic-bezier(.2,.8,.2,1), filter 0.5s ease;
}
.mdt .mdt-photo img.mdt-focus-center { object-position: 50% 50%; }
.mdt .mdt-photo img.mdt-focus-bottom { object-position: 50% 85%; }

.mdt .mdt-placeholder { display: grid; place-items: end center; }
.mdt .mdt-placeholder svg { width: 78%; height: auto; display: block; }
.mdt .mdt-sil { fill: var(--mdt-ph-fg); }
.mdt .mdt-sil-hair { fill: var(--mdt-ph-hair); }

/* ---------- Frames ---------- */
.mdt-frame-border .mdt-photo { border: var(--mdt-frame-w) solid var(--mdt-frame); }
.mdt-frame-double .mdt-photo { border: max(4px, var(--mdt-frame-w)) double var(--mdt-frame); }
.mdt-frame-shadow .mdt-photo { box-shadow: 0 12px 28px -10px rgba(15, 23, 42, 0.35); }
.mdt-frame-polaroid .mdt-media {
	padding: var(--mdt-frame-w) var(--mdt-frame-w) calc(var(--mdt-frame-w) * 3.5);
	background: var(--mdt-frame);
	box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.35);
	transform: rotate(-1.2deg);
}
.mdt-frame-polaroid .mdt-card:nth-child(even) .mdt-media { transform: rotate(1.2deg); }
.mdt-frame-polaroid .mdt-photo { border-radius: 2px; }
.mdt-frame-polaroid.mdt-shape-circle .mdt-photo { border-radius: 50%; }
.mdt-frame-ring .mdt-media {
	padding: max(3px, var(--mdt-frame-w));
	border-radius: calc(var(--mdt-radius) + var(--mdt-frame-w));
	background: linear-gradient(135deg, var(--mdt-accent), var(--mdt-frame), var(--mdt-accent));
}
.mdt-frame-ring.mdt-shape-circle .mdt-media { border-radius: 50%; }
.mdt-frame-ring.mdt-shape-square .mdt-media { border-radius: 0; }
.mdt-frame-offset .mdt-media { isolation: isolate; margin: 0 calc(var(--mdt-frame-w) * 1.5) calc(var(--mdt-frame-w) * 1.5) 0; }
.mdt-frame-offset .mdt-media::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	transform: translate(calc(var(--mdt-frame-w) * 1.5), calc(var(--mdt-frame-w) * 1.5));
	border-radius: var(--mdt-radius);
	background: var(--mdt-accent);
	transition: transform 0.35s ease;
}
.mdt-frame-offset.mdt-shape-circle .mdt-media::before { border-radius: 50%; }
.mdt-frame-offset.mdt-shape-square .mdt-media::before { border-radius: 0; }

/* ---------- Themes ---------- */
.mdt-theme-dark {
	--mdt-text: #f3f4f6;
	--mdt-muted: #a1a8b3;
	--mdt-card: #151b27;
	--mdt-line: rgba(255, 255, 255, 0.08);
	--mdt-ph-bg: #232b3a;
	--mdt-ph-fg: #4b5568;
	--mdt-ph-hair: #3a4354;
}
.mdt-theme-dark .mdt-group-title, .mdt-theme-dark .mdt-group-desc { color: inherit; }
.mdt-theme-soft { --mdt-card: color-mix(in srgb, var(--mdt-accent) 7%, #ffffff); --mdt-line: color-mix(in srgb, var(--mdt-accent) 14%, transparent); }
.mdt-theme-bold .mdt-card {
	--mdt-text: #ffffff;
	--mdt-muted: rgba(255, 255, 255, 0.85);
	background: var(--mdt-accent);
	color: #fff;
	box-shadow: 0 10px 24px -14px var(--mdt-accent);
}
.mdt-theme-bold .mdt-role { color: rgba(255, 255, 255, 0.92); }
.mdt-theme-bold .mdt-more { color: #fff; }
.mdt-theme-bold .mdt-more:hover, .mdt-theme-bold .mdt-more:focus-visible { background: #fff; color: var(--mdt-accent); border-color: #fff; }
.mdt-theme-transparent { color: inherit; --mdt-text: inherit; --mdt-muted: inherit; }
.mdt-theme-transparent .mdt-card { background: none; box-shadow: none; padding: 0; }
.mdt-theme-transparent .mdt-bio { opacity: 0.8; }

/* ---------- Layout: list ---------- */
.mdt-layout-list .mdt-grid {
	--mdt-n: 1;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
	max-width: none;
}
.mdt-layout-list .mdt-card { flex-direction: row; gap: 18px; text-align: left; align-items: flex-start; }
.mdt-layout-list .mdt-media { flex: 0 0 clamp(96px, 30%, 170px); }
.mdt-layout-list .mdt-body { padding-top: 2px; }
.mdt-layout-list .mdt-more { align-self: flex-start; }
@media (max-width: 420px) {
	.mdt-layout-list .mdt-media { flex-basis: 96px; }
}

/* ---------- Layout: compact ---------- */
.mdt-layout-compact .mdt-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	max-width: none;
}
.mdt-layout-compact.mdt-align-left .mdt-grid { justify-content: flex-start; }
.mdt-layout-compact .mdt-card { width: 150px; padding: 10px 10px 14px; text-align: center; }
.mdt-layout-compact .mdt-body { padding-top: 10px; }
.mdt-layout-compact .mdt-name { font-size: 0.95em; }
.mdt-layout-compact .mdt-role { font-size: 0.8em; }
.mdt-layout-compact .mdt-more { align-self: center; font-size: 0.78em; padding: 4px 10px; }

/* ---------- Layout: overlay ---------- */
.mdt-layout-overlay .mdt-card { padding: 0; overflow: hidden; }
.mdt-layout-overlay .mdt-media { padding: 0 !important; margin: 0 !important; transform: none !important; box-shadow: none; background: none; }
.mdt-layout-overlay .mdt-media::before { display: none; }
.mdt-layout-overlay .mdt-photo { border-radius: var(--mdt-radius); border: 0; box-shadow: none; }
.mdt-layout-overlay .mdt-body {
	position: absolute;
	inset: auto 0 0 0;
	padding: 44px 16px 16px;
	color: #fff;
	background: linear-gradient(to top, rgba(10, 14, 24, 0.88), rgba(10, 14, 24, 0.55) 55%, transparent);
	border-radius: 0 0 var(--mdt-radius) var(--mdt-radius);
}
.mdt-layout-overlay .mdt-role { color: #fff; opacity: 0.9; }
.mdt-layout-overlay .mdt-bio { color: rgba(255, 255, 255, 0.85); max-height: 0; overflow: hidden; margin: 0; transition: max-height 0.4s ease, margin 0.4s ease; }
.mdt-layout-overlay .mdt-card:hover .mdt-bio,
.mdt-layout-overlay .mdt-card:focus-within .mdt-bio { max-height: 8em; margin-top: 6px; }
.mdt-layout-overlay .mdt-more { color: #fff; margin-top: 10px; }
.mdt-layout-overlay .mdt-contact a { color: #fff; }
.mdt-layout-overlay.mdt-shape-circle .mdt-photo,
.mdt-layout-overlay.mdt-shape-landscape .mdt-photo { aspect-ratio: 4 / 5; border-radius: var(--mdt-radius); }

/* ---------- Spotlight (first person in each group) ---------- */
.mdt-spotlight:not(.mdt-layout-list):not(.mdt-layout-compact) .mdt-card:first-child {
	grid-column: 1 / -1;
	justify-self: center;
	width: min(100%, calc(var(--mdt-max) * 1.2));
}
.mdt-spotlight.mdt-align-left:not(.mdt-layout-list):not(.mdt-layout-compact) .mdt-card:first-child { justify-self: start; }
.mdt-spotlight .mdt-card:first-child .mdt-name { font-size: 1.25em; }
.mdt-spotlight.mdt-layout-list .mdt-card:first-child { grid-column: 1 / -1; }

/* ---------- Hover effects ---------- */
@media (hover: hover) {
	.mdt-hover-lift .mdt-card:hover { transform: translateY(-6px); box-shadow: 0 18px 36px -18px rgba(15, 23, 42, 0.45), 0 0 0 1px var(--mdt-line); }
	.mdt-hover-lift.mdt-frame-offset .mdt-card:hover .mdt-media::before { transform: translate(calc(var(--mdt-frame-w) * 2.2), calc(var(--mdt-frame-w) * 2.2)); }
	.mdt-hover-zoom .mdt-card:hover .mdt-photo img { transform: scale(1.08); }
	.mdt-hover-grayscale .mdt-photo img { filter: grayscale(1); }
	.mdt-hover-grayscale .mdt-card:hover .mdt-photo img { filter: none; }
}
.mdt-hover-grayscale .mdt-card:focus-within .mdt-photo img { filter: none; }

/* ---------- Entrance animations (only once JS has run; content is visible without JS) ---------- */
.mdt-js:not(.mdt-anim-none) .mdt-card:not(.mdt-in) { opacity: 0; }
.mdt-js .mdt-card.mdt-in { animation-duration: 0.7s; animation-timing-function: cubic-bezier(.2,.8,.2,1); animation-fill-mode: backwards; animation-delay: calc(var(--mdt-i, 0) * 70ms); }
.mdt-js.mdt-anim-fade .mdt-card.mdt-in { animation-name: mdt-fade; }
.mdt-js.mdt-anim-rise .mdt-card.mdt-in { animation-name: mdt-rise; }
.mdt-js.mdt-anim-zoom .mdt-card.mdt-in { animation-name: mdt-zoom; }
.mdt-js.mdt-anim-flip .mdt-card.mdt-in { animation-name: mdt-flip; }
@keyframes mdt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mdt-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes mdt-zoom { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: none; } }
@keyframes mdt-flip { from { opacity: 0; transform: perspective(800px) rotateY(-70deg); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	.mdt-js .mdt-card:not(.mdt-in) { opacity: 1 !important; }
	.mdt .mdt-card, .mdt .mdt-card.mdt-in, .mdt .mdt-photo img, .mdt .mdt-media::before { animation: none !important; transition: none !important; }
	.mdt .mdt-card:hover { transform: none !important; }
	.mdt .mdt-dialog[open] { animation: none; }
}

/* ---------- Pop-up ---------- */
.mdt .mdt-dialog {
	width: min(760px, calc(100vw - 32px));
	max-height: calc(100dvh - 32px);
	padding: 0;
	border: 0;
	border-radius: calc(var(--mdt-radius) + 4px);
	background: #fff;
	color: #1f2937;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
	overflow: auto;
}
.mdt-theme-dark .mdt-dialog { background: #151b27; color: #f3f4f6; }
.mdt .mdt-dialog::backdrop { background: rgba(10, 14, 24, 0.6); backdrop-filter: blur(3px); }
.mdt .mdt-dialog[open] { animation: mdt-zoom 0.3s cubic-bezier(.2,.8,.2,1); }
.mdt .mdt-dialog-inner { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 28px; padding: 28px; text-align: left; }
.mdt .mdt-dialog-media { align-self: start; }
.mdt .mdt-dialog .mdt-photo { aspect-ratio: 4 / 5; border-radius: var(--mdt-radius); border: 0; }
.mdt.mdt-shape-circle .mdt-dialog .mdt-photo { aspect-ratio: 1; border-radius: 50%; }
.mdt .mdt-dialog .mdt-name { font-size: 1.5em; padding-right: 32px; }
.mdt .mdt-dialog .mdt-role { margin-bottom: 12px; }
.mdt .mdt-bio-full { line-height: 1.65; }
.mdt .mdt-bio-full p { margin: 0 0 1em; }
.mdt .mdt-dialog .mdt-contact a { color: var(--mdt-accent); }
.mdt .mdt-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(127, 127, 127, 0.15);
	color: inherit;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}
.mdt .mdt-close:hover { background: rgba(127, 127, 127, 0.28); }
@media (max-width: 600px) {
	.mdt .mdt-dialog-inner { grid-template-columns: 1fr; padding: 20px; gap: 16px; }
	.mdt .mdt-dialog-media { width: min(200px, 60%); margin: 0 auto; }
}
/* Browsers without <dialog>: keep pop-up content hidden until JS fallback shows it. */
.mdt dialog:not([open]) { display: none; }

/* ---------- Utilities ---------- */
.mdt .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;
}
.mdt-empty { padding: 12px 16px; border: 1px dashed #c3c4c7; border-radius: 8px; color: #50575e; }
