/*
Block Name: Books
Description: Displays a grid of book cards from the Books CPT, with cover image, description, price and stock status.
*/

/* ============================================================
   GRID
   Three columns on desktop.
   ============================================================ */
.block-books .books-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}

/* ============================================================
   CARD
   Clip overflow so the panel slides up cleanly within the
   card boundary. The card height is fixed by the cover image
   aspect ratio — the panel slides up over it on hover.
   ============================================================ */
.block-books .book-card {
	position: relative;
	display: block;
	border-radius: var(--border-radius, 2rem);
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
	text-decoration: none;
	background: #fff;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.block-books .book-card:hover {
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
	transform: translateY(-4px);
}

/* ============================================================
   COVER IMAGE
   3:4 aspect ratio (portrait) to match book cover proportions.
   ============================================================ */
.block-books .book-cover {
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--brand-8, #f0f0f0);
	display: block;
}

.block-books .book-cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 1rem;
}

.block-books .book-cover-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--brand-4, #999);
	font-size: clamp(1.2rem, 1.2vw, 1.4rem);
}

/* ============================================================
   INFO PANEL
   Sits below the image in normal flow at rest (translateY(100%)
   hides it below the card bottom edge due to overflow:hidden).
   On hover it slides up to sit over the bottom portion of the
   cover image, matching the screenshot.
   ============================================================ */
.block-books .book-card-panel {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--brand-2);
	color: #fff;
	padding: 2rem;
	transform: translateY(100%);
	transition: transform 0.3s ease;
}

.block-books .book-card:hover .book-card-panel {
	transform: translateY(0);
}

/* ============================================================
   PANEL TYPOGRAPHY
   Matches the screenshot: large bold title, body description,
   bold price, and "Out of stock" on its own line.
   ============================================================ */
.block-books .book-card-title {
	font-size: clamp(1.8rem, 2vw, 2.6rem);
	font-weight: 700;
	color: #fff;
	margin: 0 0 1rem;
	line-height: 1.3;
}

.block-books .book-card-description {
	font-size: clamp(1.4rem, 1.5vw, 1.8rem);
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.9);
	margin-bottom: 1.5rem;
}

.block-books .book-card-description p {
	margin: 0 0 0.4rem;
}

.block-books .book-card-price {
	font-size: clamp(1.4rem, 1.5vw, 1.6rem);
	font-weight: 700;
	color: #fff;
	margin: 0 0 0.4rem;
}

.block-books .book-card-stock {
	font-size: clamp(1.2rem, 1.2vw, 1.3rem);
	font-weight: 700;
	color: #fff;
	margin: 0;
}

/* ============================================================
   OUT OF STOCK — desaturate cover image slightly
   ============================================================ */
.block-books .book-card--out-of-stock .book-cover-img {
	filter: grayscale(40%);
	opacity: 0.85;
}

/* ============================================================
   EDITOR NOTICE
   ============================================================ */
.block-books .books-empty-notice {
	color: #e88b39;
	font-weight: 600;
	padding: 2rem 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media screen and (max-width: 900px) {
	.block-books .books-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media screen and (max-width: 576px) {
	.block-books .books-grid {
		grid-template-columns: 1fr;
	}
}


/*
 * Single Book Page Styles
 * -----------------------
 * Paste into global-styles.css.
 */

/* ============================================================
   HERO
   No background — inherits the page background colour.
   ============================================================ */
.book-hero-category {
	font-size: clamp(1.2rem, 1.2vw, 1.4rem);
	font-weight: 600;
	color: var(--brand-1);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 0 0 1rem;
}

.book-hero-category a {
	color: inherit;
	text-decoration: none !important;
}

.book-hero-category a:hover {
	text-decoration: underline !important;
}

.book-hero-title {
	margin: 0;
}

.book-hero-author {
	margin: 0;
	color: var(--brand-4, #666);
	font-size: clamp(1.4rem, 1.5vw, 1.6rem);
}

/* ============================================================
   CONTENT SECTION
   White background to separate from the hero.
   ============================================================ */
.book-detail {
	background: #fff;
	padding: var(--section-padding, 6rem) 0;
}

/* ============================================================
   TWO-COLUMN GRID
   3fr text : 2fr image.
   ============================================================ */
.book-detail-grid {
	display: grid;
	grid-template-columns: 3fr 2fr;
	gap: 6rem;
	align-items: start;
}

/* ============================================================
   LEFT COLUMN
   ============================================================ */
.book-detail-description {
	margin-bottom: 2rem;
	font-size: clamp(1.4rem, 1.5vw, 1.6rem);
	line-height: 1.7;
}

.book-detail-price {
	font-size: clamp(1.5rem, 1.8vw, 1.8rem);
	font-weight: 700;
	margin: 0 0 1.5rem;
}

.book-detail-stock-status {
	font-size: clamp(1.2rem, 1.2vw, 1.4rem);
	font-weight: 600;
	color: var(--brand-4, #888);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0 0 2rem;
}

.book-detail-enquiry-prompt {
	font-size: clamp(1.3rem, 1.4vw, 1.5rem);
	margin: 0 0 2rem;
}

/* ============================================================
   RIGHT COLUMN — cover image
   Sticky so it stays in view while scrolling the left column.
   ============================================================ */
.book-detail-cover {
	position: sticky;
	top: 12rem;
}

.book-detail-cover-img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: var(--border-radius, 1rem);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   RESPONSIVE
   Stack to single column on tablet/mobile.
   Cover moves above content on mobile.
   ============================================================ */
@media screen and (max-width: 768px) {
	.book-detail-grid {
		grid-template-columns: 1fr;
		gap: 3rem;
	}

	.book-detail-cover {
		position: static;
		max-width: 28rem;
	}
}