/* ============================================================================
 * Publisher Book Metadata — Front-end styles
 *
 * Scoped to .pbm-single-book and .pbm-single-author.
 * Uses the site's existing CSS variables:
 *   --dark-blue, --gold, --cream, --black, --dark-gray, --light-gray,
 *   --light-blue-teal, --primary-font, --heading-font,
 *   --max-content-width, --max-text-width
 * No hardcoded colors or fonts — rebrand-safe.
 * ============================================================================ */


/* --- Shared reset for both templates ---------------------------------- */

.pbm-single-book,
.pbm-single-author {
	color: var(--dark-blue);
}

.pbm-single-book a,
.pbm-single-author a {
	transition: color 200ms ease;
}


/* =====================================================================
 * BOOK HERO — cover + metadata on the left, title/author/desc on right
 * ===================================================================== */

.pbm-book-hero {
	display: grid;
	grid-template-columns: minmax(260px, 340px) 1fr;
	gap: 3rem;
	align-items: start;
	margin-bottom: 3.5rem;
}

.pbm-book-hero__cover-column {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.pbm-book-hero__cover-image {
	display: block;
	width: 100%;
	height: auto;
	box-shadow: 0 6px 24px rgba(0, 43, 79, 0.18);
	border-radius: 2px;
}


/* --- Metadata definition list (bordered table look) ------------------ */

.pbm-book-meta {
	margin: 0;
	display: grid;
	grid-template-columns: max-content 1fr;
	border: 1px solid var(--light-gray);
	font-size: 0.85rem;
	line-height: 1.3;
}

.pbm-book-meta dt,
.pbm-book-meta dd {
	padding: 0.55em 0.85em;
	border-bottom: 1px solid var(--light-gray);
	margin: 0;
}

.pbm-book-meta dt {
	border-right: 1px solid var(--light-gray);
	font-family: var(--primary-font);
	font-style: italic;
	color: var(--dark-gray);
	font-weight: 400;
	white-space: nowrap;
}

.pbm-book-meta dd {
	font-family: var(--primary-font);
	color: var(--black);
}

.pbm-book-meta > dt:nth-last-of-type(1),
.pbm-book-meta > dd:nth-last-of-type(1) {
	border-bottom: none;
}


/* --- Right column: title, subtitle, byline, description, buttons ---- */

.pbm-book-hero__details {
	padding-top: 0.25rem;
}

.pbm-book-title {
	font-family: var(--primary-font);
	font-weight: 400;
	color: var(--dark-blue);
	font-size: 3rem;
	line-height: 1.05;
	letter-spacing: -0.5px;
	margin: 0 0 0.15em 0;
}

.pbm-book-subtitle {
	font-family: var(--primary-font);
	font-weight: 400;
	color: var(--dark-blue);
	font-size: 1.5rem;
	line-height: 1.2;
	margin: 0 0 1.25em 0;
	opacity: 0.85;
}

.pbm-book-authors {
	font-family: var(--primary-font);
	font-weight: 700;
	font-style: italic;
	color: var(--dark-blue);
	font-size: 1.125rem;
	margin: 0 0 1.5em 0;
}

.pbm-book-authors a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.pbm-book-authors a:hover {
	border-bottom-color: var(--gold);
}

.pbm-book-description {
	font-family: var(--primary-font);
	color: var(--dark-blue);
	line-height: 1.55;
	font-size: 1rem;
	margin-bottom: 2rem;
}

.pbm-book-description p {
	margin: 0 0 0.9em 0;
}

.pbm-book-description p:last-child {
	margin-bottom: 0;
}


/* --- Buy buttons ----------------------------------------------------- */

.pbm-buy-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.875rem;
	margin-top: 2rem;
}

.pbm-buy-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.95em 1.75em;
	background: var(--gold);
	color: var(--dark-blue);
	font-family: var(--heading-font);
	font-weight: 800;
	text-transform: uppercase;
	text-decoration: none;
	letter-spacing: 0.75px;
	font-size: 0.875rem;
	border-radius: 5px;
	transition: transform 300ms ease, box-shadow 300ms ease;
	flex: 1 1 0;
	min-width: 110px;
	max-width: 200px;
}

.pbm-buy-button:hover,
.pbm-buy-button:focus {
	color: var(--dark-blue);
	transform: scale(1.05);
	box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
}


/* =====================================================================
 * REVIEWS
 * ===================================================================== */

.pbm-reviews {
	margin: 3.5rem 0;
	max-width: var(--max-text-width);
}

.pbm-reviews__heading {
	font-family: var(--heading-font);
	font-weight: 800;
	color: var(--dark-blue);
	font-size: 1.25rem;
	letter-spacing: 0.75px;
	text-transform: uppercase;
	margin: 0 0 1.5rem 0;
}

.pbm-review {
	font-family: var(--primary-font);
	font-style: italic;
	font-size: 1rem;
	line-height: 1.55;
	color: var(--dark-blue);
	margin: 0 0 1.75em 0;
	padding: 0;
	border: none;
	quotes: none;
}

.pbm-review:last-child {
	margin-bottom: 0;
}

.pbm-review p {
	margin: 0 0 0.75em 0;
}

.pbm-review p:last-of-type {
	margin-bottom: 0;
}

.pbm-review__attribution {
	display: block;
	margin-top: 0.6em;
	font-style: normal;
	font-family: var(--heading-font);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.25px;
	color: var(--dark-gray);
	text-transform: uppercase;
}

.pbm-review__attribution::before {
	content: "— ";
}


/* =====================================================================
 * THE AUTHORS section on the book page
 * ===================================================================== */

.pbm-authors {
	margin-top: 4rem;
	margin-bottom: 4rem;
	padding-top: 3rem;
	border-top: 2px solid var(--dark-blue);
}

.pbm-authors__heading {
	font-family: var(--heading-font);
	font-weight: 800;
	color: var(--dark-blue);
	font-size: 1.75rem;
	text-align: center;
	margin: 0 0 2.5rem 0;
	letter-spacing: 0.25px;
}

.pbm-author-card {
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: 2rem;
	margin: 0 auto 2.5rem auto;
	max-width: var(--max-text-width);
	align-items: start;
}

.pbm-author-card:last-child {
	margin-bottom: 0;
}

.pbm-author-card__image {
	width: 160px;
	height: 160px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--light-blue-teal);
	flex-shrink: 0;
}

.pbm-author-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pbm-author-card__content {
	min-width: 0;
}

.pbm-author-card__name {
	font-family: var(--heading-font);
	font-weight: 700;
	color: var(--dark-blue);
	font-size: 1.5rem;
	margin: 0 0 0.75rem 0;
	line-height: 1.1;
	letter-spacing: -0.25px;
}

.pbm-author-card__bio {
	font-family: var(--primary-font);
	color: var(--dark-blue);
	line-height: 1.5;
	font-size: 0.95rem;
	margin-bottom: 0.75rem;
}

.pbm-author-card__bio p {
	margin: 0 0 0.75em 0;
}

.pbm-author-card__bio p:last-child {
	margin-bottom: 0;
}

.pbm-author-card__link {
	font-family: var(--primary-font);
	color: var(--dark-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pbm-author-card__link:hover {
	color: var(--gold);
}


/* =====================================================================
 * SINGLE AUTHOR PAGE
 * ===================================================================== */

.pbm-author-hero {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 2.5rem;
	align-items: start;
	max-width: var(--max-text-width);
	margin: 0 auto 3.5rem auto;
}

.pbm-author-hero__image {
	width: 220px;
	height: 220px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--light-blue-teal);
}

.pbm-author-hero__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pbm-author-name {
	font-family: var(--primary-font);
	font-weight: 400;
	color: var(--dark-blue);
	font-size: 2.5rem;
	line-height: 1.1;
	letter-spacing: -0.5px;
	margin: 0 0 1.25rem 0;
}

.pbm-author-bio {
	font-family: var(--primary-font);
	color: var(--dark-blue);
	line-height: 1.55;
	font-size: 1rem;
}

.pbm-author-bio p {
	margin: 0 0 0.9em 0;
}

.pbm-author-bio p:last-child {
	margin-bottom: 0;
}


/* --- Books grid on the author page ----------------------------------- */

.pbm-author-books {
	margin-top: 4rem;
	margin-bottom: 4rem;
	padding-top: 3rem;
	border-top: 2px solid var(--dark-blue);
}

.pbm-author-books__heading {
	font-family: var(--heading-font);
	font-weight: 800;
	color: var(--dark-blue);
	font-size: 1.75rem;
	text-align: center;
	margin: 0 0 2.5rem 0;
	letter-spacing: 0.25px;
}

.pbm-author-books__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 2.5rem 2rem;
}

.pbm-book-card {
	display: block;
	text-decoration: none;
	color: var(--dark-blue);
	transition: transform 300ms ease;
}

.pbm-book-card:hover {
	transform: translateY(-4px);
	color: var(--dark-blue);
}

.pbm-book-card__cover {
	display: block;
	width: 100%;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	box-shadow: 0 6px 18px rgba(0, 43, 79, 0.15);
	margin-bottom: 1rem;
	border-radius: 2px;
	transition: box-shadow 300ms ease;
}

.pbm-book-card:hover .pbm-book-card__cover {
	box-shadow: 0 10px 28px rgba(0, 43, 79, 0.22);
}

.pbm-book-card__title {
	font-family: var(--primary-font);
	font-weight: 400;
	color: var(--dark-blue);
	font-size: 1.25rem;
	line-height: 1.2;
	margin: 0 0 0.35em 0;
	text-align: center;
}

.pbm-book-card__authors {
	font-family: var(--primary-font);
	font-style: italic;
	font-size: 0.875rem;
	color: var(--dark-blue);
	margin: 0;
	text-align: center;
	opacity: 0.8;
}


/* =====================================================================
 * MOBILE RESPONSIVE — breakpoints match the theme's 768px
 * ===================================================================== */

@media (max-width: 768px) {

	/* Book hero stacks: cover → details → meta.
	 * `display: contents` on cover-column unwraps it so cover-image and
	 * meta become direct flex children of the hero, allowing flex `order`
	 * to push meta past details. */
	.pbm-book-hero {
		display: flex;
		flex-direction: column;
		gap: 2rem;
	}

	.pbm-book-hero__cover-column {
		display: contents;
	}

	.pbm-book-hero__cover-image {
		order: 1;
		max-width: 260px;
		margin: 0 auto;
	}

	.pbm-book-hero__details {
		order: 2;
	}

	.pbm-book-meta {
		order: 3;
		width: 100%;
		max-width: 360px;
		margin: 0 auto;
	}

	.pbm-book-title {
		font-size: 2.25rem;
		text-align: center;
	}

	.pbm-book-subtitle {
		font-size: 1.25rem;
		text-align: center;
	}

	.pbm-book-authors {
		text-align: center;
	}

	.pbm-buy-buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.pbm-buy-button {
		max-width: none;
		width: 100%;
		padding: 1em 1.5em;
	}

	/* Author cards stack: picture above content, centered */
	.pbm-author-card {
		grid-template-columns: 1fr;
		text-align: center;
		gap: 1.25rem;
	}

	.pbm-author-card__image {
		margin: 0 auto;
		width: 140px;
		height: 140px;
	}

	.pbm-authors__heading,
	.pbm-author-books__heading {
		font-size: 1.5rem;
	}

	/* Single-author hero stacks */
	.pbm-author-hero {
		grid-template-columns: 1fr;
		text-align: center;
		gap: 1.5rem;
	}

	.pbm-author-hero__image {
		margin: 0 auto;
		width: 180px;
		height: 180px;
	}

	.pbm-author-name {
		font-size: 2rem;
	}
}
