/* ==========================================================================
   IMH BOOK LIST — .imh-book-list (ACF: IMH Book List)
   ========================================================================== */

.imh-book-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

.imh-book-list--cols-2 {
	--imh-book-list-max-cols: 2;
}
.imh-book-list--cols-3 {
	--imh-book-list-max-cols: 3;
}
.imh-book-list--cols-4 {
	--imh-book-list-max-cols: 4;
}

@media (min-width: 640px) {
	.imh-book-list--cols-2,
	.imh-book-list--cols-3,
	.imh-book-list--cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.imh-book-list--cols-3 {
		grid-template-columns: repeat(3, 1fr);
	}
	.imh-book-list--cols-4 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1280px) {
	.imh-book-list--cols-4 {
		grid-template-columns: repeat(4, 1fr);
	}
}

.imh-book-list__item {
	display: flex;
	flex-direction: column;
	gap: 16px;
	background-color: var(--wp--preset--color--surface-white);
	border: 1px solid var(--wp--preset--color--surface-parchment);
	border-radius: var(--imh-radius-xl);
	padding: 24px;
	box-shadow: var(--wp--preset--shadow--subtle);
	transition: border-color 220ms ease-out;
}

.imh-book-list__item:hover {
	border-color: var(--wp--preset--color--sage-300);
}

.imh-book-list--horizontal .imh-book-list__item {
	flex-direction: row;
	gap: 20px;
}

.imh-book-list__media {
	flex-shrink: 0;
	width: 80px;
	height: 96px;
	border-radius: var(--imh-radius-md);
	background-color: var(--wp--preset--color--sage-100);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.imh-book-list--horizontal .imh-book-list__media {
	width: 80px;
	height: 130px;
}

.imh-book-list:not(.imh-book-list--horizontal) .imh-book-list__media {
	width: 100%;
	height: 140px;
}

.imh-book-list__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
	box-shadow: none;
}

.imh-book-list__media-placeholder {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--3xl);
	color: var(--wp--preset--color--sage-300);
	line-height: 1;
}

.imh-book-list__body {
	flex: 1;
	min-width: 0;
}

.imh-book-list__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--lg);
	color: var(--wp--preset--color--warm-800);
	line-height: 1.25;
	margin: 0 0 2px;
}

.imh-book-list__author {
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--sage-600);
	font-weight: 500;
	margin: 0 0 4px;
}

.imh-book-list__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.imh-book-list__badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: var(--imh-radius-full);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 500;
}

.imh-book-list__badge--amber {
	background-color: var(--wp--preset--color--amber-100);
	color: var(--wp--preset--color--amber-700);
}

.imh-book-list__badge--primary {
	background-color: var(--wp--preset--color--primary-100);
	color: var(--wp--preset--color--primary-700);
}

.imh-book-list__description {
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--warm-700);
	line-height: 1.625;
	margin: 0;
	max-width: none;
}

.imh-book-list__description-toggle {
	margin: 0;
	padding: 0;
	background: none;
	border: none;
	font: inherit;
	color: var(--wp--preset--color--sage-600);
	text-decoration: underline;
	cursor: pointer;
}

.imh-book-list__description-toggle:hover,
.imh-book-list__description-toggle:focus-visible {
	color: var(--wp--preset--color--primary-700);
}

.imh-book-list__load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.imh-book-list__load-more {
	display: inline-flex;
	align-items: center;
	padding: 10px 28px;
	border-radius: var(--imh-radius-full);
	border: 1px solid var(--wp--preset--color--sage-300);
	background-color: var(--wp--preset--color--surface-white);
	color: var(--wp--preset--color--primary-700);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	cursor: pointer;
	transition: background-color 200ms ease-out, border-color 200ms ease-out;
}

.imh-book-list__load-more:hover,
.imh-book-list__load-more:focus-visible {
	background-color: var(--wp--preset--color--sage-100);
	border-color: var(--wp--preset--color--sage-400);
}

.imh-book-list__load-more[aria-busy="true"] {
	opacity: 0.6;
	cursor: default;
}

.imh-book-list__notes {
	font-size: var(--wp--preset--font-size--xs);
	color: var(--wp--preset--color--warm-500);
	font-style: italic;
	margin: 8px 0 0;
	max-width: none;
	border-left: 2px solid var(--wp--preset--color--surface-parchment);
	padding-left: 8px;
}

.imh-book-list__placeholder {
	color: var(--wp--preset--color--warm-500);
}
