/* MAA Audioweb chapter image strip
   Add after css/reddank.css in /audioweb/index.html. */

#maaChapterImageStrip {
  --maa-strip-thumb-w: 92px;
  --maa-strip-thumb-h: 64px;
  --maa-strip-overlap: 0px;
  align-items: flex-end;
  background: transparent;
  border: 0;
  bottom: calc(var(--maa-audioleiste-height, 56px) + 6px);
  box-shadow: none;
  display: flex;
  gap: 12px;
  justify-content: center;
  left: 50%;
  max-width: min(92vw, 1480px);
  min-height: 106px;
  overflow-x: visible;
  overflow-y: visible;
  padding: 28px 14px 12px;
  position: fixed;
  right: auto;
  scrollbar-width: none;
  scroll-padding: 16px;
  transform: translateX(-50%);
  width: max-content;
  z-index: 2147483000;
}

#maaChapterImageStrip::-webkit-scrollbar {
  display: none;
  height: 0;
}

#maaChapterImageStrip::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .25);
}

#maaChapterImageStrip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .58);
  border-radius: 99px;
}

.maa-chapter-image-thumb {
  appearance: none;
  background: rgba(6, 9, 14, .34);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 2px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .34);
  cursor: pointer;
  flex: 0 0 auto;
  height: var(--maa-strip-thumb-h);
  margin: 0 0 0 calc(var(--maa-strip-overlap) * -1);
  overflow: hidden;
  padding: 0;
  position: relative;
  transition: border-color .16s ease, box-shadow .16s ease, filter .16s ease, transform .16s ease;
  transform-origin: center bottom;
  width: var(--maa-strip-thumb-w);
}

.maa-chapter-image-thumb:first-child {
  margin-left: 0;
}

.maa-chapter-image-thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  opacity: .92;
  transition: opacity .16s ease, transform .2s ease;
  width: 100%;
}

.maa-chapter-image-thumb::after {
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.78));
  bottom: 0;
  color: #fff;
  content: attr(data-timecode);
  font: 700 12px/1.1 Arial, sans-serif;
  left: 0;
  padding: 24px 8px 7px;
  position: absolute;
  right: 0;
  text-align: left;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}

.maa-chapter-image-thumb__number {
  align-items: center;
  background: rgba(0, 0, 0, .58);
  border: 1px solid rgba(255, 255, 255, .38);
  color: #fff;
  display: flex;
  font: 700 11px/1 Arial, sans-serif;
  height: 22px;
  justify-content: center;
  left: 7px;
  min-width: 22px;
  padding: 0 5px;
  position: absolute;
  top: 7px;
  z-index: 2;
}

.maa-chapter-image-thumb:hover,
.maa-chapter-image-thumb:focus-visible {
  border-color: #fff;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .52);
  filter: saturate(1.08) contrast(1.04);
  outline: none;
  transform: translateY(-5px) scale(1.045);
  z-index: 3;
}

.maa-chapter-image-thumb:hover img,
.maa-chapter-image-thumb:focus-visible img,
.maa-chapter-image-thumb.is-active img {
  opacity: 1;
  transform: scale(1.05);
}

.maa-chapter-image-thumb.is-active {
  border-color: rgba(255, 255, 255, .55);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .5), 0 0 18px rgba(49, 205, 240, .22);
}

.maa-chapter-image-thumb.is-active::before {
  background: #31cdf0;
  bottom: 0;
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  z-index: 3;
}

body.maa-audioweb-start #maaChapterImageStrip,
body.maa-audioweb-start #maaChapterImagePreview,
body.maa-audioweb-start #maaChapterStagePreview,
body.maa-audioweb-start #HgBildLeiste,
body.maa-audioweb-start #audioleiste,
body.maa-audioweb-start #audioLeiste,
body.maa-audioweb-start #Player,
body.maa-audioweb-start #playercontrols,
body.maa-audioweb-start .mejs-container {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

#maaChapterImagePreview {
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 2px solid rgba(255, 255, 255, .88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .62);
  display: none !important;
  height: min(34vh, 320px);
  left: var(--maa-preview-x, 50vw);
  pointer-events: none;
  position: fixed;
  bottom: calc(var(--maa-audioleiste-height, 56px) + 98px);
  transform: translateX(-50%);
  width: min(40vw, 520px);
  z-index: 2147482999;
}

#audioleiste,
#audioLeiste,
#Player,
#playercontrols,
.mejs-container {
  position: relative;
  z-index: 2147483100;
}

body.maa-image-strip-ready #audioleiste {
  background: #000 !important;
  bottom: 0 !important;
  color: #fff !important;
  display: block !important;
  left: 0 !important;
  min-height: var(--maa-audioleiste-height, 56px);
  opacity: 1 !important;
  position: fixed !important;
  visibility: visible !important;
  width: 100% !important;
}

#maaChapterImagePreview.is-visible {
  display: none !important;
}

#maaChapterImagePreview::after {
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.76));
  bottom: 0;
  color: #fff;
  content: attr(data-timecode) "  " attr(data-title);
  font: 700 18px/1.12 "Saira Extra Condensed", Arial, sans-serif;
  left: 0;
  letter-spacing: 0;
  padding: 42px 16px 14px;
  position: absolute;
  right: 0;
  text-align: left;
  text-shadow: 0 1px 6px rgba(0,0,0,.78);
}

#maaChapterStagePreview {
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: cover;
  bottom: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity .16s ease;
  visibility: hidden;
  z-index: 4;
}

#maaChapterStagePreview.is-visible {
  opacity: .9;
  visibility: visible;
}

body.maa-image-strip-previewing #Karten .einzelaudio {
  opacity: .025 !important;
  transition: opacity .12s ease !important;
}

body.maa-image-strip-previewing #Karten {
  pointer-events: auto;
}

body.maa-image-strip-previewing #maaChapterImageStrip {
  pointer-events: auto;
}

body.maa-image-strip-card-clicks #Karten .einzelaudio {
  cursor: pointer;
}

body.maa-image-strip-ready #HgBildLeiste {
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 650px) {
  #maaChapterImageStrip {
    --maa-strip-thumb-w: 82px;
    --maa-strip-thumb-h: 60px;
    --maa-strip-overlap: 10px;
    bottom: calc(var(--maa-audioleiste-height, 64px) + 8px);
    gap: 8px;
    min-height: 88px;
    padding: 14px 12px 12px;
    max-width: 94vw;
  }

  .maa-chapter-image-thumb::after {
    font-size: 11px;
    padding: 20px 6px 6px;
  }

  .maa-chapter-image-thumb:hover,
  .maa-chapter-image-thumb:focus-visible {
    transform: translateY(-3px) scale(1.03);
  }

  #maaChapterImagePreview {
    display: none !important;
  }
}

/* Active chapter artwork across the player stage, under a warm orange tint. */
#HGBild,
#HGBild2 {
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}

#maaChapterStageBackground {
  background-color: #2b2118;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: saturate(.82) contrast(1.04);
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 2;
}

#maaChapterBackgroundTint {
  background: #f2a23a;
  inset: 0;
  opacity: .88;
  pointer-events: none;
  position: fixed;
  transition: opacity .22s ease;
  z-index: 3;
}

body.maa-player-background-hover #maaChapterBackgroundTint {
  opacity: .33;
}

/* All player and chapter UI remains above the artwork/tint layers. */
#inhaltinhalt,
#Karten_blaettern_links,
#Karten_blaettern_rechts,
#maaChapterImageStrip,
#maaChapterImagePreview,
#audioleiste,
#audioLeiste,
#Player,
#playercontrols,
.mejs-container {
  position: relative;
  z-index: 4;
}

@media (hover: none), (pointer: coarse) {
  #maaChapterBackgroundTint {
    opacity: .88;
  }
}
