/* TLDM dependency-free carousel */
.tldm-carousel {
  position: relative;
  width: min(100%, 450px);
  margin: 0 auto 1rem;
}

.tldm-slider {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

#slider1.tldm-slider {
  aspect-ratio: 9 / 5;
  background: #111;
}

#slider2.tldm-slider {
  height: 250px;
  background: transparent;
}

.tldm-slider > li {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 650ms ease, visibility 650ms ease;
}

.tldm-slider:not(.is-ready) > li:first-child,
.tldm-slider > li.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.tldm-slider > li > a {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

#slider1.tldm-slider img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#slider2.tldm-slider img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 250px;
  object-fit: contain;
  margin: 0 auto;
}

.tldm-slider-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  font: 700 0.95rem/1.3 Arial, Helvetica, sans-serif;
  text-align: center;
}

.tldm-carousel-button {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.68);
  font: 700 1.4rem/1 Arial, sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
}

.tldm-carousel-button:hover,
.tldm-carousel-button:focus-visible {
  background: #0066ff;
}

.tldm-carousel-button--previous {
  left: 0.5rem;
}

.tldm-carousel-button--next {
  right: 0.5rem;
}

.tldm-carousel-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.6rem 0 0;
}

.tldm-carousel-dot {
  width: 0.72rem;
  height: 0.72rem;
  padding: 0;
  border: 1px solid #444;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.tldm-carousel-dot.is-active,
.tldm-carousel-dot:hover,
.tldm-carousel-dot:focus-visible {
  border-color: #0066ff;
  background: #0066ff;
}

.tldm-carousel-button:focus-visible,
.tldm-carousel-dot:focus-visible,
.tldm-slider a:focus-visible {
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .tldm-slider > li {
    transition: none;
  }
}
