/* DBC All Books explorer — signature panels, RAL-style cards, dual range sliders */

.dbc-all-books {
  --dbc-all-books-cover-w: 150px;
  /* Match prior 130×200 aspect ratio (≈1.538:1) */
  --dbc-all-books-cover-h: 220px;
  /* Book grid: max row width; 5 columns × cover width + 4 equal gaps = this width when wide enough. */
  --dbc-all-books-grid-max: 1200px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 0 48px;
  box-sizing: border-box;
}

/* Sort row: borderless, thin controls (~30px) */
.dbc-all-books__toolbar {
  margin-bottom: 16px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.dbc-all-books__toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.dbc-all-books__toolbar-count {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  min-height: 30px;
  display: flex;
  align-items: center;
  line-height: 1.3;
}

.dbc-all-books__toolbar-bc {
  flex: 1 1 200px;
  min-width: 0;
}

.dbc-all-books__toolbar-bc .dbc-bc {
  margin: 0;
  font-size: 13px;
}

.dbc-all-books__view-toggle {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.dbc-all-books__view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dbc-all-books__view-btn:hover {
  color: #111827;
  background: rgba(255, 255, 255, 0.85);
}

.dbc-all-books__view-btn.is-active {
  color: #111827;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.dbc-all-books__view-btn:focus-visible {
  outline: 2px solid #69aaff;
  outline-offset: 2px;
}

.dbc-all-books__view-btn-icon {
  display: flex;
  line-height: 0;
}

.dbc-all-books__sort {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.dbc-all-books__sort-label {
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  margin: 0;
  color: #374151;
}

.dbc-all-books__sort-select {
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  min-width: 180px;
  height: 30px;
  padding: 0 10px;
  line-height: 30px;
  box-sizing: border-box;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  color: #222;
}

.dbc-all-books__layout {
  display: grid;
  grid-template-columns: minmax(290px, 330px) 1fr;
  gap: 24px;
  align-items: start;
  overflow: visible;
}

/* Desktop: sidebar filter column matches main column height (All Books, Authors, Celebrities). */
@media (min-width: 961px) {
  .dbc-all-books__layout {
    align-items: stretch;
  }

  .dbc-all-books__sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .dbc-all-books__filters-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
  }
}

.dbc-all-books__main {
  overflow: visible;
  min-width: 0;
}

@media (max-width: 960px) {
  /* Stack: filters first (narrow screens), results second — refine before browsing */
  .dbc-all-books__layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .dbc-all-books__sidebar {
    order: 1;
    width: 100%;
    min-width: 0;
  }

  .dbc-all-books__main {
    order: 2;
    width: 100%;
    min-width: 0;
  }

  /* Filter card: slightly tighter + clearer panel on touch screens */
  #dbc-all-books-root .dbc-all-books__filters-card,
  .dbc-explore-directory .dbc-all-books__filters-card {
    padding: 12px 12px 14px;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.07);
    border-color: #e5e5e5;
  }

  #dbc-all-books-root .dbc-all-books__filters-toolbar,
  .dbc-explore-directory .dbc-all-books__filters-toolbar {
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  #dbc-all-books-root .dbc-all-books__filters-title,
  .dbc-explore-directory .dbc-all-books__filters-title {
    font-size: 22px !important;
    line-height: 1.15 !important;
    gap: 8px;
  }

  #dbc-all-books-root .dbc-all-books__filters-icon,
  .dbc-explore-directory .dbc-all-books__filters-icon {
    width: 38px;
    height: 43px;
  }

  #dbc-all-books-root .dbc-all-books__filters-icon svg,
  .dbc-explore-directory .dbc-all-books__filters-icon svg {
    width: 38px;
    height: 43px;
  }

  /* Letter row: thinner scrollbar on small viewports */
  .dbc-all-books__alpha-track {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
    padding-bottom: 6px;
  }

  .dbc-all-books__alpha-track::-webkit-scrollbar {
    height: 5px;
  }

  .dbc-all-books__alpha-track::-webkit-scrollbar-thumb {
    border-radius: 999px;
  }

  /*
   * Preset save/list dialogs: base styles use right:0 + fixed width — matches a desktop sidebar.
   * On full-width filter cards, that pins the popover to the screen/card right (under Clear, not the icons).
   */
  #dbc-all-books-root .dbc-all-books__preset-panel,
  .dbc-explore-directory .dbc-all-books__preset-panel {
    left: 0;
    right: auto;
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}

/* Filter sidebar */
.dbc-all-books__filters-card {
  --dbc-all-books-filter-xpad: 8px;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 14px 14px 16px;
  background: #f9f9f9;
  box-shadow: none;
}

.dbc-all-books__filters-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: stretch;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  position: relative;
}

/* Title row + dedicated row for Save / Presets / Clear */
.dbc-all-books__filters-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  width: 100%;
}

/* Icon-only: save / saved list (matches Clear row height ~30px) */
.dbc-all-books__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  padding: 0;
  margin: 0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Keep list/SVG icons dark on hover (Elementor / theme sometimes forces light text on buttons). */
.dbc-all-books__icon-btn:hover,
.dbc-all-books__icon-btn:focus-visible {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827 !important;
}

.dbc-all-books__icon-btn:focus-visible {
  outline: 2px solid rgba(35, 42, 53, 0.35);
  outline-offset: 2px;
}

.dbc-all-books__icon-btn svg {
  display: block;
  flex-shrink: 0;
  color: inherit;
}

.dbc-all-books__icon-btn svg path {
  fill: currentColor;
}

.dbc-all-books__icon-btn img {
  display: block;
  width: 20px;
  height: 20px;
}

/* Beat Elementor/widget rules that recolor button contents on hover */
#dbc-all-books-root .dbc-all-books__filters-actions .dbc-all-books__icon-btn:hover,
.dbc-explore-directory .dbc-all-books__filters-actions .dbc-all-books__icon-btn:hover,
#dbc-all-books-root .dbc-all-books__filters-actions .dbc-all-books__icon-btn:focus-visible,
.dbc-explore-directory .dbc-all-books__filters-actions .dbc-all-books__icon-btn:focus-visible {
  color: #111827 !important;
}

#dbc-all-books-root .dbc-all-books__filters-actions .dbc-all-books__icon-btn:hover svg path,
.dbc-explore-directory .dbc-all-books__filters-actions .dbc-all-books__icon-btn:hover svg path {
  fill: currentColor !important;
}

/* Popovers — shell matches .dbc-bod-shelf-popup (Add to Shelf): tray + white header strip */
.dbc-all-books__preset-anchor {
  position: relative;
  z-index: 40;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.dbc-all-books__preset-panel {
  position: absolute;
  top: 4px;
  right: 0;
  box-sizing: border-box;
  width: min(320px, calc(100vw - 24px));
  min-width: min(272px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
  background: #f0f1f4;
  color: #1a1c21;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
  pointer-events: auto;
  text-align: left;
  overscroll-behavior: contain;
}

/* Same rhythm as .dbc-bod-shelf-title */
.dbc-all-books__preset-panel-header {
  margin: 0;
  padding: 10px 16px 8px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.dbc-all-books__preset-panel-header--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dbc-all-books__preset-panel-title {
  margin: 0;
  font-family: Poppins, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-synthesis: none;
  color: rgb(102, 102, 102);
}

.dbc-all-books__preset-panel-header--split .dbc-all-books__preset-panel-title {
  flex: 1;
  min-width: 0;
}

.dbc-all-books__preset-panel-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}

.dbc-all-books__preset-panel-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #111827;
}

/* Same as .dbc-bod-shelf-grid-outer */
.dbc-all-books__preset-panel-tray {
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px 18px;
  background: #f0f1f4;
}

.dbc-all-books__preset-label {
  display: block;
  margin: 0 0 8px;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  color: #6b7280;
}

.dbc-all-books__preset-input {
  width: 100%;
  box-sizing: border-box;
  height: 30px;
  padding: 0 10px;
  margin-bottom: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.2;
  background: #fff;
  color: #111827;
}

.dbc-all-books__preset-input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #93c5fd;
}

.dbc-all-books__preset-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dbc-all-books .dbc-all-books__preset-primary.dbc-button {
  font-size: 14px !important;
  font-weight: 300 !important;
  padding: 0 11px !important;
  min-height: 30px !important;
  line-height: 1.2 !important;
  border-radius: 3px !important;
}

.dbc-all-books__preset-secondary {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #6b7280;
  cursor: pointer;
}

.dbc-all-books__preset-secondary:hover {
  color: #111827;
  text-decoration: underline;
}

/* Scroll list — rhythm like .dbc-bod-shelf-grid */
.dbc-all-books__preset-items {
  list-style: none;
  margin: 0;
  padding: 0 10px 10px 0;
  max-height: min(52vh, 280px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
}

.dbc-all-books__preset-item {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 7px 10px;
  background: #fff;
  border: none;
  border-radius: 10px;
  box-sizing: border-box;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.dbc-all-books__preset-item + .dbc-all-books__preset-item {
  margin-top: 4px;
}

.dbc-all-books__preset-item-name {
  flex: 1 1 120px;
  min-width: 0;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbc-all-books__preset-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Compact icon-only Apply (✓) / Remove (×) — single-line preset rows */
.dbc-all-books__preset-icon-btn {
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  cursor: pointer;
  line-height: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dbc-all-books__preset-icon-btn svg {
  display: block;
  pointer-events: none;
}

.dbc-all-books__preset-apply.dbc-all-books__preset-icon-btn {
  border: none;
  background: #232a35;
  color: #fff;
}

.dbc-all-books__preset-apply.dbc-all-books__preset-icon-btn:hover {
  background: #151a22;
}

.dbc-all-books__preset-apply.dbc-all-books__preset-icon-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.dbc-all-books__preset-remove.dbc-all-books__preset-icon-btn {
  border: 1px solid rgba(185, 28, 28, 0.35);
  background: transparent;
  color: #b91c1c;
}

.dbc-all-books__preset-remove.dbc-all-books__preset-icon-btn:hover {
  background: rgba(185, 28, 28, 0.08);
  border-color: rgba(185, 28, 28, 0.5);
}

.dbc-all-books__preset-remove.dbc-all-books__preset-icon-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Same as .dbc-bod-shelf-empty */
.dbc-all-books__preset-empty {
  margin: 0 0 8px;
  padding: 16px 14px;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
  text-align: center;
  background: #fff;
  border-radius: 10px;
  border: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.dbc-all-books__preset-empty[hidden],
.dbc-all-books__preset-panel[hidden] {
  display: none !important;
}

/* Win over Elementor / theme h2 rules on All Books pages */
.dbc-all-books h2.dbc-all-books__filters-title,
.dbc-all-books .dbc-all-books__filters-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: "Noto Serif Vithkuqi", "Noto Serif", Georgia, serif !important;
  font-size: 28px !important;
  font-style: normal !important;
  font-weight: 500 !important;
  line-height: 23px !important;
  color: #111 !important;
}

.dbc-all-books__filters-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 54px;
  color: #ffd56c;
}

.dbc-all-books__filters-icon svg {
  display: block;
  width: 48px;
  height: 54px;
}

/* Clear: 14px text; wins over global .dbc-button / .dbc-button--sm */
.dbc-all-books .dbc-all-books__clear-all.dbc-button {
  flex-shrink: 0;
  align-self: center;
  white-space: nowrap;
  font-size: 14px !important;
  line-height: 1.25 !important;
  /* Opposite side from Save / Presets to reduce accidental taps */
  margin-inline-start: auto;
}

/* .dbc-button sets display:inline-flex; ensure [hidden] still suppresses the control */
.dbc-all-books .dbc-all-books__clear-all.dbc-button[hidden],
.dbc-all-books .dbc-all-books__preset-save-btn[hidden] {
  display: none !important;
}

.dbc-all-books__clear-all__label {
  font-weight: 300;
}

.dbc-all-books__search {
  width: 100%;
  box-sizing: border-box;
  height: 30px;
  padding: 0 12px;
  line-height: 30px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  margin-bottom: 30px;
  background: #fff;
  color: #222;
}

.dbc-all-books__search::placeholder {
  color: #7f7f7f;
  opacity: 1;
}

.dbc-all-books__search::-webkit-input-placeholder {
  color: #7f7f7f;
  opacity: 1;
}

.dbc-all-books__search::-moz-placeholder {
  color: #7f7f7f;
  opacity: 1;
}

.dbc-all-books__search:-ms-input-placeholder {
  color: #7f7f7f;
}

/* Dividers sit under each accordion title row (not above the next section). */
.dbc-all-books__acc-item {
  margin: 0 var(--dbc-all-books-filter-xpad, 8px);
}

.dbc-all-books__acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding: 7px 0 9px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #e8e8e8;
  border-radius: 0;
  background: transparent !important;
  background-color: transparent !important;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: #1f2937;
  cursor: pointer;
  text-align: left;
  box-shadow: none !important;
}

/* Accordion section headers: no hover / pressed chrome (keyboard users keep :focus-visible ring below) */
.dbc-all-books .dbc-all-books__acc-head:hover,
.dbc-all-books .dbc-all-books__acc-head:focus,
.dbc-all-books .dbc-all-books__acc-head:active {
  background: transparent !important;
  background-color: transparent !important;
  color: #1f2937 !important;
  font-size: 13px !important;
  font-weight: 300 !important;
  box-shadow: none !important;
  outline: none !important;
  border-radius: 0 !important;
  border-bottom: 1px solid #e8e8e8 !important;
  border-bottom-color: #e8e8e8 !important;
  filter: none !important;
  opacity: 1 !important;
}

.dbc-all-books .dbc-all-books__acc-head:focus:not(:focus-visible) {
  outline: none !important;
}

.dbc-all-books__acc-head:focus-visible {
  outline: 2px solid rgba(35, 42, 53, 0.35);
  outline-offset: 2px;
}

.dbc-all-books__acc-title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 300;
}

.dbc-all-books__acc-chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(45deg);
  margin-left: 12px;
  flex-shrink: 0;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.dbc-all-books__acc-head[aria-expanded="false"] .dbc-all-books__acc-chev {
  transform: rotate(-135deg);
}

/* Open/close height is driven by JS (pixel height transition). Grid 0fr/1fr caused layout jitter on
 * short panels; interpolating height in px is smoother. Closed state uses CSS height:0. */
.dbc-all-books__acc-body {
  display: block;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition: height 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.dbc-all-books__acc-head[aria-expanded="false"] + .dbc-all-books__acc-body {
  height: 0 !important;
}

.dbc-all-books__acc-body-inner {
  overflow: hidden;
  min-height: 0;
  /* Symmetric vertical gap: same space under divider as above next section header. */
  padding: 24px 0 24px;
  box-sizing: border-box;
}

/* Rating / Page count / Awards — tighter gap under divider only (not scroll/tag panels) */
.dbc-all-books__acc-body-inner > .dbc-all-books__dual-range:first-child {
  margin-top: -12px;
}

/*
 * Collapsed: grid 0fr still respects children’s min-height / overflow-y:visible (e.g. dual-range
 * min-height:50px, .scroll--short). Force zero contribution so panels fully hide.
 * (Do not animate inner padding here — it ran in parallel with grid-template-rows and made content
 * appear to slide/jitter during open/close.)
 */

/* Closed only: inner padding would otherwise keep a tall min-height on .acc-item (opened unchanged). */
.dbc-all-books__acc-head[aria-expanded="false"] + .dbc-all-books__acc-body .dbc-all-books__acc-body-inner {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.dbc-all-books__acc-head[aria-expanded="false"] + .dbc-all-books__acc-body .dbc-all-books__dual-range {
  max-height: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
}

.dbc-all-books__acc-head[aria-expanded="false"] + .dbc-all-books__acc-body .dbc-all-books__date-fields {
  max-height: 0;
  min-height: 0;
  overflow: hidden;
  gap: 0;
  margin: 0;
  padding: 0;
}

.dbc-all-books__acc-head[aria-expanded="false"] + .dbc-all-books__acc-body .dbc-all-books__scroll,
.dbc-all-books__acc-head[aria-expanded="false"] + .dbc-all-books__acc-body .dbc-all-books__scroll--scroll-cap,
.dbc-all-books__acc-head[aria-expanded="false"] + .dbc-all-books__acc-body .dbc-all-books__tag-wrap,
.dbc-all-books__acc-head[aria-expanded="false"] + .dbc-all-books__acc-body .dbc-all-books__tag-wrap--scroll-cap {
  max-height: 0 !important;
  min-height: 0;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .dbc-all-books__acc-body {
    transition-duration: 0.01ms;
  }

  .dbc-all-books__acc-chev {
    transition-duration: 0.01ms;
  }
}

/* Genre…checkbox lists: no scrollbar until JS adds --scroll-cap (short lists use --short). */
/*
 * Genre checkbox list: use overflow-x: clip (not hidden). Paired with overflow-y: visible,
 * overflow-x: hidden forces the used overflow-y to "auto" (CSS 2.1/Overflow), which always
 * creates a vertical scrollbar — Book tags avoid this because they don't clip the x axis.
 */
/*
 * Short genre lists: kill phantom scrollbar (must NOT apply when accordion is closed — otherwise
 * max-height:none !important beats the collapsed-panel rule and Reading difficulty leaks content).
 */
#dbc-all-books-root .dbc-all-books__acc-head[aria-expanded="true"] + .dbc-all-books__acc-body .dbc-all-books__scroll.dbc-all-books__scroll--short,
.dbc-explore-directory .dbc-all-books__acc-head[aria-expanded="true"] + .dbc-all-books__acc-body .dbc-all-books__scroll.dbc-all-books__scroll--short {
  max-height: none !important;
  overflow-y: visible !important;
  overflow-x: clip;
  padding-right: 0 !important;
}

/* Genre…checkbox lists: no scrollbar until JS adds --scroll-cap (content taller than cap). */
.dbc-all-books__scroll {
  box-sizing: border-box;
  max-height: none;
  overflow-x: clip;
  overflow-y: visible;
  padding-right: 0;
  min-height: 0;
}

.dbc-all-books__scroll--scroll-cap {
  max-height: 280px;
  overflow-x: clip;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

@supports not (overflow-x: clip) {
  #dbc-all-books-root .dbc-all-books__acc-head[aria-expanded="true"] + .dbc-all-books__acc-body .dbc-all-books__scroll.dbc-all-books__scroll--short,
  .dbc-explore-directory .dbc-all-books__acc-head[aria-expanded="true"] + .dbc-all-books__acc-body .dbc-all-books__scroll.dbc-all-books__scroll--short,
  .dbc-all-books__scroll {
    overflow-x: visible;
  }

  .dbc-all-books__scroll--scroll-cap {
    overflow-x: hidden;
  }
}

/* Space between checkbox rows (flex column + gap could confuse overflow with short lists). */
.dbc-all-books__scroll > .dbc-all-books__check + .dbc-all-books__check {
  margin-top: 8px;
}

#dbc-all-books-root .dbc-all-books__acc-head[aria-expanded="true"] + .dbc-all-books__acc-body .dbc-all-books__tag-wrap.dbc-all-books__tag-wrap--short,
.dbc-explore-directory .dbc-all-books__acc-head[aria-expanded="true"] + .dbc-all-books__acc-body .dbc-all-books__tag-wrap.dbc-all-books__tag-wrap--short {
  max-height: none !important;
  overflow-y: visible !important;
  padding: 4px 4px 4px 0 !important;
}

.dbc-all-books__tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: none;
  overflow-y: visible;
  padding: 4px 4px 4px 0;
}

.dbc-all-books__tag-wrap--scroll-cap {
  max-height: 320px;
  overflow-y: auto;
  /* Reserve gutter so flex-wrap does not reflow when the bar is painted a frame late. */
  scrollbar-gutter: stable;
}

.dbc-all-books__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  color: #374151;
}

.dbc-all-books .dbc-all-books__check:hover {
  color: #374151 !important;
  background: transparent !important;
}

.dbc-all-books__check input {
  margin-top: 2px;
}

/* Country checklist: [checkbox][flag][label] — title uses remaining width */
.dbc-all-books__check--country {
  align-items: center;
  gap: 8px;
}

.dbc-all-books__check--country .dbc-all-books__check-label {
  flex: 1 1 auto;
  min-width: 0;
}

.dbc-all-books__check--country input {
  flex-shrink: 0;
  margin-top: 0;
}

/* lipis .fi: keep default .fi box metrics (no custom width) */
.dbc-all-books__check--country .dbc-flag-icon.fi {
  flex-shrink: 0;
  vertical-align: middle;
}

/* Theme SVG flags (author explore / celeb filters) — same row height as label */
.dbc-all-books__check--country .dbc-flag-icon.dbc-flag-icon--svg {
  flex-shrink: 0;
  vertical-align: middle;
  font-size: 14px;
}

/* Parent .dbc-all-books__scroll uses overflow-x: clip — flags at row end were clipped */
.dbc-all-books__scroll--country {
  overflow-x: visible !important;
}

#dbc-all-books-root .dbc-all-books__acc-head[aria-expanded="true"]
  + .dbc-all-books__acc-body
  .dbc-all-books__scroll.dbc-all-books__scroll--short.dbc-all-books__scroll--country,
.dbc-explore-directory
  .dbc-all-books__acc-head[aria-expanded="true"]
  + .dbc-all-books__acc-body
  .dbc-all-books__scroll.dbc-all-books__scroll--short.dbc-all-books__scroll--country {
  overflow-x: visible !important;
}

.dbc-all-books__cnt {
  font-size: 12px; /* 1px smaller than .dbc-all-books__check (13px) */
  color: #9ca3af;
  font-weight: 400;
}

/* Mini scrollbars — same family as letter row + Add-to-Shelf list (.dbc-bod-shelf-grid) */
.dbc-all-books__alpha-track,
.dbc-all-books__scroll--scroll-cap,
.dbc-all-books__tag-wrap--scroll-cap,
.dbc-all-books__preset-items {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.28) rgba(0, 0, 0, 0.06);
}

.dbc-all-books__alpha-track::-webkit-scrollbar {
  height: 6px;
}

.dbc-all-books__alpha-track::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
}

.dbc-all-books__alpha-track::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
}

.dbc-all-books__scroll--scroll-cap::-webkit-scrollbar,
.dbc-all-books__tag-wrap--scroll-cap::-webkit-scrollbar,
.dbc-all-books__preset-items::-webkit-scrollbar {
  width: 6px;
}

.dbc-all-books__scroll--scroll-cap::-webkit-scrollbar-thumb,
.dbc-all-books__tag-wrap--scroll-cap::-webkit-scrollbar-thumb,
.dbc-all-books__preset-items::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
}

.dbc-all-books__scroll--scroll-cap::-webkit-scrollbar-track,
.dbc-all-books__tag-wrap--scroll-cap::-webkit-scrollbar-track,
.dbc-all-books__preset-items::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
}

/* Filter tag buttons: match [dbc_book_tag_pills] (.dbc-pill) */
.dbc-all-books .dbc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #e2e2e2;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-family: Poppins, Georgia, serif !important;
  font-size: 12px !important;
  font-weight: 300 !important;
  line-height: 13px !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: none !important;
}

.dbc-all-books .dbc-pill.is-active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Tag pills: same look on hover as at rest (no hover treatment) */
.dbc-all-books .dbc-pill:not(.is-active):hover,
.dbc-all-books .dbc-pill:not(.is-active):focus,
.dbc-all-books .dbc-pill:not(.is-active):active {
  background: #fff !important;
  color: #222 !important;
  border-color: #e2e2e2 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  transform: none !important;
}

.dbc-all-books .dbc-pill.is-active:hover,
.dbc-all-books .dbc-pill.is-active:focus,
.dbc-all-books .dbc-pill.is-active:active {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
  box-shadow: none !important;
  transform: none !important;
}

.dbc-all-books .dbc-pill .label,
.dbc-all-books .dbc-pill .count {
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: inherit !important;
  line-height: 13px !important;
}

.dbc-all-books .dbc-pill .count {
  opacity: 0.55;
}

/* Dual-handle range: one visual track, thumbs centered on the line (full content width; was 8px inset). */
.dbc-all-books__dual-range {
  position: relative;
  min-height: 50px;
  height: auto;
  padding: 0 0 4px;
  box-sizing: border-box;
  /* Outer track (outside handles): lighter; inner segment set via --rng-a / --rng-b from JS */
  --dbc-rng-out: #eceef2;
  --dbc-rng-in: #c5ccd6;
  --rng-a: 0%;
  --rng-b: 100%;
}

.dbc-all-books__dual-range::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 17px;
  height: 4px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    to right,
    var(--dbc-rng-out) 0,
    var(--dbc-rng-out) var(--rng-a),
    var(--dbc-rng-in) var(--rng-a),
    var(--dbc-rng-in) var(--rng-b),
    var(--dbc-rng-out) var(--rng-b),
    var(--dbc-rng-out) 100%
  );
}

.dbc-all-books__rng {
  position: absolute;
  left: 0;
  width: 100%;
  height: 38px;
  margin: 0;
  top: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  z-index: 1;
}

.dbc-all-books__rng::-moz-focus-outer {
  border: 0;
}

.dbc-all-books__rng::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border: none;
}

.dbc-all-books__rng::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 1px solid #9ca3af;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  pointer-events: auto;
}

.dbc-all-books__rng::-moz-range-track {
  height: 4px;
  background: transparent;
  border: none;
}

.dbc-all-books__rng::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 1px solid #9ca3af;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  pointer-events: auto;
}

.dbc-all-books__rng-label {
  position: absolute;
  left: 0;
  right: 0;
  top: 30px;
  bottom: auto;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 12px;
  color: #4b5563;
  text-align: center;
  line-height: 1.25;
}

/* Publish date: stacked full-width rows — sidebar is too narrow for two date inputs side by side */
.dbc-all-books__date-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  max-width: 100%;
}

.dbc-all-books__date-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.dbc-all-books__date-label {
  font-family: Poppins, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  line-height: 1.2;
}

.dbc-all-books__date {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 30px;
  padding: 0 10px;
  line-height: 30px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  color: #222;
}

/* Match search field placeholder styling (browsers that honor placeholder on type=date + fallback) */
.dbc-all-books__date::placeholder {
  color: #7f7f7f;
  opacity: 1;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
}

.dbc-all-books__date::-webkit-input-placeholder {
  color: #7f7f7f;
  opacity: 1;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
}

.dbc-all-books__date::-moz-placeholder {
  color: #7f7f7f;
  opacity: 1;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
}

.dbc-all-books__date:-ms-input-placeholder {
  color: #7f7f7f;
}

/* Chromium / Safari: empty date parts are not ::placeholder — tint the datetime-edit fields */
.dbc-all-books__date::-webkit-datetime-edit-fields-wrapper {
  color: #7f7f7f;
}

.dbc-all-books__date::-webkit-datetime-edit-text,
.dbc-all-books__date::-webkit-datetime-edit-month-field,
.dbc-all-books__date::-webkit-datetime-edit-day-field,
.dbc-all-books__date::-webkit-datetime-edit-year-field {
  color: #7f7f7f;
}

.dbc-all-books__date.dbc-all-books__date--filled {
  color: #222;
}

.dbc-all-books__date.dbc-all-books__date--filled::-webkit-datetime-edit-fields-wrapper,
.dbc-all-books__date.dbc-all-books__date--filled::-webkit-datetime-edit-text,
.dbc-all-books__date.dbc-all-books__date--filled::-webkit-datetime-edit-month-field,
.dbc-all-books__date.dbc-all-books__date--filled::-webkit-datetime-edit-day-field,
.dbc-all-books__date.dbc-all-books__date--filled::-webkit-datetime-edit-year-field {
  color: #222;
}

/* Main: plain grid (no outer card frame) */
.dbc-all-books__main-card {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* Compact letter row */
.dbc-all-books__alpha {
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: none;
}

.dbc-all-books__alpha-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
}

.dbc-all-books__alpha-btn {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: #4b5563;
  cursor: pointer;
  line-height: 1.2;
  box-sizing: border-box;
}

.dbc-all-books__alpha-btn:hover {
  background: #ececec;
  font-weight: 300;
  color: #4b5563;
}

.dbc-all-books__alpha-btn.is-active,
.dbc-all-books__alpha-btn.is-active:hover {
  background: #ececec;
  color: #111;
  font-weight: 300;
}

.dbc-all-books__results-wrap {
  position: relative;
  background: transparent;
  container-type: inline-size;
  container-name: dbc-ab-results;
}

.dbc-all-books__loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  pointer-events: none;
}

.dbc-all-books__loading[hidden] {
  display: none !important;
}

/* Same spinner + label pattern as `css/dbc-searchbar.css` (.dbc-search-loading / .dbc-search-spinner) */
.dbc-all-books__loading .dbc-search-loading {
  pointer-events: none;
  padding: 16px 12px;
  text-align: center;
  color: #666;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dbc-all-books__loading .dbc-search-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #f5c518;
  border-radius: 50%;
  animation: dbc-spin 0.8s linear infinite;
  box-sizing: border-box;
}

@keyframes dbc-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.dbc-all-books__count {
  font-family: Poppins, system-ui, sans-serif;
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.dbc-all-books__grid {
  min-height: 100px;
  transition: opacity 0.2s ease;
  overflow: visible;
}

.dbc-all-books__grid.is-loading {
  opacity: 0.55;
}

/* Grid refresh: no card hover/tooltips until replaced DOM receives a fresh hover */
.dbc-all-books--fetching .dbc-all-books__grid .book-tooltip-card {
  pointer-events: none;
}

.dbc-all-books--fetching .dbc-all-books__grid .book-tooltip-info,
.dbc-all-books--fetching .dbc-all-books__grid .dbc-all-books__tooltip {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Book grid: narrow = auto-fill; wide = exactly 5 × cover + 4 gaps filling row width (up to --dbc-all-books-grid-max). */
.dbc-all-books__grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--dbc-all-books-cover-w));
  row-gap: 20px;
  column-gap: 22px;
  justify-content: start;
  width: 100%;
  max-width: min(100%, var(--dbc-all-books-grid-max, 1200px));
  box-sizing: border-box;
  overflow: visible;
}

@container dbc-ab-results (min-width: 840px) {
  .dbc-all-books__grid-inner {
    grid-template-columns: repeat(5, var(--dbc-all-books-cover-w));
    column-gap: max(0px, calc((100% - 5 * var(--dbc-all-books-cover-w)) / 4));
  }
}

/* No container queries: approximate desktop with viewport. */
@supports not (container-type: inline-size) {
  @media (min-width: 1180px) {
    .dbc-all-books__grid-inner {
      grid-template-columns: repeat(5, var(--dbc-all-books-cover-w));
      column-gap: max(0px, calc((100% - 5 * var(--dbc-all-books-cover-w)) / 4));
    }
  }
}

/* List layout (books + shared directory): single column rows */
.dbc-all-books__grid-inner--layout-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: min(100%, var(--dbc-all-books-grid-max, 1200px));
  grid-template-columns: unset;
  justify-content: flex-start;
}

.dbc-all-books__person-list-media {
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.dbc-all-books__person-list-media .dbc-all-books__person-media.is-circle {
  --dbc-person-avatar: 80px;
}

.dbc-all-books__card--list {
  width: 100%;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.dbc-all-books__list-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

/* List row cover: same frame as grid (theme vars) */
.dbc-all-books__bookmark-slot--list {
  width: var(--dbc-all-books-cover-w);
  max-width: min(100%, var(--dbc-all-books-cover-w));
  flex-shrink: 0;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dbc-all-books__cover-link--list {
  display: block;
  width: var(--dbc-all-books-cover-w);
  height: var(--dbc-all-books-cover-h);
  max-width: 100%;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
  border-radius: inherit;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
  aspect-ratio: unset;
  max-height: none;
}

.dbc-all-books__cover-link--list:focus-visible {
  outline: 2px solid #69aaff;
  outline-offset: 2px;
}

.dbc-all-books__list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0 0 8px;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
}

.dbc-all-books__list-meta-piece {
  display: inline;
}

.dbc-all-books__list-meta-piece + .dbc-all-books__list-meta-piece::before {
  content: '·';
  display: inline-block;
  margin-right: 0.35em;
  color: #9ca3af;
  font-weight: 600;
}

.dbc-all-books__list-rating-with-star {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
}

.dbc-all-books__rating-star {
  flex-shrink: 0;
  color: #f5c518;
  display: block;
}

.dbc-all-books__list-rating-num {
  font-variant-numeric: tabular-nums;
}

/* All Books list: rating + title on one row; authors / genres below */
.dbc-all-books__card--list .dbc-all-books__list-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 8px;
}

.dbc-all-books__card--list .dbc-all-books__list-heading-rating {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  line-height: 1;
}

.dbc-all-books__card--list .dbc-all-books__list-heading-rating .dbc-all-books__list-rating-with-star {
  line-height: 1;
}

.dbc-all-books__card--list .dbc-all-books__list-heading-row .dbc-all-books__list-title {
  margin: 0;
  flex: 1 1 140px;
  min-width: 0;
  line-height: 23px;
}

.dbc-all-books__card--list .dbc-all-books__list-stackline {
  margin: 0 0 6px;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
}

.dbc-all-books__card--list .dbc-all-books__list-stackline--authors {
  font-style: italic;
  font-weight: 400;
  color: #9ca3af;
}

.dbc-all-books__card--list .dbc-all-books__list-authors-prefix {
  font-weight: 300;
}

.dbc-all-books__card--list .dbc-all-books__list-stackline--genres {
  margin-bottom: 10px;
  font-style: normal;
  font-weight: 500;
  color: #4b5563;
}

.dbc-all-books__list-meta--person {
  margin-bottom: 6px;
}

.dbc-all-books__list-body {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 2px;
}

.dbc-all-books__list-title {
  display: inline-block;
  margin: 0 0 6px;
  font-family: "Noto Serif Vithkuqi", "Noto Serif", Georgia, serif;
  font-style: normal;
  font-weight: 500;
  font-size: 18px;
  line-height: 23px;
  color: rgb(51, 51, 51);
  text-decoration: none;
}

.dbc-all-books__list-title:hover {
  text-decoration: underline;
}

.dbc-all-books__list-excerpt {
  margin: 0;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  font-style: normal;
  font-weight: 300;
  line-height: 23px;
  color: #000;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.dbc-all-books__list-excerpt--book-list {
  -webkit-line-clamp: 5;
}

/* Card: match Highest ranked list — fixed cover frame so every thumbnail is identical */
.dbc-all-books__card.book-tooltip-card {
  position: relative;
  z-index: 1;
  width: var(--dbc-all-books-cover-w);
  max-width: 100%;
  overflow: visible;
}

@supports selector(:has(*)) {
  .dbc-all-books__card.book-tooltip-card:has(.dbc-all-books__bookmark-slot:hover) {
    z-index: 30;
  }
}

.dbc-all-books__bookmark-slot {
  position: relative;
  z-index: 2;
  display: block;
  width: var(--dbc-all-books-cover-w);
  max-width: 100%;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .dbc-all-books__bookmark-slot:hover,
  .dbc-all-books__bookmark-slot:focus-within {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  }
  .dbc-all-books__bookmark-slot:has(.dbc-bod-bookmark-wrap.is-open) {
    transform: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  }
}

@supports selector(:has(a)) {
  .dbc-all-books__bookmark-slot {
    overflow: visible;
  }
}

.dbc-all-books__cover-link {
  display: block;
  width: var(--dbc-all-books-cover-w);
  height: var(--dbc-all-books-cover-h);
  max-width: 100%;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
  border-radius: inherit;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

.dbc-all-books__cover-link:focus-visible {
  outline: 2px solid #69aaff;
  outline-offset: 2px;
}

/* Fill the fixed frame (beats theme / Elementor img { height:auto; max-width:100% }) */
.dbc-all-books .dbc-all-books__cover-img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  min-height: 0;
  object-fit: cover !important;
  object-position: center center;
  border-radius: 0 8px 8px 0;
}

.dbc-all-books .dbc-all-books__cover-fallback {
  display: block;
  width: 100%;
  height: 100%;
  min-height: var(--dbc-all-books-cover-h);
  box-sizing: border-box;
  background: linear-gradient(135deg, #f0f0f0, #e2e2e2);
  border-radius: 0 8px 8px 0;
}

/*
 * Tooltips: only the cover / bookmark slot is the hover trigger (not the whole card, not the tooltip).
 * Overrides global style.css `.book-tooltip-card:hover .book-tooltip-info`.
 * Tooltip uses pointer-events: none so the pointer can reach books underneath when the panel overlaps.
 */
#dbc-all-books-root .book-tooltip-card:hover > .book-tooltip-info,
.dbc-explore-directory .book-tooltip-card:hover > .book-tooltip-info,
#dbc-all-books-root .book-tooltip-card:hover .book-tooltip-info,
.dbc-explore-directory .book-tooltip-card:hover .book-tooltip-info {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#dbc-all-books-root .book-tooltip-card .dbc-all-books__bookmark-slot:hover ~ .book-tooltip-info[data-tooltip-loaded="0"],
.dbc-explore-directory .book-tooltip-card .dbc-all-books__bookmark-slot:hover ~ .book-tooltip-info[data-tooltip-loaded="0"],
#dbc-all-books-root .book-tooltip-card .dbc-all-books__bookmark-slot:hover ~ .book-tooltip-info[data-tooltip-loaded="1"],
.dbc-explore-directory .book-tooltip-card .dbc-all-books__bookmark-slot:hover ~ .book-tooltip-info[data-tooltip-loaded="1"] {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#dbc-all-books-root .book-tooltip-card .dbc-all-books__bookmark-slot:hover ~ .book-tooltip-info[data-tooltip-loaded="2"],
.dbc-explore-directory .book-tooltip-card .dbc-all-books__bookmark-slot:hover ~ .book-tooltip-info[data-tooltip-loaded="2"] {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
}

.dbc-all-books .book-tooltip-info {
  z-index: 50;
}

.dbc-all-books .book-tooltip-info::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 0;
  width: 28px;
  height: 100%;
  min-height: 48px;
  pointer-events: none;
}

.dbc-all-books__empty {
  font-family: Poppins, system-ui, sans-serif;
  padding: 36px 12px;
  text-align: center;
  color: #6b7280;
  font-size: 15px;
}

.dbc-all-books__pagination {
  margin-top: 28px;
}

.dbc-all-books__pagination .page-numbers {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dbc-all-books__pagination li {
  display: inline-block;
  margin: 0;
}

.dbc-all-books__pagination a,
.dbc-all-books__pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  text-decoration: none;
  color: #374151;
  background: #fff;
}

.dbc-all-books__pagination span.current {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Shelf ribbon: match carousel hover reveal */
@media (hover: hover) and (pointer: fine) {
  .dbc-all-books__bookmark-slot:hover .dbc-bod-bookmark-wrap--overlay .dbc-bod-bookmark-btn,
  .dbc-all-books__bookmark-slot:focus-within .dbc-bod-bookmark-wrap--overlay .dbc-bod-bookmark-btn,
  .dbc-bod-bookmark-wrap--overlay.is-open .dbc-bod-bookmark-btn {
    opacity: 1;
    pointer-events: auto;
  }
}

/* All Authors / All Celebrities — person cards (shell reuses .dbc-all-books__*) */
.dbc-all-books__grid-inner--people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  row-gap: 24px;
  column-gap: 18px;
  justify-content: start;
  width: 100%;
  max-width: min(100%, var(--dbc-all-books-grid-max, 1200px));
  box-sizing: border-box;
}

/*
 * Authors/Celebrities list: `.grid-inner--people` appears later and was winning the cascade,
 * forcing a multi-column grid inside list mode. These rules MUST follow `.grid-inner--people`.
 */
.dbc-all-books__grid-inner--people.dbc-all-books__grid-inner--layout-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 14px;
  grid-template-columns: none;
  grid-auto-columns: unset;
  grid-auto-flow: unset;
  row-gap: unset;
  column-gap: unset;
}

.dbc-all-books__card--person.dbc-all-books__card--list {
  max-width: none;
  width: 100%;
  margin: 0;
  min-width: 0;
}

.dbc-all-books__card--person.dbc-all-books__card--list .dbc-all-books__list-body {
  min-width: 0;
}

.dbc-all-books__card--person.dbc-all-books__card--list .dbc-all-books__list-title {
  display: block;
  max-width: 100%;
  word-break: normal;
  overflow-wrap: break-word;
}

.dbc-all-books__person-list-row {
  align-items: flex-start;
}

.dbc-all-books--fetching .dbc-all-books__grid .dbc-all-books__card--person {
  pointer-events: none;
  opacity: 0.7;
}

.dbc-all-books__card--person {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 140px;
  margin: 0 auto;
}

.dbc-all-books__person-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.dbc-all-books__person-link:hover .dbc-all-books__person-title {
  text-decoration: underline;
}

.dbc-all-books__person-media {
  --dbc-person-avatar: 95px;
  position: relative;
  display: block;
  width: var(--dbc-person-avatar);
  height: var(--dbc-person-avatar);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.dbc-all-books__person-media.is-circle {
  border-radius: 50%;
}

.dbc-all-books__person-media.is-square {
  border-radius: 14px;
}

/*
 * Person avatars must cover the frame (no letterboxing). Elementor’s
 * `.elementor img { height:auto; max-width:100% }` loads late and beats an
 * unpinned `%` height — use absolute fill + !important within this scope only.
 */
.dbc-all-books__person-media .dbc-all-books__person-img {
  position: absolute !important;
  inset: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  /* Ensure cover scaling always exceeds the square before clipping */
  min-width: 100% !important;
  min-height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
}

.dbc-all-books__person-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e5e7eb 0%, #f9fafb 100%);
}

.dbc-all-books__person-title {
  font-family: Poppins, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  line-height: 1.35;
  color: #111827;
}
