/**
 * @copyright   Copyright (C) 2024 TLWebdesign. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

.mod-prettyslider .carousel-item {
  flex: 0 0 100%;
}

/* A dark gradient keeps the white caption text readable on light images */
.mod-prettyslider .carousel-caption {
  right: 0;
  bottom: 0;
  left: 0;
  padding: 3rem 15% 1.25rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
}

/* Buttons keep the colours of their Bootstrap class */
.mod-prettyslider .carousel-caption a:not(.btn) {
  color: #fff;
}

.mod-prettyslider .prettyslider-title {
  margin-bottom: 0.25rem;
}

/* The look of the title while it has no classes of its own */
.mod-prettyslider .prettyslider-title-default {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
}

.mod-prettyslider .carousel-caption p {
  margin-bottom: 0.5rem;
}

.mod-prettyslider .carousel-caption > :last-child {
  margin-bottom: 0;
}

.mod-prettyslider .prettyslider-toggle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  border: 0;
  border-radius: 50%;
}

.mod-prettyslider .prettyslider-toggle[hidden] {
  display: none;
}

.mod-prettyslider .prettyslider-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #000;
}

/* Pause icon: two bars */
.mod-prettyslider .prettyslider-toggle-icon {
  box-sizing: border-box;
  width: 0.875rem;
  height: 1rem;
  border-right: 0.3rem solid currentColor;
  border-left: 0.3rem solid currentColor;
}

/* Play icon: a triangle */
.mod-prettyslider .prettyslider-toggle.is-paused .prettyslider-toggle-icon {
  width: 0;
  height: 0;
  margin-left: 0.2rem;
  border-top: 0.5rem solid transparent;
  border-right: 0;
  border-bottom: 0.5rem solid transparent;
  border-left: 0.875rem solid currentColor;
}

/* Bullets at the bottom to go to a slide */
.mod-prettyslider .carousel-indicators {
  margin-bottom: 0.5rem;
}

.mod-prettyslider .carousel-indicators [data-bs-target] {
  box-sizing: border-box;
  width: 0.875rem;
  height: 0.875rem;
  margin: 0 0.3rem;
  background-color: #fff;
  background-clip: border-box;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.mod-prettyslider .carousel-indicators [data-bs-target]:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Room for the bullets below the caption */
.mod-prettyslider.has-indicators .carousel-caption {
  padding-bottom: 2.75rem;
}

/* Caption at the top: the gradient runs down, and the text stays clear of the pause button */
.mod-prettyslider.prettyslider-caption-top .carousel-caption {
  top: 0;
  bottom: auto;
  padding: 1.25rem max(15%, 4rem) 3rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
}

/* Caption in the middle: a dark band behind the text that fades out above and below it */
.mod-prettyslider.prettyslider-caption-middle .carousel-caption {
  top: 0;
  bottom: 0;
  height: fit-content;
  padding: 3rem 15%;
  margin-block: auto;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.65) 2.5rem, rgba(0, 0, 0, 0.65) calc(100% - 2.5rem), rgba(0, 0, 0, 0));
}

.mod-prettyslider.prettyslider-align-start .carousel-caption {
  text-align: start;
}

.mod-prettyslider.prettyslider-align-end .carousel-caption {
  text-align: end;
}

.mod-prettyslider.prettyslider-no-gradient .carousel-caption {
  background: none;
}

/* A line at the top that fills up until the next slide */
.mod-prettyslider .prettyslider-progress {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  height: 0.25rem;
  background: rgba(0, 0, 0, 0.35);
}

.mod-prettyslider .prettyslider-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

.mod-prettyslider .prettyslider-progress.is-running .prettyslider-progress-bar {
  animation: prettyslider-progress var(--prettyslider-interval, 5000ms) linear forwards;
}

@keyframes prettyslider-progress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

[dir="rtl"] .mod-prettyslider .prettyslider-progress-bar {
  transform-origin: right center;
}

@media (prefers-reduced-motion: reduce) {
  .mod-prettyslider .prettyslider-progress {
    display: none;
  }
}
