/* suite-header.css — the shared Connecter Suite header (`.dl-header`,
   template DesktopApp/templates/header_connecter.htm).

   Trello #593: /connecter/desktop-app and /connecter/subscriptions (both also
   proxied as connecterapp.com/desktop-app and /subscriptions) must show the
   SAME horizontal navigation. Both actions now render the same partial and both
   layouts (newindex.htm, serversubscriptions.htm) load this one stylesheet, so
   the header is defined once.

   Scope: every rule is under `body.cnnctr-suite-nav .dl-header`. The body hook
   is set on both layouts. It deliberately does NOT start with `dc-`: a global
   Bootstrap iconfont rule `[class^="dc-"], [class*=" dc-"]` forces the icon
   font (no Latin glyphs) onto such elements. Specificity is identical to the
   original `body.dc-download .dl-header` rules these were moved from, so the
   desktop-app page renders exactly as before.

   Tokens (--dc-white, --dc-ink, --dc-font-body, --dc-radius-pill,
   --dc-btn-gradient) come from redesign-tokens.css, which also scopes them to
   `.dl-header` so the pricing page (no `.dc-redesign` body class) gets them.

   The two pages load DIFFERENT legacy sheets (new_style.css vs
   serversubscriptions/style.css + subscriptions-v2.css) whose generic `header`
   rules disagree, mostly in the <=1024px hamburger overlay. The last block of
   this file pins every overlay property both sheets set, so the mobile menu is
   identical on both pages too. */

/* Header text uses the Suite body font on every page and at every width. The
   desktop-app body already resolves to it (download-redesign.css); the pricing
   page body is Open Sans, so without this the mobile overlay links would differ. */
body.cnnctr-suite-nav .dl-header {
  font-family: var(--dc-font-body);
}

/* ==========================================================================
   Task 2 — Header reskin (`.dl-header`)
   The legacy `header` rule in new_style.css is a fixed, 200px-wide vertical
   icon rail (position:absolute; width:200px), and serversubscriptions/style.css
   has the same rail. `header_connecter.htm` is rendered only by
   DesktopApp::actionIndex() and Subscriptions::actionIndex() (Trello #593),
   so we fully replace that layout here rather than patch it. The header is
   transparent: on the desktop-app it sits over the hero aurora painted by
   `.dl-hero` (download-redesign.css); on the pricing page it is positioned
   over the dark `.section-dark-plans` wave (pricing-redesign.css).
   ========================================================================== */

body.cnnctr-suite-nav .dl-header {
  position: relative;
  z-index: 3;
  width: auto;
  /* The legacy `header` rule forces height:170px at <=1024px, which is far
     taller than this slim flex row and leaves a white band above the aurora
     (the hero pulls up by the header height). Pin the height to the content so
     the header always sits within the aurora at every width. */
  height: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Base = mobile: full-width row, logo left + hamburger right at 48px. On
     desktop (>=1025px) the whole row (logo + nav) is constrained to the centred
     section content column instead — see the desktop block below. */
  padding: 28px 48px;
  margin: 0;
  background-color: transparent;
}

/* White logo: the source asset (logo_suite_blue.svg) is blue; the header
   sits on a dark aurora so it must read as clean white. Inverting via
   filter keeps the shared asset untouched and this rule page-scoped.
   Size override is REQUIRED: the legacy `header .logo img` rule in
   new_style.css sets height:126px (140px/110px in its media queries),
   sized for a 200px-wide vertical icon rail — that would render the mark
   hugely oversized in this slim ~28px-padded header row. This selector
   out-specifies `header .logo img`, so the mark tracks the ~40px height it
   has in Hero Image.png. Scoped to `.dl-header__logo` (the top header-row
   logo only), so the mobile-overlay duplicate (`li.logo-mobile a.logo img`,
   which has no `dl-header__logo` class) keeps its own larger sizing. */
body.cnnctr-suite-nav .dl-header .dl-header__logo img {
  filter: brightness(0) invert(1);
  /* Base (mobile) keeps the original 40px so the mobile header stays ~96px and
     its hero spacing is unchanged. The 2x (80px) enlargement is applied on
     desktop (>=1025px) only — see the desktop header block — where the layout
     already changes from the hamburger overlay to the full nav row. */
  height: 40px;
  width: auto;
  max-height: 40px;
}

body.cnnctr-suite-nav .dl-header .dl-header__logo {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

/* Mobile hamburger / close icon bars: recolor to white so they read over
   the dark aurora. Only visible at <=1024px via the existing `.mobile-only`
   rule in new_style.css — safe to set unconditionally here. */
body.cnnctr-suite-nav .dl-header span.icon-hamburger i,
body.cnnctr-suite-nav .dl-header span.icon-hamburger i:before,
body.cnnctr-suite-nav .dl-header span.icon-hamburger i:after {
  background-color: var(--dc-white);
}

body.cnnctr-suite-nav .dl-header span.icon-close-nav:before,
body.cnnctr-suite-nav .dl-header span.icon-close-nav:after {
  background-color: var(--dc-white);
}

/* "NEW" badge on the Connecter 8 nav item. Defined OUTSIDE the desktop media
   query so it also renders in the <=1024px mobile overlay. Self-colored (brand
   blue gradient + white text) so it reads on both the dark desktop bar and the
   light mobile overlay panel. */
body.cnnctr-suite-nav .dl-header .dl-header__badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--dc-radius-pill);
  background: var(--dc-btn-gradient);
  color: var(--dc-white);
  font-family: var(--dc-font-body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: 1;
}

/* Desktop nav row (>1024px matches the breakpoint new_style.css uses to
   switch into the full-screen mobile overlay nav — leave that overlay's
   own layout/colors alone below 1025px so the existing hamburger behaviour
   keeps working unmodified). */
@media screen and (min-width: 1025px) {
  /* Desktop header: the WHOLE row (logo + nav) is constrained to the centred
     section content column — the logo aligns to the section content-left and
     "Get started" to the content-right. Mirrors the sections exactly: their
     max-width:1600 inner sits inside 64px section padding, so reproducing that
     here (max-width 1600 + 2*64, box-sizing:border-box, 64px side padding, auto
     margins) yields the same content box, min(1600px, 100vw - 128px), centred.
     min-height holds the row tall enough for the 2x (80px) logo. */
  body.cnnctr-suite-nav .dl-header {
    max-width: 1728px;
    margin: 0 auto;
    padding: 28px 64px;
    box-sizing: border-box;
    min-height: 136px;
  }

  /* 2x logo (80px, up from the 40px base) — desktop only. Portrait asset
     (viewBox 140.6x223.1) → ~50px wide, so it barely affects the nav; it does
     make the header ~136px tall, so the hero -136px pull-up (desktop-scoped)
     keeps the aurora covering the full header (no white band). */
  body.cnnctr-suite-nav .dl-header .dl-header__logo img {
    height: 80px;
    max-height: 80px;
  }

  /* Nav fills from the logo across to the header content-right (= section
     content-right); the right cluster is pushed there by margin-left:auto on
     `.nav-right-start`. 64px gap between the logo and the first item. */
  body.cnnctr-suite-nav .dl-header .dl-header__nav {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    margin-left: 64px;
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav {
    display: flex;
    align-items: center;
    /* 32px (was 40) keeps all 8 items on one row down to the 1025px desktop
       floor; below 1025px the mobile overlay takes over. */
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li {
    display: block;
    /* Hold each item at its natural single-line width so a tight row never
       shrinks an item enough to wrap its label; at <=1232px the gap/offsets
       tighten instead (media block after this one). */
    flex-shrink: 0;
  }

  /* Mobile-only duplicate logo inside the nav — never shown on desktop. */
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li.logo-mobile {
    display: none;
  }

  /* The legacy new_style.css puts clearfix ::before/::after (content:" ";
     display:table) on `.nav`. In this flex row they blockify into zero-width
     flex items, so `gap:32px` reserves 32px before the first and after the
     last real item — that trailing 32px pushes the right cluster (Get started)
     in from the section content edge. Drop them so the row sits flush with the
     content column on both sides. Desktop-only (>=1025px) — the <=1024 mobile
     overlay keeps the legacy clearfix untouched. */
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav::before,
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav::after {
    display: none;
  }

  /* Split the row into a left cluster (Pricing…Connecter 8, by the logo) and a
     right cluster (Login/Logout · Feedback · Get started). `.nav-right-start`
     is set on BOTH the login_button and logout_button <li> in
     header_connecter.htm; exactly one renders, so it is always the first
     right-cluster item — `margin-left:auto` on it pushes it and everything
     after to the right, regardless of how many left items precede it. This
     replaces an earlier `nth-last-child(3)` selector that hard-coded a 5-<li>
     nav; nav items can now be added/removed without touching this rule. */
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li.nav-right-start {
    margin-left: auto;
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a {
    display: inline-flex;
    align-items: center;
    position: static;
    margin: 0;
    padding: 0;
    font-family: var(--dc-font-body);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    text-transform: none;
    /* Multi-word labels ("Customer Stories", "Get started") never break to a
       second line; the 1025–1232px media block tightens spacing to keep the
       nowrap row fitting. */
    white-space: nowrap;
    text-decoration: none;
    color: var(--dc-white);
    opacity: .92;
    border-top: none;
    background-color: transparent;
    transition: opacity .2s ease-in-out;
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a:hover,
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a:focus {
    color: var(--dc-white);
    opacity: 1;
    background-color: transparent;
  }

  /* Plain text nav — icons from the legacy icon-rail layout are hidden. */
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a .icn-nav {
    display: none;
  }

  /* Get started — the sole white-outlined rounded pill, transparent fill.
     (Login/Logout are now plain text links; they inherit the nav-link style
     above.) */
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a.nav-cta {
    padding: 10px 24px;
    border: 1px solid var(--dc-white);
    border-radius: var(--dc-radius-pill);
    opacity: 1;
    text-align: center;
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a.nav-cta:hover,
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a.nav-cta:focus {
    background-color: rgba(255, 255, 255, .12);
  }
}

/* ==========================================================================
   Narrow desktop (1025–1232px): with the whole row constrained to the content
   column (64px side padding) plus the 2x logo, the 8 nav items + Get-started
   pill don't fit at the base 64px logo-gap / 32px item-gap once labels are
   `nowrap`. Tighten both (logo→nav gap 32px, item gap 16px). Below 1100px the
   page sections drop to 24px side padding, so the header padding follows suit —
   this keeps the logo aligned to the section content-left AND frees the extra
   room the tightest widths (down to the 1025px floor) need. Verified no
   horizontal overflow down to 1025px (below that the mobile overlay takes over).
   ========================================================================== */
@media screen and (min-width: 1025px) and (max-width: 1232px) {
  body.cnnctr-suite-nav .dl-header .dl-header__nav {
    margin-left: 32px;
  }
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav {
    gap: 16px;
  }
}

@media screen and (min-width: 1025px) and (max-width: 1100px) {
  body.cnnctr-suite-nav .dl-header {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ==========================================================================
   Task 7 — Mobile nav legibility (<=1024px)
   Below 1025px, new_style.css swaps `header nav` into a full-screen LIGHT
   overlay panel (background:#fff; each `header nav .nav li a` row painted
   on #f4f4f4). The white nav-link color set above is scoped to the
   >=1025px desktop rule only, so it never reaches this range — the legacy
   base rule `header .nav li a{color:#444}` is what actually paints the
   text there. Pin that explicitly to the design token (rather than resting
   on the legacy fallback) so it can't regress if the legacy rule changes.
   Also fixes a real bug: the close (X) icon was forced white unconditionally
   above (correct for the hamburger's resting state over the dark aurora),
   but the (X) itself is only ever drawn on top of this light open panel —
   white-on-white was invisible. Icons inside nav links (`.icn-nav`) have no
   color of their own (icon-font glyphs use `currentColor`), so they follow
   the link color fix automatically. */
@media screen and (max-width: 1024px) {
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a {
    color: var(--dc-ink);
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a:hover,
  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a:focus {
    color: var(--dc-ink);
  }

  body.cnnctr-suite-nav .dl-header span.icon-close-nav:before,
  body.cnnctr-suite-nav .dl-header span.icon-close-nav:after {
    background-color: var(--dc-ink);
  }
}

/* ==========================================================================
   Mobile overlay (<=1024px) — identical on both pages (Trello #593)
   Values are the ones new_style.css gives the desktop-app page (what the Suite
   header has always looked like there). serversubscriptions/style.css uses
   smaller bars, other offsets and a dark `.server-page` background image with
   translucent rows; each of those properties is re-declared here so the
   pricing page's hamburger, close icon and open menu match the desktop-app.
   ========================================================================== */
@media screen and (max-width: 1024px) {
  body.cnnctr-suite-nav .dl-header span.icon-hamburger {
    position: absolute;
    top: 27px;
    right: 50px;
    width: 50px;
    height: 44px;
    z-index: 2;
  }

  body.cnnctr-suite-nav .dl-header span.icon-hamburger i {
    position: absolute;
    top: 35px;
    left: 0;
    width: 50px;
    height: 4px;
    border-radius: 4px;
  }

  body.cnnctr-suite-nav .dl-header span.icon-hamburger i:before,
  body.cnnctr-suite-nav .dl-header span.icon-hamburger i:after {
    left: 0;
    top: -14px;
    width: 50px;
    height: 4px;
    border-radius: 4px;
  }

  body.cnnctr-suite-nav .dl-header span.icon-hamburger i:after {
    top: 14px;
  }

  body.cnnctr-suite-nav .dl-header span.icon-close-nav {
    top: 44px;
    right: 50px;
    width: 44px;
    height: 44px;
  }

  body.cnnctr-suite-nav .dl-header span.icon-close-nav:before,
  body.cnnctr-suite-nav .dl-header span.icon-close-nav:after {
    left: 5px;
    top: 20px;
    width: 44px;
    height: 4px;
    border-radius: 4px;
  }

  /* The open menu: a light full-screen panel. `background` (shorthand) also
     clears the `.server-page header nav` dark image on the pricing page. */
  body.cnnctr-suite-nav .dl-header .dl-header__nav {
    background: #fff;
    padding: 0 50px;
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li a {
    font-family: var(--dc-font-body);
    font-size: 22px;
    font-weight: 500;
    line-height: 34px;
    text-transform: none;
    text-decoration: none;
    padding: 30px 80px 30px 50px;
    margin: 2px 0;
    border-top: none;
    background-color: #f4f4f4;
    float: left;
    width: 100%;
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li.logo-mobile {
    display: block;
    text-align: center;
    padding: 110px 0 60px;
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li.logo-mobile a {
    padding: 0;
    background-color: transparent;
  }

  body.cnnctr-suite-nav .dl-header .dl-header__nav .nav li.logo-mobile img {
    height: 165px;
  }
}
