@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Ethiopic:wght@500;600;700&display=swap");

/* Option 2 document cards. Scoped under .dz-card so .fold / .bookborder stay untouched. */
.dz-card {
  --dz-orange: #f26522;
  --dz-text: #1d1d1f;
  --dz-muted: #6e6e73;
  --dz-read: #f26522;
  position: relative;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 0 0 10px;
  margin: 0 4px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 28px rgba(0, 0, 0, .07);
  transition: transform .45s ease, box-shadow .45s ease;
  overflow: visible;
  -webkit-font-smoothing: antialiased;
}

.dz-card a {
  text-decoration: none;
  color: inherit;
}

.dz-card a:hover,
.dz-card a:focus {
  text-decoration: none;
  color: inherit;
}

.dz-card__stage {
  position: relative;
  aspect-ratio: 2 / 3;
  perspective: 900px;
  overflow: visible;
  border-radius: 12px 12px 0 0;
}

.dz-card__pages {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: auto;
  right: -5px;
  width: 12px;
  background: linear-gradient(90deg, #efeae2, #f7f4ee 40%, #faf8f4);
  border-radius: 0 3px 3px 0;
  box-shadow: 1px 0 0 #e6e1d8, 2px 0 0 #f3efe8, 3px 0 0 #e4dfd6, 5px 0 0 #f7f4ee, 6px 0 0 #ddd7cc;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
  transition: width .45s ease, right .45s ease, left .45s ease;
}

.dz-card__cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 12px 12px 2px 2px;
  overflow: hidden;
  background: #eceae6;
  transform-origin: left center;
  transform: rotateY(0deg);
  transition: transform .55s cubic-bezier(.22, .61, .36, 1), box-shadow .55s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 4px 0 10px -3px rgba(0, 0, 0, .28);
}

/* Spine shade + paper highlight */
.dz-card__cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 18%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, .28) 0%,
    rgba(0, 0, 0, .08) 28%,
    rgba(255, 255, 255, .22) 52%,
    rgba(255, 255, 255, .04) 70%,
    transparent 100%);
}

.dz-card__cover--light::before {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, .16) 0%,
    rgba(0, 0, 0, .05) 28%,
    rgba(255, 255, 255, .35) 52%,
    transparent 100%);
}

/* Sheen */
.dz-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 38%, rgba(255, 255, 255, .18) 47.5%, transparent 57%);
}

.dz-card__cover--light::after {
  background: linear-gradient(118deg, transparent 38%, rgba(255, 255, 255, .28) 47.5%, transparent 57%);
}

/* Hairline so white / near-white covers don't disappear on the page */
.dz-card__cover--photo {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .06),
    4px 0 10px -3px rgba(0, 0, 0, .22),
    inset 0 0 0 1px rgba(0, 0, 0, .10);
}

.dz-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 0;
}

.dz-card--generated .dz-card__img,
.dz-card--fallback .dz-card__img {
  display: none;
}

/* Typographic covers */
.dz-card__gen {
  display: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, var(--c2) 0%, var(--c1) 72%);
  color: var(--ink);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 14px 36px;
  text-align: center;
}

.dz-card--generated .dz-card__gen,
.dz-card--fallback .dz-card__gen {
  display: flex;
}

.dz-card__frame {
  position: absolute;
  inset: 12px 12px 14px 14px;
  border: 1px solid var(--ink);
  opacity: .35;
  border-radius: 1px;
  pointer-events: none;
  z-index: 1;
}

.dz-card__inner {
  position: relative;
  z-index: 1;
  max-width: 100%;
}

.dz-card__kick {
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: 10px;
}

.dz-card__rule {
  width: 36px;
  height: 1px;
  background: var(--ink);
  opacity: .45;
  margin: 0 auto 10px;
}

.dz-card__gtitle {
  font-family: Georgia, "Times New Roman", "Noto Serif Ethiopic", "Nyala", "Abyssinica SIL", serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.22;
  overflow-wrap: break-word;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
  unicode-bidi: isolate;
}

.dz-card--eth .dz-card__gtitle,
.dz-card__gtitle--eth {
  font-family: "Noto Serif Ethiopic", "Nyala", "Abyssinica SIL", Georgia, serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
  word-break: break-word;
}

.dz-card--audio .dz-card__gtitle {
  font-weight: 550;
}

.dz-card__gen--doc .dz-card__gtitle {
  font-size: 14.5px;
  font-weight: 650;
}

.dz-card__badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px 0 5px;
  border-radius: 999px;
  background: rgba(20, 20, 22, .78);
  color: #fff;
  font-size: 8.5px;
  font-weight: 620;
  letter-spacing: .06em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  line-height: 1;
  max-width: calc(100% - 16px);
}

.dz-card__badge--light {
  background: rgba(30, 30, 32, .72);
}

/* File-type badge is only for generated / fallback jackets (and the Audiobook badge). */
.dz-card:not(.dz-card--generated):not(.dz-card--fallback):not(.dz-card--audio) .dz-card__badge {
  display: none;
}


.dz-card__badge .dz-card__ico-phones {
  width: 11px;
  height: 11px;
  flex: none;
}

.dz-card__play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.dz-card__play .dz-card__ico-play {
  width: 30px;
  height: 30px;
  color: rgba(255, 255, 255, .95);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .35));
  transform: scale(1);
  opacity: .9;
  transition: opacity .35s ease, transform .35s ease;
}

.dz-card__meta {
  padding: 12px 12px 0;
}

.dz-card__title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
  color: var(--dz-text);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  min-height: 2.6em;
  overflow-wrap: break-word;
  word-break: break-word;
  unicode-bidi: isolate;
}

.dz-card--eth .dz-card__title {
  font-family: "Noto Serif Ethiopic", "Nyala", "Abyssinica SIL", inherit;
  font-weight: 500;
}

.dz-card__user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--dz-muted);
  margin: 0 0 8px;
  min-width: 0;
}

.dz-card__user a {
  color: var(--dz-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.dz-card__user a:hover {
  color: var(--dz-text);
}

.dz-card__user .glyphicon {
  color: var(--dz-orange);
  font-size: 11px;
  flex: none;
}

.dz-card__user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.dz-card__acts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  padding: 0 1px 2px;
}

.dz-card__acts a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: -.01em;
  line-height: 1;
  cursor: pointer;
}

.dz-card__add {
  color: var(--dz-orange);
}

.dz-card__add:hover,
.dz-card__add:focus {
  color: var(--dz-orange);
}

.dz-card__add .fa-plus,
.dz-card__add .fas {
  color: var(--dz-orange);
  font-size: 10px;
}

.dz-card__read {
  color: var(--dz-read);
  margin-left: auto;
}

.dz-card__read:hover,
.dz-card__read:focus {
  color: var(--dz-orange);
}

.dz-card__read .glyphicon {
  font-size: 10px;
  color: inherit;
}

/* Desktop hover: book-open tilt. No tilt on touch. */
@media (hover: hover) and (pointer: fine) {
  .dz-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 18px 40px rgba(0, 0, 0, .12);
  }

  .dz-card:hover .dz-card__cover {
    transform: rotateY(-16deg);
    box-shadow: 10px 14px 28px rgba(0, 0, 0, .22), 4px 0 10px -3px rgba(0, 0, 0, .28);
  }

  .dz-card:hover .dz-card__pages {
    right: -8px;
    width: 20px;
  }

  .dz-card:hover .dz-card__play .dz-card__ico-play {
    opacity: 1;
    transform: scale(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dz-card,
  .dz-card__cover,
  .dz-card__pages,
  .dz-card__play .dz-card__ico-play {
    transition: none;
  }

  .dz-card:hover {
    transform: none;
  }

  .dz-card:hover .dz-card__cover {
    transform: none;
  }

  .dz-card:hover .dz-card__pages {
    right: -5px;
    width: 12px;
  }

  .dz-card--audio .dz-card__play .dz-card__ico-play {
    opacity: 1;
    transform: none;
  }
}

/* Arabic UI: spine on the right, pages on the left, open the other way. */
[dir="rtl"] .dz-card__pages {
  right: auto;
  left: -5px;
  border-radius: 3px 0 0 3px;
  box-shadow: -1px 0 0 #e6e1d8, -2px 0 0 #f3efe8, -3px 0 0 #e4dfd6, -5px 0 0 #f7f4ee, -6px 0 0 #ddd7cc;
}

[dir="rtl"] .dz-card__cover {
  transform-origin: right center;
}

[dir="rtl"] .dz-card__cover::before {
  inset: 0 0 0 auto;
  background: linear-gradient(270deg,
    rgba(0, 0, 0, .28) 0%,
    rgba(0, 0, 0, .08) 28%,
    rgba(255, 255, 255, .22) 52%,
    rgba(255, 255, 255, .04) 70%,
    transparent 100%);
}

[dir="rtl"] .dz-card__cover--light::before {
  background: linear-gradient(270deg,
    rgba(0, 0, 0, .16) 0%,
    rgba(0, 0, 0, .05) 28%,
    rgba(255, 255, 255, .35) 52%,
    transparent 100%);
}

[dir="rtl"] .dz-card__badge {
  left: auto;
  right: 8px;
}

[dir="rtl"] .dz-card__read {
  margin-left: 0;
  margin-right: auto;
}

@media (hover: hover) and (pointer: fine) {
  [dir="rtl"] .dz-card:hover .dz-card__cover {
    transform: rotateY(16deg);
  }

  [dir="rtl"] .dz-card:hover .dz-card__pages {
    left: -8px;
    right: auto;
    width: 20px;
  }
}

@media (max-width: 767px) {
  .dz-card {
    margin-bottom: 14px;
  }

  .dz-card__acts a {
    font-size: 10px;
  }

  .dz-card__title {
    font-size: 12.5px;
  }
}

/* Give the page-edge room; don't clip the tilt. */
.col-xs-6.col-md-2:has(> .dz-card),
.home_page_style .col-xs-6:has(> .dz-card) {
  overflow: visible;
}


/* ========== Option B: audiobook covers (podcast / album art) ==========
   PDF / document cards keep the book spine, frame, sheen and tilt. */

.dz-card--audio .dz-card__pages {
  display: none;
}

.dz-card--audio .dz-card__stage {
  perspective: none;
}

.dz-card--audio .dz-card__cover,
.dz-card--audio .dz-card__cover--light,
.dz-card--audio .dz-card__cover--photo {
  border-radius: 12px 12px 0 0;
  box-shadow: none;
  transform: none;
  transform-origin: center center;
  background: var(--c1, #eceae6);
}

.dz-card--audio .dz-card__cover::before,
.dz-card--audio .dz-card__cover::after,
.dz-card--audio .dz-card__cover--light::before,
.dz-card--audio .dz-card__cover--light::after {
  content: none;
  display: none;
}

/* The generated audio layer fills the 2:3 cover. */
.dz-card__gen--audio {
  padding: 10px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-align: center;
  background: var(--c1);
  overflow: hidden;
  color: var(--ink);
}

.dz-card__mesh {
  position: absolute;
  inset: -22%;
  background:
    radial-gradient(52% 48% at 16% 18%, var(--c2) 0%, transparent 68%),
    radial-gradient(48% 44% at 90% 12%, var(--c3, var(--c2)) 0%, transparent 64%),
    radial-gradient(70% 58% at 30% 95%, var(--c1) 0%, transparent 68%),
    radial-gradient(42% 40% at 82% 72%, var(--c2) 0%, transparent 68%),
    var(--c1);
  filter: blur(16px);
  transform: scale(1.06);
  z-index: 0;
  pointer-events: none;
}

.dz-card__album {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: linear-gradient(165deg, var(--c2) 0%, var(--c1) 88%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18), inset 0 0 0 1px rgba(255, 255, 255, .38);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 14px 14px;
  overflow: hidden;
  color: var(--ink);
  flex: none;
}

.dz-card__album::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, .28), transparent 55%);
}

.dz-card--audio:not(.dz-card--light) .dz-card__album {
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.dz-card__pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  max-width: 100%;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .36);
  border: 1px solid rgba(255, 255, 255, .45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1;
  flex: none;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dz-card--light .dz-card__pill {
  background: rgba(255, 255, 255, .55);
  border-color: rgba(255, 255, 255, .7);
}

.dz-card--audio:not(.dz-card--light) .dz-card__pill {
  background: rgba(255, 255, 255, .20);
  border-color: rgba(255, 255, 255, .28);
}

.dz-card__pill .dz-card__ico-phones {
  width: 10px;
  height: 10px;
  flex: none;
}

.dz-card__mid {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dz-card--audio .dz-card__gtitle {
  width: 100%;
  font-family: roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.18;
  text-align: center;
  margin: 0;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.dz-card--audio.dz-card--eth .dz-card__gtitle,
.dz-card--audio .dz-card__gtitle--eth {
  font-family: "Noto Sans Ethiopic", "Nyala", "Abyssinica SIL", roboto, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.32;
  letter-spacing: 0;
}

.dz-card__dock {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .28);
  border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .10);
  flex: none;
}

.dz-card--audio:not(.dz-card--light) .dz-card__dock {
  background: rgba(12, 18, 28, .32);
  border-color: rgba(255, 255, 255, .16);
}

.dz-card--light .dz-card__dock {
  background: rgba(255, 255, 255, .42);
  border-color: rgba(255, 255, 255, .55);
}

.dz-card__wave {
  flex: 1;
  height: 18px;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
}

.dz-card__wave span {
  flex: 1;
  min-width: 2px;
  border-radius: 1.5px;
  background: currentColor;
  opacity: .5;
}

/* Play sits in the dock, not over the cover. */
.dz-card--audio .dz-card__play {
  position: relative;
  right: auto;
  bottom: auto;
  inset: auto;
  flex: none;
  z-index: 3;
}

.dz-card--audio .dz-card__play .dz-card__ico-play {
  width: 28px;
  height: 28px;
  opacity: 1;
  transform: scale(1);
}

/* No book-open tilt on audiobooks; the card itself still lifts. */
@media (hover: hover) and (pointer: fine) {
  .dz-card--audio:hover .dz-card__cover {
    transform: none;
    box-shadow: none;
  }

  .dz-card--audio:hover .dz-card__pages {
    right: -5px;
    width: 12px;
  }

  .dz-card--audio:hover .dz-card__play .dz-card__ico-play {
    opacity: 1;
    transform: scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dz-card--audio .dz-card__cover,
  .dz-card--audio .dz-card__mesh,
  .dz-card--audio .dz-card__play .dz-card__ico-play {
    transition: none;
    filter: none;
  }

  .dz-card--audio .dz-card__mesh {
    /* Keep the mesh, just skip the blur-scale animation if any. */
    transform: none;
  }

  .dz-card--audio:hover .dz-card__play .dz-card__ico-play {
    transform: none;
  }
}

/* RTL: dock play goes to the start (right in RTL is visual start? flex row-reverse
   under dir=rtl already flips. Keep the wave reading naturally; play at the "end". */
[dir="rtl"] .dz-card--audio .dz-card__dock {
  padding: 0 12px 0 8px;
}

[dir="rtl"] .dz-card--audio .dz-card__cover {
  transform-origin: center center;
}

@media (hover: hover) and (pointer: fine) {
  [dir="rtl"] .dz-card--audio:hover .dz-card__cover {
    transform: none;
  }
}

@media (max-width: 767px) {
  .dz-card__gen--audio {
    padding: 8px;
    gap: 8px;
  }

  .dz-card__album {
    border-radius: 16px;
    padding: 10px 12px 12px;
  }

  .dz-card--audio .dz-card__gtitle {
    font-size: 15px;
  }

  .dz-card--audio.dz-card--eth .dz-card__gtitle,
  .dz-card--audio .dz-card__gtitle--eth {
    font-size: 14.5px;
  }

  .dz-card__dock {
    height: 40px;
  }
}
