/* apphead.css — стили единой шапки сайта (разметку строит js/apphead.js).
 *
 * Единственное место, где описана шапка. Подключается на всех страницах
 * ПОСЛЕ остальных стилей. Раньше её вид собирался из трёх источников —
 * style.css, site-theme.css (только для главной) и site-head.css (только
 * для редактора и драфта), — поэтому шапки и выглядели по-разному.
 *
 * Кнопки внутри шапки — свой класс .ahbtn, а не .btn: правила .btn на
 * главной заданы через id экранов (#homeScreen .btn) и по специфичности
 * перебили бы любое правило отсюда. Отдельный класс делает шапку
 * независимой от того, на какой странице она стоит.
 */

.apphead{
  --h-bg1:#0a0f1a; --h-bg2:#070a12;
  --h-text:#eef1f8; --h-muted:#8b93a7;
  --h-line:rgba(255,255,255,.10);
  --h-accent:#1f56ff; --h-accent-hi:#5b8cff;
  --h-r:10px;

  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  margin:0; padding:10px 22px;
  background:linear-gradient(180deg,var(--h-bg1),var(--h-bg2));
  border-bottom:1px solid var(--h-line);
  backdrop-filter:none;
  color:var(--h-text);
  font-family:inherit;
}
.apphead a{ text-decoration:none }
.apphead-left{ display:flex; align-items:center; gap:22px; min-width:0; min-height:0 }
.apphead-right{ display:flex; align-items:center; gap:12px }

/* логотип: «ED» подсвечено акцентом */
.apphead .brandmark{
  font-size:19px; font-weight:800; letter-spacing:.16em; color:var(--h-text);
  white-space:nowrap; user-select:none;
}
.apphead .brandmark b{ color:var(--h-accent-hi); font-weight:800 }

/* пункты навигации */
.apphead .appnav{ display:flex; align-items:center; gap:4px; flex-wrap:wrap }
.apphead .navbtn{
  display:inline-flex; align-items:center; gap:7px;
  background:transparent; border:0; border-radius:var(--h-r);
  color:var(--h-muted); font-family:inherit; font-size:14px; font-weight:700;
  letter-spacing:.02em; line-height:1.25; padding:8px 14px; cursor:pointer;
  transition:background .15s, color .15s;
}
.apphead .navbtn .ni{ font-size:14px; opacity:.85 }
.apphead .navbtn:hover{ background:rgba(255,255,255,.06); color:var(--h-text) }
.apphead .navbtn.on{ background:var(--h-accent); color:#fff }
.apphead .navbtn.on:hover{ background:var(--h-accent); filter:brightness(1.1) }

/* кнопки шапки: ссылка на сайт, вход, профиль — размер как у пунктов */
.apphead .ahbtn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 14px; font-family:inherit; font-size:14px; font-weight:700;
  line-height:1.25; letter-spacing:.02em; white-space:nowrap; cursor:pointer;
  border:1px solid rgba(255,255,255,.18); border-radius:var(--h-r);
  background:transparent; color:var(--h-text);
  transition:background .15s, border-color .15s, filter .15s;
}
.apphead .ahbtn:hover{ border-color:var(--h-accent); background:rgba(31,86,255,.12) }
.apphead .ahbtn.primary{ background:var(--h-accent); border-color:transparent; color:#fff }
.apphead .ahbtn.primary:hover{ filter:brightness(1.1) }
.apphead .ahbtn.small{ padding:6px 11px; font-size:13px }
.apphead .ahbtn.sitelink{ color:var(--h-accent-hi) }

/* профиль */
.apphead .authbox{ display:flex; align-items:center }
.apphead .authcta{ display:flex; align-items:center; gap:8px }
.apphead .userchip{ display:flex; align-items:center; gap:10px }
.apphead .userchip .uav{
  width:38px; height:38px; flex:0 0 auto; border-radius:50%;
  border:1px solid var(--h-line); background:#1b1f26 center/cover no-repeat;
  display:flex; align-items:center; justify-content:center;
  font-size:17px; font-weight:700; color:var(--h-accent-hi); text-transform:uppercase;
}
.apphead .userchip .uinfo{ display:flex; flex-direction:column; line-height:1.2; min-width:0 }
.apphead .userchip .uname{ font-size:15px; font-weight:700; color:var(--h-text); white-space:nowrap }
.apphead .userchip .ulogin{ font-size:12px; color:var(--h-muted) }
.apphead .userchip .uactions{ display:flex; gap:6px; margin-left:4px }
.apphead .urating{
  display:inline-block; margin-left:4px; padding:1px 8px; border-radius:20px;
  font-size:12px; font-weight:700; color:var(--h-accent-hi);
  border:1px solid rgba(91,140,255,.4);
}
.apphead .urole{
  display:inline-block; margin-left:4px; padding:1px 8px; border-radius:20px;
  font-size:11px; font-weight:700; color:var(--h-muted); border:1px solid var(--h-line);
}

/* Средние экраны (ноутбуки, 1366–1600): семь пунктов и полный профиль в одну
   строку не помещаются. Убираем второстепенное — иконки пунктов и логин. */
@media (max-width: 1600px){
  .apphead-left{ gap:16px }
  .apphead .navbtn{ padding:8px 10px }
  .apphead .navbtn .ni{ display:none }
  .apphead .userchip .ulogin{ display:none }
}
/* Узкие: шапка переносится на две строки. */
@media (max-width: 1100px){
  .apphead{ flex-wrap:wrap; padding:8px 14px }
  .apphead .navbtn{ padding:7px 9px; font-size:13px }
}
