/* cifra_bootstrap — header + nav (ported from cifra_all_blocks.html) */

/* ── ШАПКА ── */
.hdr {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--ln);
}
.hdr-in {
  max-width: var(--cw);
  margin: 0 auto;
  padding: 0 16px;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Лого */
.logo {
  flex-shrink: 0;
  font-weight: 700;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: -.03em;
  color: var(--fg);
  white-space: nowrap;
}
.logo .dot { color: var(--o); }

/* Иконки разделов (SVG) */
.svc { display: flex; gap: 2px; flex-shrink: 0; }
.svc a {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rad);
  color: var(--fg3);
  transition: .15s;
  position: relative;
}
.svc a:hover { background: var(--bg2); color: var(--o); }
.svc a svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Тултипы */
.svc a .tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--rad);
  font-size: .78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: .15s;
  z-index: 50;
  font-weight: 500;
}
.svc a .tip::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--dark);
}
.svc a:hover .tip { opacity: 1; top: calc(100% + 6px); }
@media (max-width: 768px) { .svc { display: none; } }

/* Регион */
.geo {
  font-size: .8125rem;
  color: var(--fg3);
  padding: 5px 10px;
  border: 1px solid var(--ln);
  border-radius: var(--rad);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}
.geo b { color: var(--fg); font-weight: 600; }
.geo:hover { border-color: var(--o); color: var(--o); }
.geo svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) { .geo { display: none; } }

/* Поиск */
.srch { flex: 1; position: relative; min-width: 80px; }
.srch input {
  width: 100%;
  padding: 7px 36px 7px 14px;
  border: 1px solid var(--ln);
  border-radius: var(--rad);
  font-family: inherit;
  font-size: .875rem;
  outline: none;
  background: var(--bg2);
  color: var(--fg);
  transition: .2s;
}
.srch input:focus {
  border-color: var(--o);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .08);
}
.srch-ic {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg4);
  pointer-events: none;
}
.srch-ic svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Пилюли (мессенджеры) */
.pill {
  font-size: .75rem;
  padding: 4px 10px;
  border: 1px solid var(--ln);
  border-radius: var(--rad);
  color: var(--fg3);
  flex-shrink: 0;
  transition: .15s;
}
.pill:hover, .pill.on { border-color: var(--o); color: var(--o); }
@media (max-width: 900px) { .pill { display: none; } }

/* Правые иконки */
.ubar { display: flex; gap: 2px; flex-shrink: 0; }
.ubar a {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rad);
  color: var(--fg3);
  transition: .15s;
  cursor: pointer;
}
.ubar a:hover { background: var(--bg2); color: var(--o); }
.ubar a svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ── НАВБАР РУБРИК ── */
.nav-w {
  border-bottom: 1px solid var(--ln);
  background: var(--bg);
}
/* Центрированный контейнер — выравнивается с .hdr-in */
.nav-w__inner {
  max-width: var(--cw);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: stretch;
  height: 38px;
}
.nav-w__rubrics {
  flex: 1;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}
.nav-w__rubrics::-webkit-scrollbar { display: none; }
.nav-w__rubrics .block-menu { display: contents; }
.nav-w__secondary {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  border-left: 1px solid var(--ln);
  padding-left: 12px;
}
.nav-w__secondary a {
  font-size: .8125rem;
  color: var(--fg3);
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: .15s;
}
.nav-w__secondary a:hover { color: var(--fg); background: var(--bg2); }
.nav-subscribe {
  background: var(--o) !important;
  color: #fff !important;
  font-weight: 600;
  margin-left: 4px;
}
.nav-subscribe:hover { opacity: .85; background: var(--o) !important; }

.nav-w > .nav,
.nav-w > div > .nav,
.nav-w .block-menu .nav,
.nav-w__rubrics > .nav,
.nav-w__rubrics .block-menu .nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  height: 38px;
  align-items: stretch;
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.nav-w .nav::-webkit-scrollbar { display: none; }

/* Drupal block wrapper прозрачный */
.nav-w .block-menu { display: contents; }

/* Ссылки в нав */
.nav-w .nav a,
.nav-w .nav .nav-link {
  font-size: .875rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: .2px;
  color: var(--fg3);
  padding: 8px 10px 5px;
  white-space: nowrap;
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: .15s;
  text-decoration: none;
}

/* Цветные точки перед рубриками */
.nav-w .nav .nav-link::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: .55;
  transition: opacity .15s;
}
.nav-w .nav .nav-link:hover::before,
.nav-w .nav .nav-link.is-active::before,
.nav-w .nav .nav-link--active-trail::before { opacity: 1; }
.nav-w .nav .nav-link--ai::before       { background: var(--r1); }
.nav-w .nav .nav-link--platforms::before { background: var(--r2); }
.nav-w .nav .nav-link--soft::before      { background: var(--r3); }
.nav-w .nav .nav-link--hardware::before  { background: var(--r4); }
.nav-w .nav .nav-link--security::before  { background: var(--r5); }
.nav-w .nav .nav-link--business::before  { background: var(--r6); }
.nav-w .nav .nav-link--gov::before       { background: var(--r7); }
.nav-w .nav .nav-link--science::before   { background: var(--r8); }
.nav-w .nav a:first-child,
.nav-w .nav .nav-item:first-child .nav-link { padding-left: 0; }
.nav-w .nav a:hover,
.nav-w .nav .nav-link:hover { color: var(--fg); }
.nav-w .nav a::after,
.nav-w .nav .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 1px;
  opacity: 0;
  transition: .15s;
}
.nav-w .nav a:hover::after,
.nav-w .nav a.on::after,
.nav-w .nav .nav-link:hover::after,
.nav-w .nav .nav-link.is-active::after,
.nav-w .nav .nav-link--active-trail::after { opacity: 1; }
.nav-w .nav a.on,
.nav-w .nav .nav-link.is-active { color: var(--fg); font-weight: 700; }

/* Цвета по рубрикам */
.nav-w .nav .r1::after,
.nav-w .nav .nav-link--ai::after { background: var(--r1); }
.nav-w .nav .r2::after,
.nav-w .nav .nav-link--platforms::after { background: var(--r2); }
.nav-w .nav .r3::after,
.nav-w .nav .nav-link--soft::after { background: var(--r3); }
.nav-w .nav .r4::after,
.nav-w .nav .nav-link--hardware::after { background: var(--r4); }
.nav-w .nav .r5::after,
.nav-w .nav .nav-link--security::after { background: var(--r5); }
.nav-w .nav .r6::after,
.nav-w .nav .nav-link--business::after { background: var(--r6); }
.nav-w .nav .r7::after,
.nav-w .nav .nav-link--gov::after { background: var(--r7); }
.nav-w .nav .r8::after,
.nav-w .nav .nav-link--science::after { background: var(--r8); }

@media (max-width: 768px) { .nav-w { display: none; } }

/* nav-item li */
.nav-w .nav .nav-item { display: flex; align-items: stretch; }

/* ── Мобильный bottom bar ── */
.cifra-bottom-bar {
  display: none;
}
@media (max-width: 768px) {
  body { padding-bottom: 56px; }
  .cifra-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg);
    border-top: 1px solid var(--ln);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
  }
}
.cifra-bottom-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 600;
  color: var(--fg3);
  text-decoration: none;
}
.cifra-bottom-bar__item.is-active { color: var(--o); }
.cifra-bottom-bar__item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── ВЕРХНИЙ РЕКЛАМНЫЙ БАННЕР (40px → expands on hover) ── */
.cifra-top-ad {
  width: 100%;
  background: var(--dark, #0d0d1a);
  overflow: hidden;
  height: 40px;
  transition: height .35s ease;
  position: relative;
  z-index: 100;
}
.cifra-top-ad:hover { height: 220px; }

.cifra-top-ad__inner {
  max-width: var(--cw, 1800px);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: flex-start;
  gap: 0;
}

/* Compact strip (40px) */
.cifra-top-ad__compact {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  flex-shrink: 0;
  width: 100%;
  position: relative;
  z-index: 2;
}
.cifra-top-ad__erid {
  font-size: .625rem;
  color: rgba(255,255,255,.35);
  white-space: nowrap;
  flex-shrink: 0;
}
.cifra-top-ad__teaser {
  font-size: .875rem;
  color: rgba(255,255,255,.8);
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cifra-top-ad__teaser span { color: var(--o, #F97316); font-weight: 700; }
.cifra-top-ad__pill {
  background: var(--o, #F97316);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: .15s;
}
.cifra-top-ad__pill:hover { opacity: .85; }
.cifra-top-ad__hint {
  color: rgba(255,255,255,.4);
  font-size: .75rem;
  transition: transform .35s;
  flex-shrink: 0;
}
.cifra-top-ad:hover .cifra-top-ad__hint { transform: rotate(180deg); }

/* Expanded infographic block */
.cifra-ad-prefix {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 8px 0 16px;
  opacity: 0;
  transition: opacity .25s .1s;
  text-decoration: none;
  color: inherit;
  width: 100%;
  position: absolute;
  top: 40px;
  left: 16px;
  right: 16px;
}
.cifra-top-ad:hover .cifra-ad-prefix { opacity: 1; }

.cifra-ad-prefix__scale {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.cifra-ad-prefix__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cifra-ad-prefix__dot {
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.cifra-ad-prefix__unit:nth-child(1) .cifra-ad-prefix__dot { width: 8px;  height: 8px; }
.cifra-ad-prefix__unit:nth-child(2) .cifra-ad-prefix__dot { width: 12px; height: 12px; }
.cifra-ad-prefix__unit:nth-child(3) .cifra-ad-prefix__dot { width: 18px; height: 18px; }
.cifra-ad-prefix__unit:nth-child(4) .cifra-ad-prefix__dot { width: 26px; height: 26px; }
.cifra-ad-prefix__unit:nth-child(5) .cifra-ad-prefix__dot { width: 36px; height: 36px; }
.cifra-ad-prefix__unit:nth-child(6) .cifra-ad-prefix__dot { width: 46px; height: 46px; background: var(--o, #F97316); opacity: 1; }
.cifra-ad-prefix__unit:nth-child(7) .cifra-ad-prefix__dot { width: 56px; height: 56px; background: rgba(255,255,255,.08); font-size: 20px; }
.cifra-ad-prefix__name {
  font-size: .5625rem;
  color: rgba(255,255,255,.4);
  white-space: nowrap;
}
.cifra-ad-prefix__unit:nth-child(6) .cifra-ad-prefix__name { color: var(--o, #F97316); }
.cifra-ad-prefix__body { color: #fff; }
.cifra-ad-prefix__kicker { font-size: .6875rem; color: var(--o, #F97316); font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.cifra-ad-prefix__title { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; }
.cifra-ad-prefix__sub { font-size: .875rem; color: rgba(255,255,255,.65); margin-bottom: 6px; }
.cifra-ad-erid { font-size: .625rem; color: rgba(255,255,255,.3); }
