/**
 * MV Experts frontend styles.
 *
 * Theme-overridable via CSS variables. WCAG 2.1 AA: focus-visible rings,
 * 4.5:1 contrast, semantic HTML5.
 */

:root {
	--mvex-border:        #e5e7eb;
	--mvex-bg:            #ffffff;
	--mvex-fg:            #1f2937;
	--mvex-muted:         #6b7280;
	--mvex-accent:        #100129;
	--mvex-accent-2:      #44e78e;
	--mvex-radius:        8px;
	--mvex-padding:       1.25rem;
	--mvex-gap:           0.75rem;
	--mvex-photo:         72px;
	--mvex-photo-large:  120px;
}

.mvex-card {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var( --mvex-gap );
	padding: var( --mvex-padding );
	background: var( --mvex-bg );
	color: var( --mvex-fg );
	border: 1px solid var( --mvex-border );
	border-radius: var( --mvex-radius );
	margin: 1.5rem 0;
}

.mvex-card__photo {
	width: var( --mvex-photo );
	height: var( --mvex-photo );
	border-radius: 50%;
	overflow: hidden;
	background: var( --mvex-border );
	flex-shrink: 0;
}

.mvex-card__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mvex-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.mvex-card__name {
	font-size: 1.05em;
	font-weight: 600;
	margin: 0;
	color: var( --mvex-fg );
}

.mvex-card__name a {
	color: var( --mvex-fg );
	text-decoration: none;
}

.mvex-card__name a:hover,
.mvex-card__name a:focus-visible {
	text-decoration: underline;
}

.mvex-card__name a:focus-visible {
	outline: 2px solid var( --mvex-accent );
	outline-offset: 2px;
}

.mvex-card__role {
	display: inline-block;
	font-size: 0.7em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 2px 8px;
	border-radius: 999px;
	background: var( --mvex-accent );
	color: #fff;
	margin-bottom: 0.25rem;
}

.mvex-card__role[data-role="reviewer"] {
	background: var( --mvex-accent-2 );
	color: var( --mvex-accent );
}

.mvex-card__role[data-role="contributor"] {
	background: var( --mvex-muted );
}

.mvex-card__job {
	font-size: 0.9em;
	color: var( --mvex-muted );
	margin: 0;
}

.mvex-card__bio {
	margin: 0.5rem 0 0;
	color: var( --mvex-fg );
	line-height: 1.5;
}

.mvex-card__credentials {
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.mvex-card__credential {
	font-size: 0.8em;
	background: #f3f4f6;
	padding: 2px 8px;
	border-radius: 4px;
}

.mvex-card__socials {
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	gap: 0.5rem;
}

.mvex-card__socials a {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.85em;
	color: var( --mvex-muted );
	text-decoration: none;
}

.mvex-card__socials a:hover,
.mvex-card__socials a:focus-visible {
	color: var( --mvex-accent );
	text-decoration: underline;
}

.mvex-card__socials a:focus-visible {
	outline: 2px solid var( --mvex-accent );
	outline-offset: 2px;
}

.mvex-card__verified {
	margin-top: 0.5rem;
	font-size: 0.8em;
	color: var( --mvex-muted );
}

/* Variants */

.mvex-card--compact {
	grid-template-columns: auto auto;
	padding: 0.5rem 0.75rem;
	margin: 0;
	border: 0;
	background: transparent;
	display: inline-grid;
}

.mvex-card--compact .mvex-card__photo {
	width: 32px;
	height: 32px;
}

.mvex-card--compact .mvex-card__bio,
.mvex-card--compact .mvex-card__credentials,
.mvex-card--compact .mvex-card__socials {
	display: none;
}

.mvex-card--byline {
	display: inline;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	font-size: inherit;
	color: var( --mvex-muted );
}

.mvex-card--byline .mvex-card__photo,
.mvex-card--byline .mvex-card__bio,
.mvex-card--byline .mvex-card__credentials,
.mvex-card--byline .mvex-card__socials,
.mvex-card--byline .mvex-card__role {
	display: none;
}

.mvex-card--detailed .mvex-card__photo {
	width: var( --mvex-photo-large );
	height: var( --mvex-photo-large );
}

.mvex-card--no-photo {
	grid-template-columns: 1fr;
}

.mvex-card--detailed .mvex-card__publications,
.mvex-card--detailed .mvex-card__peer-reviews {
	margin: 0.75rem 0 0;
	padding-left: 1.25rem;
}

.mvex-card__section-title {
	margin: 1.25rem 0 0.5rem;
	font-size: 1rem;
	font-weight: 600;
	color: var( --mvex-fg );
	letter-spacing: 0.01em;
}

/* Signature: compact horizontal card with CTA button */
.mvex-card--signature {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 1.25rem;
	padding: 1rem 1.5rem;
	max-width: 720px;
	margin: 2.5rem auto;
	background: #f3f4f6;
	border: 0;
	border-radius: 14px;
}

.mvex-card--signature .mvex-card__photo {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	overflow: hidden;
	display: block;
	flex-shrink: 0;
	background: #e5e7eb;
	transition: transform 0.18s ease;
}

.mvex-card--signature .mvex-card__photo:hover {
	transform: scale( 1.03 );
}

.mvex-card--signature .mvex-card__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mvex-card--signature .mvex-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.mvex-card--signature .mvex-card__name {
	font-size: 1.15rem;
	font-weight: 700;
	color: var( --mvex-accent, #100129 );
	text-decoration: none;
	line-height: 1.2;
}

.mvex-card--signature .mvex-card__name:hover,
.mvex-card--signature .mvex-card__name:focus-visible {
	color: var( --mvex-accent-2, #44e78e );
	text-decoration: none;
}

.mvex-card--signature .mvex-card__name:focus-visible {
	outline: 2px solid var( --mvex-accent, #100129 );
	outline-offset: 3px;
	border-radius: 2px;
}

.mvex-card--signature .mvex-card__job {
	color: var( --mvex-fg, #1f2937 );
	font-size: 0.95rem;
	margin: 0;
	line-height: 1.3;
}

.mvex-card--signature .mvex-card__role-line {
	font-size: 0.8rem;
	color: var( --mvex-muted, #6b7280 );
	margin: 0.2rem 0 0;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	font-weight: 600;
}

.mvex-card--signature .mvex-card__role-line time {
	text-transform: none;
	font-weight: 500;
	letter-spacing: 0;
}

.mvex-card--signature .mvex-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: var( --mvex-accent, #100129 );
	color: #fff;
	padding: 0.6rem 1.4rem;
	border-radius: 999px;
	text-decoration: none;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
	transition: background 0.18s ease, transform 0.18s ease;
}

.mvex-card--signature .mvex-card__cta:hover,
.mvex-card--signature .mvex-card__cta:focus-visible {
	background: var( --mvex-accent-2, #44e78e );
	color: var( --mvex-accent, #100129 );
	transform: translateX( 2px );
}

.mvex-card--signature .mvex-card__cta:focus-visible {
	outline: 2px solid var( --mvex-accent, #100129 );
	outline-offset: 3px;
}

.mvex-card--signature .mvex-card__cta::after {
	content: '→';
	font-weight: 400;
	transition: transform 0.18s ease;
}

.mvex-card--signature .mvex-card__cta:hover::after {
	transform: translateX( 3px );
}

/* Mobile: stack photo above text, CTA full-width below */
@media ( max-width: 540px ) {
	.mvex-card--signature {
		grid-template-columns: auto 1fr;
		grid-template-areas:
			"photo body"
			"cta cta";
		gap: 0.75rem 1rem;
		padding: 1rem;
	}
	.mvex-card--signature .mvex-card__photo {
		grid-area: photo;
		width: 64px;
		height: 64px;
	}
	.mvex-card--signature .mvex-card__body {
		grid-area: body;
	}
	.mvex-card--signature .mvex-card__cta {
		grid-area: cta;
		justify-content: center;
	}
	.mvex-card--signature .mvex-card__name {
		font-size: 1.05rem;
	}
}

/* Archive grid */
.mvex-archive {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 1.5rem;
	margin: 2rem 0;
}

.mvex-archive .mvex-card {
	margin: 0;
}

/* Reduced motion */
@media ( prefers-reduced-motion: reduce ) {
	* {
		transition: none !important;
		animation: none !important;
	}
}
