/* ============================================
   BACKGROUND BLOCK: Программа Early Years
   ============================================ */
.background-block {
  max-width: var(--page-width);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.background-block_bg {
  position: relative;
  width: 100vw;
  max-width: none;
  height: 500px;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  z-index: 0;
}

.background-block_bg > img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

.background-block_bg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.698);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1;
  pointer-events: none;
}

.background-block_content {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  height: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 60px var(--side-padding, 20px);
  box-sizing: border-box;
  align-items: center;
  gap: 60px;
}

.background-block_left {
  flex: 1;
  display: flex;
  align-items: center;
}

.background-block_text {
  color: #FFFFFF;
  width: 100%;
}

.background-block_title {
  font-family: Lora, serif;
  font-weight: 500;
  font-size: 37px;
  line-height: 1.2;
  color: #FFFFFF;
  margin: 0;
  text-align: left;
  margin-bottom: 27px;
}

.background-block_intro {
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: #FFFFFF;
  margin: 0;
  text-align: left;
}

.background-block_list-title {
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  color: #FFFFFF;
  margin: 0;
  text-align: left;
}

.background-block_list {
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: #FFFFFF;
  margin: 0;
  padding-left: 20px;
  text-align: left;
  list-style: none;
}

.background-block_list li {
  margin-bottom: 0;
  padding-left: 0;
  position: relative;
}

.background-block_list li::before {
  content: "—";
  position: absolute;
  left: -20px;
  color: #E31E24;
}

.background-block_list li:last-child {
  margin-bottom: 0;
}

.background-block_right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  height: 100%;
  min-height: 400px;
  overflow: visible;
}

.background-block_videos-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 100%;
  max-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  box-sizing: content-box;
}

.background-block_videos-wrapper:active {
  cursor: grabbing;
}

/* Кнопки навигации видео слайдера */
.video-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #E31E24;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.video-slider-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.video-slider-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.video-slider-btn-prev {
  left: -60px;
}

.video-slider-btn-next {
  right: -60px;
}

.background-block_videos {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.background-block_video {
  position: absolute;
  width: 200px;
  height: 350px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.6s ease, opacity 0.6s ease;
  will-change: transform, filter, opacity, z-index;
  left: 50%;
  top: 50%;
  margin-left: -100px;
  margin-top: -175px;
  cursor: pointer;
}

.background-block_video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Кнопка play для видео */
.video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.background-block_video.active .video-play-button {
  pointer-events: auto;
}

.video-play-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Скрываем кнопку play когда видео воспроизводится */
.background-block_video.playing .video-play-button {
  opacity: 0;
  pointer-events: none;
}

/* Показываем кнопку только на активном видео */
.background-block_video:not(.active) .video-play-button {
  opacity: 0;
  pointer-events: none;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 1023px) {
  .background-block_bg {
    width: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    margin-right: 0;
    height: auto;
    min-height: 500px;
  }

  .background-block_content {
    flex-direction: column;
    padding: 40px var(--side-padding, 20px);
    gap: 40px;
  }

  .background-block_left {
    width: 100%;
  }

  .background-block_right {
    width: 100%;
    justify-content: center;
    min-height: 350px;
  }

  .background-block_videos-wrapper {
    max-width: 240px;
    max-height: 400px;
  }

  .background-block_video {
    width: 170px;
    height: 300px;
    margin-left: -85px;
    margin-top: -150px;
  }
}

@media (max-width: 768px) {
  .background-block_bg {
    height: auto;
    min-height: auto;
  }

  .background-block_content {
    padding: 20px 20px 30px 20px;
    gap: 30px;
  }

  .background-block_right {
    margin-top: 45px;
    margin-bottom: 42px;
  }

  .background-block_title {
    margin-bottom: 17px !important;
  }

  .background-block_intro {
    font-size: 14px !important;
  }

  .background-block_list-title {
    margin-top: 17px !important;
    margin-bottom: 17px !important;
    font-size: 14px !important;
  }

  .background-block_list {
    padding-left: 20px;
    font-size: 14px !important;
  }

  .background-block_list li {
    margin-bottom: 7px;
  }
  
  .background-block_list li::before {
    left: -20px;
  }

  .background-block_list li:last-child {
    margin-bottom: 0;
  }

  .background-block_videos-wrapper {
    max-width: 200px;
    max-height: 350px;
  }
  
  /* Только страницы детсада (internal): свайп в videoSlider.js, стрелки не нужны */
  body.kindergarten-page .background-block_videos-wrapper .video-slider-btn {
    display: none !important;
  }

  /* Боковые видео - 228x432 */
  .background-block_video {
    width: 228px;
    height: 432px;
    border-radius: 8px;
    margin-left: -114px;
    margin-top: -216px;
  }

  /* Центральное видео (transform: translateX(0) scale(1)) - 245x465 */
  .background-block_video[style*="translateX(0)"] {
    width: 245px !important;
    height: 465px !important;
    margin-left: -122.5px !important;
    margin-top: -232.5px !important;
  }
}

/* При уменьшении ширины экрана боковые видео смещаются ближе к центру */
@media (max-width: 480px) {
  .background-block_video[style*="translateX(-110px)"] {
    transform: translateX(-60px) scale(0.95) !important;
  }

  .background-block_video[style*="translateX(120px)"] {
    transform: translateX(60px) scale(0.95) !important;
  }
}

@media (max-width: 393px) {
  .background-block_video[style*="translateX(-110px)"] {
    transform: translateX(-40px) scale(0.95) !important;
  }

  .background-block_video[style*="translateX(120px)"] {
    transform: translateX(40px) scale(0.95) !important;
  }
}

