/* Автособрано script/build_campus_page_gallery_css.sh — block5 из style.css,
   только внутри .campus-page-gallery-scope. Не подключать полный style.css на /campuses/. */

.campus-page-gallery-scope.block5 {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-inline: var(--side-padding);
  padding-top: 40px;
  padding-bottom: 0px;
  position: relative;
  box-sizing: border-box;
  background-image: url('/landing_2025/src/img/All/Skolkovo_2.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  min-height: 400px;
}

.campus-page-gallery-scope.block5::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, #ffffff);
  pointer-events: none;
  z-index: 0;
}

@media (min-width: 1441px) {
  .campus-page-gallery-scope.block5 {
    background-size: 110%;
  }
}

@media (min-width: 1600px) {
  .campus-page-gallery-scope.block5 {
    background-size: 120%;
  }
}

@media (min-width: 1920px) {
  .campus-page-gallery-scope.block5 {
    background-size: 130%;
  }
}

.campus-page-gallery-scope .campus_absolute {
  max-width: var(--content-width);
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.campus-page-gallery-scope .campus_photo {
  font-family: Lora, serif;
  font-weight: 500;
  font-size: 32px;
  color: var(--color-black);
  margin-bottom: 30px;
}

.campus-page-gallery-scope .campus_tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  gap: 10px;
}

/* По умолчанию campus_buttons_group не влияет на layout (как было раньше) */
.campus-page-gallery-scope .campus_buttons_group {
  display: contents;
}

.campus-page-gallery-scope .campus_selector_wrapper {
  position: relative;
  display: inline-block;
}

.campus-page-gallery-scope .campus_btn {
  padding: 5px 10px;
  width: 206.75px;
  min-height: 48px;
  height: auto;
  background: #fff;
  color: #c00;
  border: 2px solid #c00;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 400;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-family: "Roboto";
  font-size: 16px;
}

.campus-page-gallery-scope .campus_btn.active {
  background: #c00;
  width: 246.56px;
  min-height: 48.02px;
  height: auto;
  color: #fff;
  font-weight: 700;
}

.campus-page-gallery-scope .campus_btn.active * {
  font-weight: 700;
}

#selectedCampus,
.campus-page-gallery-scope .campus_btn #selectedCampus {
  font-family: "Roboto";
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
}

.campus-page-gallery-scope .campus_btn.active #selectedCampus {
  font-weight: 700;
}

/* Стили для кнопки выбора кампуса */
.campus-page-gallery-scope #campusSelectorBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 10px;
  white-space: nowrap;
  padding-right: 30px; /* Место для треугольника справа */
}

/* Текст по центру */
.campus-page-gallery-scope #campusSelectorBtn #selectedCampus {
  text-align: center;
}

.campus-page-gallery-scope .campus_arrow {
  font-size: 17px;
  transition: transform 0.3s ease;
  color: inherit;
  display: inline-block;
  position: absolute;
  right: 10px;
  flex-shrink: 0;
}

.campus-page-gallery-scope #campusSelectorBtn.menu-open .campus_arrow {
  transform: rotate(180deg);
}

.campus-page-gallery-scope .campus_modal {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  min-width: 206.75px;
  background: #fff;
  border-radius: 6px;
  box-shadow: inset 0px 4px 8px 0px rgba(217, 217, 217, 1);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 400px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1000;
  box-sizing: border-box;
}

.campus-page-gallery-scope .campus_modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.campus-page-gallery-scope .campus_option {
  padding: 0 20px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.171875em;
  color: #231F20;
  border-bottom: 1px solid #EFEFEF;
  position: relative;
  z-index: 1001;
  pointer-events: auto !important;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  flex-shrink: 0;
  min-height: 36px;
  height: 36px;
  display: flex;
  align-items: center;
}

.campus-page-gallery-scope .campus_option:last-child {
  border-bottom: none;
}

.campus-page-gallery-scope .campus_option:hover {
  background: #f9f9f9;
}

.campus_option.selected,
.campus-page-gallery-scope .campus_option.active {
  background: #EFEFEF;
  font-weight: 700;
}

/* Адаптивность для campus_tabs при 1366px и меньше */
@media (max-width: 1373px) {
  .campus-page-gallery-scope .campus_tabs {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .campus-page-gallery-scope .campus_buttons_group {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 10px;
  }

  .campus-page-gallery-scope .campus_buttons_group .campus_btn {
    flex: 1;
    width: 100%;
  }
}

/* При 1367px+ все как было изначально - campus_buttons_group не влияет на layout */
@media (min-width: 1374px) {
  .campus-page-gallery-scope .campus_buttons_group {
    display: contents;
  }
}

/* При 768px все блоки друг под другом */
@media (max-width: 768px) {
  .campus-page-gallery-scope .campus_absolute {
    display: flex;
    flex-direction: column;
  }
  
  .campus-page-gallery-scope .campus_tabs {
    display: contents;
  }

  .campus-page-gallery-scope .phone_close_btn {
    margin-left: 20px;
  }
  
  .campus-page-gallery-scope .campus_selector_wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    order: 1;
  }

  .campus-page-gallery-scope .campus-navigation .campus-arrow {
    display: none;
  }

  .campus-page-gallery-scope #campusSelectorBtn {
    width: 100%;
    justify-content: flex-start; /* Текст слева на 768px */
    position: relative;
    padding-left: 20px;
    padding-right: 30px; /* Место для треугольника справа */
    background: #c00 !important;
    color: #fff !important;
    border-color: #c00 !important;
  }
  
  .campus-page-gallery-scope #campusSelectorBtn #selectedCampus {
    flex: 1;
    text-align: left !important; /* Текст слева на 768px */
  }
  
  .campus-page-gallery-scope .campus_arrow {
    position: absolute;
    right: 10px; /* Треугольник справа */
    flex-shrink: 0;
  }

  .campus-page-gallery-scope .slider_container {
    order: 2;
  }
  
  .campus-page-gallery-scope .campus-navigation {
    order: 3;
    display: none !important;
  }

  .campus-page-gallery-scope .campus_buttons_group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    gap: 20px;
    order: 4;
    margin-top: 20px;
  }

  .campus-page-gallery-scope .campus_buttons_group .campus_btn {
    width: 100%;
    padding: 7px;
    min-height: 1px;
  }

  .campus-page-gallery-scope .campus_btn {
    min-height: 1px;
    padding: 4px 10px 4px 20px;
    font-size: 14px;
  }

  #selectedCampus,
  .campus-page-gallery-scope .campus_btn #selectedCampus {
    font-size: 14px;
  }

  .campus-page-gallery-scope .campus_option {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .block12_campus_btn {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .block12_campus_selector_btn {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .block12_campus_option {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .block14_campus_btn {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .block14_campus_selector_btn {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .block14_campus_option {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .block20_campuses .block20_campus_btn {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .block20_campus_selector_btn {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .block20_campus_option {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .form_campus_btn {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .form_campus_option {
    font-size: 14px !important;
  }

  .campus-page-gallery-scope .form_step2_select_container select {
    font-size: 14px;
  }

  .campus-page-gallery-scope .form_step2_select_container select option {
    font-size: 14px;
  }

  .campus-page-gallery-scope .block18_form_bottom {
    margin-top: 0;
  }
}


.campus-page-gallery-scope .slider_container {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
  padding: 25px 0;
  box-sizing: border-box;
  background: transparent;
  border: none;
  box-shadow: none;
}

.campus-page-gallery-scope .slides {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 20px;
  cursor: grab;
  user-select: none;
  width: fit-content;
}

/* Адаптивный transition для больших экранов */
@media (min-width: 1024px) {
  .campus-page-gallery-scope .slides {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

.campus-page-gallery-scope .slides.dragging {
  cursor: grabbing;
  transition: none;
}

.campus-page-gallery-scope .slide {
  flex-shrink: 0;
  width: 548px;
  height: 400px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.campus-page-gallery-scope .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
  border-radius: 12px;
  box-shadow: none;
}

/* Блок навигации для слайдера кампуса (как hero-navigation) */
.campus-page-gallery-scope .campus-navigation {
  position: relative;
  width: 100%;
  height: 60px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.campus-page-gallery-scope .campus-arrow {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #5C5D5D;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  padding: 0;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.campus-page-gallery-scope .campus-arrow:hover {
  background: var(--color-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}

.campus-page-gallery-scope .campus-arrow:active {
  transform: scale(0.95);
}

.campus-page-gallery-scope .campus-arrow svg {
  width: 24px;
  height: 24px;
}

/* Campus Pagination */
.campus-page-gallery-scope .campus-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  min-width: 0;
}

.campus-page-gallery-scope .campus-pagination-bullet {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #CCCCCC;
  border: 2px solid #CCCCCC;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.campus-page-gallery-scope .campus-pagination-bullet:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: scale(1.2);
}

.campus-page-gallery-scope .campus-pagination-bullet.active {
  background: var(--color-red);
  border-color: var(--color-red);
}

/* Страница кампуса: без селектора города, табы в одну линию */
.campus-page-gallery-scope.block5--locked-campus .campus_buttons_group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

@media (min-width: 1374px) {
  .campus-page-gallery-scope.block5--locked-campus .campus_buttons_group {
    display: flex;
  }
}

/* Размеры слайдов и слайдер — из style.css @media 1023 / 768 (синхрон с campusSlider.js getSlideWidth). */
@media (max-width: 1023px) {
  .campus-page-gallery-scope .slider_container {
    display: block;
  }

  .campus-page-gallery-scope .slide {
    width: 411px;
    height: 300px;
  }
}

@media (max-width: 768px) {
  .campus-page-gallery-scope .slider_container .slide,
  .campus-page-gallery-scope .slide {
    width: 313px;
    height: 248px;
  }

  .campus-page-gallery-scope .slider_container .slide img {
    width: 313px;
    height: 248px;
  }

  .campus-page-gallery-scope .slides {
    touch-action: pan-x pinch-zoom;
  }
}
