/*
 * The look of the site's own slider (the program is slider.js, the markup comes from build\lib\slider.mjs).
 *
 *   .rts          the slider: as wide as its place, w:h kept; "rts-full" goes from edge to edge of the window
 *   .rts-slide    one slide, all of them on top of each other; "rts-cur" is the one that shows
 *   .rts-bg       the picture behind the layers, fills the slide
 *   .rts-stage    w x h pixels in the middle, made smaller as a whole on narrow screens (--rts-r)
 *   .rts-pos      where a layer is;  .rts-cx / .rts-cy: the position is the middle of the layer
 *   .rts-layer    the layer itself: a text, a picture, a button
 *   .rts-card     a white card around a slider ("frame": "card"): the banners of the products
 *   .rts-over     on a slide while the pointer is on one of its trigger layers: layers with "rts-ov" take their other state
 *
 * Without scripts the first slide simply stands there with all its layers.
 * After a change here: raise "?v=" in build\lib\slider.mjs (SLIDER_STYLE), then build.
 */
.rts {
  --rts-r: 1;
  --rts-x: 0px;
  position: relative;
  width: 100%;
  max-width: calc(var(--rts-w) * 1px);
  aspect-ratio: var(--rts-w) / var(--rts-h);
  margin: 0 auto;
  overflow: hidden;
  line-height: normal;
  text-align: left;
  outline-offset: -2px;
}
.rts.rts-full {
  max-width: none;
  aspect-ratio: auto;
  height: min(calc(var(--rts-h) * 1px), calc(100vw * var(--rts-h) / var(--rts-w)));
}
/* "frame": "card" - the slider sits in a white card with round corners, a thin line and a soft shadow */
.rts-card {
  box-sizing: border-box;
  max-width: calc(var(--rts-w) * 1px + 22px);
  margin: 0 auto;
  padding: 10px;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
  overflow: hidden;
}
.rts-slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  visibility: hidden;
}
.rts-slide:first-child,
.rts-slide.rts-cur { visibility: visible; }
.rts-on > .rts-slide:not(.rts-cur) { visibility: hidden; }
.rts-slide.rts-cur { z-index: 2; }
.rts-slide.rts-leaving { z-index: 1; }
.rts-slide.rts-bare { background-color: transparent !important; }
.rts-slide.rts-bare > .rts-bg { visibility: hidden; }

.rts .rts-bg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  margin: 0;
}

.rts-stage {
  position: absolute;
  left: var(--rts-x);
  top: 0;
  width: calc(var(--rts-w) * 1px);
  height: calc(var(--rts-h) * 1px);
  transform: scale(var(--rts-r));
  transform-origin: 0 0;
}
.rts-pos {
  position: absolute;
  width: max-content;
  max-width: none;
}
.rts-pos.rts-cx { transform: translateX(-50%); }
.rts-pos.rts-cy { transform: translateY(-50%); }
.rts-pos.rts-cx.rts-cy { transform: translate(-50%, -50%); }

.rts .rts-layer {
  display: block;
  box-sizing: content-box;
  margin: 0;
  padding: 0;
  border: 0;
  max-width: none;
  font-size: 36px;
  line-height: normal;
  white-space: nowrap;
  word-wrap: normal;
  text-decoration: none;
  transform-origin: 50% 50%;
}
/* a picture is as large as its file (or as its width="" says) unless the layer gives a size; the height follows the width */
.rts img.rts-layer,
.rts a.rts-layer > img { height: auto; }
.rts a.rts-layer { cursor: pointer; }
.rts a.rts-layer > img { display: block; max-width: none; }
.rts .rts-button { cursor: pointer; }
.rts-ch { display: inline-block; white-space: pre; }

/* the "over" state: while the pointer is on a trigger layer of the slide, layers move, grow or change how see-through
   they are (slider.js writes each layer's numbers into --rts-ox ... and sets "rts-over" on the slide) */
.rts .rts-ov {
  transition: translate var(--rts-od, .3s) var(--rts-oe, ease), scale var(--rts-od, .3s) var(--rts-oe, ease), opacity var(--rts-od, .3s) var(--rts-oe, ease);
}
.rts-slide.rts-over .rts-ov { translate: var(--rts-ox, 0px) var(--rts-oy, 0px); scale: var(--rts-os, 1); }
.rts-slide.rts-over .rts-ov-o { opacity: var(--rts-oo, 1) !important; }
/* on a slide with a trigger layer only that layer and links feel the pointer: what lies over it must not take the pointer away */
.rts-slide.rts-hot .rts-pos { pointer-events: none; }
.rts-slide.rts-hot .rts-trigger,
.rts-slide.rts-hot a.rts-layer { pointer-events: auto; }

/* until the program has taken over, the layers wait unseen (they come in one by one); should the program never
   arrive - scripts switched off, file blocked - they simply show after a few seconds */
.rts:not(.rts-on) .rts-layer { visibility: hidden; animation: rts-late 1ms 4s forwards; }
@keyframes rts-late { to { visibility: visible; } }

/* the pieces of a slide change */
.rts-pieces { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.rts-piece { position: absolute; overflow: hidden; }
.rts-piece-in { position: absolute; }

/* arrows and dots (only when there is more than one slide) */
.rts-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 44px;
  height: 44px;
  margin: -22px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .25s, background-color .25s;
}
.rts-arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
}
.rts-prev { left: 16px; }
.rts-next { right: 16px; }
.rts-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.rts-next::before { transform: translate(-70%, -50%) rotate(45deg); }
.rts:hover .rts-arrow,
.rts:focus-within .rts-arrow { opacity: 1; }
.rts-arrow:hover,
.rts-arrow:focus-visible { background: rgba(0, 0, 0, .6); }
.rts-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
.rts-dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 3px rgba(0, 0, 0, .4);
  cursor: pointer;
  pointer-events: auto;
}
.rts-dot.rts-cur { background: #fff; }
.rts-arrow:focus-visible,
.rts-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: none) {
  .rts-arrow { opacity: .8; }
}
