.bc-library {
  --bc-accent: var(--theme-palette-color-1, #6f263d);
  --bc-border: rgba(25, 25, 25, .12);
  --bc-soft: rgba(25, 25, 25, .045);
  --bc-radius: 16px;
  width: 100%;
}

.bc-library [hidden] { display: none !important; }

.bc-toolbar {
  display: grid;
  gap: 18px;
  margin: 0 0 22px;
}

.bc-search-wrap {
  position: relative;
  display: block;
  width: min(100%, 760px);
}

.bc-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  line-height: 1;
  opacity: .55;
  pointer-events: none;
}

.bc-search {
  width: 100%;
  min-height: 50px;
  padding: 11px 16px 11px 46px !important;
  border: 1px solid var(--bc-border) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: inherit !important;
  font: inherit !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.035);
}

.bc-search:focus {
  outline: 2px solid rgba(111, 38, 61, .24);
  outline-offset: 2px;
  border-color: var(--bc-accent) !important;
}

.bc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bc-filter,
.bc-reset,
.bc-more {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--bc-border);
  border-radius: 999px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: .94rem;
  line-height: 1.2;
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.bc-filter:hover,
.bc-reset:hover,
.bc-more:hover {
  border-color: var(--bc-accent);
}

.bc-filter:focus-visible,
.bc-reset:focus-visible,
.bc-more:focus-visible {
  outline: 2px solid var(--bc-accent);
  outline-offset: 2px;
}

.bc-filter.is-active {
  background: var(--bc-accent);
  border-color: var(--bc-accent);
  color: #fff;
}

.bc-results-meta {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  font-size: .92rem;
  opacity: .82;
}

.bc-reset {
  padding: 6px 11px;
  font-size: .86rem;
}

.bc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 18px;
  align-items: stretch;
}

.bc-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  background: #fff;
  box-shadow: 0 5px 24px rgba(0,0,0,.045);
  display: flex;
  flex-direction: column;
}

.bc-cover {
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bc-soft);
  border-bottom: 1px solid var(--bc-border);
}

.bc-cover-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.bc-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  opacity: .52;
}

.bc-cover-placeholder span { font-size: 2rem; }

.bc-card-body {
  padding: 15px 15px 17px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.bc-title {
  margin: 0 0 7px !important;
  padding: 0 !important;
  font-size: 1rem !important;
  line-height: 1.32 !important;
  font-weight: 650 !important;
  overflow-wrap: anywhere;
  hyphens: auto;
  /* Aucun line-clamp : le titre reste toujours complet. */
}

.bc-authors,
.bc-biblio,
.bc-copies {
  margin: 0 !important;
  line-height: 1.4;
}

.bc-authors { font-size: .9rem; }
.bc-biblio { margin-top: 3px !important; font-size: .82rem; opacity: .68; }
.bc-copies { margin-top: 6px !important; font-size: .8rem; font-weight: 600; opacity: .72; }

.bc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 12px;
}

.bc-tag {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bc-soft);
  font-size: .73rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.bc-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.bc-more { padding: 11px 19px; font-weight: 600; }
.bc-empty { padding: 26px 0; text-align: center; opacity: .75; }

@media (min-width: 1440px) {
  .bc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .bc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .bc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .bc-cover { padding: 12px; }
  .bc-card-body { padding: 12px; }
  .bc-title { font-size: .94rem !important; }
  .bc-authors { font-size: .84rem; }
  .bc-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .bc-filter { flex: 0 0 auto; }
}

@media (max-width: 360px) {
  .bc-grid { grid-template-columns: 1fr; }
  .bc-cover { max-height: 480px; }
}

@media (prefers-reduced-motion: reduce) {
  .bc-filter,
  .bc-reset,
  .bc-more { transition: none; }
}
