/*
 * GDV Ebooks: the [gdv_ebooks] grid. The cards are gdv-public-ui's teaser and
 * its notice; what is drawn here is the price line, the place of the owner's
 * notice inside a card, the filter bar and the line shown when nothing matches.
 */

/* Three classes' weight, over the teaser grid's and card's two, so what the
   filter hides stays hidden whatever the theme does with [hidden]. */
.gdv-ebooks-grid .gdv-ebooks-card[hidden],
.gdv-ebooks-grid .gdv-ui-teaser-grid[hidden],
.gdv-ebooks-grid .gdv-ebooks-none[hidden],
.gdv-ebooks-grid .gdv-ebooks-search[hidden] {
	display: none;
}

/* ===== The card ===== */

/* The price, as the buy button writes it; a price is never bold. */
.gdv-ebooks-grid .gdv-ebooks-card__price {
	margin: 0;
	padding: 0.5rem;
	text-align: center;
	font-size: 1.125rem;
	font-weight: 400;
	line-height: 1.4;
	color: var(--gdv-ui-text, #444444);
}

/* The pages after the price: read, but quieter than the price itself. */
.gdv-ebooks-grid .gdv-ebooks-card__facts {
	font-size: 1rem;
}

/* Each file with its format on a line of its own. */
.gdv-ebooks-grid .gdv-ebooks-card__files > span {
	display: block;
}

/* The card's own button and, for an administrator, "Edit" beside it,
   wrapping under it on a narrow card. */
.gdv-ebooks-grid .gdv-ebooks-card .gdv-ui-teaser__actions {
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* "You bought this ebook.": held in from the card's edges like the slots
   around it. */
.gdv-ebooks-grid .gdv-ebooks-card__owned.gdv-ebooks-card__owned {
	margin: 0.5rem;
}

/* ===== Filter bar ===== */

/*
 * The search bar on [gdv_brands]: the box takes the row, the category select
 * and the button stay as wide as their content and move under it on a phone.
 * The box and the select are drawn by gdv-public-ui's form field base. The
 * 6px at the top is room for the field's focus ring.
 */
.gdv-ebooks-grid .gdv-ebooks-search {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px;
	padding-top: 6px;
}

.gdv-ebooks-search .gdv-ebooks-search__input {
	flex: 1 1 12rem;
	min-width: 0;
}

.gdv-ebooks-search .gdv-ebooks-search__category {
	flex: none;
	max-width: 16rem;
}

/* ===== Nothing matches ===== */

.gdv-ebooks-grid .gdv-ebooks-none {
	margin: 0 0 16px;
	color: var(--gdv-ui-text, #444444);
}

.gdv-ebooks-none .gdv-ebooks-none__text {
	margin: 0 0 12px;
}
