/* ============================================================
   Studio Visuali — Book Cards  |  visuali-book-cards.css  |  v1.0.0
   ============================================================ */

.vbc-root {
	--vbc-gap: 24px;
	--vbc-cols: 4;
	--vbc-item-bg: #ffffff;
	--vbc-item-radius: 10px;
	--vbc-btn-bg: #f3f4f6;
	--vbc-btn-color: #111827;
	--vbc-btn-bg-hover: #e5e7eb;
	--vbc-search-bg: #ffffff;
	--vbc-search-color: #111827;
	--vbc-search-border: #d1d5db;

	display: flex;
	flex-direction: column;
	gap: var(--vbc-gap);
}

.vbc-grid {
	display: grid;
	grid-template-columns: repeat(var(--vbc-cols), 1fr);
	gap: var(--vbc-gap);
}

.vbc-item {
	display: flex;
	flex-direction: column;
	background: var(--vbc-item-bg);
	border: 1px solid #e5e7eb;
	border-radius: var(--vbc-item-radius);
	overflow: hidden;
}

.vbc-item.vbc-hidden,
.vbc-item.vbc-search-hidden,
.vbc-item.vbc-lang-hidden {
	display: none;
}

.vbc-cover {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	background: #ffffff;
	overflow: hidden;
}

.vbc-cover img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	display: block;
}

.vbc-cover--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #c1c7cd;
	font-size: 40px;
}

.vbc-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px;
	flex: 1 1 auto;
}

.vbc-title {
	font-size: 17px;
	font-weight: 700;
	color: #111827;
	line-height: 1.35;
}

.vbc-desc {
	font-size: 14px;
	color: #4b5563;
	line-height: 1.5;
}

.vbc-note {
	font-size: 12px;
	color: #9ca3af;
	line-height: 1.5;
	margin-top: 4px;
}

.vbc-note a {
	color: inherit;
	text-decoration: underline;
}

/* .vbc-root prefix + !important: a host-theme link reset can otherwise
   outrank a plain .vbc-btn selector — same reasoning as the sibling
   visuali-download-attachments plugin's .vda-action rule. */
.vbc-root a.vbc-btn {
	display: block;
	margin: 0 16px 16px;
	padding: 10px 16px;
	background: var(--vbc-btn-bg) !important;
	color: var(--vbc-btn-color) !important;
	text-align: center;
	text-decoration: none !important;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	transition: background-color 0.15s ease;
}

.vbc-root a.vbc-btn:hover {
	background: var(--vbc-btn-bg-hover) !important;
	color: var(--vbc-btn-color) !important;
}

/* No button on this item — let .vbc-body's own bottom padding stand in for
   the button's margin so the card doesn't end abruptly. */
.vbc-item:not(:has(.vbc-btn)) .vbc-body {
	padding-bottom: 16px;
}

.vbc-filters {
	display: grid;
	grid-template-columns: 30% 1fr;
	gap: 8px;
}

@media (max-width: 480px) {
	.vbc-filters {
		grid-template-columns: 1fr;
	}
}

.vbc-root input.vbc-search,
.vbc-root select.vbc-lang-filter {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	background: var(--vbc-search-bg) !important;
	color: var(--vbc-search-color) !important;
	border: 1px solid var(--vbc-search-border) !important;
	border-radius: 8px !important;
	padding: 9px 14px;
	font-size: 14px;
}

.vbc-root input.vbc-search {
	appearance: none;
	-webkit-appearance: none;
}

.vbc-root button.vbc-loadmore {
	display: block;
	width: fit-content;
	margin: 4px auto 0;
	background: var(--vbc-btn-bg) !important;
	color: var(--vbc-btn-color) !important;
	border: none !important;
	padding: 10px 28px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.vbc-root button.vbc-loadmore:hover {
	background: var(--vbc-btn-bg-hover) !important;
}

.vbc-placeholder,
.vbc-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 32px 20px;
	border: 1px dashed #d1d5db;
	border-radius: 10px;
	color: #6b7280;
	font-size: 14px;
	text-align: center;
}

.vbc-placeholder i {
	font-size: 26px;
	color: #9ca3af;
}

@media (max-width: 900px) {
	.vbc-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 640px) {
	.vbc-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 400px) {
	.vbc-grid {
		grid-template-columns: 1fr;
	}
}
