/*
 * SECTION:  Book card and shelf (shared by home shelves, deals, shop grid, product page)
 * File:     assets/css/sections/sol-book-card.css
 * Used by:  [sol_books], [sol_book_tabs], [sol_deals], the shop grid and the product page. Many sections use this file.
 * To remove: delete this file and its line in inc/assets.php (handle "sol-book-card").
 */
/* Delete only if you remove every section that shows book cards. */

/* Phone: a shelf is a row you swipe sideways. Tablet and up: a grid. */
.sol-shelf {
	display: flex;
	gap: 14px;
	padding: 0 var(--sol-gutter) 8px;
	margin-inline: calc(var(--sol-gutter) * -1);
	overflow-x: auto;
	scroll-snap-type: x proximity;
}

.sol-shelf .sol-card {
	flex: 0 0 148px;
	scroll-snap-align: start;
}

@media (min-width: 700px) {
	.sol-shelf {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px 18px;
		padding: 0;
		margin: 0;
		overflow: visible;
	}

	.sol-shelf .sol-card {
		flex: none;
	}

	.sol-shelf--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.sol-shelf {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1100px) {
	.sol-shelf {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.sol-shelf--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.sol-card {
	display: block;
	min-width: 0;
	text-decoration: none;
	color: var(--sol-text);
}

.sol-card__cover {
	display: block;
}

.sol-card__cover img,
.sol-cover {
	display: block;
	width: 100%;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	border-radius: 4px 8px 8px 4px;
	box-shadow: inset 5px 0 0 rgba(0, 0, 0, 0.15), 0 12px 26px -12px var(--sol-shadow);
	transition: transform var(--sol-normal) var(--sol-ease);
}

.sol-card:hover .sol-card__cover > * {
	transform: translateY(-4px);
}

.sol-card__title {
	margin: 12px 0 2px;
	color: var(--sol-text);
	font: 600 0.875rem/1.3 var(--sol-font-sans);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sol-card__author,
.sol-card__seller {
	display: block;
	font-size: 0.8125rem;
	color: var(--sol-muted);
}

.sol-card__price {
	display: block;
	margin-top: 4px;
	font-weight: 700;
}

.sol-card__price del {
	font-weight: 400;
	font-size: 0.75rem;
	color: var(--sol-muted);
}

.sol-card__price ins {
	text-decoration: none;
}

/* Generated cover, used when a book has no image yet. */
.sol-cover {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 12% 10%;
	overflow: hidden;
}

.sol-cover b {
	font: 600 clamp(0.75rem, 1.4vw, 1.1rem)/1.1 var(--sol-font-serif);
}

.sol-cover span {
	font-size: 0.625rem;
	opacity: 0.85;
}

.sol-cover--1 { background: #efe7d6; color: #b3261e; }
.sol-cover--2 { background: #14284b; color: #f3d27a; }
.sol-cover--3 { background: #c7691a; color: #2a1406; }
.sol-cover--4 { background: #4a3a28; color: #e2c58a; }
.sol-cover--5 { background: #1f4d3a; color: #e8d9a0; }
.sol-cover--6 { background: #7b1e1e; color: #f3d27a; }
