/* =======children vanilla JavaScript Слайдер====== */

:root {
  --name-performances: "«Рандеву»";
  /* --background-fon-children: radial-gradient(circle 150vh at top left, transparent, rgba(226, 2, 203, 0.2)); */
  --width-item-perform: clamp(112px, 22vw, 306px);
  /* --width-item-perform: 22vw; */
  --right-item-perform: calc(var(--width-item-perform) / 2);
  --left-item-perform: calc(-1 * var(--right-item-perform));
  --right-width-perform: calc(var(--width-item-perform) - 2.5vw);
  --left-width-perform: calc(-1 * var(--right-width-perform));
  --width-item-child: clamp(170px, 28vw, 390px);
}

/*     ============================================================== */

.repertoire {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 200vh;
  height: auto;
  overflow-x: hidden;
  /* visible: иначе Chrome «съедает» прокрутку колесом по секции */
  overflow-y: visible;
}

.repertoire article {
  position: relative;
  /* min-height: 100vh; */
  text-align: center;
  padding: 2vh 0px;
}

.repertoire article.performances {
  height: calc(100vh - var(--height-header));
}
.content {
  display: flex;
  justify-content: space-evenly;
  /* flex-wrap: wrap; */
  flex-direction: row;
  margin-top: 5vh;
  gap: 10px;
}

/* perspective на родителе — корректный 3D в Chrome */
.performances .content {
  perspective: min(1200px, 92vw);
  transform-style: preserve-3d;
}

/* TODO: 3D бесконечный слайдер изображений =================== */
.performances__slider {
  position: relative;
  width: 65vw;
  height: 70vh;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}
.performances__slider .item {
  position: absolute;
  top: 0px;
  left: calc(50% - var(--right-item-perform));
  width: var(--width-item-perform);
  /* left: calc(50% - 11vw);
  width: 22vw; */
  aspect-ratio: 9 / 10; /* 9/10 */
  background: transparent;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  transition: 1.1s;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform-origin: bottom center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
  user-select: none;
  /* -webkit-box-reflect ломает порядок слоёв и 3D в Chrome */
  opacity: 0;
}
.performances__slider .item::before {
  /* white-space: nowrap; */
  width: 50vw;
}
/* translateZ после rotateY: в Chrome иначе соседние «боковые» карты рисуются поверх центра */
.performances__slider .item:nth-child(1) {
  transform: translate3d(var(--left-width-perform), 7vh, 0) scale(0.8)
    rotateY(30deg) translateZ(-85px);
  z-index: 1;
}
.performances__slider .item:nth-child(2) {
  transform: translate3d(var(--left-width-perform), 7vh, 0) scale(0.8)
    rotateY(30deg) translateZ(-65px);
  z-index: 2;
  opacity: 1;
}
.performances__slider .item:nth-child(3) {
  transform: translate3d(var(--left-item-perform), 9vh, 0) scale(0.88)
    rotateY(24deg) translateZ(-40px);
  z-index: 3;
  opacity: 1;
}
.performances__slider .item:nth-child(4) {
  transform: translate3d(0px, 11vh, 0) scale(1) rotateY(0deg) translateZ(100px);
  z-index: 10;
  opacity: 1;
}
.performances__slider .item:nth-child(4)::before {
  transform: translate3d(-14vw, -10vh, 0) rotate(0deg) scale(1.32) translateZ(2px);
  opacity: 1;
  z-index: 12;
}
.performances__slider .item:nth-child(5) {
  transform: translate3d(var(--right-item-perform), 9vh, 0) scale(0.88)
    rotateY(-24deg) translateZ(-40px);
  z-index: 3;
  opacity: 1;
}
.performances__slider .item:nth-child(6) {
  transform: translate3d(var(--right-width-perform), 7vh, 0) scale(0.8)
    rotateY(-30deg) translateZ(-65px);
  z-index: 2;
  opacity: 1;
}
.performances__slider .item:nth-child(7) {
  transform: translate3d(var(--right-width-perform), 7vh, 0) scale(0.8)
    rotateY(-30deg) translateZ(-85px);
  z-index: 1;
  opacity: 1;
}
/* в разметке 8 постеров — без правила 8-й оказывается в центре поверх остальных */
.performances__slider .item:nth-child(8) {
  transform: translate3d(var(--right-width-perform), 7vh, 0) scale(0.8)
    rotateY(-30deg) translateZ(-95px);
  z-index: 0;
  opacity: 0;
}
.performances__slider .item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
}
/* TODO: children vanilla JavaScript Слайдер     ============== */
.children .content {
  margin-top: 11vh;
}
.children__slider {
  position: relative;
  width: 65vw;
  height: 70vh;
  top: 0;
  left: 0;
  will-change: transform;
}
.children__slider .item {
  position: absolute;
  width: var(--width-item-child);
  aspect-ratio: 3/2;
  /* --opacity-bgmain: 1; */
  background: var(--img);
  background-repeat: no-repeat;
  /* linear-gradient(rgba(0, 0, 0, 1), rgba(2, 2, 2, 1)); */
  /* var(--gradient-background-fon); */
  background-size: var(--img-size, cover);
  background-position: var(--img-position, center);
  transition: 2s ease-in-out;
  backface-visibility: hidden;
  will-change: transform, opacity;
  border-radius: 10px;
  box-shadow: 0 25px 25px rgba(0, 0, 0, 0.8);
}
.children__slider .item:nth-child(n-1) {
  transform: translate3d(80vw, -100vh, 0) rotate(-0deg);
  /* transform: translate3d(-3vw, 2vh, 0) rotate(-40deg); */
}
.children__slider .item:nth-child(1) {
  transform: translate3d(-3vw, 2vh, 0) rotate(-40deg);
}
.children__slider .item:nth-child(2) {
  transform: translate3d(5vw, 7vh, 0) rotate(-30deg);
}
.children__slider .item:nth-child(3) {
  transform: translate3d(14vw, 14vh, 0) rotate(-20deg);
}
.children__slider .item:nth-child(4) {
  transform: translate3d(21vw, 21vh, 0) rotate(-15deg);
}
.children__slider .item:nth-child(5) {
  transform: translate3d(37vw, 35vh, 0) scale(1.32);
  transform-origin: bottom right;
  z-index: 12;
}
.children__slider .item:nth-child(5)::before {
  transform: translate3d(-8vw, -26vh, 0) rotate(0deg);
  opacity: 1;
  z-index: 12;
}
.children__slider .item:nth-child(n + 6) {
  transform: translate3d(80vw, -100vh, 0);
  opacity: 0;
  z-index: 13;
}
.children__slider .item::before {
  --name-performances: attr(data-text);
}

.item::before {
  width: 58vw;
  display: flex;
  padding-left: 30px;
  content: var(--name-performances);
  position: absolute;
  transition: 1.1s ease-in-out;
  transform: translate3d(-50px, -185px, 0) rotate(0deg);
  opacity: 0;
  letter-spacing: -1px;
  font-family: var(--font-text);
  font-size: clamp(14px, 2.7vw, 30px);
  font-weight: 800;
  font-style: italic;
  text-shadow: 6px 6px 6px rgba(0, 0, 0, 0.6);
  background: var(--gradient-title);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  background-size: 150% 150%;
  animation: gradientShift 10s linear infinite;
}
/* TODO: ".fabula" =========================================== */
.fabula {
  /* position: absolute; */
  position: relative;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 20px 10px 0;
  width: 28vw;
  height: 70vh;
  z-index: 15;
  opacity: 1;
}
/*TODO: scroll__content scrolling --- overflow-y: auto;===========*/
.scroll__content {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 80%;
  height: calc(100% - var(--height-header) - 24px);
  border: none;
}

.scroll__content .fabula__content {
  /* без класса --scrollable не создаём scrollport: колесо крутит страницу на всей площади */
  overflow-y: visible;
  overscroll-behavior: auto;
  position: relative;
  padding: 0 18px 26px 0;
  height: 100%;
  color: rgb(255, 166, 0);
  text-shadow: 3px 3px 3px rgba(0, 0, 0, 0.9);
}

.scroll__content .fabula__content.fabula__content--scrollable {
  overflow-y: auto;
}

.scroll__content .fabula__content::-webkit-scrollbar {
  width: 0;
}

.scroll__content .fabula__content h3 {
  color: inherit;
}

.scroll__content .fabula__content > span {
  display: block;
  font-size: small;
  color: inherit;
  opacity: 0.8;
}

/* Локальные полосы прокрутки текста — не фиксированные на весь экран (см. #progressbar в main.css) */
.scroll__content > .scroll-path {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  background: rgba(120, 120, 120, 0.28);
  z-index: 2;
  border-radius: 4px;
  pointer-events: none;
}
.scroll__content > .progressbar {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  min-height: 4px;
  height: 2%;
  z-index: 3;
  border-radius: 4px;
  pointer-events: none;
  background: linear-gradient(to top, #008aff, #00ffe7);
  animation: none;
  box-shadow: none;
}
.scroll__content > .progressbar::before,
.scroll__content > .progressbar::after {
  display: none;
}
/* .grad-box {
  position: absolute;
  position: relative;
  top: -25px;
  left: 0;
  width: 100%;
  height: 50px;
  background: linear-gradient(
    to bottom,
    rgba(145, 11, 56, 0) 0%,
    rgba(145, 11, 56, 0.6) 50%,
    rgba(145, 11, 56, 0) 100%
  );
  pointer-events: none;
  border: none;
} */

/* TODO: ".fabula__btns" ========================*/
.fabula__btns {
  display: flex;
  gap: 15px;
  position: absolute;
  bottom: 12px;
}
/*! social-btn ================================ */
.social-btn {
  position: relative;
  display: block;
  width: var(--height-header);
  aspect-ratio: 1;
  text-align: center;
  border-radius: 50%;
  padding: 5px;
  border: none;
  box-shadow: 0 10px 15px #000;
  background: linear-gradient(0deg, #919191, #fff);
  opacity: 0.8;
  transition: 0.5s;
  cursor: pointer;
  z-index: 1000;
}

.social-btn:hover {
  box-shadow: 0 2px 5px #000;
  opacity: 1;
}

.social-btn span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, #fff, #919191);
  border-radius: 50%;
  line-height: calc(45px - 10px);
  color: rgb(102, 37, 152);
  /* color: #15122a; */
  font-size: 24px;
}

.social-btn:hover span {
  color: red;
}
/* ! эффект_волшебной кнопки ================== */
.magic {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}
.spark {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  background: rgb(255, 255, 0);
  z-index: -1;
  /* animation: animateMagic 2s linear forwards; */
}

.spark:nth-child(even) {
  background: transparent;
  border: 2px solid rgb(255, 255, 0);
}
@keyframes animateMagic {
  0% {
    opacity: 1;
    transform: translate(0, 0);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y));
  }
}
@media (max-width: 780px) {
  section.repertoire {
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 40px 10px 10px;
  }

  .performances .content {
    perspective: none;
    transform-style: flat;
  }
  .repertoire article.performances,
  .repertoire article.children {
    padding: 10px;
    height: auto;
  }
  .fabula {
    padding-top: 10px;
  }
  .repertoire .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    /* align-content: center; */
    /* margin-top: 0vh; */
  }
  .performances .content {
    margin-top: 0vh;
    height: 90vh;
  }

  .performances .content .fabula {
    height: 48vh;
  }

  .children .content {
    height: 94vh;
    margin-top: 4vh;
  }

  .children .content .fabula {
    height: 39vh;
  }

  .fabula {
    width: 90vw;
    order: 1;
  }
  .performances__slider,
  .children__slider {
    width: 90vw;
    height: 25vh;
    order: 0;
  }
  /* .performances__slider {
    order: 0;
  } */
}
@media (max-width: 420px) {
  .performances .content {
    height: 82vh;
  }

  .performances .content .fabula {
    height: 54vh;
  }

  .children .content {
    height: 90vh;
  }

  .children .content .fabula {
    height: 42vh;
  }
}
