/* AN Category Images — Frontend CSS
   Styles for image display on book covers, index cards,
   hero tiles in both AN Spectacle Pro & AN Library Pro */

/* ── Book cover: image mode ── */
.shelf-book[data-term] .book-cover,
.anlib-book[data-term] .anlib-book-cover {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* Overlay gradient on covers that have images (improves legibility) */
.shelf-book[data-term] .book-cover::after,
.anlib-book[data-term] .anlib-book-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,.05) 0%,
    rgba(0,0,0,.0)  40%,
    rgba(0,0,0,.35) 100%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}

/* Shine layer on top of image */
.shelf-book[data-term] .book-shine,
.anlib-book[data-term] .anlib-book-shine {
  z-index: 3 !important;
  opacity: .4 !important;
}

/* Image transitions */
.shelf-book[data-term] .book-cover,
.anlib-book[data-term] .anlib-book-cover {
  transition: transform .4s cubic-bezier(0.16,1,0.3,1) !important;
}
.shelf-book[data-term]:hover .book-cover,
.anlib-book[data-term]:hover .anlib-book-cover {
  transform: scale(1.03) !important;
}

/* ── Index cards: image mode ── */
.corpus-index-card[data-term],
.anlib-icard[data-term] {
  overflow: hidden;
}

/* Mini image strip at top of index card */
.anci-icard-img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
  border-radius: calc(var(--r-lg, 14px) - 1px) calc(var(--r-lg, 14px) - 1px) 0 0;
  margin: -16px -14px 10px;
  width: calc(100% + 28px);
}

/* ── Hero category tiles ── */
.cat-hero-tile[data-term] {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}
.cat-hero-tile[data-term]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(0,0,0,.45) 0%,
    rgba(0,0,0,.2)  100%
  );
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
}
.cat-hero-tile[data-term] .cat-hero-emoji,
.cat-hero-tile[data-term] .cat-hero-name,
.cat-hero-tile[data-term] .cat-hero-count,
.cat-hero-tile[data-term] .cat-hero-bar {
  position: relative;
  z-index: 1;
}

/* ── Cat all grid cards ── */
.cat-all-card[data-term] .cat-all-emoji {
  /* Keep emoji as label badge when image is present */
  background: rgba(0,0,0,.4);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
}

/* ── Loading shimmer for cards awaiting images ── */
.anci-img-loading .book-cover,
.anci-img-loading .anlib-book-cover {
  background: linear-gradient(
    90deg,
    rgba(134,239,172,.05) 25%,
    rgba(134,239,172,.15) 50%,
    rgba(134,239,172,.05) 75%
  );
  background-size: 200% 100%;
  animation: anciShimmer 1.5s infinite;
}
@keyframes anciShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
