Шаблон:Main page/header/styles.css

Материал из SS220 SS14 WIKI
.home-header {
  margin: 3rem 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0 20px;
  flex-wrap: wrap;
  position: relative;
}

.home-header-text-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex-grow: 1;
    margin-right: 20px;
}

.home-header__pretitle {
  color: #7faad9;
  font-size: 0.9rem;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.home-header__title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0.5rem 0;
}

.home-header__subtitle {
  font-size: 1rem;
  color: #bbb;
  margin-bottom: 0;
}

.home-header__search {
  display: inline-flex; /* Используем inline-flex, чтобы блок обволакивал содержимое */
  flex-direction: row; /* Возвращаемся к горизонтальному расположению */
  justify-content: center; /* Центрируем содержимое по горизонтали */
  align-items: center; /* Центрируем содержимое по вертикали */
  background: #1a2027;
  border-radius: 2px; /* Сохраняем очень маленькое скругление */
  padding: 8px 15px; /* Уменьшаем padding, чтобы блок был более компактным, но сохранял читаемость */
  font-size: 0.9rem;
  color: #ccc;
  cursor: text;
  transition: all 0.2s ease;
  max-width: none; /* Убираем ограничение max-width, чтобы блок обволакивал текст */
  width: auto; /* Позволяем ширине подстраиваться под контент */
  box-sizing: border-box;
  height: auto;
  min-height: auto;
  overflow: hidden;
}

.home-header__search:hover {
  color: #fff;
}

.home-header__searchIcon {
  margin-right: 8px; /* Отступ справа от иконки, чтобы она была слева от текста */
  margin-bottom: 0; /* Убираем нижний отступ, так как теперь горизонтальное расположение */
  opacity: 0.7;
  line-height: 1;
  font-size: 1.4em; /* Увеличиваем размер иконки */
  flex-shrink: 0; /* Не даем иконке сжиматься */
}

.home-header__searchText {
    display: inline; /* Делаем текст inline, чтобы он был рядом с иконкой */
    text-align: left; /* Текст будет выравниваться по левому краю в рамках своего контейнера */
    line-height: 1.2;
    white-space: nowrap; /* Делаем текст в одну строку, чтобы он не переносился */
}

.home-header__searchText a {
  color: #7faad9;
  text-decoration: none;
}

.home-header__searchText a:hover {
  text-decoration: underline;
}

kbd {
  background: #2e3a46;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #eee;
  vertical-align: middle;
}

/* Медиа-запрос для адаптивности на маленьких экранах */
@media (max-width: 768px) {
    .home-header {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }

    .home-header-text-group {
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
        margin-right: 0;
    }

    .home-header__search {
        max-width: 90%;
        margin: 20px auto 0 auto;
        padding: 8px 10px; /* Немного уменьшил padding для мобильных */
        white-space: normal; /* Разрешаем перенос текста на мобильных, если он не помещается */
        flex-direction: row; /* На мобильных тоже горизонтально */
        justify-content: center;
    }
    .home-header__searchIcon {
        margin-right: 5px; /* Отступ для иконки на мобильных */
        font-size: 1.2em;
    }
    .home-header__searchText {
        text-align: center; /* Центрируем текст на мобильных */
    }
}