/* ==========================================================================
   MedEncyclo Author Grid - Author Archive Page Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties - Inherit from theme where possible
   -------------------------------------------------------------------------- */
:root {
	--author-grid-gap: 30px;
	--author-grid-gap-tablet: 24px;
	--author-grid-gap-mobile: 20px;
	--author-card-radius: 8px;
	--author-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	--author-card-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.12);
	--author-card-border: 1px solid #e8e8e8;
	--author-card-bg: #ffffff;
	--author-card-padding: 0;
	--author-card-transition: transform 0.25s ease, box-shadow 0.25s ease;
	--author-profile-bg: #f7f8fa;
	--author-profile-border: 1px solid #e8e8e8;
	--author-text-primary: #1a1a2e;
	--author-text-secondary: #555555;
	--author-text-muted: #777777;
	--author-accent: #0073aa;
	--author-accent-hover: #005a87;
	--author-category-bg: #eef4fb;
	--author-category-color: #0073aa;
	--author-border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Main Content Area Overrides
   IMPORTANT: Do NOT force a max-width, margin, or fixed padding here.
   The theme's own layout rules control width and alignment (including the
   sidebar). We only add bottom spacing so the grid never collides with the
   footer.
   -------------------------------------------------------------------------- */
.medencyclo-author-grid-main {
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0 0 60px;
}

/* Prevent grid items from blowing out of the container on small screens */
.medencyclo-author-grid-main *,
.medencyclo-author-grid-main *::before,
.medencyclo-author-grid-main *::after {
	box-sizing: border-box;
	max-width: 100%;
}

/* --------------------------------------------------------------------------
   Author Profile Section
   -------------------------------------------------------------------------- */
.author-profile-section {
	background: var(--author-profile-bg);
	border: var(--author-profile-border);
	border-radius: var(--author-card-radius);
	padding: 40px;
	margin-bottom: 40px;
}

.author-profile-inner {
	display: flex;
	align-items: flex-start;
	gap: 30px;
}

.author-profile-avatar {
	flex-shrink: 0;
}

.author-profile-avatar img {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.author-profile-info {
	flex: 1;
	min-width: 0;
}

.author-profile-name {
	font-size: 28px;
	font-weight: 700;
	color: var(--author-text-primary);
	margin: 0 0 12px;
	line-height: 1.3;
}

.author-profile-bio {
	font-size: 15px;
	line-height: 1.7;
	color: var(--author-text-secondary);
	margin: 0;
}

/* --------------------------------------------------------------------------
   Article Grid - Desktop (Default)
   -------------------------------------------------------------------------- */
.author-posts-section {
	margin-bottom: 40px;
}

.author-posts-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--author-grid-gap);
}

/* Explicit desktop range guard (1025px and up keeps 3 columns) */
@media (min-width: 1025px) {
	.author-posts-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* --------------------------------------------------------------------------
   Article Card
   -------------------------------------------------------------------------- */
.author-post-card {
	background: var(--author-card-bg);
	border: var(--author-card-border);
	border-radius: var(--author-card-radius);
	box-shadow: var(--author-card-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	transition: var(--author-card-transition);
}

.author-post-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--author-card-shadow-hover);
}

.author-card-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

/* --------------------------------------------------------------------------
   Card Image
   -------------------------------------------------------------------------- */
.author-card-image {
	position: relative;
	overflow: hidden;
	background: #f0f0f0;
}

.author-card-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.author-post-card:hover .author-card-image img {
	transform: scale(1.03);
}

/* --------------------------------------------------------------------------
   Card Content
   -------------------------------------------------------------------------- */
.author-card-content {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

/* Category Badge */
.author-card-category {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--author-category-color);
	background: var(--author-category-bg);
	padding: 4px 10px;
	border-radius: var(--author-border-radius);
	margin-bottom: 10px;
	align-self: flex-start;
	line-height: 1.4;
}

/* Card Title */
.author-card-title {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 10px;
	color: var(--author-text-primary);
	overflow-wrap: break-word;
	word-wrap: break-word;
	hyphens: auto;
}

.author-card-title a {
	text-decoration: none;
	color: inherit;
	transition: color 0.2s ease;
}

.author-card-title a:hover,
.author-card-title a:focus {
	color: var(--author-accent);
}

/* Card Meta */
.author-card-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 13px;
	color: var(--author-text-muted);
	margin-bottom: 12px;
	line-height: 1.4;
}

.author-card-sep {
	opacity: 0.5;
}

.author-card-date,
.author-card-author {
	white-space: nowrap;
}

/* Card Excerpt */
.author-card-excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: var(--author-text-secondary);
	margin: 0 0 16px;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Read More Button */
.author-card-readmore {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--author-accent);
	text-decoration: none;
	transition: color 0.2s ease;
	padding: 6px 0;
	margin-top: auto;
}

.author-card-readmore::after {
	content: '\2192';
	font-size: 14px;
	transition: transform 0.2s ease;
}

.author-card-readmore:hover,
.author-card-readmore:focus {
	color: var(--author-accent-hover);
}

.author-card-readmore:hover::after {
	transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   No Posts Message
   -------------------------------------------------------------------------- */
.author-no-posts {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: var(--author-text-muted);
	font-size: 16px;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.author-pagination {
	text-align: center;
	padding: 30px 0 10px;
}

.author-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	margin: 0 4px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	color: var(--author-text-secondary);
	background: var(--author-card-bg);
	border: 1px solid #ddd;
	border-radius: var(--author-border-radius);
	transition: all 0.2s ease;
}

.author-pagination .page-numbers:hover {
	border-color: var(--author-accent);
	color: var(--author-accent);
}

.author-pagination .page-numbers.current {
	background: var(--author-accent);
	border-color: var(--author-accent);
	color: #ffffff;
}

/* --------------------------------------------------------------------------
   Responsive: Tablet (min-width: 768px and max-width: 1024px)
   Shows 2 columns
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
	.medencyclo-author-grid-main {
		padding: 0 0 50px;
	}

	.author-posts-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--author-grid-gap-tablet);
	}

	.author-profile-section {
		padding: 30px;
	}

	.author-profile-avatar img {
		width: 100px;
		height: 100px;
	}

	.author-profile-name {
		font-size: 24px;
	}
}

/* --------------------------------------------------------------------------
   Responsive: Mobile (max-width: 767px)
   Shows 1 column
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
	.medencyclo-author-grid-main {
		padding: 0 0 40px;
	}

	.author-posts-grid {
		grid-template-columns: 1fr;
		gap: var(--author-grid-gap-mobile);
	}

	.author-profile-section {
		padding: 24px 20px;
	}

	.author-profile-inner {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 20px;
	}

	.author-profile-avatar img {
		width: 90px;
		height: 90px;
	}

	.author-profile-name {
		font-size: 22px;
	}

	.author-profile-bio {
		font-size: 14px;
		text-align: left;
	}

	.author-card-title {
		font-size: 16px;
	}

	.author-card-content {
		padding: 16px;
	}
}

/* --------------------------------------------------------------------------
   Responsive: Small Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
	.medencyclo-author-grid-main {
		padding: 0 0 32px;
	}

	.author-profile-section {
		padding: 20px 16px;
	}

	.author-card-title {
		font-size: 15px;
	}

	.author-card-excerpt {
		font-size: 13px;
		-webkit-line-clamp: 2;
	}

	.author-card-meta {
		font-size: 12px;
	}
}

/* --------------------------------------------------------------------------
   Accessibility: Focus States
   -------------------------------------------------------------------------- */
.author-card-link:focus-visible,
.author-card-title a:focus-visible,
.author-card-readmore:focus-visible,
.author-pagination .page-numbers:focus-visible {
	outline: 2px solid var(--author-accent);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
	.author-posts-grid {
		grid-template-columns: 1fr;
	}

	.author-post-card {
		break-inside: avoid;
		box-shadow: none;
		border: 1px solid #ccc;
	}

	.author-card-image img {
		max-height: 200px;
	}
}
