/**
 * Front-end styles for Books CPT templates.
 *
 * Loaded conditionally on books pages only via Templates::maybe_enqueue_styles().
 * Uses the warm cozy palette for visual consistency with the Series Grid.
 *
 * Colour reference:
 *   Parchment:   #FDF9F2
 *   Cream border: #EDE0C4
 *   Plum:         #3B1D62
 *   Plum hover:   #5C3491
 *   Gold:         #D4AA40
 *   Warm ink:     #2C1A08
 *   Ink2:         #5C3D1E
 *   Ink3:         #8C6A3F
 */

/* ──────────────────────────────────────────
 * Single Book Layout
 * ────────────────────────────────────────── */
.mpwn-single-book__header {
	margin-bottom: 1.5rem;
}

.mpwn-single-book__header .entry-title {
	color: #2c1a08;
	margin-bottom: 0.25rem;
}

.mpwn-book-author {
	font-size: 0.9375rem;
	color: #5c3d1e;
	margin: 0;
}

.mpwn-book-author-link {
	color: #5c3d1e;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mpwn-book-author-link:hover {
	color: #2c1a08;
}

.mpwn-single-book__layout {
	display: flex;
	gap: 2rem;
	align-items: flex-start;
}

.mpwn-single-book__details {
	flex: 0 0 320px;
	max-width: 320px;
}

.mpwn-single-book__content {
	flex: 1 1 0;
	min-width: 0;
}

@media (max-width: 768px) {
	.mpwn-single-book__layout {
		flex-direction: column;
	}

	.mpwn-single-book__details {
		flex: none;
		max-width: 100%;
		width: 100%;
	}
}

/* ──────────────────────────────────────────
 * Book Details Component
 * (used in single template and Featured Book block)
 * ────────────────────────────────────────── */
.mpwn-book-details {
	text-align: center;
	margin-bottom: 2rem;
}

.mpwn-book-details__image {
	position: relative;
	display: inline-block;
	margin-bottom: 1rem;
	max-width: 100%;
	overflow: hidden;
}

.mpwn-book-details__image img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.mpwn-book-details__banner {
	position: absolute;
	top: 10px;
	right: -30px;
	width: 140px;
	padding: 5px 10px;
	background: #d4aa40;
	color: #2c1a08;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	text-align: center;
	transform: rotate(45deg);
}

.mpwn-book-details__price {
	font-size: 1.75rem;
	font-weight: 700;
	color: #2c1a08;
	padding-bottom: 1rem;
	margin-bottom: 1rem;
	border-bottom: 2px solid #ede0c4;
}

.mpwn-book-details__meta {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	text-align: left;
}

.mpwn-book-details__meta li {
	margin-bottom: 0.4rem;
	font-size: 0.875rem;
	color: #5c3d1e;
}

.mpwn-book-details__label {
	font-weight: 700;
	color: #2c1a08;
}

/* ── Sale buttons ── */
.mpwn-book-details__buttons {
	margin-top: 1rem;
}

.mpwn-book-details__btn-group {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 0.75rem;
}

.mpwn-book-details__btn-group:last-child {
	margin-bottom: 0;
}

.mpwn-book-details__btn-heading {
	width: 100%;
	margin: 0.25rem 0 0.125rem;
	font-size: 0.875rem;
	color: #2c1a08;
	text-align: left;
}

.mpwn-book-details__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	width: 100%;
	background: #3b1d62;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease;
	box-sizing: border-box;
}

.mpwn-book-details__btn:hover,
.mpwn-book-details__btn:focus-visible {
	background: #5c3491;
	color: #fff;
	text-decoration: none;
}

.mpwn-book-details__btn--half {
	width: calc(50% - 3px);
}

.mpwn-book-details__btn--third {
	width: calc(33.333% - 4px);
}

.mpwn-book-details__btn-img {
	display: inline-block;
	padding: 4px;
	transition: opacity 0.2s ease;
}

.mpwn-book-details__btn-img:hover {
	opacity: 0.7;
}

.mpwn-book-details__btn-img img {
	display: block;
	max-width: 72px;
	height: auto;
	filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.3));
}

/* ──────────────────────────────────────────
 * Archive Grid
 * ────────────────────────────────────────── */
.mpwn-archive-books__header {
	margin-bottom: 1.5rem;
}

.mpwn-archive-books__header .page-title {
	color: #2c1a08;
}

.mpwn-archive-books__desc {
	color: #5c3d1e;
	font-size: 0.9375rem;
	max-width: 700px;
}

.mpwn-archive-books__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 1.25rem;
}

.mpwn-archive-books__card {
	background: #fdf9f2;
	border: 1.5px solid #ede0c4;
	border-radius: 10px;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mpwn-archive-books__card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 24px rgba(44, 26, 8, 0.1);
}

.mpwn-archive-books__image {
	display: block;
	line-height: 0;
}

.mpwn-archive-books__image img {
	display: block;
	width: 100%;
	height: auto;
}

.mpwn-archive-books__body {
	padding: 12px 14px 16px;
}

.mpwn-archive-books__title {
	margin: 0 0 4px;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

.mpwn-archive-books__title a {
	color: #2c1a08;
	text-decoration: none;
}

.mpwn-archive-books__title a:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mpwn-archive-books__card .mpwn-book-author {
	font-size: 0.8125rem;
	margin-bottom: 6px;
}

.mpwn-archive-books__excerpt {
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #5c3d1e;
	margin: 0;
}

/* ── Pagination ── */
.mpwn-archive-books-wrap .navigation.pagination {
	margin-top: 2rem;
	clear: both;
}

/* ── Empty state ── */
.mpwn-archive-books__empty {
	padding: 3rem 0;
	text-align: center;
	color: #8c6a3f;
}

/* ──────────────────────────────────────────
 * No-sidebar layout override
 *
 * When the sidebar is hidden via Book Appearance,
 * let the content area fill the full width.
 * ────────────────────────────────────────── */
.mpwn-books--no-sidebar .content-area,
.mpwn-books--no-sidebar #primary {
	width: 100%;
	max-width: 100%;
	float: none;
	margin-right: 0;
}

/* ──────────────────────────────────────────
 * Backward compatibility
 *
 * Old theme CSS may target these classes.
 * They're added via body_class/post_class in Templates.php.
 * ────────────────────────────────────────── */
.genesis-author-pro .author-pro-featured-image {
	display: inline-block;
	max-width: 100%;
	overflow: hidden;
	position: relative;
}

.genesis-author-pro .book-featured-text-banner {
	position: absolute;
	top: 10px;
	right: -30px;
	width: 140px;
	padding: 5px 10px;
	background: #d4aa40;
	color: #2c1a08;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	text-align: center;
	transform: rotate(45deg);
}
