/* Book cards and covers. Covers keep their real proportions, bottom-aligned on a fixed-height shelf. */

.cover {
	display: block;
	border-radius: var(--cover-radius);
	box-shadow: var(--cover-shadow);
}

img.cover {
	width: auto;
	height: auto;
}

.cover--placeholder {
	width: 62%;
	aspect-ratio: 2 / 3;
	background: var(--ph-bg);
	color: var(--ph-fg);
	border-radius: 3px 7px 7px 3px;
	padding: 12px 10px;
	display: flex;
	flex-direction: column;
}

.cover__ph-title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
}

.cover__ph-author {
	margin-top: auto;
	font-size: 8px;
	font-weight: 600;
	text-transform: uppercase;
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius-card);
	padding: 12px;
	color: var(--text);
	transition: translate 0.35s var(--ease-out);
}

.card:hover {
	translate: 0 -6px;
}

.card__shelf {
	border-radius: 16px;
	padding: 28px 18px;
	height: 280px;
	display: flex;
	justify-content: center;
	align-items: flex-end;
	background: var(--surface);
}

.card__cover {
	max-width: 82%;
	max-height: 100%;
	transition: translate 0.45s var(--ease-out), rotate 0.45s var(--ease-out), scale 0.45s var(--ease-out);
}

.card:hover .card__cover {
	translate: 0 -8px;
	rotate: -3deg;
	scale: 1.06;
}

.card--landed img.card__cover {
	box-shadow: 0 0 50px var(--glow, rgba(43, 214, 123, 0.25)), var(--cover-shadow);
}

.card__title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	margin: 14px 6px 2px;
}

/* The title link covers the whole card. */
.card__link {
	color: inherit;
	text-decoration: none;
}

.card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.card__link:hover {
	color: inherit;
}

.card__link:focus-visible {
	outline: 0;
}

.card:has(.card__link:focus-visible) {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.card__author {
	font-size: 13.5px;
	color: var(--muted);
	margin: 0 6px 14px;
}

.card__to-order {
	margin: -8px 6px 12px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--gold);
}

.card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: auto 6px 4px;
}

.card__price {
	font-size: 18px;
	font-weight: 700;
}

.card__price del {
	color: var(--muted);
	font-weight: 500;
	font-size: 14px;
	margin-right: 6px;
}

.card__price ins {
	text-decoration: none;
}

.card__add {
	position: relative;
	z-index: 1;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-pill);
	background: var(--accent);
	color: var(--accent-ink);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	text-decoration: none;
	flex: none;
}

.card__add:hover {
	background: var(--accent-hover);
	color: var(--accent-ink);
}

.card__add.loading {
	opacity: 0.6;
}

.card__add.added::after {
	content: "✓";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--accent);
	border-radius: inherit;
	font-size: 18px;
}

/* WooCommerce adds a "View basket" link after an AJAX add; the header count does that job. */
.card .added_to_cart {
	display: none;
}

/* Shelf variant (Browse carousel, related books). */
.card--shelf {
	border-radius: 22px;
}

.card--shelf .card__shelf {
	border-radius: 14px;
	padding: 24px 18px;
	height: 250px;
	background: var(--bg);
}

.card--shelf .card__title {
	font-size: 15px;
}

.card--shelf .card__author {
	font-size: 13px;
	margin-bottom: 12px;
}

.card--shelf .card__price {
	font-size: 17px;
}

/* Related-books variant (product page): like the shelf card, on the lighter surface. */
.card--related .card__shelf {
	padding: 24px 18px;
	height: 250px;
}

.card--related .card__cover {
	max-width: 80%;
}

.card--related .card__title {
	font-size: 15px;
}

.card--related .card__author {
	font-size: 13px;
	margin-bottom: 12px;
}

.card--related .card__price {
	font-size: 17px;
}

@media (max-width: 760px) {
	.card__shelf,
	.card--shelf .card__shelf {
		height: 210px;
		padding: 20px 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.card,
	.card__cover {
		transition: none;
	}
}
