/* ==========================================================
   Merchspine Author Page — frontend styles
   ========================================================== */

/* ---------- Fallback author archive template ---------- */
.merchspine-author-archive-fallback {
	max-width: 800px;
	margin: 0 auto;
	padding: 40px 20px;
	box-sizing: border-box;
}

.merchspine-author-archive-fallback__header {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.merchspine-author-archive-fallback__photo {
	width: 100px;
	height: 100px;
	object-fit: cover;
	border-radius: 50%;
}

.merchspine-author-archive-fallback__bio {
	margin-top: 20px;
	line-height: 1.7;
}

.merchspine-author-archive-fallback__posts {
	margin-top: 15px;
	padding-left: 20px;
}

/* ---------- MERCH Author Name / Image / Bio widgets ---------- */
.merchspine-author-name {
	margin: 0;
}

.merchspine-author-image-wrap {
	width: 100%;
}

.merchspine-author-image {
	display: block;
}

.merchspine-author-bio {
	line-height: 1.7;
}

/* ---------- Generic "Read more" clamp (shared by every widget that
   clamps text: MERCH Post Author's bio, MERCH Book Editorial Review,
   MERCH Book Bio). JS toggles the "is-expanded" class directly on the
   element carrying "merchspine-readmore-text". ---------- */
.merchspine-readmore-text {
	overflow: hidden;
}

.merchspine-readmore-text.is-expanded {
	max-height: none !important;
	overflow: visible;
}

.merchspine-readmore-toggle {
	background: none;
	border: none;
	cursor: pointer;
	font: inherit;
	text-decoration: underline;
	display: inline-block;
}

/* ---------- MERCH Post Author widget ---------- */
.merchspine-post-author {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 20px;
	box-sizing: border-box;
	max-width: 100%;
}

.merchspine-post-author * {
	box-sizing: border-box;
	min-width: 0;
}

/* Image column: photo, then the Visit Author Page button stacked below it. */
.merchspine-post-author__image-wrap {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.merchspine-post-author__image-container {
	display: block;
}

.merchspine-post-author__image {
	display: block;
	width: 150px;
	height: 150px;
	object-fit: cover;
	margin: 0 auto;
}

/* Always spans the full column width, regardless of "Image Column
   Alignment" above, so its own text-align control actually has room to
   move the button left/center/right. */
.merchspine-post-author__visit-container {
	align-self: stretch;
	width: 100%;
}

.merchspine-post-author__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 100%;
	overflow: hidden;
}

.merchspine-post-author__name {
	font-weight: 700;
	margin: 0 0 8px;
}

.merchspine-post-author__bio {
	flex: 1 1 auto;
	position: relative;
	margin-bottom: 10px;
}

.merchspine-post-author__actions {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 16px;
	flex-wrap: wrap;
}

.merchspine-post-author__visit {
	display: inline-block;
	text-decoration: none;
	white-space: nowrap;
}

/* ---------- Vertical layout ---------- */
.merchspine-post-author[style*="flex-direction: column"] .merchspine-post-author__image {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
}

/* ---------- MERCH Book Editorial Review widget (plain text field) ---------- */
.merchspine-book-editorial-review {
	max-width: 100%;
	box-sizing: border-box;
}

.merchspine-book-editorial-review__text {
	line-height: 1.7;
	white-space: pre-wrap;
}

.merchspine-book-editorial-review__read-more-row {
	margin-top: 8px;
}

/* ---------- MERCH Book Bio widget (full WordPress-rendered content —
   the same 'the_content' output as the Book's own content area, so bold,
   paragraphs, lists, etc. must render exactly as normal HTML). ---------- */
.merchspine-book-bio {
	max-width: 100%;
	box-sizing: border-box;
}

.merchspine-book-bio__text {
	line-height: 1.7;
}

.merchspine-book-bio__text p {
	margin: 0 0 1em;
}

.merchspine-book-bio__text ul,
.merchspine-book-bio__text ol {
	margin: 0 0 1em 1.5em;
	padding: 0;
}

.merchspine-book-bio__text li {
	margin-bottom: 0.4em;
}

.merchspine-book-bio__text strong,
.merchspine-book-bio__text b {
	font-weight: 700;
}

.merchspine-book-bio__text em,
.merchspine-book-bio__text i {
	font-style: italic;
}

.merchspine-book-bio__text > *:last-child {
	margin-bottom: 0;
}

.merchspine-book-bio__read-more {
	margin-left: 6px;
	vertical-align: baseline;
}

/* ---------- Responsive: never allow overflow ---------- */
@media (max-width: 767px) {
	.merchspine-post-author {
		flex-direction: column;
	}

	.merchspine-post-author__image-wrap {
		width: 100%;
	}

	.merchspine-post-author__image-container,
	.merchspine-post-author__image {
		width: 100% !important;
		height: auto !important;
		aspect-ratio: 1 / 1;
	}

	.merchspine-post-author__actions {
		flex-direction: column;
		align-items: flex-start;
	}
}
