/* site_head.css -- the bar on top of the site (header() in site/views.mjs): the players' bar, the makers' bar, the admin.
 * The mark, the sections, the game search or «К играм», then the support button (makers) and the avatar's menu (or «Войти»).
 * It sets its own face and size, so it looks the same over any page; it stays at the top while the page scrolls. */
.site-head {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--f-surface-3);
    background-color: var(--f-surface-0);
    font-family: var(--f-font);
    font-size: 15px;
    line-height: 1.5;
}
.site-head a:hover { opacity: 1; }

.site-head .brand-link { color: var(--f-fg); }
.site-head .brand-word { font-family: var(--f-font-display); font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.site-head .brand-dot { color: var(--f-accent-2); }

.site-head-row {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1320px;          /* the edges of .wrap: the bar lines up with the page under it */
    height: 68px;
    margin: 0 auto;
    padding: 0 40px;
}

.site-logo {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    font-size: 19px;
}
.site-logo .brand-mark { font-size: 34px; }

.site-nav { display: flex; gap: 4px; min-width: 0; }

.site-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    color: var(--f-fg-2);
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.site-nav-link:hover { background-color: var(--f-surface-3); }
.site-nav-link.is-active { background-color: var(--f-surface-4); color: var(--f-fg); }

/* the search: a query goes to the home page's catalogue */
.site-search {
    position: relative;
    display: flex;
    flex: 0 1 320px;
    align-items: center;
    min-width: 160px;
    margin-left: auto;
}
.site-search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--f-fg-3);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    pointer-events: none;
}
.site-search-input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    border: 0;
    border-radius: 12px;
    outline: none;
    background-color: var(--f-surface-3);
    color: var(--f-fg);
    font-size: 15px;
}
.site-search-input::placeholder { color: var(--f-fg-3); }
.site-search-input:focus { box-shadow: inset 0 0 0 2px var(--f-accent-2); }
@media (pointer: coarse) { .site-search-input { font-size: 16px; } }     /* under 16px a phone zooms in on focus */

/* the member's buttons: support, the avatar */
.site-head-btn {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--f-surface-5);     /* its edge shows on the dark bar: as big as the avatar beside it */
    border-radius: 12px;
    background-color: var(--f-surface-3);
    color: var(--f-fg-2);
    cursor: pointer;
}
.site-head-btn:hover { background-color: var(--f-surface-4); color: var(--f-fg); }
.site-head-btn.is-active { border-color: var(--f-accent-2); background-color: var(--f-surface-4); color: var(--f-accent-2); }
.site-head-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.site-avatar-link {
    flex: 0 0 auto;
    border-radius: 12px;
    transition: transform 0.15s ease;
}
.site-avatar-link:hover { transform: scale(1.05); }
.site-avatar-link.is-active { box-shadow: 0 0 0 2px var(--f-accent-2); }
.site-avatar {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-color: var(--f-surface-6);
    object-fit: cover;
}

.site-login { flex: 0 0 auto; }

/* narrower: the search gives way; on a phone the sections go to the tabs at the bottom (portal.css) */
@media (max-width: 1100px) {
    .site-search { display: none; }
}

@media (max-width: 760px) {
    .site-nav { display: none; }
    .site-head-row { gap: 12px; height: 60px; padding: 0 16px; }
    .site-logo { margin-right: auto; }
}

/* ---------------------------------------------------------------- the two zones (views.mjs zoneOf)
 * The players' bar: «Создать игру» is a quiet text link, not a button (as «Разработчикам» on Yandex Games). The makers'
 * bar («Nodenize для авторов») says so beside the mark and keeps «К играм» on the right. */
.site-create {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--f-fg-2);
    font-weight: 600;
    white-space: nowrap;
}
.site-create:hover { background-color: var(--f-surface-3); color: var(--f-fg); }
.site-create-icon,
.site-back-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--f-spark);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.site-zone {
    padding: 3px 8px;
    border-radius: 7px;
    background-color: var(--f-surface-4);
    color: var(--f-spark);
    font-family: var(--f-font);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.site-back {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    margin-left: auto;
    padding: 0 12px 0 8px;
    border-radius: 10px;
    color: var(--f-fg-2);
    font-weight: 600;
    white-space: nowrap;
}
.site-back:hover { background-color: var(--f-surface-3); color: var(--f-fg); }
.site-back-icon { stroke: currentColor; stroke-width: 2.2; }

/* the avatar's menu: details/summary, the list under the avatar at the right edge */
.site-me { position: relative; flex: 0 0 auto; }
.site-me > summary { display: block; list-style: none; cursor: pointer; }
.site-me > summary::-webkit-details-marker { display: none; }
.site-me[open] > summary { box-shadow: 0 0 0 2px var(--f-accent-2); }
.site-me-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--f-surface-5);
    border-radius: 14px;
    background-color: var(--f-surface-2);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.site-me-name {
    overflow: hidden;
    padding: 6px 12px 8px;
    color: var(--f-fg-3);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-me-item {
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--f-fg);
    font-weight: 600;
}
.site-me-item:hover { background-color: var(--f-surface-4); }
.site-me .site-me-item.is-spark { color: var(--f-spark); }       /* over .site-body a:hover */
.site-me-sep { height: 1px; margin: 6px 4px; background-color: var(--f-surface-5); }

/* the makers' bar has five sections and no search to give way: narrower, the «для авторов» plate goes, then the
   sections tighten and «К играм» keeps its arrow only */
@media (max-width: 1180px) {
    .is-dev .site-zone { display: none; }
}
@media (max-width: 1100px) {
    .site-create { margin-left: auto; }
    .is-dev .site-head-row { gap: 12px; }
    .is-dev .site-nav-link { padding: 0 10px; }
    .is-dev .site-back { padding: 0 8px; font-size: 0; gap: 0; }     /* the arrow only */
    .is-dev .site-back-icon { width: 22px; height: 22px; }
}
@media (max-width: 900px) {
    .is-dev .site-logo .brand-word { display: none; }                  /* the mark alone */
}
@media (max-width: 760px) {
    .site-create { display: none; }
    .site-zone { display: none; }
}
