/* ============================================================
   v2 Navigation menu — editorial dropdown
   Top items: JetBrains Mono uppercase
   Group titles: JetBrains Mono uppercase smaller
   Items: Inter sans-serif (clean, functional)
   ============================================================ */

.v2-nav { display: flex; }
.v2-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
  align-items: center;
}
.v2-nav-item { position: relative; }

.v2-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  background: transparent;
  border: none;
  color: var(--ink-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: color .15s;
  position: relative;
}
.v2-nav-link:hover,
.v2-nav-item.is-active > .v2-nav-link,
.v2-nav-link.is-active { color: var(--blue); }

.v2-nav-arrow {
  display: inline-block;
  margin-left: 2px;
  opacity: 0.6;
  transition: transform .2s, opacity .15s;
}
.v2-nav-item.has-dropdown:hover .v2-nav-arrow {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--blue);
}

/* ============== Dropdown panel ============== */
.v2-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: -20px;
  min-width: 360px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 12px 36px rgba(10,31,68,0.12);
  z-index: 100;
}
.v2-dropdown::before {
  /* invisible bridge so hover doesn't break in the gap */
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}
.v2-dropdown-inner {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
}

/* ============== Flat item (single-level dropdown) ============== */
.v2-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 22px;
  font-family: "Source Serif 4", "Source Serif Pro", Charter, Georgia, serif;
  font-feature-settings: "ss01", "lnum";
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  transition: background .12s, color .12s, padding-left .15s;
  line-height: 1.25;
  letter-spacing: -0.005em;
  border-left: 2px solid transparent;
}
.v2-dropdown-item:hover {
  background: var(--blue-pale);
  color: var(--blue);
  border-left-color: var(--blue);
}
.v2-dropdown-item-flat { font-weight: 500; }

/* ============== Group with children (multi-level) ============== */
.v2-dropdown-group {
  padding: 8px 0 6px;
  border-top: 1px solid var(--rule-soft);
}
.v2-dropdown-group:first-child { border-top: none; padding-top: 4px; }

.v2-dropdown-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 22px 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  text-decoration: none;
  transition: color .12s;
  line-height: 1.3;
}
a.v2-dropdown-group-title:hover { color: var(--blue); }

.v2-dropdown-group-arrow {
  font-size: 11px;
  opacity: 0.4;
  transition: opacity .12s, transform .15s;
  flex-shrink: 0;
}
a.v2-dropdown-group-title:hover .v2-dropdown-group-arrow {
  opacity: 1;
  color: var(--blue);
  transform: translateX(3px);
}

.v2-dropdown-children {
  display: flex;
  flex-direction: column;
  padding: 2px 0 4px;
}

/* Items within a group — nested visually */
.v2-dropdown-group .v2-dropdown-item {
  font-family: "Source Serif 4", "Source Serif Pro", Charter, Georgia, serif;
  font-feature-settings: "ss01", "lnum";
  font-size: 15px;
  font-weight: 400;
  padding: 6px 22px 6px 30px;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  position: relative;
}
.v2-dropdown-group .v2-dropdown-item:hover {
  color: var(--blue);
  background: var(--blue-pale);
  border-left-color: var(--blue);
}

/* Wide dropdown for "Рейтинги" — many groups */
.v2-nav-item.has-dropdown[data-wide="true"] .v2-dropdown { min-width: 380px; }

/* ============== Footer section (utility actions) ============== */
.v2-dropdown-footer {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--ink);
  background: var(--paper-2);
}
.v2-dropdown-footer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: background .12s, color .12s, padding-left .15s;
  border-bottom: 1px solid var(--rule-soft);
}
.v2-dropdown-footer-item:last-child { border-bottom: none; }
.v2-dropdown-footer-item:hover {
  background: var(--blue-pale);
  color: var(--blue);
}
.v2-dropdown-footer-arrow {
  font-size: 13px;
  opacity: 0.5;
  transition: opacity .12s, transform .15s;
  flex-shrink: 0;
}
.v2-dropdown-footer-item:hover .v2-dropdown-footer-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* ============================================================
   v2 Responsive header — two-stage collapse
   1. ≤1200px: drop the CTA button from the header. The inline nav
      stays visible. Users still have full top-level navigation.
   2. ≤1024px: drop the inline nav too and reveal the burger button.
      The CTA is duplicated inside the drawer so it stays reachable.

   The burger lives INSIDE .masthead-r (the right-hand cell), so the
   .masthead grid always has exactly 3 children — never wrapping onto
   a second row.
   ============================================================ */
@media (max-width: 1024px) {
  .v2-nav { display: none; }
  /* When the inline nav is removed it leaves the masthead with only
     2 in-flow children (brand + masthead-r). The default 1fr|auto|1fr
     would land masthead-r in the middle column, leaving an empty 1fr
     on the right and visually centering the burger. Drop to 2 columns
     so masthead-r sits flush right. */
  .masthead { grid-template-columns: auto 1fr; }
}

/* Burger hidden by default; shown only when the inline nav is hidden. */
.v2-burger-wrap { display: none; }
@media (max-width: 1024px) {
  .v2-burger-wrap { display: block; }
}

/* CTA in the header disappears earlier than the nav. Between
   1025-1200px users see brand + inline nav (no CTA, no burger). */
@media (max-width: 1200px) {
  .masthead-r > .btn-mini { display: none; }
}

.v2-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  /* Stay above the home-page brand-logo-link (z-index 60) so the
     SVG logo never steals burger clicks on narrow widths. */
  position: relative;
  z-index: 80;
}
.v2-burger:hover { border-color: var(--ink); }
.v2-burger-line {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .2s, opacity .15s;
}
.v2-burger.is-open .v2-burger-line:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
.v2-burger.is-open .v2-burger-line:nth-child(2) { opacity: 0; }
.v2-burger.is-open .v2-burger-line:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.v2-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 68, 0.55);
  z-index: 1000;
}

.v2-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--paper);
  border-left: 1px solid var(--ink);
  z-index: 1010;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(10, 31, 68, 0.18);
}

/* Hide the floating Telegram bubble while the drawer is open so it
   doesn't overlap the CTA at the bottom of the drawer. */
body.no-scroll .telegram-button { display: none; }

/* slide-in animation */
.v2-drawer-enter { transition: transform .25s ease-out; }
.v2-drawer-enter-start { transform: translateX(100%); }
.v2-drawer-enter-end { transform: translateX(0); }
.v2-drawer-leave { transition: transform .2s ease-in; }
.v2-drawer-leave-start { transform: translateX(0); }
.v2-drawer-leave-end { transform: translateX(100%); }

.v2-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
}
.v2-drawer-title {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.v2-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.v2-drawer-close:hover { border-color: var(--ink); color: var(--blue); }

.v2-drawer-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  flex: 1;
}
.v2-drawer-item { border-bottom: 1px solid var(--rule-soft); }
.v2-drawer-item:last-child { border-bottom: none; }

.v2-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 24px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.v2-drawer-link:hover { color: var(--blue); background: var(--paper-2, rgba(10,31,68,0.03)); }
.v2-drawer-item.is-active > .v2-drawer-link { color: var(--blue); }

.v2-drawer-arrow {
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform .2s;
}
.v2-drawer-arrow.is-rotated { transform: rotate(180deg); opacity: 1; }

.v2-drawer-sub {
  padding: 4px 0 12px;
  background: var(--paper-2, rgba(10,31,68,0.02));
}
.v2-drawer-group { padding: 8px 24px 4px; }
.v2-drawer-group-title {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 8px 0 6px;
  text-decoration: none;
}
a.v2-drawer-group-title:hover { color: var(--blue); }

.v2-drawer-subitem {
  display: block;
  padding: 10px 24px 10px 36px;
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.v2-drawer-subitem:hover { color: var(--blue); background: rgba(10,31,68,0.04); }
.v2-drawer-group .v2-drawer-subitem { padding-left: 0; }
.v2-drawer-footer-group {
  padding: 8px 24px 4px;
  margin-top: 8px;
  border-top: 1px solid var(--rule-soft);
}
.v2-drawer-subitem-footer {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-left: 0;
}

.v2-drawer-cta {
  padding: 20px 24px 28px;
  border-top: 1px solid var(--rule);
}
.v2-drawer-cta-btn { display: block; text-align: center; width: 100%; }

/* Body scroll-lock while drawer is open */
body.no-scroll { overflow: hidden; }

/* ============================================================
   v2 Company logo — uniform square frame
   Used in highlights, bigtech preview, bigtech 100 table.
   Picture is centered, contained, never cropped.
   ============================================================ */
.v2-logo {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--rule-soft);
  overflow: hidden;
  position: relative;
}
.v2-logo-sm { width: 36px; height: 36px; padding: 4px; }
.v2-logo-md { width: 48px; height: 48px; padding: 6px; }
.v2-logo-lg { width: 64px; height: 64px; padding: 8px; }

.v2-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Fallback when no image — initials in navy */
.v2-logo-fallback {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.v2-logo-sm .v2-logo-fallback { font-size: 10px; }

