/* Главная страница на телефонах и планшетах в вертикальном положении.
   Десктопная вёрстка здесь не меняется: правила работают только на узких вертикальных экранах. */
@media (orientation: portrait) and (max-width: 1100px) {
  html body.page-home .screen {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100vw !important;
  }

  /* Сетка линий рассчитана на широкий экран — на телефоне её заменяют рамки блоков */
  html body.page-home .screen::before {
    display: none !important;
  }

  /* Верхняя панель с языками */
  html body.page-home .top-panel {
    border-bottom: 1px solid #111 !important;
    flex: none !important;
    height: 13vw !important;
    left: auto !important;
    max-height: 64px !important;
    min-height: 48px !important;
    position: relative !important;
    top: auto !important;
    width: 100% !important;
  }

  html body.page-home .languages {
    width: 55% !important;
  }

  html body.page-home .languages a {
    font-size: clamp(13px, 3.6vw, 20px) !important;
  }

  html body.page-home .languages a.active {
    border-radius: 0 0 3.5vw 3.5vw !important;
  }

  /* «Добро пожаловать!» */
  html body.page-home .welcome {
    flex: none !important;
    left: auto !important;
    position: relative !important;
    top: auto !important;
    width: 100% !important;
  }

  html body.page-home .welcome-line {
    border-bottom: 1px solid #111 !important;
    height: auto !important;
    padding: 3vw 4vw !important;
  }

  html body.page-home .welcome-line span {
    font-size: 15vw !important;
    letter-spacing: -.05em !important;
    line-height: 1.1 !important;
  }

  html body.page-home .second-line span {
    font-size: 13.5vw !important;
  }

  /* Жёлтые карточки — квадрат 2×2 на всю ширину */
  html body.page-home .navigation {
    aspect-ratio: 1 / 1 !important;
    flex: none !important;
    height: auto !important;
    left: auto !important;
    margin: 4vw !important;
    position: relative !important;
    top: auto !important;
    width: auto !important;
  }

  html body.page-home .navigation-card {
    border-width: 1px !important;
    padding: 3.5vw !important;
  }

  html body.page-home .overview-card { border-radius: 0 0 6vw 0 !important; }
  html body.page-home .rectors-card { border-radius: 0 0 0 6vw !important; }
  html body.page-home .history-card { border-radius: 0 6vw 0 0 !important; }
  html body.page-home .professor-card { border-radius: 6vw 0 0 0 !important; }

  html body.page-home .navigation-card h2 {
    font-size: clamp(17px, 5.4vw, 34px) !important;
    line-height: 1.3 !important;
  }

  html body.page-home .card-button {
    border-radius: 2.5vw !important;
    border-width: 1px !important;
    font-size: clamp(11px, 3.3vw, 19px) !important;
    min-height: clamp(34px, 9vw, 56px) !important;
    padding: 1.5vw 3vw !important;
  }

  html body.page-home .arrow {
    font-size: clamp(16px, 4.8vw, 28px) !important;
  }

  html body.page-home .play-icon {
    border-bottom-width: clamp(9px, 2.6vw, 15px) !important;
    border-left-width: clamp(16px, 4.6vw, 27px) !important;
    border-top-width: clamp(9px, 2.6vw, 15px) !important;
  }

  /* M.NARIKBAYEV UNIVERSITY */
  html body.page-home .university-name {
    border-top: 1px solid #111 !important;
    flex: none !important;
    left: auto !important;
    padding-top: 2vw !important;
    position: relative !important;
    top: auto !important;
    white-space: nowrap !important;
    width: 100% !important;
  }

  html body.page-home .university-name p {
    font-size: 12.6vw !important;
    letter-spacing: -.05em !important;
    line-height: 1.1 !important;
    padding-left: 3vw !important;
  }

  /* Здание — внизу во всю ширину */
  html body.page-home .building.home-building {
    display: block !important;
    flex: none !important;
    margin-top: auto !important;
    max-height: none !important;
    position: relative !important;
    right: auto !important;
    top: auto !important;
    width: 100% !important;
  }
}
