/**
 * Biblivanta – styles
 * Override in your style's CSS, e.g.  :root { --bv-akzent: #2f6f8f; }
 *
 * @author Maggan22
 */
:root {
	--bv-akzent: #8b5e34;
	--bv-akzent-text: #ffffff;
	--bv-rand: rgba(127, 127, 127, 0.28);
	--bv-flaeche: rgba(127, 127, 127, 0.07);
	--bv-flaeche-stark: rgba(127, 127, 127, 0.14);
	--bv-stern: #e0a526;
	--bv-stern-leer: rgba(127, 127, 127, 0.35);
	--bv-ok: #2e7d4f;
	--bv-warn: #b5651d;
	--bv-fehler: #b3261e;
	--bv-radius: 8px;
	--bv-cover-breite: 128px;
}

.bv-page { margin-bottom: 1.5em; }
.bv-page h2.bv-title { margin: 0.2em 0 0.4em; font-size: 1.8em; }
.bv-page h3 { border-bottom-color: var(--bv-rand); margin-top: 1.2em; }
.bv-page .bv-muted { opacity: 0.72; }
.bv-page .bv-small { font-size: 0.9em; }
.bv-hidden { display: none; }

/* ---------- Tabs ---------- */
.bv-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 0 0 6px; border-bottom: 2px solid var(--bv-rand); list-style: none; }
.bv-tabs li { margin: 0; }
.bv-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--bv-radius) var(--bv-radius) 0 0; text-decoration: none; font-weight: 600; }
.bv-tabs a:hover { background: var(--bv-flaeche-stark); text-decoration: none; }
.bv-tabs a.bv-active { background: var(--bv-akzent); color: var(--bv-akzent-text); }
.bv-badge { display: inline-block; min-width: 1.5em; padding: 0 5px; border-radius: 1em; background: var(--bv-fehler); color: #fff; font-size: 0.8em; line-height: 1.5em; text-align: center; font-weight: bold; }
.bv-notice { padding: 8px 12px; border-left: 4px solid var(--bv-warn); background: var(--bv-flaeche); margin-bottom: 12px; border-radius: 0 var(--bv-radius) var(--bv-radius) 0; }
.bv-notice.bv-ok { border-left-color: var(--bv-ok); }
.bv-notice.bv-error { border-left-color: var(--bv-fehler); }

/* ---------- Buttons ---------- */
.bv-btn, a.bv-btn, input.bv-btn, button.bv-btn {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--bv-radius);
	border: 1px solid var(--bv-akzent); background: var(--bv-akzent); color: var(--bv-akzent-text) !important;
	font-weight: 600; font-size: 1em; cursor: pointer; text-decoration: none !important; line-height: 1.4; font-family: inherit;
}
.bv-btn:hover { filter: brightness(1.08); }
.bv-btn.bv-btn-light, a.bv-btn.bv-btn-light, input.bv-btn.bv-btn-light, button.bv-btn.bv-btn-light { background: transparent; color: var(--bv-akzent) !important; }
.bv-btn.bv-btn-light:hover { background: var(--bv-flaeche-stark); }
.bv-btn.bv-btn-danger, button.bv-btn.bv-btn-danger { background: transparent; border-color: var(--bv-fehler); color: var(--bv-fehler) !important; }
.bv-btn.bv-btn-small, button.bv-btn.bv-btn-small, input.bv-btn.bv-btn-small { padding: 3px 9px; font-size: 0.92em; }
.bv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }

/* ---------- Toolbar (search, filter) ---------- */
.bv-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.bv-toolbar .inputbox { width: auto; flex: 1 1 220px; max-width: 420px; }
.bv-toolbar select { max-width: 260px; }
.bv-toolbar .bv-count { margin-left: auto; opacity: 0.72; }

/* ---------- Stats ---------- */
.bv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.bv-stat { background: var(--bv-flaeche); border: 1px solid var(--bv-rand); border-radius: var(--bv-radius); padding: 10px 12px; text-align: center; }
.bv-stat strong { display: block; font-size: 1.8em; line-height: 1.2; color: var(--bv-akzent); }

/* ---------- Book grid ---------- */
.bv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--bv-cover-breite), 1fr)); gap: 18px 14px; margin: 8px 0 16px; }
.bv-card { position: relative; min-width: 0; }
.bv-card a.bv-card-link { text-decoration: none; color: inherit; display: block; }
.bv-card a.bv-card-link:hover .bv-cover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22); }
.bv-card-title { font-weight: 700; margin-top: 6px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bv-card-meta { font-size: 0.9em; opacity: 0.8; line-height: 1.3; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.bv-card-meta a { color: inherit; }
.bv-card-tag { position: absolute; top: 6px; left: 6px; z-index: 1; font-size: 0.75em; font-weight: 700; padding: 1px 7px; border-radius: 1em; background: rgba(0, 0, 0, 0.65); color: #fff; }
.bv-card-tag.bv-tag-lend { background: var(--bv-ok); }
.bv-card-tag.bv-tag-wanted { background: var(--bv-warn); }

/* ---------- Cover ---------- */
.bv-cover { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 4px 8px 8px 4px; overflow: hidden; background: var(--bv-flaeche-stark); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); transition: transform 0.15s, box-shadow 0.15s; }
.bv-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bv-cover-blank { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 10px; box-sizing: border-box; text-align: center;
	background: linear-gradient(135deg, var(--bv-akzent), rgba(0, 0, 0, 0.55)); background-color: var(--bv-akzent); color: #fff; }
.bv-cover-blank::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.25); }
.bv-cover-blank .bv-initial { font-size: 2.6em; font-weight: 700; font-family: Georgia, serif; line-height: 1; }
.bv-cover-blank .bv-cover-text { font-size: 0.85em; margin-top: 8px; line-height: 1.2; max-height: 3.6em; overflow: hidden; opacity: 0.92; }
.bv-cover-small { width: 54px; flex: 0 0 54px; }
.bv-cover-small .bv-initial { font-size: 1.4em; }
.bv-cover-small .bv-cover-text { display: none; }

/* ---------- Stars ---------- */
.bv-stars { position: relative; display: inline-block; font-size: 1.05em; line-height: 1; letter-spacing: 1px; color: var(--bv-stern-leer); white-space: nowrap; vertical-align: -1px; }
.bv-stars::before { content: '★★★★★'; }
.bv-stars > span { position: absolute; top: 0; left: 0; overflow: hidden; color: var(--bv-stern); white-space: nowrap; }
.bv-stars > span::before { content: '★★★★★'; }
.bv-rating-value { font-weight: 700; margin-left: 4px; }

/* Star input */
.bv-star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; border: 0; padding: 0; margin: 0; }
.bv-star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bv-star-input label { font-size: 1.9em; line-height: 1; color: var(--bv-stern-leer); cursor: pointer; padding: 0 1px; }
.bv-star-input label:hover, .bv-star-input label:hover ~ label, .bv-star-input input:checked ~ label { color: var(--bv-stern); }
.bv-star-input input:focus-visible + label { outline: 2px solid var(--bv-akzent); border-radius: 3px; }

/* ---------- Progress ---------- */
.bv-progress { height: 8px; border-radius: 4px; background: var(--bv-flaeche-stark); overflow: hidden; margin-top: 5px; }
.bv-progress > span { display: block; height: 100%; background: var(--bv-akzent); border-radius: 4px; }
.bv-progress-row { display: flex; align-items: center; gap: 8px; }
.bv-progress-row .bv-progress { flex: 1; margin: 0; }

/* ---------- Book detail ---------- */
.bv-book { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.bv-book-cover .bv-cover { width: 200px; }
.bv-book h2 { margin-top: 0; font-size: 1.9em; line-height: 1.2; }
.bv-book-authors { font-size: 1.2em; margin-bottom: 6px; }
.bv-book-series { margin-bottom: 8px; }
.bv-book-rating { margin: 8px 0; }
.bv-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 12px 0; }
.bv-facts dt { font-weight: 700; opacity: 0.8; }
.bv-facts dd { margin: 0; }
.bv-description { line-height: 1.55; margin: 14px 0; max-width: 60em; }
.bv-shelf-state { display: inline-block; padding: 4px 10px; border-radius: var(--bv-radius); background: var(--bv-flaeche-stark); }

/* ---------- Lists / rows ---------- */
.bv-list { list-style: none; margin: 0; padding: 0; }
.bv-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--bv-rand); }
.bv-row:last-child { border-bottom: 0; }
.bv-row-main { flex: 1; min-width: 0; }
.bv-row-side { flex: 0 0 auto; text-align: right; }
.bv-row h4 { margin: 0 0 2px; font-size: 1.1em; }
.bv-row form { margin: 6px 0 0; }
.bv-inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bv-inline-form .inputbox { width: auto; }
.bv-inline-form input[type="number"] { width: 5em; }
.bv-pill { display: inline-block; padding: 1px 8px; border-radius: 1em; font-size: 0.85em; font-weight: 600; background: var(--bv-flaeche-stark); }
.bv-pill.bv-pill-ok { background: var(--bv-ok); color: #fff; }
.bv-pill.bv-pill-warn { background: var(--bv-warn); color: #fff; }
.bv-pill.bv-pill-error { background: var(--bv-fehler); color: #fff; }
.bv-pill.bv-pill-accent { background: var(--bv-akzent); color: var(--bv-akzent-text); }

/* ---------- Reviews ---------- */
.bv-review { padding: 14px 0; border-bottom: 1px solid var(--bv-rand); }
.bv-review:last-child { border-bottom: 0; }
.bv-review-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.bv-review-title { font-weight: 700; font-size: 1.1em; }
.bv-review-text { margin: 8px 0; line-height: 1.55; }
.bv-review.bv-pending { opacity: 0.85; border-left: 3px solid var(--bv-warn); padding-left: 10px; }

/* ---------- Forms ---------- */
.bv-form dl { display: grid; grid-template-columns: 220px 1fr; gap: 6px 14px; margin: 0 0 10px; }
.bv-form dt { padding-top: 4px; }
.bv-form dt label { font-weight: 700; }
.bv-form dt span, .bv-form .bv-explain { display: block; font-size: 0.9em; opacity: 0.72; font-weight: normal; }
.bv-form dd { margin: 0; }
.bv-form .inputbox { width: 100%; max-width: 640px; box-sizing: border-box; }
.bv-form .bv-short { max-width: 180px; }
.bv-form textarea.inputbox { min-height: 90px; }
.bv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.bv-lookup { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bv-lookup .inputbox { max-width: 240px; }
.bv-panel { background: var(--bv-flaeche); border: 1px solid var(--bv-rand); border-radius: var(--bv-radius); padding: 12px 16px; margin: 12px 0; }
.bv-panel > h3:first-child { margin-top: 0; }
details.bv-panel > summary { cursor: pointer; font-weight: 700; font-size: 1.1em; }
details.bv-panel[open] > summary { margin-bottom: 10px; }

/* ---------- Shelf ---------- */
.bv-shelf-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--bv-rand); }
.bv-shelf-item:last-child { border-bottom: 0; }
.bv-shelf-item .bv-cover { width: 70px; flex: 0 0 70px; }
.bv-shelf-item .bv-row-main h4 { margin: 0; font-size: 1.15em; }
.bv-shelf-item details { margin-top: 8px; }
.bv-shelf-item summary { cursor: pointer; color: var(--bv-akzent); font-weight: 600; }
.bv-shelf-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0; }

/* ---------- Tables ---------- */
.bv-table { width: 100%; border-collapse: collapse; }
.bv-table th, .bv-table td { padding: 7px 8px; border-bottom: 1px solid var(--bv-rand); text-align: left; }
.bv-table th { font-size: 0.9em; opacity: 0.8; }
.bv-table td.bv-num, .bv-table th.bv-num { text-align: center; }

/* ---------- Columns on overview ---------- */
.bv-columns { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* ---------- Header dropdown ---------- */
.bv-nav-badge { margin-left: 4px; }

@media (max-width: 900px) {
	.bv-columns { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
	:root { --bv-cover-breite: 104px; }
	.bv-book { grid-template-columns: 1fr; }
	.bv-book-cover .bv-cover { width: 150px; margin: 0 auto; }
	.bv-form dl { grid-template-columns: 1fr; gap: 2px; }
	.bv-two { grid-template-columns: 1fr; }
	.bv-tabs a { padding: 5px 8px; font-size: 0.95em; }
	.bv-table .bv-hide-small { display: none; }
}

/* ---------- Categories ---------- */
.bv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.bv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border: 1px solid var(--bv-rand); border-radius: 1em; background: var(--bv-flaeche); text-decoration: none; font-weight: 600; }
.bv-chip:hover { background: var(--bv-flaeche-stark); text-decoration: none; }
.bv-chip.bv-chip-active { background: var(--bv-akzent); border-color: var(--bv-akzent); color: var(--bv-akzent-text); }
.bv-chip-count { font-weight: normal; opacity: 0.75; font-size: 0.9em; }
.bv-cat-head { margin: 0 0 14px; }
.bv-cat-head h3 { margin-top: 0; }

/* ---------- Cover field ---------- */
.bv-cover-field { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.bv-cover-preview { width: 90px; flex: 0 0 90px; }
.bv-cover-inputs { flex: 1 1 260px; min-width: 0; }
.bv-cover-inputs input[type=file] { max-width: 100%; }
