/* Общая шапка страниц сайта: логотип, название и иконка меню.
   Вынесена из index.css, чтобы все страницы с меню использовали
   одну и ту же разметку и одни и те же стили. */

.header {
    text-align: left;
    /* Шапка держит ту же ширину, что и карточка (.container): иначе на
       широком экране иконка «О проекте» не совпадала бы по отступу
       с правым краем карточки. */
    max-width: 1000px;
    margin: 0 auto 6px;
}

.header-content {
    display: grid;
    /* Три колонки: логотип | заголовок | иконка.
       Левая и правая — одинаковой фиксированной ширины,
       поэтому заголовок всегда ровно по центру. */
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    column-gap: 10px;
    margin-bottom: 0;
}

/* Иконка «О проекте» вынесена из потока: логотип с названием остаются
   по центру строки, а иконка стоит справа. Отступ справа равен радиусу
   скругления карточки (.container, border-radius: 15px) — правый край
   иконки приходится ровно на начало закругления. */
.header-info {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    /* Вернуть отступ 15px от правого края — как было с right: 15px. */
    margin-right: 15px;
    padding: 6px 0 6px 10px;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.header-info:hover,
.header-info:focus-visible {
    opacity: 1;
}

/* Кружок с первой буквой логина: тот же размер и позиция, что у иконки. */
.header-info .header-user-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #1a3a5f;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.header-logo {
    justify-self: start;
    /* Симметричный отступ слева, чтобы центр текста не сместился. */
    margin-left: 15px;
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

/* На info.html логотип — ссылка на главную. Отступ остаётся на ссылке,
   чтобы сетка колонки не разъехалась по сравнению с index.html. */
.header-logo-link {
    justify-self: start;
    margin-left: 15px;
    display: inline-flex;
    align-items: center;
}

.header-logo-link .header-logo {
    margin-left: 0;
}

.header-title {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 7px;
    /* Может сжиматься и переноситься внутри своей колонки. */
    min-width: 0;
}

.header-title .title-line:first-child {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.header-title .title-line:last-child {
    font-size: 1.05rem;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 0;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .header-logo {
        width: 26px;
        height: 26px;
    }
    .header-title .title-line:first-child {
        font-size: 1rem;
    }
    .header-title .title-line:last-child {
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .header-logo {
        width: 24px;
        height: 24px;
    }
    .header-title .title-line:first-child {
        font-size: 0.95rem;
    }
    .header-title .title-line:last-child {
        font-size: 0.95rem;
    }
}
