/* _shared/topbar/topbar.css — единый стиль топбара и боковой панели */

:root{
  --ig-bg: #f7f7f8;
  --ig-border: #e5e7eb;
  --ig-muted: #6b7280;
  --topbar-search-max: 780px;
}

/* Sticky Topbar */
.ig-topbar{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--ig-bg);
  backdrop-filter: saturate(1.2) blur(2px);
  padding: 10px 14px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--ig-border);
}
/* Центровка поиска, кнопки справа */
.ig-topbar{ justify-content: center; }
.ig-search{ flex: 0 1 var(--topbar-search-max); margin: 0 auto; min-width: 0; }

.ig-search .ig-search-wrap{ position: relative; }
.ig-search input{
  width:100%;
  /* Сдвигаем текст ближе к слову "Поиск" */
  padding: 12px 14px 12px 90px;
  border:1px solid var(--ig-border);
  border-radius: 12px;
  background:#fff;
  font-size: 14px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
  box-sizing: border-box;
}
.ig-search input:focus{ border-color:#9ca3af; box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
.ig-search .ig-search-label{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  font-size: 12px; font-weight:600; letter-spacing:.2px;
  color:#6b7280; pointer-events:none; white-space:nowrap;
}

/* Кнопки: kебаб и стрелка — одна высота/ширина */
.ig-kebab{ position: relative; flex: 0 0 auto; margin-left: auto; }
.ig-kebab-btn,
.ig-panel-btn{
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ig-border); background: #fff; border-radius: 10px;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.ig-panel-btn.has-unread::after{
  content:""; position:absolute; top:-4px; right:-4px; width:10px; height:10px;
  background:#ef4444; border:2px solid #fff; border-radius:50%; box-shadow:0 0 0 1px rgba(0,0,0,.05);
}
.ig-kebab-btn:focus,
.ig-panel-btn:focus{ outline:none; box-shadow: 0 0 0 3px rgba(37,99,235,.10); }

.ig-kebab-menu{
  position:absolute; right:0; top: 42px; min-width: 220px;
  background:#fff; border:1px solid var(--ig-border); border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0,0,0,.12);
  padding: 6px; display:none; z-index: 2000;
}
.ig-kebab.open .ig-kebab-menu{ display:block; }
.ig-kebab-menu a{ display:block; padding:9px 10px; border-radius:8px; color:#111827; text-decoration:none; font-size:14px; }
.ig-kebab-menu a:hover{ background:#f3f4f6; }

/* Боковая панель */
.page-panel{
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 360px; max-width: calc(100vw - 40px);
  background: #fff; border-left: 1px solid var(--ig-border);
  box-shadow: -12px 0 24px rgba(0,0,0,.10);
  transform: translateX(100%);
  transition: transform .18s ease-in-out;
  z-index: 1300; display: flex; flex-direction: column;
}
.page-panel[aria-hidden="true"]{ pointer-events: none; }
body.panel-open .page-panel{ transform: translateX(0); }
.page-panel header{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border-bottom:1px solid var(--ig-border); }
.page-panel .panel-body{ padding: 12px; overflow:auto; }

/* Open-panel button: arrow icon, no text */
#openPagePanel.ig-panel-btn{ position:relative; font-size:0; }
#openPagePanel.ig-panel-btn::before{
  content:""; position:absolute; top:50%; left:50%; width:0; height:0;
  transform: translate(-50%,-50%);
  border-style: solid; border-width: 6px 0 6px 9px;
  border-color: transparent transparent transparent #111;
}
body.panel-open #openPagePanel.ig-panel-btn::before{
  transform: translate(-50%,-50%) rotate(180deg);
}

/* Panel quick links (e.g., Profile) */
.page-panel .panel-menu{ margin: 0 0 10px 0; }
.page-panel .panel-menu .panel-link{
  display:block; padding:10px 12px; margin:0 0 8px 0;
  border:1px solid var(--ig-border); border-radius:10px; background:#fff;
  color:#111827; text-decoration:none;
}
.page-panel .panel-menu .panel-link:hover{ background:#f3f4f6; }

/* Unify: keep legacy page menus hidden, but allow existing .ig-topbar too */
body.ig-enabled .menu-dropdown{ display:none !important; }

/* Role badge near page title */
.ig-role-badge{
  display:inline-block; margin-left:8px; padding:2px 8px;
  font-size:12px; line-height:1.4; color:#374151;
  background:#fbfdff; border:1px solid var(--ig-border); border-radius:999px;
}

/* Unify headings: use the same serif font as on Gallery/ui */
.bar h1{ font-family: Georgia, "Times New Roman", Times, serif; }

/* Мобильная адаптация */
@media (max-width: 540px){
  .ig-topbar{ padding: 8px 10px 6px; gap: 10px; }
  .ig-search{ max-width: none; }
  .ig-search input{ padding: 10px 12px 10px 86px; font-size: 14px; }
  .ig-search .ig-search-label{ font-size: 11px; }
  .ig-kebab-btn{ width: 34px; height: 34px; }
}
