/* Site header. This file intentionally loads after the legacy layout styles. */
.site_header {
  position: sticky;
  top: 0;
  z-index: 1200;
  padding: 0;
  color: var(--black);
  border-bottom: 1px solid rgba(var(--primary-rgb), .16);
  background: rgba(var(--white-rgb), .97);
  box-shadow: 0 8px 28px rgba(var(--shadow-rgb), .07);
  backdrop-filter: blur(18px);
}

.site_header .header_wrapper {
  display: grid;
  width: 100%;
  min-height: 112px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 0 var(--page-gutter);
}

.site_header .header_logo_block {
  display: flex;
  min-width: 0;
  align-items: center;
  padding-right: clamp(20px, 2.4vw, 38px);
  border-right: 1px solid var(--border);
}

.site_header .brand_link {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  color: var(--black);
}

.site_header .header_logo_block img,
.site_header .brand_link .logo {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: contain;
}

.site_header .brand_copy {
  display: flex;
  width: auto;
  min-width: 0;
  flex-direction: column;
  color: var(--black);
}

.site_header .brand_copy strong {
  color: var(--primary);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .045em;
}

.site_header .brand_copy small {
  max-width: 190px;
  margin-top: 7px;
  color: var(--secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.site_header .header_top {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding-left: clamp(20px, 2.6vw, 42px);
}

.site_header .header_up_block {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.site_header .header_right_group {
  display: contents;
}

.site_header .header_contacts {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  order: 1;
}

.site_header .contacts {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: clamp(14px, 1.6vw, 26px);
}

.site_header .contacts_item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.site_header .contacts_item img {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  opacity: .78;
}

.site_header .contacts_item a {
  overflow: hidden;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site_header .contacts_item a:hover {
  color: var(--primary);
}

.site_header .icons {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.site_header .icons .icon_btn {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.site_header .icons .icon_btn:hover {
  background: var(--primary-soft);
  transform: none;
}

.site_header .icons .icon_btn img {
  width: 18px;
  height: 18px;
}

.site_header .header_up_block > .dropdown {
  flex: 0 0 auto;
  order: 2;
}

.site_header .dropdown.student {
  flex: 0 0 auto;
  order: 3;
}

.site_header .btn {
  min-height: 36px;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border-width: 1px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  line-height: 1;
  transform: none;
}

.site_header .btn > img {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
}

.site_header .primary_btn {
  color: var(--primary);
  border-color: rgba(var(--primary-rgb), .36);
  background: var(--white);
}

.site_header .primary_btn:hover,
.site_header .dropdown.active .primary_btn {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: none;
}

.site_header .primary_btn:hover .dropdown_arrow {
  filter: none;
}

.site_header .student_btn {
  color: var(--white);
  border-color: var(--primary);
  background: var(--primary);
  background-image: none;
  box-shadow: none;
}

.site_header .student_btn:hover,
.site_header .dropdown.active .student_btn {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  box-shadow: none;
}

.site_header .header_bottom {
  display: flex;
  min-width: 0;
  min-height: 59px;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 1.4vw, 24px);
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.site_header .header_bottom > a,
.site_header .nav_dropdown_toggle {
  position: relative;
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--secondary);
  border: 0;
  background: transparent;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
}

.site_header .header_bottom > a::after,
.site_header .nav_dropdown_toggle::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  background: var(--primary);
  content: "";
  opacity: 0;
  transform: scaleX(.35);
  transition: opacity .18s ease, transform .18s ease;
}

.site_header .header_bottom > a:hover,
.site_header .header_bottom > a.active,
.site_header .nav_dropdown_toggle:hover,
.site_header .nav_dropdown_toggle.active,
.site_header .nav_dropdown.open > .nav_dropdown_toggle {
  color: var(--primary);
}

.site_header .header_bottom > a.active::after,
.site_header .header_bottom > a[aria-current="page"]::after,
.site_header .nav_dropdown_toggle.active::after,
.site_header .nav_dropdown.open > .nav_dropdown_toggle::after {
  opacity: 1;
  transform: scaleX(1);
}

.site_header .header_bottom > a:first-child { order: 1; }
.site_header #programsDropdown { order: 2; }
.site_header .header_bottom > a:nth-of-type(2) { order: 3; }
.site_header #teachersDropdown { order: 4; }
.site_header .header_bottom > a:nth-of-type(3) { order: 5; }
.site_header .header_bottom > a:nth-of-type(4) { order: 6; }
.site_header .header_bottom > a:nth-of-type(5) { order: 7; }

.site_header .header_bottom a img,
.site_header .nav_dropdown_arrow {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
}

.site_header .dropdown_menu,
.site_header .nav_dropdown_menu {
  top: calc(100% + 10px);
  z-index: 3000;
  min-width: 240px;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: 0 18px 48px rgba(var(--shadow-rgb), .16);
}

.site_header .primary_menu {
  right: 0;
  left: auto;
  width: 260px;
}

.site_header .student_menu {
  right: 0;
  left: auto;
  width: min(390px, calc(100vw - 32px));
}

.site_header .primary_menu a,
.site_header .primary_menu .pm_item,
.site_header .student_menu a,
.site_header .nav_dropdown_menu a {
  min-height: 42px;
  padding: 10px 12px;
  color: var(--secondary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
}

.site_header .primary_menu a:hover,
.site_header .primary_menu .pm_item:hover,
.site_header .student_menu a:hover,
.site_header .nav_dropdown_menu a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.site_header .mnav,
.site_header .mnav_backdrop,
.site_header .mnav_popover {
  display: none;
}

@media (max-width: 1320px) and (min-width: 1037px) {
  .site_header .header_wrapper {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .site_header .header_logo_block {
    padding-right: 20px;
  }

  .site_header .header_logo_block img,
  .site_header .brand_link .logo {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }

  .site_header .brand_copy {
    display: flex;
  }

  .site_header .brand_copy small {
    max-width: 120px;
    font-size: 9px;
  }

  .site_header .header_top {
    padding-left: 20px;
  }

  .site_header .header_bottom {
    gap: 10px;
  }

  .site_header .header_bottom > a,
  .site_header .nav_dropdown_toggle {
    font-size: 13px;
  }
}

@media (max-width: 1160px) and (min-width: 1037px) {
  .site_header .header_wrapper {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .site_header .brand_copy small,
  .site_header .contacts_item:last-child,
  .site_header .icons a {
    display: none;
  }

  .site_header .header_contacts {
    justify-content: flex-start;
  }

  .site_header .icons {
    margin-left: auto;
  }
}

@media (max-width: 1036px) {
  .site_header {
    position: sticky;
    padding: 0;
  }

  .site_header .header_wrapper {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px var(--page-gutter);
  }

  .site_header .header_logo_block {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0;
    border: 0;
  }

  .site_header .brand_link {
    gap: 10px;
  }

  .site_header .header_logo_block img,
  .site_header .brand_link .logo {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .site_header .brand_copy {
    display: flex;
  }

  .site_header .brand_copy strong {
    font-size: 21px;
  }

  .site_header .brand_copy small {
    display: none;
  }

  .site_header .header_top {
    display: none;
  }

  .site_header .mnav {
    position: static;
    display: flex;
    width: auto;
    flex: 0 0 auto;
    grid-template-columns: none;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .site_header .mnav_btn {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
  }

  .site_header .mnav_btn:hover,
  .site_header .mnav_btn.is-active {
    border-color: rgba(var(--primary-rgb), .22);
    background: var(--primary-soft);
  }

  .site_header .mnav_btn.is-active .mnav_icon {
    filter: none;
  }

  .site_header .mnav_btn.is-active .mnav_icon_wrap {
    background: transparent;
  }

  .site_header .mnav_icon_wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
  }

  .site_header .mnav_icon {
    display: block;
    width: 20px;
    height: 20px;
  }

  .site_header .mnav_label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .site_header .mnav_backdrop:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: block;
    background: rgba(var(--black-rgb), .34);
    backdrop-filter: blur(3px);
  }

  .site_header .mnav_popover:not([hidden]) {
    position: fixed;
    z-index: 1700;
    display: block;
    width: min(440px, calc(100vw - 24px));
    max-width: min(440px, calc(100vw - 24px));
    max-height: calc(100vh - 96px);
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius:var(--radius-md);
    background: var(--white);
    box-shadow: 0 24px 70px rgba(var(--black-rgb), .22);
  }

  .site_header .mp_list,
  .site_header .mp_view {
    display: flex;
    flex-direction: column;
  }

  .site_header .mp_item {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    color: var(--secondary);
    border: 0;
    border-radius:var(--radius-sm);
    background: var(--white);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
  }

  .site_header .mp_item + .mp_item {
    border-top: 0;
  }

  .site_header .mp_item:hover,
  .site_header .mp_item[aria-current="page"] {
    color: var(--primary);
    background: var(--primary-soft);
  }

  .site_header .mp_item--primary,
  .site_header .mp_item--primary:link,
  .site_header .mp_item--primary:visited {
    margin-bottom: 6px;
    color: var(--white) !important;
    background: var(--primary);
  }

  .site_header .mp_item--primary:hover {
    color: var(--white) !important;
    background: var(--primary-dark);
  }

  .site_header .mp_right {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    margin-left: 10px;
  }

  .site_header .mp_header {
    display: flex;
    padding: 4px 4px 8px;
    border: 0;
    background: var(--white);
  }

  .site_header .mp_back {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: var(--secondary);
    border: 0;
    border-radius:var(--radius-sm);
    background: transparent;
    font-weight: 700;
    cursor: pointer;
  }

  .site_header .mp_back:hover {
    color: var(--primary);
    background: var(--primary-soft);
  }

  .site_header .mp_back img {
    width: 18px;
    height: 18px;
  }

  .site_header .mp_contacts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
  }

  .site_header .mp_contacts a {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: var(--secondary);
    font-size: 14px;
    font-weight: 700;
  }

  body .footer_bottom {
    margin-bottom: 0;
  }

  body .back_to_top {
    bottom: 24px;
  }
}

@media (max-width: 430px) {
  .site_header .header_wrapper {
    min-height: 64px;
    gap: 6px;
  }

  .site_header .header_logo_block img,
  .site_header .brand_link .logo {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .site_header .brand_copy strong {
    font-size: 18px;
  }

  .site_header .mnav {
    gap: 1px;
  }

  .site_header .mnav_btn {
    width: 38px;
    height: 38px;
  }

  .site_header .mnav_icon {
    width: 18px;
    height: 18px;
  }
}
