/*
 * KyiKyiHouse book carousel (front-page Bookcase).
 *
 * A scroll-snap track that works without JavaScript; the script adds
 * previous/next arrows that disable themselves at either end.
 */

.kkh-bkc-track {
	display: flex;
	gap: var(--wp--preset--spacing--30);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.25rem;
}

.kkh-bkc-track::-webkit-scrollbar {
	display: none;
}

.kkh-bkc-card {
	flex: 0 0 calc((100% - 2 * var(--wp--preset--spacing--30)) / 3);
	scroll-snap-align: start;
}

.kkh-bkc-cover {
	display: block;
	border-radius: var(--wp--preset--border-radius--sm);
}

.kkh-bkc-cover img {
	aspect-ratio: 2 / 3;
	object-fit: cover;
	box-shadow: 0 8px 20px rgba(43, 33, 25, 0.14);
}

.kkh-bkc-excerpt {
	margin: 0;
	color: var(--wp--preset--color--muted);
}

/* The carousel builds the facts row itself, so it carries the flex
   layout the archive gets from its container. */
.kkh-bkc-card .kkh-book-facts {
	display: flex;
	flex-wrap: wrap;
}

/* Arrows sit below the track, right-aligned. */
.kkh-bkc-controls {
	display: flex;
	gap: 0.5rem;
	justify-content: flex-end;
	margin-top: 0.75rem;
}

.kkh-bkc-arrow {
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
}

.kkh-bkc-arrow:hover:not(:disabled),
.kkh-bkc-arrow:focus-visible {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
}

.kkh-bkc-arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

@media (max-width: 781px) {
	.kkh-bkc-card {
		flex-basis: calc((100% - var(--wp--preset--spacing--30)) / 2);
	}
}

@media (max-width: 480px) {
	.kkh-bkc-card {
		flex-basis: 72%;
	}
}