/* ==========================================================================
   Dynamic Team Members — Frontend Styles
   Prefix: dtm- | Brand: Primary #034565, Secondary #186192
   ========================================================================== */

.dtm-team-grid,
.dtm-modal {
	--dtm-primary: #034565;
	--dtm-secondary: #186192;
	--dtm-text-color: #1f2d33;
	--dtm-card-bg: #ffffff;
	--dtm-icon-color: var(--dtm-primary);
	--dtm-section-bg: #f5f4eb;
	--dtm-popup-width: 780px;
	--dtm-popup-bg: #ffffff;
	--dtm-overlay-color: rgba(3, 27, 43, 0.78);
	--dtm-popup-image-width: 260px;
	--dtm-popup-padding-top: 44px;
	--dtm-popup-padding-right: 44px;
	--dtm-popup-padding-bottom: 44px;
	--dtm-popup-padding-left: 36px;
}

*,
.dtm-team-grid *,
.dtm-modal * {
	box-sizing: border-box;
}

/* ---------- Section wrapper ---------- */
.dtm-team-section {
	background: var(--dtm-section-bg, #f5f4eb);
	padding: 56px 32px;
	border-radius: 4px;
}

/* ---------- Grid ---------- */
.dtm-team-grid {
	display: grid;
	grid-template-columns: repeat(var(--dtm-columns, 3), 1fr);
	gap: var(--dtm-gap, 36px);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.dtm-team-grid {
		grid-template-columns: repeat(var(--dtm-columns-tablet, 2), 1fr);
	}
}

@media (max-width: 600px) {
	.dtm-team-grid {
		grid-template-columns: repeat(var(--dtm-columns-mobile, 1), 1fr);
	}
}

.dtm-no-members {
	color: var(--dtm-text-color);
	opacity: 0.7;
}

/* ---------- Card (flat, no shadow — matches the cream-section reference) ---------- */
.dtm-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: transparent;
	cursor: pointer;
	text-align: left;
	outline: none;
}

.dtm-card-photo {
	width: 100%;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: linear-gradient(135deg, rgba(3, 69, 101, 0.1), rgba(24, 97, 146, 0.1));
}

.dtm-card-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.dtm-card:hover .dtm-card-photo img,
.dtm-card:focus-visible .dtm-card-photo img {
	transform: scale(1.04);
}

.dtm-card:focus-visible {
	outline: 2px solid var(--dtm-secondary);
	outline-offset: 4px;
}

.dtm-card-image-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--dtm-primary), var(--dtm-secondary));
	opacity: 0.25;
}

.dtm-card-body {
	padding: 16px 2px 0;
}

.dtm-card-name {
	margin: 0 0 4px;
	font-size: 15.5px;
	font-weight: 700;
	color: #14212a;
	letter-spacing: 0;
}

.dtm-name-first {
	font-weight: 700;
}

.dtm-card-role {
	margin: 0;
	font-size: 13px;
	font-weight: 400;
	color: #74787c;
	line-height: 1.5;
}

.dtm-card-socials {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

/* ---------- Social icons (shared by card + popup) ---------- */
.dtm-social-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #f2f6f8;
	color: var(--dtm-icon-color, var(--dtm-primary));
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
	flex-shrink: 0;
}

.dtm-social-icon svg {
	width: 15px;
	height: 15px;
}

.dtm-social-icon:hover,
.dtm-social-icon:focus-visible {
	background: var(--dtm-primary);
	color: #ffffff;
	transform: translateY(-2px);
	outline: none;
}

/* ---------- Modal overlay ---------- */
.dtm-modal-overlay {
	position: fixed;
	inset: 0;
	background: var(--dtm-overlay-color);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	z-index: 100000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dtm-modal-overlay[hidden] {
	display: flex;
	pointer-events: none;
}

.dtm-modal-overlay.dtm-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

body.dtm-modal-active {
	overflow: hidden;
}

.dtm-modal {
	position: relative;
	width: 100%;
	max-width: var(--dtm-popup-width, 780px);
	max-height: 88vh;
	overflow-y: auto;
	background: var(--dtm-popup-bg, #fff);
	border-radius: 18px;
	box-shadow: 0 40px 90px rgba(0, 0, 0, 0.4);
	display: flex;
	transform: translateY(28px) scale(0.97);
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.dtm-modal-overlay.dtm-open .dtm-modal {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.dtm-modal-close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(3, 27, 43, 0.06);
	color: var(--dtm-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease;
	z-index: 2;
	padding: 0;
	line-height: 0;
}

.dtm-modal-close svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	display: block;
	fill: none;
	stroke: currentColor;
}

.dtm-modal-close:hover,
.dtm-modal-close:focus-visible {
	background: var(--dtm-primary);
	color: #fff;
	outline: none;
}

.dtm-modal-loading {
	padding: 90px 40px;
	text-align: center;
	color: var(--dtm-text-color);
	width: 100%;
}

.dtm-modal-body {
	display: flex;
	width: 100%;
}

/* Left panel: square/rectangular photo — shows the FULL uploaded image
   (object-fit: contain) so nothing gets cropped off, unlike "cover". */
.dtm-modal-image-panel {
	width: var(--dtm-popup-image-width, 300px);
	flex-shrink: 0;
	overflow: hidden;
	background: linear-gradient(160deg, rgba(3, 69, 101, 0.06), rgba(24, 97, 146, 0.1));
	border-radius: 18px 0 0 18px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dtm-modal-image-panel img {
	width: 100%;
	height: 100%;
	min-height: 380px;
	object-fit: contain;
	object-position: center;
	display: block;
}

.dtm-modal-content {
	flex: 1;
	min-width: 0;
	padding: var(--dtm-popup-padding-top, 44px) var(--dtm-popup-padding-right, 44px)
		var(--dtm-popup-padding-bottom, 44px) var(--dtm-popup-padding-left, 36px);
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.dtm-modal-name {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 700;
	color: var(--dtm-primary);
	line-height: 1.25;
}

.dtm-modal-role {
	margin: 0 0 20px;
	font-size: 12.5px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--dtm-secondary);
}

.dtm-modal-description {
	color: var(--dtm-text-color);
	line-height: 1.75;
	font-size: 15px;
	padding-top: 16px;
	border-top: 1px solid rgba(3, 69, 101, 0.1);
}

.dtm-modal-description p:first-child {
	margin-top: 0;
}

.dtm-modal-socials {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 24px;
}

/* ---------- Responsive: popup ---------- */
@media (max-width: 720px) {
	.dtm-modal-body {
		flex-direction: column;
	}

	.dtm-modal-image-panel {
		width: 100%;
		min-height: 260px;
		border-radius: 18px 18px 0 0;
	}

	.dtm-modal-image-panel img {
		min-height: 260px;
	}

	.dtm-modal-content {
		padding: 24px 26px 36px;
	}

	.dtm-modal-name {
		font-size: 22px;
	}

	.dtm-modal {
		max-height: 92vh;
	}
}
