/**
 * Medical Author & Reviewer — Frontend Styles
 * Version: 1.0.0
 *
 * BEM-inspired class naming: .mar-* prefix throughout.
 * All dynamic values (colors, sizes) are overridden by inline CSS
 * generated from plugin settings in MAR_Frontend::generate_inline_css().
 */

/* ==========================================================================
   Box container
   ========================================================================== */

.mar-box {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 20px;
	padding: 20px;
	margin: 0 0 28px;
	max-width: 100%;
	box-sizing: border-box;
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	line-height: 1.5;
	color: inherit;
}

.mar-box--bottom {
	margin: 28px 0 0;
}

/* ==========================================================================
   Avatar
   ========================================================================== */

.mar-avatar-wrap {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
}

.mar-avatar {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	background-color: #f3f4f6;
	border: 2px solid #f0f0f0;
}

/* ==========================================================================
   Content column
   ========================================================================== */

.mar-content {
	flex: 1;
	min-width: 0;
}

/* ==========================================================================
   Blocks (reviewer, author, date)
   ========================================================================== */

.mar-block {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mar-block + .mar-block {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #f0f0f0;
}

/* ==========================================================================
   Rows within blocks
   ========================================================================== */

.mar-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 3px 6px;
}

/* ==========================================================================
   Typography
   ========================================================================== */

.mar-label {
	font-size: 14px;
	font-weight: 400;
	color: #6b7280;
	line-height: 1.6;
	white-space: nowrap;
}

.mar-name {
	font-size: 16px;
	font-weight: 600;
	color: #111827;
	text-decoration: none;
	line-height: 1.6;
}

.mar-name:hover,
.mar-name:focus {
	text-decoration: underline;
}

.mar-name:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	border-radius: 2px;
}

.mar-credentials {
	font-size: 14px;
	font-weight: 400;
	color: #374151;
	line-height: 1.6;
}

.mar-date {
	font-size: 14px;
	color: #6b7280;
	line-height: 1.6;
}

/* ==========================================================================
   Specializations
   ========================================================================== */

.mar-specializations {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 6px;
}

.mar-specialization {
	font-size: 12px;
	color: #6b7280;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	padding: 2px 8px;
	line-height: 1.6;
}

/* ==========================================================================
   Biography
   ========================================================================== */

.mar-bio {
	font-size: 14px;
	color: #374151;
	line-height: 1.7;
	margin-top: 8px;
}

.mar-bio p {
	margin: 0 0 8px;
}

.mar-bio p:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.mar-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

.mar-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #059669;
	border: 1.5px solid #059669;
	border-radius: 100px;
	padding: 3px 10px;
	line-height: 1.5;
	white-space: nowrap;
}

.mar-badge svg {
	width: 11px;
	height: 11px;
	fill: none;
	flex-shrink: 0;
}

/* ==========================================================================
   Social / academic icons
   ========================================================================== */

.mar-social {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.mar-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #f3f4f6;
	color: #6b7280;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.mar-social-link:hover,
.mar-social-link:focus {
	background: #e5e7eb;
	color: #111827;
}

.mar-social-link:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.mar-social-link svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
	display: block;
}

/* ==========================================================================
   Reading time
   ========================================================================== */

.mar-reading-time {
	font-size: 13px;
	color: #9ca3af;
	margin-top: 6px;
}

/* ==========================================================================
   RTL support
   ========================================================================== */

[dir="rtl"] .mar-box,
body.rtl .mar-box {
	flex-direction: row-reverse;
}

[dir="rtl"] .mar-content,
body.rtl .mar-content {
	text-align: right;
}

[dir="rtl"] .mar-row,
body.rtl .mar-row {
	flex-direction: row-reverse;
}

[dir="rtl"] .mar-specializations,
body.rtl .mar-specializations,
[dir="rtl"] .mar-badges,
body.rtl .mar-badges,
[dir="rtl"] .mar-social,
body.rtl .mar-social {
	justify-content: flex-end;
}

/* ==========================================================================
   Tablet (≤ 768 px)
   ========================================================================== */

@media screen and (max-width: 768px) {
	.mar-box {
		gap: 16px;
		padding: 16px;
	}

	.mar-avatar {
		width: 50px;
		height: 50px;
	}

	.mar-name {
		font-size: 15px;
	}
}

/* ==========================================================================
   Mobile (≤ 480 px) — vertical stacked, centred
   ========================================================================== */

@media screen and (max-width: 480px) {
	.mar-box {
		flex-direction: column !important;
		align-items: center;
		text-align: center;
		gap: 12px;
		padding: 16px;
	}

	.mar-avatar-wrap {
		margin-bottom: 2px;
	}

	.mar-row {
		justify-content: center;
		flex-direction: row;
	}

	.mar-specializations,
	.mar-badges,
	.mar-social {
		justify-content: center;
	}

	[dir="rtl"] .mar-content,
	body.rtl .mar-content {
		text-align: center;
	}
}

/* ==========================================================================
   Extra-small (≤ 320 px)
   ========================================================================== */

@media screen and (max-width: 320px) {
	.mar-box {
		padding: 14px 12px;
	}

	.mar-label,
	.mar-credentials,
	.mar-date {
		font-size: 13px;
	}

	.mar-name {
		font-size: 14px;
	}
}
