/* =======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%;
  height: 200vh;
  overflow: hidden;
}

.repertoire article {
  position: relative;
  /* min-height: 100vh; */
  text-align: center;
  padding: 2vh 0px;
  &.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;
}

/* TODO: 3D бесконечный слайдер изображений =================== */
.performances__slider {
  position: relative;
  width: 65vw;
  height: 70vh;
  /* top: 0; */
  /* top: 50%; */
  /* right: 0; */
  /* display: flex; */
  transform-style: preserve-3d;
  perspective: 38vw;
  & .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;
    transform-origin: bottom;
    user-select: none;
    -webkit-box-reflect: below 1px linear-gradient(transparent, transparent, #0002);
    opacity: 0;
  }
  & .item::before {
    /* white-space: nowrap; */
    width: 50vw;
  }
  & .item:nth-child(1) {
    transform: translate3d(var(--left-width-perform), 7vh, 0) scale(0.8) rotateY(30deg);
    z-index: 1;
  }
  & .item:nth-child(2) {
    transform: translate3d(var(--left-width-perform), 7vh, 0) scale(0.8) rotateY(30deg);
    z-index: 2;
    opacity: 1;
  }
  & .item:nth-child(3) {
    transform: translate3d(var(--left-item-perform), 9vh, 0) scale(0.88) rotateY(24deg);
    z-index: 3;
    opacity: 1;
  }
  & .item:nth-child(4) {
    transform: translate3d(0px, 11vh, 0) scale(1) rotateY(0deg);
    z-index: 4;
    opacity: 1;
  }
  & .item:nth-child(4)::before {
    transform: translate3d(-14vw, -10vh, 0) rotate(0deg) scale(1.32);
    opacity: 1;
    /* scale: 0.7; */
    z-index: 12;
  }
  & .item:nth-child(5) {
    transform: translate3d(var(--right-item-perform), 9vh, 0) scale(0.88) rotateY(-24deg);
    z-index: 3;
    opacity: 1;
  }
  & .item:nth-child(6) {
    transform: translate3d(var(--right-width-perform), 7vh, 0) scale(0.8) rotateY(-30deg);
    z-index: 2;
    opacity: 1;
  }
  & .item:nth-child(7) {
    transform: translate3d(var(--right-width-perform), 7vh, 0) scale(0.8) rotateY(30deg);
    z-index: 1;
  }
  & .item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
/* TODO: children vanilla JavaScript Слайдер     ============== */
.children .content {
  margin-top: 11vh;
}
.children__slider {
  position: relative;
  width: 65vw;
  height: 70vh;
  top: 0;
  left: 0;
  & .item {
    position: absolute;
    width: var(--width-item-child);
    aspect-ratio: 3/2;
    /* --opacity-bgmain: 1; */
    background: var(--img);
    /* linear-gradient(rgba(0, 0, 0, 1), rgba(2, 2, 2, 1)); */
    /* var(--gradient-background-fon); */
    background-size: cover;
    transition: 2s ease-in-out;
    border-radius: 10px;
    box-shadow: 0 25px 25px rgba(0, 0, 0, 0.8);
  }
  & .item:nth-child(n-1) {
    transform: translate3d(80vw, -100vh, 0) rotate(-0deg);
    /* transform: translate3d(-3vw, 2vh, 0) rotate(-40deg); */
  }
  & .item:nth-child(1) {
    transform: translate3d(-3vw, 2vh, 0) rotate(-40deg);
  }
  & .item:nth-child(2) {
    transform: translate3d(5vw, 7vh, 0) rotate(-30deg);
  }
  & .item:nth-child(3) {
    transform: translate3d(14vw, 14vh, 0) rotate(-20deg);
  }
  & .item:nth-child(4) {
    transform: translate3d(21vw, 21vh, 0) rotate(-15deg);
  }
  & .item:nth-child(5) {
    transform: translate3d(37vw, 35vh, 0) scale(1.32);
    transform-origin: bottom right;
    z-index: 12;
  }
  & .item:nth-child(5)::before {
    transform: translate3d(-8vw, -26vh, 0) rotate(0deg);
    opacity: 1;
    z-index: 12;
  }
  & .item:nth-child(n + 6) {
    transform: translate3d(80vw, -100vh, 0);
    opacity: 0;
    z-index: 13;
  }
  & .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;
  & .fabula__content {
    overflow-y: 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);
    &::-webkit-scrollbar {
      width: 0;
    }
    & h3 {
      color: inherit;
    }
    & > span {
      display: block;
      font-size: small;
      color: inherit;
      opacity: 0.8;
    }
  }
}
/* .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;
  &:hover {
    box-shadow: 0 2px 5px #000;
    opacity: 1;
  }
  & 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;
  }
  &: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; */
  &: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 {
    /* min-height: 200vh; */
    height: auto;
    padding: 40px 10px 10px;
  }
  .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;
    & .fabula {
      height: 48vh;
    }
  }
  .children .content {
    height: 94vh;
    margin-top: 4vh;
    & .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;
    & .fabula {
      height: 54vh;
    }
  }
  .children .content {
    height: 90vh;
    & .fabula {
      height: 42vh;
    }
  }
}
