/**
 * Shared Carousel Item Styles
 *
 * Book-style and row-style item cards + grid layout.
 * Used by Content Carousel and Featured Carousel blocks.
 */

/* ==========================================================================
   Book Card
   ========================================================================== */

.carousel-item-book {
	width: 100%;
	height: 100%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.carousel-item-book__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* Reset button styles when free card uses <button> instead of <a> */
button.carousel-item-book__link {
	width: 100%;
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.carousel-item-book__image {
	box-sizing: border-box;
	position: relative;
	width: 100%;
	aspect-ratio: 2 / 3;
	overflow: hidden;
	margin-bottom: 0.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.carousel-item-book__image img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.carousel-item-book__placeholder {
	display: block;
	width: 70%;
	height: 85%;
	background: var(--color-gray-mid);
}

.carousel-item-book__content {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 0.125rem;
}

.carousel-item-book__series {
	color: var(--color-gray-dark);
	margin-bottom: 0.125rem;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Title — inherits from .kd-card-title */

.carousel-item-book__title a {
	color: inherit;
	text-decoration: none;
}

/* Creators — inherits from .kd-card-creator */

.carousel-item-book__cta-wrap {
	margin-top: auto;
	padding-top: 0.5rem;
}

.carousel-item-book__actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: auto;
	padding-top: 0.5rem;
	max-width: 100%;
}

.carousel-item-book__actions .button--buy {
	width: 100%;
	font-size: 0.6875rem;
	padding: 0.5rem 0.25rem;
	box-sizing: border-box;
}


/* ==========================================================================
   Grid Layout (used by compact_grid style)
   ========================================================================== */

.content-carousel__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem 2.5rem;
}

/* Tablet — 2 columns */
@media (max-width: 1024px) {
	.content-carousel__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1.5rem 2rem;
	}
}

/* Mobile — 1 column */
@media (max-width: 768px) {
	.content-carousel__grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
}


/* ==========================================================================
   Row Card
   ========================================================================== */

.carousel-item-row {
	min-width: 0;
}

.carousel-item-row__link {
	display: flex;
	gap: 1rem;
	text-decoration: none;
	color: inherit;
}

.carousel-item-row__image {
	flex-shrink: 0;
	width: 80px;
	aspect-ratio: 2 / 3;
	overflow: hidden;
}

.carousel-item-row__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.carousel-item-row__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--color-gray-mid);
}

.carousel-item-row__content {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.carousel-item-row__series {
	color: var(--color-gray-dark);
}

.carousel-item-row__title {
	font-family: "Maax Bold";
	font-weight: 400;
	font-size: 1rem;
	line-height: 1.2;
	margin: 0.125rem 0 0;
	color: var(--color-black);
}

.carousel-item-row__creators {
	font-size: 0.875rem;
	color: var(--color-gray-dark);
	margin: 0.125rem 0 0;
	line-height: 1.4;
}

.carousel-item-row__cta {
	margin-top: 0.75rem;
}

@media (max-width: 768px) {
	.carousel-item-row__image {
		width: 70px;
	}
}
