/**
 * Pelagia Book Store — Front-Page Sections (Additive CSS)
 *
 * Only classes NOT present in other CSS files.
 * Design tokens from variables.css are used throughout.
 *
 * Sections:
 *   0. Front-Page Section Title (.front-section-title)
 *   1. Horizontal Carousel (hp-carousel)
 *   2. Compact Product Card (product-card--sm)
 *   3. Compact Author / Publisher Card
 *   4. Hero — Background Layout Variant
 *   5. Featured Category Banners (fp-cat-banners)
 *   6. Editorial Banner Grid (fp-editorial)
 *   7. Section Visibility Helpers
 *   8. Latest Category Posts Section (.front-latest-cat-posts)
 *   9. Responsive overrides
 *
 * @package Pelagia
 */

/* ══════════════════════════════════════════════════
   0. FRONT-PAGE SECTION TITLE (.front-section-title)
      Applied to every main <h2> on the front page.
      — Text: --color-secondary (#1B1464 Deep Navy)
      — Half-width decorative underline via ::after
══════════════════════════════════════════════════ */

.front-section-title {
	color: var(--color-secondary);
	/* Navy */
	position: relative;
	padding-bottom: var(--space-4);
	margin-bottom: var(--space-6);
}

.front-section-title::after {
	content: '';
	display: block;
	position: absolute;
	bottom: 0;
	left: 0;
	width: 50%;
	height: 2px;
	background-color: var(--color-primary);
	/* Terracotta underline */
}

/* When the title sits inside a flex row, keep it left-aligned */
.hp-carousel__header .front-section-title {
	flex: 1 1 auto;
}

/* ══════════════════════════════════════════════════
   1. HORIZONTAL CAROUSEL
══════════════════════════════════════════════════ */

.hp-carousel {
	padding: 2.5rem 0;
	background: var(--color-white);
	/* default; overridden by --bg modifiers */
}

.hp-carousel.section--gray {
	background: var(--color-bg-gray);
}

.hp-carousel__inner {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 0 var(--container-pad);
}

/* ── Header row (title + controls) ── */
.hp-carousel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	margin-bottom: var(--space-6);
	flex-wrap: wrap;
}

.hp-carousel__title {
	font-size: var(--text-2xl);
	font-weight: var(--font-weight-black);
	letter-spacing: -0.03em;
	color: var(--color-dark);
	margin: 0;
}

.hp-carousel__controls {
	display: flex;
	align-items: center;
	gap: var(--space-3);
}

.hp-carousel__browse-link {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-primary);
	text-decoration: none;
	transition: color var(--transition-fast);
}

.hp-carousel__browse-link:hover {
	color: var(--color-primary-light);
}

/* ── Arrow buttons ── */
.hp-carousel__btn--prev,
.hp-carousel__btn--next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1.5px solid var(--color-border);
	border-radius: var(--radius-full);
	background: var(--color-white);
	color: var(--color-body);
	cursor: pointer;
	transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
	flex-shrink: 0;
}

.hp-carousel__btn--prev:hover:not(:disabled),
.hp-carousel__btn--next:hover:not(:disabled) {
	border-color: var(--color-primary);
	background: var(--color-primary);
	color: var(--color-white);
}

.hp-carousel__btn--prev:disabled,
.hp-carousel__btn--next:disabled {
	opacity: 0.35;
	cursor: default;
}

/* ── Scrollable track ── */
.hp-carousel__track {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	width: 100%;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: var(--space-2);
	/* room for box-shadow hover */
	/* scroll padding so snap target isn't hidden by sticky header */
	scroll-padding-left: 0;
}

.hp-carousel__track::-webkit-scrollbar {
	display: none;
}

/* All direct children snap */
.hp-carousel__track>* {
	flex-shrink: 0;
	scroll-snap-align: start;
	height: auto;
}

/* ── Default height (for product cards in carousel) ── */
.hp-carousel__track .product-card,
.hp-carousel__track .author-card,
.hp-carousel__track .publisher-card {
	width: 100%;
	height: 100%;
}

/* ══════════════════════════════════════════════════
   2. COMPACT PRODUCT CARD  (.product-card--sm)
══════════════════════════════════════════════════ */
.product-card--sm {
	border: none;
	box-shadow: none;
}

.product-card--sm .product-card__body {
	padding: var(--space-3) var(--space-2);
	gap: var(--space-1);
}

.product-card--sm .product-card__title {
	font-size: 1rem;
}

.product-card--sm .product-card__author {
	font-size: calc(var(--text-xs) - 1px);
}

.product-card--sm .product-card__price {
	font-size: var(--text-xs);
}

.product-card--sm .product-card__cta {
	padding: var(--space-1) var(--space-3);
	font-size: calc(var(--text-xs) - 1px);
}

/* ══════════════════════════════════════════════════
   3. COMPACT AUTHOR CARD (.author-card--sm)
      & PUBLISHER CARD (.publisher-card)
══════════════════════════════════════════════════ */

.author-card--sm .author-card__photo-wrap {
	margin-bottom: var(--space-3);
	border-radius: 50%;
	/* circular on compact variant */
	overflow: hidden;
}

.author-card--sm .author-card__name {
	font-size: var(--text-xs);
}

.author-card--sm .author-card__bio {
	font-size: calc(var(--text-xs) - 1px);
	-webkit-line-clamp: 2;
}

/* Publisher card — shares author card aesthetic */
.publisher-card {
	text-align: center;
	cursor: pointer;
	transition: transform var(--transition-base);
}

.publisher-card:hover {
	transform: translateY(-4px);
}

.publisher-card__logo-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 50%;
	overflow: hidden;
	margin-bottom: var(--space-3);
	background: var(--color-bg-light);
}

.publisher-card__logo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--transition-slow);
}

.publisher-card:hover .publisher-card__logo {
	transform: scale(1.05);
}

.publisher-card__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}

.publisher-card__initials {
	font-size: 1.75rem;
	font-weight: var(--font-weight-black);
	color: rgba(255, 255, 255, 0.88);
	letter-spacing: -0.03em;
	line-height: 1;
}

.publisher-card__name {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-semibold);
	color: var(--color-primary);
	margin-bottom: var(--space-1);
	letter-spacing: -0.01em;
}

.publisher-card__name a {
	color: inherit;
	text-decoration: none;
	transition: color var(--transition-fast);
}

.publisher-card__name a:hover {
	color: var(--color-primary-dark);
}

.publisher-card__bio {
	font-size: calc(var(--text-xs) - 1px);
	color: var(--color-muted);
	line-height: var(--line-height-relaxed);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

/* ══════════════════════════════════════════════════
   4. HERO — BACKGROUND CAROUSEL VARIANT
      (.hero-banner--bg-carousel)
══════════════════════════════════════════════════ */

.hero-banner--bg-carousel {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: transparent;
	min-height: 0; /* Prevents 560px stretching on tablet which causes cropping */
}

/* ── Carousel wrapper: max-width 1024px, centered on desktop ── */
.hero-carousel {
	position: relative;
	max-width: 1280px;
	width: 100%;
	margin: 0 auto;
}

/* ── Track: enforces 2:1 ratio (1280×640 desktop, scales proportionally).
   CSS Grid stacks all slides on the same cell for cross-fade. ── */
.hero-carousel__track {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
	aspect-ratio: 2 / 1;
	position: relative;
	width: 100%;
	overflow: hidden;
}

/* ── Individual slides: all in same grid cell (stacked) ── */
.hero-carousel__slide {
	grid-column: 1;
	grid-row: 1;
	opacity: 0;
	transition: opacity 0.45s ease;
	pointer-events: none;
	min-height: 0;
}

.hero-carousel__slide.is-active {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

/* Link wrapper — fills the entire slide height */
.hero-carousel__link {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	text-decoration: none;
}

/* ── Image: fills the 2:1 track with object-fit cover ── */
.hero-carousel__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Placeholder when no image is configured */
.hero-carousel__placeholder {
	width: 100%;
	aspect-ratio: 2 / 1;
	/* Fallback sizing for empty slots */
	background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
}

/* ── Gradient overlay: hidden by default, fades in on hover ── */
.hero-carousel__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top,
			rgba(0, 0, 0, 0.55) 0%,
			rgba(0, 0, 0, 0.15) 50%,
			transparent 100%);
	opacity: 0;
	transition: opacity var(--transition-base);
	pointer-events: none;
	z-index: 2;
}

.hero-carousel__link:hover .hero-carousel__overlay,
.hero-carousel__slide:hover .hero-carousel__overlay {
	opacity: 1;
}

/* ── Navigation arrows: overlaid on the track ── */
.hero-carousel__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	padding: 0 var(--space-4);
	z-index: 10;
	pointer-events: none;
}

.hero-carousel__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.90);
	border: none;
	border-radius: var(--radius-full);
	color: var(--color-dark);
	cursor: pointer;
	pointer-events: all;
	transition: background var(--transition-fast), transform var(--transition-fast);
	box-shadow: var(--shadow-md);
}

.hero-carousel__btn:hover:not(:disabled) {
	background: var(--color-white);
	transform: scale(1.08);
}

.hero-carousel__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

/* ── Dot indicators ── */
.hero-carousel__dots {
	position: absolute;
	bottom: var(--space-4);
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: var(--space-2);
	z-index: 10;
}

.hero-carousel__dot {
	width: 8px;
	height: 8px;
	border-radius: var(--radius-full);
	background: rgba(255, 255, 255, 0.5);
	border: none;
	cursor: pointer;
	transition: background var(--transition-fast), transform var(--transition-fast);
	padding: 0;
}

.hero-carousel__dot.is-active {
	background: var(--color-white);
	transform: scale(1.3);
}

/* ── Responsive ── */
@media (max-width: 767px) {
	.hero-carousel__btn {
		width: 36px;
		height: 36px;
	}

	.hero-carousel__nav {
		padding: 0 var(--space-2);
	}

	/* Prevent any extra whitespace below the image on tablet/mobile */
	.hero-banner--bg-carousel,
	.hero-carousel,
	.hero-carousel__track {
		overflow: hidden;
	}

	.hero-carousel__image {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.hero-carousel__placeholder {
		margin: 0;
		padding: 0;
	}

	.hero-carousel__track {
		aspect-ratio: 2 / 1; /* Maintains desktop ratio so it doesn't crop */
	}
}

/* ══════════════════════════════════════════════════
   5. FEATURED CATEGORY BANNERS (.fp-cat-banners)
      Reuses .editorial-banner classes for each item.
══════════════════════════════════════════════════ */

.fp-cat-banners-section {
	padding: 0;
	/* full-bleed */
}

.fp-cat-banners {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	min-height: 480px;
}

.fp-cat-banners .editorial-banner {
	height: 480px;
}

/* ══════════════════════════════════════════════════
   6. EDITORIAL BANNER GRID (.fp-editorial)
      6 small boxes on the left + 1 big box on the right.
══════════════════════════════════════════════════ */

.fp-editorial-section {
	padding: 0;
}

.fp-editorial {
	display: grid;
	grid-template-columns: 2fr 1fr;
	min-height: 600px;
}

.fp-editorial__left {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: repeat(3, 1fr);
}

.fp-editorial__small {
	position: relative;
	overflow: hidden;
	cursor: pointer;
	border: 1px solid rgba(0, 0, 0, 0.06);
}

a.fp-editorial__small {
	display: block;
	text-decoration: none;
	color: inherit;
}

.fp-editorial__big {
	position: relative;
	overflow: hidden;
	cursor: pointer;
}

/* Shared image/overlay/content inside editorial boxes */
.fp-editorial__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--transition-slow);
}

.fp-editorial__small:hover .fp-editorial__image,
.fp-editorial__big:hover .fp-editorial__image {
	transform: scale(1.06);
}

.fp-editorial__placeholder {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
}

.fp-editorial__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.18) 55%, transparent 100%);
	z-index: 1;
}

.fp-editorial__content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 2;
	padding: var(--space-4) var(--space-5) var(--space-5);
	color: var(--color-white);
}

.fp-editorial__big .fp-editorial__content {
	padding: var(--space-8) var(--space-8) var(--space-10);
}

.fp-editorial__tag-name {
	font-size: var(--text-base);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-snug);
	margin-bottom: var(--space-1);
	letter-spacing: -0.01em;
}

.fp-editorial__big .fp-editorial__tag-name {
	font-size: var(--text-2xl);
	margin-bottom: var(--space-3);
}

.fp-editorial__caption {
	font-size: var(--text-xs);
	color: rgba(255, 255, 255, 0.78);
	margin-bottom: var(--space-3);
	line-height: var(--line-height-normal);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.fp-editorial__big .fp-editorial__caption {
	font-size: var(--text-sm);
	-webkit-line-clamp: 3;
	margin-bottom: var(--space-5);
}

.fp-editorial__link {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-white);
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.45);
	padding-bottom: 2px;
	transition: border-color var(--transition-fast);
}

.fp-editorial__link:hover {
	border-color: var(--color-white);
}

/* ══════════════════════════════════════════════════
   7. SECTION VISIBILITY HELPERS
══════════════════════════════════════════════════ */




/* ══════════════════════════════════════════════════
   9. BEST SELLER SECTION (.best-seller-section)
      Static 2-row × 5-column grid of 10 books.
══════════════════════════════════════════════════ */

.best-seller-section {
	padding: 2.5rem 0;
}

.best-seller__inner {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 0 var(--container-pad);
}

.best-seller__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--space-4);
	margin-bottom: var(--space-8);
	flex-wrap: wrap;
}

.best-seller__title-wrap {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}

.best-seller__eyebrow {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-primary);
	opacity: 0.65;
}

.best-seller__title {
	font-size: var(--text-2xl);
	font-weight: var(--font-weight-black);
	letter-spacing: -0.03em;
	color: var(--color-dark);
	margin: 0;
}

.best-seller__browse-link {
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-primary);
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--transition-fast);
}

.best-seller__browse-link:hover {
	color: var(--color-primary-light);
}

/* 5 columns × 2 rows — horizontal scrolling carousel */
.best-seller__controls {
	display: flex;
	align-items: center;
	gap: var(--space-3);
}

.best-seller__grid {
	display: grid;
	grid-template-rows: repeat(2, auto);
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 4 * 16px) / 5);
	gap: 16px;
	width: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: var(--space-2);
}

.best-seller__grid::-webkit-scrollbar {
	display: none;
}

.best-seller__grid>.best-seller__item {
	scroll-snap-align: start;
	width: 100%;
}

.best-seller__item {
	position: relative;
}

.best-seller__item .product-card {
	height: 100%;
}

/* Rank badge — Navy */
.best-seller__rank {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: 3;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-secondary);
	/* Navy */
	color: var(--color-white);
	font-size: var(--text-body);
	font-weight: var(--font-weight-bold);
	border-radius: var(--radius-full);
	line-height: 1;
	letter-spacing: 0;
}

/* Best Seller grid uses standard --grid-gap and full-size product cards (same as New Titles). */


/* ══════════════════════════════════════════════════
   10. EDITORIAL QUOTE PANEL (.fp-editorial__quote-panel)
       Minimalist right-side quote display.
══════════════════════════════════════════════════ */



.fp-editorial__quote-panel {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #1a1a1a;
	padding: var(--space-10) var(--space-8);
	overflow: hidden;
	min-height: 600px;
}

/* Decorative large quotation mark */
.fp-editorial__quote-deco {
	margin-bottom: var(--space-4);
}

.fp-editorial__quote-mark {
	width: 50px;
	height: 40px;
	color: #666;
}

/* Body */
.fp-editorial__quote-body {
	position: relative;
	z-index: 2;
	width: 60%;
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.fp-editorial__quote-eyebrow {
	display: none;
	/* Hide eyebrow */
}

.fp-editorial__quote-text {
	margin: 0;
	border: none;
	padding: 0;
}

.fp-editorial__quote-text p {
	font-size: var(--text-3xl);
	font-weight: 800;
	line-height: 1.1;
	color: #ffffff;
	font-style: normal;
	text-transform: uppercase;
	margin: 0;
}

.fp-editorial__quote-text--placeholder p {
	font-size: var(--text-xl);
	text-transform: none;
	color: rgba(255, 255, 255, 0.5);
}

.fp-editorial__quote-footer {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	padding-top: var(--space-3);
}

.fp-editorial__quote-author {
	font-size: var(--text-lg);
	font-weight: var(--font-weight-medium);
	font-style: normal;
	color: #ffffff;
}

.fp-editorial__quote-source {
	font-size: var(--text-sm);
	color: rgba(255, 255, 255, 0.6);
	font-style: normal;
}

/* Image */
.fp-editorial__quote-img-wrap {
	position: absolute;
	right: 5%;
	top: 50%;
	transform: translateY(-50%);
	width: 32%;
	max-width: 320px;
	aspect-ratio: 1;
	border-radius: 50%;
	overflow: hidden;
	z-index: 1;
	border: 8px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.fp-editorial__quote-circle {
	display: none;
}

.fp-editorial__quote-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
}

.fp-editorial__quote-img-placeholder {
	display: none;
}



/* ══════════════════════════════════════════════════
   12. LATEST CATEGORY POSTS SECTION
       (.latest-post-grid + .latest-post-card)
══════════════════════════════════════════════════ */

/* 4-column grid (default) */
.latest-post-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--grid-gap);
	margin-top: var(--space-4);
}

/* 5-column override */
.latest-post-grid--5col {
	grid-template-columns: repeat(5, 1fr);
}

/* ── Post card ── */
.latest-post-card {
	display: flex;
	flex-direction: column;
	background: var(--color-bg);
	border: 1.5px solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
	transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.latest-post-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-card-hover);
	border-color: var(--color-primary);
}

/* Image area */
.latest-post-card__img-wrap {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--color-bg-gray);
}

.latest-post-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--transition-slow);
}

.latest-post-card:hover .latest-post-card__img {
	transform: scale(1.04);
}

.latest-post-card__img-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary-light) 100%);
}

/* Body */
.latest-post-card__body {
	padding: var(--space-5);
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

/* Meta row */
.latest-post-card__meta {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--text-xs);
	color: var(--color-muted);
}

.latest-post-card__meta-sep {
	color: var(--color-border);
}

.latest-post-card__date,
.latest-post-card__author {
	font-size: inherit;
	color: inherit;
}

/* Title */
.latest-post-card__title {
	font-size: var(--text-base);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-snug);
	letter-spacing: -0.01em;
	color: var(--color-dark);
	margin: 0;
	transition: color var(--transition-fast);
}

.latest-post-card__title a {
	color: inherit;
	text-decoration: none;
}

.latest-post-card:hover .latest-post-card__title a {
	color: var(--color-primary);
}

/* Excerpt */
.latest-post-card__excerpt {
	font-size: var(--text-sm);
	color: var(--color-body);
	line-height: var(--line-height-normal);
	flex: 1;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	margin: 0;
}

/* Read more link */
.latest-post-card__read-more {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-primary);
	text-decoration: none;
	margin-top: auto;
	transition: gap var(--transition-fast), color var(--transition-fast);
}

.latest-post-card__read-more:hover {
	color: var(--color-primary-light);
	gap: var(--space-2);
}

/* ══════════════════════════════════════════════════
   13. RESPONSIVE
══════════════════════════════════════════════════ */

@media (max-width: 1280px) {

	/* 5-col posts: drop to 4 */
	.latest-post-grid--5col {
		grid-template-columns: repeat(4, 1fr);
	}
	/* .best-seller__grid layout handled in Polish Override section below */
}

@media (max-width: 1024px) {

	/* Product card fills its listitem wrapper — width controlled by .hp-carousel__track > * */
	.hp-carousel__track .product-card,
	.hp-carousel__track .author-card,
	.hp-carousel__track .publisher-card {
		width: 100%;
	}

	.latest-post-grid,
	.latest-post-grid--5col {
		grid-template-columns: repeat(3, 1fr);
	}
	/* .best-seller__grid layout handled in Polish Override section below */
}

@media (max-width: 768px) {
	.fp-cat-banners {
		grid-template-columns: 1fr;
	}

	.fp-cat-banners .editorial-banner,
	.fp-cat-banners {
		min-height: auto;
	}

	.fp-cat-banners .editorial-banner {
		height: 320px;
	}

	.fp-editorial {
		grid-template-columns: 1fr;
	}

	.fp-editorial__left {
		grid-template-columns: 1fr 1fr;
		min-height: 360px;
	}

	.fp-editorial__small {
		height: 200px;
	}

	.fp-editorial__quote-panel {
		min-height: 300px;
		padding: var(--space-8) var(--space-6);
	}

	/* Product card fills its listitem wrapper — width controlled by .hp-carousel__track > * */
	.hp-carousel__track .product-card,
	.hp-carousel__track .author-card,
	.hp-carousel__track .publisher-card {
		width: 100%;
	}

	.hero-banner--bg {
		min-height: 420px;
	}

	.hp-carousel__title {
		font-size: var(--text-xl);
	}

	/* .best-seller__grid layout handled in Polish Override section below */

	.latest-post-grid,
	.latest-post-grid--5col {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {

	/* Product card fills its listitem wrapper — width controlled by .hp-carousel__track > * */
	.hp-carousel__track .product-card,
	.hp-carousel__track .author-card,
	.hp-carousel__track .publisher-card {
		width: 100%;
	}

	/* .best-seller__grid layout handled in Polish Override section below */

	.latest-post-grid,
	.latest-post-grid--5col {
		grid-template-columns: 1fr;
	}

}

/* ════════════════════════════════════════════════════════════════
   UI POLISH OVERRIDE — Best Seller + Category Carousel Sections
   Scope  : .best-seller-section, .hp-carousel (New Titles + cats)
   Method : additive overrides only — no layout / HTML changed.
   Git diff selectors:
     .best-seller__title / .hp-carousel__title
     .best-seller__grid .product-card (+ body, title, author, price)
     .hp-carousel__track .product-card (same)
     .product-card__cta-group / __cta / __atc
     responsive @media (max-width: 1024 / 768 / 480px)
   ════════════════════════════════════════════════════════════════ */

/* ── Design rules (inline summary) ───────────────────────────────
   Typography (4-pt system, 16 px root):
     Section title : clamp(20 → 26 px), weight 600, lh 1.3
     Card title    : clamp(14 → 17 px), weight 600, lh 1.4
     Card author   : clamp(13 → 14 px), weight 400, mid-gray
     Card price    : clamp(13 → 15 px), weight 700, terracotta

   Spacing:
     Header → grid   : clamp(24 → 32 px)
     Grid col gap    : 16 px desktop / 12 px mobile
     Grid row gap    : 20 px desktop / 16 px mobile
     Card padding    : 16 px desktop / 12 px mobile
     Cover → title   : handled by card layout (image-wrapper bottom)
     title → author  : 6 px | author → price : 10 px | price → CTA : 12 px

   Card state:
     Default : white bg, border #E0E0E0 1 px, shadow-sm
     Hover   : translateY(-3 px), shadow terracotta tint, border primary

   Buttons (CTA group below body — not overlaying cover):
     .product-card__cta  = "View Book"   — primary terracotta fill
     .product-card__atc  = "Add to Cart" — outline terracotta
     min-height 40 px desktop / 44 px mobile (WCAG tap target)
─────────────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────
   A. SECTION TITLES
   ───────────────────────────────────────────────── */

.best-seller__title,
.hp-carousel__title {
	font-size: clamp(1.25rem, 2.5vw, 1.625rem);
	/* 20 → 26 px */
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.3;
	color: var(--color-dark);
}

.best-seller__header {
	margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.hp-carousel__header {
	margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

/* ─────────────────────────────────────────────────
   B. CARD SHELL — defer to product-card.css
   Apply a resting shadow to carousel/bestseller cards
   ───────────────────────────────────────────────── */

.best-seller__grid .product-card,
.hp-carousel__track .product-card {
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

/* Image wrapper: 1:1 square, no background, no cropping */
.best-seller__grid .product-card__image-wrapper,
.hp-carousel__track .product-card__image-wrapper {
	aspect-ratio: 1 / 1;
	background: transparent;
	height: auto;
	max-height: none;
	width: 100%;
	overflow: hidden;
	padding: 0;
	box-sizing: border-box;
}

.best-seller__grid .product-card__image,
.hp-carousel__track .product-card__image {
	object-fit: contain;
	border-radius: 3px;
}

/* Hide empty grid slots */
.best-seller__item:empty {
	display: none;
}

/* ─────────────────────────────────────────────────
   C. CARD BODY + TYPOGRAPHY
   Carousel context: slightly tighter padding, font sizes
   handled by product-card.css responsive breakpoints.
   Only override what is carousel-specific.
   ───────────────────────────────────────────────── */

.best-seller__grid .product-card__body,
.hp-carousel__track .product-card__body {
	padding: 12px 12px 14px;
}

/* Price: push to bottom with tighter margin in compact cards */
.best-seller__grid .product-card__price,
.hp-carousel__track .product-card__price {
	margin-bottom: 0;
}

/* ─────────────────────────────────────────────────
   D. CTA GROUP
   Inherit vertical stacking + fade-in from product-card.css.
   Keep only is-added state for best-seller context.
   ───────────────────────────────────────────────── */

.best-seller__grid .product-card__atc.is-added,
.hp-carousel__track .product-card__atc.is-added {
	background-color: var(--color-secondary);
	border-color: var(--color-secondary);
	color: #fff;
}

/* ─────────────────────────────────────────────────
   E. GRID GAPS
   ───────────────────────────────────────────────── */

/* Carousel: 16px gap, exactly 4 cards per viewport. */
.hp-carousel__track {
	gap: 16px;
}

.hp-carousel__track>* {
	/* (container - 4 gaps) / 5 slots = each card width */
	width: calc((100% - 4 * 16px) / 5);
	min-width: 130px;
	max-width: none;
	flex-shrink: 0;
}

/* ── Author & Publisher: smaller circular portrait cards ── */
.hp-carousel__track > .author-card,
.hp-carousel__track > .publisher-card {
	width: calc((100% - 6 * 16px) / 7); /* ~7 circles per viewport on desktop */
	min-width: 96px;
	max-width: 136px;
}

/* ─────────────────────────────────────────────────
   F. SECTION BACKGROUND
   ───────────────────────────────────────────────── */

.best-seller-section {
	background: #F7F7F7;
}

/* ─────────────────────────────────────────────────
   G. RESPONSIVE (matching existing theme breakpoints)
   ───────────────────────────────────────────────── */

/* ── Tablet: 1025px → 1024px ── */
@media (max-width: 1024px) {

	/* hp-carousel: show 3 cards per viewport */
	.hp-carousel__track {
		gap: 14px;
	}

	.hp-carousel__track > * {
		width: calc((100% - 2 * 14px) / 3);
		min-width: 120px;
	}

	/* Author & Publisher: 5 circles per viewport on tablet */
	.hp-carousel__track > .author-card,
	.hp-carousel__track > .publisher-card {
		width: calc((100% - 4 * 14px) / 5);
		min-width: 80px;
		max-width: 110px;
	}

	/* Best Seller: keep horizontal scroll, show 3 columns */
	.best-seller__grid {
		grid-template-columns: unset;       /* clear any static column count */
		grid-auto-flow: column;             /* maintain horizontal scroll layout */
		grid-auto-columns: calc((100% - 2 * 16px) / 3);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		scroll-padding-left: 0;
		padding-bottom: var(--space-2);
	}
	.best-seller__grid::-webkit-scrollbar {
		display: none;
	}
	.best-seller__grid > * {
		scroll-snap-align: start;
	}

	.best-seller__grid .product-card__body,
	.hp-carousel__track .product-card__body {
		padding: 12px 14px 10px;
	}
}

/* ── Mobile: < 720px ── */
@media (max-width: 767px) {

	.best-seller__title,
	.hp-carousel__title {
		font-size: clamp(1.125rem, 4vw, 1.25rem);
	}

	.best-seller__grid .product-card__body,
	.hp-carousel__track .product-card__body {
		padding: 8px 8px 6px;
	}

	.best-seller__grid .product-card__title,
	.hp-carousel__track .product-card__title {
		font-size: 0.9375rem; /* increased from 0.75rem for readability */
		margin-bottom: 2px;
		-webkit-line-clamp: 2;
	}

	.best-seller__grid .product-card__author,
	.hp-carousel__track .product-card__author {
		font-size: 0.6875rem;
		margin-bottom: 4px;
	}

	.best-seller__grid .product-card__price,
	.hp-carousel__track .product-card__price {
		font-size: 0.6875rem;
		margin-bottom: 0;
	}

	/* Mobile: hide CTA buttons — card width (115px) is too narrow.
	   User taps the card link to reach the product page. */
	.best-seller__grid .product-card__cta-group,
	.hp-carousel__track .product-card__cta-group {
		display: none;
	}

	/* hp-carousel: show 2 cards per viewport */
	.hp-carousel__track {
		gap: 12px;
	}

	.hp-carousel__track > * {
		width: calc((100% - 12px) / 2);
		min-width: 120px;
	}

	/* Author & Publisher: 4 circles per viewport on mobile */
	.hp-carousel__track > .author-card,
	.hp-carousel__track > .publisher-card {
		width: calc((100% - 3 * 12px) / 4);
		min-width: 70px;
		max-width: 100px;
	}

	/* Best Seller: keep horizontal scroll, 2 columns visible */
	.best-seller__grid {
		gap: 12px;
		grid-template-columns: unset;       /* prevent static wrap */
		grid-auto-flow: column;             /* maintain horizontal scroll */
		grid-auto-columns: calc((100% - 12px) / 2);
	}
}

/* ── Extra small: ≤ 480px (fine-tune for very small phones) ── */
@media (max-width: 480px) {
	.best-seller__header {
		margin-bottom: 12px;
	}

	/* hp-carousel: 1.5 cards visible (peek pattern) */
	.hp-carousel__track {
		gap: 10px;
	}

	.hp-carousel__track > * {
		width: calc((100% - 10px) / 1.5);
		min-width: 110px;
	}

	/* Author & Publisher: 3 circles per viewport on small phones */
	.hp-carousel__track > .author-card,
	.hp-carousel__track > .publisher-card {
		width: calc((100% - 2 * 10px) / 3);
		min-width: 64px;
		max-width: 90px;
	}

	/* Best Seller: keep horizontal scroll at 2-col, tighter gap */
	.best-seller__grid {
		gap: 8px;
		grid-template-columns: unset;
		grid-auto-flow: column;
		grid-auto-columns: calc((100% - 8px) / 2);
	}
}