/* Deliberately minimal: inherits the Astra theme's type and colours. */

.bbdt-search {
	margin: 0 0 2em;
}

.bbdt-lead {
	font-weight: 600;
	margin-bottom: .75em;
}

/* Four equal panels. Grid rather than flex so every column is the same width,
   and align-items:end so the controls share a baseline even if a label wraps. */
.bbdt-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 1em 1.25em;
	align-items: end;
}

.bbdt-field {
	display: flex;
	flex-direction: column;
	gap: .3em;
	font-size: .95em;
	min-width: 0; /* let grid children shrink instead of overflowing */
}

/* Fixed label height keeps the controls level when one label wraps to two
   lines at narrow widths. */
.bbdt-label {
	color: #666;
	line-height: 1.3;
	min-height: 2.6em;
	display: flex;
	align-items: flex-end;
}

.bbdt-field select,
.bbdt-field input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	/* Selects and text inputs are styled differently by most themes; pin the
	   box so the four panels are genuinely the same height. */
	height: 2.6em;
	line-height: normal;
}

.bbdt-actions {
	margin-top: 1.25em;
}

.bbdt-count {
	margin: 1.5em 0 .75em;
	color: #666;
}

.bbdt-error,
.bbdt-empty {
	padding: .85em 1.1em;
	border-radius: 4px;
	background: #fff8e5;
	border: 1px solid #f0d9a0;
}

.bbdt-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 1.75em 1.25em;
}

.bbdt-card {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: .4em;
}

.bbdt-card-link {
	display: flex;
	flex-direction: column;
	gap: .5em;
	text-decoration: none;
}

/* Jackets are hotlinked from Batch and vary in aspect ratio, so give them a
   consistent box and let the image sit inside it rather than stretching. */
.bbdt-thumb {
	display: block;
	background: #f0efec;
	border-radius: 3px;
	overflow: hidden;
	aspect-ratio: 2 / 3;
}

.bbdt-thumb img,
.bbdt-jacket {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
}

.bbdt-name {
	font-size: .92em;
	line-height: 1.35;
}

.bbdt-price {
	font-size: .88em;
	color: #666;
}

/* The three detected colours, most prominent first. */
.bbdt-shades {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: .15em;
}

.bbdt-shade {
	display: flex;
	align-items: center;
	gap: .4em;
	margin: 0;
	font-size: .78em;
	line-height: 1.5;
	color: #6b6b6b;
}

.bbdt-chip {
	width: 12px;
	height: 12px;
	flex: none;
	border-radius: 2px;
	border: 1px solid rgba(0, 0, 0, .18);
}

.bbdt-shade-pct {
	margin-left: auto;
	font-variant-numeric: tabular-nums;
}

/* The shade that caused this book to match the chosen colour. */
.bbdt-shade-hit {
	color: #1a1a1a;
	font-weight: 600;
}

.bbdt-shade-hit .bbdt-chip {
	outline: 2px solid #1a1a1a;
	outline-offset: 1px;
}
