/* Trailview Team Members: cards and bio pop-up.
   Colours follow the Trailview web design guide (ink, ink-muted, link-blue, trailview-gold). */

.tvtm {
	--tvtm-photo: 120px;
	--tvtm-ring-w: 4px;
	--tvtm-ring-c: #F5B746;
	--tvtm-square-r: 16px;
	--tvtm-photo-ml: auto;
	--tvtm-photo-mr: auto;
	--tvtm-ink: #2B2523;
	--tvtm-muted: #6B6563;
	--tvtm-link: #1F5FCC;
}

.tvtm .tvtm-grid {
	display: grid;
	grid-template-columns: repeat(var(--tvtm-cols, 3), minmax(0, 1fr));
	gap: 32px;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 1024px) {
	.tvtm .tvtm-grid { grid-template-columns: repeat(var(--tvtm-cols-t, 2), minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.tvtm .tvtm-grid { grid-template-columns: repeat(var(--tvtm-cols-m, 2), minmax(0, 1fr)); gap: 24px; }
}

.tvtm .tvtm-card {
	margin: 0;
	padding: 0;
	text-align: center;
	min-width: 0;
	overflow-wrap: anywhere;
}

.tvtm .tvtm-card::before,
.tvtm .tvtm-card::marker { content: none; }

/* Picture */
.tvtm-photo {
	width: var(--tvtm-photo);
	max-width: 100%;
	margin: 0 var(--tvtm-photo-mr, auto) 16px var(--tvtm-photo-ml, auto);
}

.tvtm-photo .tvtm-photo__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	object-position: center 25%;
	box-sizing: border-box;
	border: var(--tvtm-ring-w, 4px) solid var(--tvtm-ring-c, #F5B746);
	background: #F0EFEC;
	max-width: 100%;
}

.tvtm--round .tvtm-photo__img { border-radius: 50%; }
.tvtm--square .tvtm-photo__img { border-radius: var(--tvtm-square-r, 16px); }

/* Text */
.tvtm .tvtm-name {
	margin: 0 0 4px;
	font-size: 21px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--tvtm-ink);
}

.tvtm .tvtm-title {
	margin: 0 0 8px;
	font-size: 16px;
	line-height: 1.45;
	color: var(--tvtm-muted);
}

.tvtm .tvtm-contact {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tvtm .tvtm-contact li {
	margin: 0;
	padding: 0;
}

.tvtm .tvtm-contact li::before { content: none; }

.tvtm .tvtm-contact a,
.tvtm .tvtm-bio-link {
	display: inline-flex;
	align-items: center;
	min-height: 0;
	padding: 2px 0;
	font-size: 16px;
	line-height: 1.4;
	color: var(--tvtm-link);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	overflow-wrap: anywhere;
}

.tvtm .tvtm-contact a:hover,
.tvtm .tvtm-bio-link:hover { text-decoration-thickness: 2px; }

.tvtm .tvtm-bio-link {
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	border-radius: 0;
	padding: 0;
	margin: 0;
	font-family: inherit;
	font-weight: 400;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}

.tvtm .tvtm-bio-link:hover,
.tvtm .tvtm-bio-link:focus {
	background: none;
	color: var(--tvtm-link);
}

.tvtm a:focus-visible,
.tvtm .tvtm-bio-link:focus-visible,
.tvtm-dialog__close:focus-visible {
	outline: 3px solid #1F5FCC;
	outline-offset: 2px;
}

.tvtm .tvtm-empty {
	margin: 0;
	color: var(--tvtm-muted);
}

.tvtm--hidden-in-editor { opacity: 0.5; }

.tvtm-editor-note {
	padding: 16px;
	border: 1px dashed #8C8583;
	border-radius: 8px;
	color: #6B6563;
	font-size: 15px;
}

/* Bio pop-up */
.tvtm-dialog {
	--tvtm-photo: 120px;
	width: min(640px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	box-sizing: border-box;
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: #FFFFFF;
	color: #2B2523;
	box-shadow: 0 20px 60px rgba(43, 37, 35, 0.35);
	overflow: hidden;
}

.tvtm-dialog[open] { display: flex; flex-direction: column; }

.tvtm-dialog::backdrop { background: rgba(43, 37, 35, 0.6); }

.tvtm-dialog__scroll {
	overflow-y: auto;
	padding: 32px;
	-webkit-overflow-scrolling: touch;
}

.tvtm-dialog__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 48px;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: #FFFFFF;
	color: #2B2523;
	cursor: pointer;
	font-size: 0;
	line-height: 1;
	z-index: 1;
}

.tvtm-dialog__close:hover { background: #F0EFEC; color: #2B2523; }

.tvtm-dialog__close svg { width: 24px; height: 24px; }

.tvtm-dialog__head {
	display: flex;
	align-items: center;
	gap: 24px;
	margin: 0 40px 24px 0;
}

.tvtm-dialog .tvtm-dialog__photo {
	flex: 0 0 var(--tvtm-photo);
	margin: 0;
}

.tvtm-dialog--round .tvtm-photo__img { border-radius: 50%; }
.tvtm-dialog--square .tvtm-photo__img { border-radius: var(--tvtm-square-r, 16px); }

.tvtm-dialog .tvtm-dialog__name {
	margin: 0 0 4px;
	font-size: 26px;
	font-weight: 600;
	line-height: 1.25;
	color: #660011;
}

.tvtm-dialog .tvtm-dialog__title {
	margin: 0;
	font-size: 16px;
	color: #6B6563;
}

.tvtm-dialog__bio {
	font-size: 18px;
	line-height: 1.6;
}

.tvtm-dialog__bio > :first-child { margin-top: 0; }
.tvtm-dialog__bio > :last-child { margin-bottom: 0; }
.tvtm-dialog__bio p { margin: 0 0 16px; }
.tvtm-dialog__bio a { color: #1F5FCC; text-decoration: underline; }

html.tvtm-dialog-open { overflow: hidden; }

@media (max-width: 600px) {
	.tvtm-dialog { --tvtm-photo: 96px; }
	.tvtm-dialog__scroll { padding: 24px 20px; }
	.tvtm-dialog__head { flex-direction: column; align-items: flex-start; gap: 16px; margin-right: 40px; }
	.tvtm-dialog .tvtm-dialog__name { font-size: 22px; }
}

@media (prefers-reduced-motion: no-preference) {
	.tvtm-dialog[open] { animation: tvtm-in 160ms ease-out; }
	@keyframes tvtm-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
