/**
 * Team Member Bio widget: the card and the shared biography modal.
 * Colours follow the site tokens: navy #071E3D, blue #0F4C81,
 * text #1F2937, green accent #6BBE44. Highlights (close button, hovers,
 * focus) use the navy; the card "View bio" bar uses the blue.
 */

.dofi-tm {
	--dofi-tm-navy: #071E3D;
	--dofi-tm-blue: #0F4C81;
	--dofi-tm-text: #1F2937;
	--dofi-tm-green: #6BBE44;
	--dofi-tm-btn: #071E3D;
	height: 100%;
}

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

.site .dofi-tm__card,
.dofi-tm__card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.dofi-tm__card:hover,
.dofi-tm__card:focus {
	background: none;
	color: inherit;
}

.dofi-tm__card:focus-visible {
	outline: 2px solid var(--dofi-tm-btn);
	outline-offset: 4px;
}

.dofi-tm__photo {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 275 / 420;
	margin-bottom: 24px;
	overflow: hidden;
	background: #fff;
}

.dofi-tm__photo .dofi-tm__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.dofi-tm__card:hover .dofi-tm__img,
.dofi-tm__card:focus-visible .dofi-tm__img {
	transform: scale(1.04);
}

.dofi-tm__cta {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--dofi-tm-blue);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: 1px;
	text-transform: uppercase;
	transform: translateY(101%);
	transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}

.dofi-tm__card:hover .dofi-tm__cta,
.dofi-tm__card:focus-visible .dofi-tm__cta {
	transform: translateY(0);
}

.dofi-tm__plus {
	position: relative;
	width: 12px;
	height: 12px;
}

.dofi-tm__plus::before,
.dofi-tm__plus::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 12px;
	height: 1.5px;
	margin-top: -.75px;
	background: var(--dofi-tm-green);
}

.dofi-tm__plus::after {
	transform: rotate(90deg);
}

.dofi-tm__name {
	display: block;
	margin-bottom: 4px;
	color: var(--dofi-tm-navy);
	font-size: 20px;
	font-weight: 500;
	line-height: 28px;
	transition: color .25s;
}

.dofi-tm__card:hover .dofi-tm__name {
	color: var(--dofi-tm-btn);
}

.dofi-tm__position {
	display: block;
	color: var(--dofi-tm-text);
	opacity: .7;
	font-size: 12px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: 1px;
	text-transform: uppercase;
}

@media (max-width: 1024px) {
	.dofi-tm__photo { margin-bottom: 16px; }
	.dofi-tm__name { font-size: 16px; line-height: 24px; }
}

/* Touch screens have no hover: keep the bio hint visible as a small tag. */
@media (hover: none) {
	.dofi-tm__cta {
		left: auto;
		gap: 8px;
		padding: 8px 10px;
		font-size: 10px;
		line-height: 14px;
		transform: none;
	}
}

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

html.dofi-tm-locked,
html.dofi-tm-locked body {
	overflow: hidden;
}

html.dofi-tm-locked body {
	padding-right: var(--dofi-tm-scrollbar, 0);
}

.dofi-tm-modal {
	--dofi-tm-navy: #071E3D;
	--dofi-tm-blue: #0F4C81;
	--dofi-tm-text: #1F2937;
	--dofi-tm-green: #6BBE44;
	--dofi-tm-btn: #071E3D;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
}

.dofi-tm-modal[hidden] {
	display: none;
}

.dofi-tm-modal {
	--dofi-tm-ease: cubic-bezier(.16, 1, .3, 1); /* fast start, soft landing */
}

.dofi-tm-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(7, 30, 61, .82);
	opacity: 0;
	transition: opacity .32s ease;
}

/* Fixed height: the panel keeps its size while photos load or members change. */
.dofi-tm-modal__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1120px;
	height: min(760px, calc(100vh - 80px));
	height: min(760px, calc(100dvh - 80px));
	background: #fff;
	color: var(--dofi-tm-text);
	opacity: 0;
	transform: translateY(28px) scale(.97);
	transition: opacity .28s ease, transform .32s var(--dofi-tm-ease);
	outline: none;
	will-change: transform, opacity;
}

.dofi-tm-modal.is-open .dofi-tm-modal__backdrop {
	opacity: 1;
}

.dofi-tm-modal.is-open .dofi-tm-modal__panel {
	opacity: 1;
	transform: none;
	transition: opacity .35s ease, transform .6s var(--dofi-tm-ease);
}

/* Opening: photo settles in, then the text rises line by line. */
.dofi-tm-modal__media img {
	transform: scale(1.06);
	transition: transform 1s var(--dofi-tm-ease);
}

.dofi-tm-modal.is-open .dofi-tm-modal__media img {
	transform: none;
}

.dofi-tm-modal__body > * {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .5s ease, transform .6s var(--dofi-tm-ease);
}

.dofi-tm-modal.is-open .dofi-tm-modal__body > * {
	opacity: 1;
	transform: none;
}

.dofi-tm-modal.is-open .dofi-tm-modal__body > :nth-child(1) { transition-delay: .12s; }
.dofi-tm-modal.is-open .dofi-tm-modal__body > :nth-child(2) { transition-delay: .18s; }
.dofi-tm-modal.is-open .dofi-tm-modal__body > :nth-child(3) { transition-delay: .24s; }
.dofi-tm-modal.is-open .dofi-tm-modal__body > :nth-child(4) { transition-delay: .30s; }

/* Stepping between members: fade/slide out, then in, in the direction of travel. */
.dofi-tm-modal__content.is-leaving .dofi-tm-modal__media img,
.dofi-tm-modal__content.is-leaving .dofi-tm-modal__body {
	opacity: 0;
	transition: opacity .18s ease, transform .18s ease;
}

.dofi-tm-modal__content.is-leaving .dofi-tm-modal__body {
	transform: translateX(-24px);
}

.dofi-tm-modal[data-dir="prev"] .dofi-tm-modal__content.is-leaving .dofi-tm-modal__body {
	transform: translateX(24px);
}

.dofi-tm-modal__content.is-entering .dofi-tm-modal__media img {
	animation: dofi-tm-photo-in .55s var(--dofi-tm-ease) both;
}

.dofi-tm-modal__content.is-entering .dofi-tm-modal__body {
	animation: dofi-tm-next-in .5s var(--dofi-tm-ease) both;
}

.dofi-tm-modal[data-dir="prev"] .dofi-tm-modal__content.is-entering .dofi-tm-modal__body {
	animation-name: dofi-tm-prev-in;
}

@keyframes dofi-tm-photo-in {
	from { opacity: 0; transform: scale(1.04); }
	to   { opacity: 1; transform: none; }
}

@keyframes dofi-tm-next-in {
	from { opacity: 0; transform: translateX(32px); }
	to   { opacity: 1; transform: none; }
}

@keyframes dofi-tm-prev-in {
	from { opacity: 0; transform: translateX(-32px); }
	to   { opacity: 1; transform: none; }
}

.dofi-tm-modal__close {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--dofi-tm-btn);
	cursor: pointer;
	transition: background .2s;
}

.dofi-tm-modal__close:hover,
.dofi-tm-modal__close:focus-visible {
	background: var(--dofi-tm-blue);
}

.dofi-tm-modal__close span::before,
.dofi-tm-modal__close span::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 1.5px;
	margin: -.75px 0 0 -10px;
	background: #fff;
	transform: rotate(45deg);
}

.dofi-tm-modal__close span::after {
	transform: rotate(-45deg);
}

.dofi-tm-modal__content {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

.dofi-tm-modal__media {
	position: relative;
	background: var(--dofi-tm-navy);
	overflow: hidden;
}

.dofi-tm-modal__media::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 64px;
	height: 4px;
	background: var(--dofi-tm-green);
}

.dofi-tm-modal__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.dofi-tm-modal__body {
	padding: 64px 64px 48px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.site .dofi-tm-modal__position,
.dofi-tm-modal__position {
	margin: 0 0 12px;
	color: var(--dofi-tm-blue);
	font-size: 12px;
	font-weight: 600;
	line-height: 20px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

.dofi-tm-modal__position::before {
	content: "";
	display: inline-block;
	width: 24px;
	height: 2px;
	margin-right: 12px;
	vertical-align: middle;
	background: var(--dofi-tm-green);
}

.site .dofi-tm-modal__name,
.dofi-tm-modal__name {
	margin: 0 0 32px;
	color: var(--dofi-tm-navy);
	font-size: 44px;
	font-weight: 600;
	line-height: 52px;
	letter-spacing: -.03em;
}

.dofi-tm-modal__bio {
	font-size: 16px;
	line-height: 28px;
}

.dofi-tm-modal__bio p {
	margin: 0 0 16px;
}

.dofi-tm-modal__bio p:last-child {
	margin-bottom: 0;
}

.dofi-tm-modal__empty {
	opacity: .6;
	font-style: italic;
}

.dofi-tm-modal__contact {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 32px;
	margin: 32px 0 0;
	padding: 24px 0 0;
	border-top: 1px solid rgba(7, 30, 61, .12);
	list-style: none;
}

.dofi-tm-modal__contact a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--dofi-tm-navy);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
}

.dofi-tm-modal__contact a:hover {
	color: var(--dofi-tm-btn);
}

.dofi-tm-modal__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid rgba(7, 30, 61, .2);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
}

.dofi-tm-modal__nav {
	display: flex;
	justify-content: space-between;
	flex: 0 0 auto;
	border-top: 1px solid rgba(7, 30, 61, .12);
}

.site .dofi-tm-modal__step,
.dofi-tm-modal__step {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 80px;
	padding: 16px 32px;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--dofi-tm-navy);
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: background .2s, color .2s;
}

.dofi-tm-modal__step.is-next {
	margin-left: auto;
	text-align: right;
}

.dofi-tm-modal__step[hidden] {
	display: none;
}

.dofi-tm-modal__step:hover,
.dofi-tm-modal__step:focus-visible {
	background: #F3F5F8;
	color: var(--dofi-tm-btn);
}

.dofi-tm-modal__step small {
	display: block;
	color: var(--dofi-tm-text);
	opacity: .6;
	font-size: 11px;
	line-height: 16px;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.dofi-tm-modal__arrow {
	color: var(--dofi-tm-green);
	font-size: 20px;
}

@media (max-width: 1024px) {
	.dofi-tm-modal { padding: 24px; }
	.dofi-tm-modal__panel { height: min(760px, calc(100dvh - 48px)); }
	.dofi-tm-modal__body { padding: 48px 40px 40px; }
	.dofi-tm-modal__name { font-size: 36px; line-height: 44px; }
}

@media (max-width: 767px) {
	.dofi-tm-modal { padding: 0; align-items: stretch; }
	.dofi-tm-modal__panel { height: 100%; transform: translateY(40px); }
	.dofi-tm-modal__close { width: 48px; height: 48px; }

	/* Photo and bio scroll together on phones. */
	.dofi-tm-modal__content {
		display: block;
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	.dofi-tm-modal__media { height: 46vh; }
	.dofi-tm-modal__body { padding: 32px 20px; overflow: visible; }
	.site .dofi-tm-modal__name,
	.dofi-tm-modal__name { margin-bottom: 24px; font-size: 30px; line-height: 38px; }
	.site .dofi-tm-modal__step,
	.dofi-tm-modal__step { min-height: 64px; padding: 12px 20px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.dofi-tm__img,
	.dofi-tm__cta,
	.dofi-tm-modal__backdrop,
	.dofi-tm-modal__panel,
	.dofi-tm-modal.is-open .dofi-tm-modal__panel,
	.dofi-tm-modal__media img,
	.dofi-tm-modal__body > *,
	.dofi-tm-modal__content.is-leaving .dofi-tm-modal__media img,
	.dofi-tm-modal__content.is-leaving .dofi-tm-modal__body { transition: none; transform: none; }
	.dofi-tm-modal__content.is-entering .dofi-tm-modal__media img,
	.dofi-tm-modal__content.is-entering .dofi-tm-modal__body { animation: none; }
}

/* The cookie-settings button floats above everything and sat on the
 * modal's prev/next bar on phones; hide it while a bio is open. */
html.dofi-tm-locked .cky-btn-revisit-wrapper {
	display: none;
}
