/* ==========================================================================
   Punch · Microsite shell — shared navigation + cross-page consistency
   Used by every doc in the system. Loaded via <link rel="stylesheet">.

   Scope:
   1. Nav, breadcrumbs, and dropdowns are styled here (self-contained, doc-
      agnostic so they sit on top of any Punch doc without conflicts).
   2. A low-specificity TYPOGRAPHY AUTO-LAYER at the bottom of this file
      applies cross-doc line-break rules (text-wrap: balance on headlines,
      text-wrap: pretty + hyphens on body). Per-doc <style> blocks load
      after this file, so doc-level font-size/color/weight rules still win
      — this layer only fills in the wrap behaviour they don't specify.
   ========================================================================== */

.punch-nav {
  /* Self-scoped vars so the nav works on any page regardless of doc-level vars */
  --pn-bg: rgba(10, 10, 10, 0.92);
  --pn-text: #FAFAFA;
  --pn-text-muted: #9c9c9c;
  --pn-text-faint: #6a6a6a;
  --pn-border: #2A2A2A;
  --pn-border-strong: #3A3A3A;
  --pn-red: #FF1449;
  --pn-red-soft: rgba(255, 20, 73, 0.14);

  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--pn-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--pn-border);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
  color: var(--pn-text);
  user-select: none;
}

.punch-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* ---------- Brand ---------- */
.punch-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--pn-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.punch-nav-brand:hover { text-decoration: none; }
.punch-nav-mark {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--pn-red);
  flex-shrink: 0;
}
.punch-nav-logo {
  height: 22px;
  width: auto;
  display: block;
  flex-shrink: 0;
  color: var(--pn-text);
}
.punch-nav-sub {
  color: var(--pn-text-muted);
  font-weight: 400;
  font-size: 13px;
}

/* ---------- Links ---------- */
.punch-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.punch-nav-links > li { position: relative; }
.punch-nav-links a,
.punch-nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--pn-text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.18s ease, background 0.18s ease;
  position: relative;
}
.punch-nav-links a:hover,
.punch-nav-dropdown-toggle:hover {
  color: var(--pn-text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}
.punch-nav-links a.is-current,
.punch-nav-dropdown.has-current > .punch-nav-dropdown-toggle {
  color: var(--pn-text);
}
.punch-nav-links a.is-current::after,
.punch-nav-dropdown.has-current > .punch-nav-dropdown-toggle::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--pn-red);
  border-radius: 2px;
}

/* ---------- Dropdown ---------- */
.punch-nav-dropdown-toggle .pn-caret {
  font-size: 9px;
  opacity: 0.6;
  margin-left: 2px;
}
.punch-nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 4px;
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  min-width: 200px;
  background: #131313;
  border: 1px solid var(--pn-border);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 110;
}
.punch-nav-dropdown:hover .punch-nav-dropdown-menu,
.punch-nav-dropdown.is-open .punch-nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.punch-nav-dropdown-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 4px;
  white-space: nowrap;
}
.punch-nav-dropdown-menu li a::after { display: none !important; }
.punch-nav-dropdown-menu .pn-ext {
  font-size: 11px;
  color: var(--pn-text-faint);
  font-weight: 400;
}
.punch-nav-dropdown-menu li a:hover .pn-ext {
  color: var(--pn-red);
}

/* ---------- Mobile burger ---------- */
.punch-nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--pn-border-strong);
  border-radius: 5px;
  width: 38px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  position: relative;
}
.punch-nav-burger span {
  position: absolute;
  left: 9px; right: 9px;
  height: 1.5px;
  background: var(--pn-text);
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}
.punch-nav-burger span:nth-child(1) { top: 11px; }
.punch-nav-burger span:nth-child(2) { top: 16px; }
.punch-nav-burger span:nth-child(3) { top: 21px; }
.punch-nav.is-mobile-open .punch-nav-burger span:nth-child(1) {
  top: 16px; transform: rotate(45deg);
}
.punch-nav.is-mobile-open .punch-nav-burger span:nth-child(2) {
  opacity: 0;
}
.punch-nav.is-mobile-open .punch-nav-burger span:nth-child(3) {
  top: 16px; transform: rotate(-45deg);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .punch-nav-inner { padding: 10px 18px; }
  .punch-nav-burger { display: block; }
  .punch-nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #0c0c0c;
    border-bottom: 1px solid var(--pn-border);
    padding: 12px 0;
    gap: 0;
  }
  .punch-nav.is-mobile-open .punch-nav-links { display: flex; }
  .punch-nav-links a,
  .punch-nav-dropdown-toggle {
    width: 100%;
    padding: 12px 24px;
    justify-content: space-between;
    border-radius: 0;
    font-size: 14px;
  }
  .punch-nav-links a.is-current::after,
  .punch-nav-dropdown.has-current > .punch-nav-dropdown-toggle::after {
    display: none;
  }
  .punch-nav-links a.is-current,
  .punch-nav-dropdown.has-current > .punch-nav-dropdown-toggle {
    background: rgba(255, 20, 73, 0.08);
    border-left: 2px solid var(--pn-red);
    padding-left: 22px;
  }
  .punch-nav-dropdown-menu {
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0 0 0 24px;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  .punch-nav-dropdown.is-open .punch-nav-dropdown-menu { display: block; }
}

/* ==========================================================================
   Sticky wrap (so nav + breadcrumbs stick together)
   ========================================================================== */
.punch-nav-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  /* Vars live here so .punch-breadcrumbs inherits them as a sibling of .punch-nav. */
  --pn-bg: rgba(10, 10, 10, 0.92);
  --pn-text: #FAFAFA;
  --pn-text-muted: #9c9c9c;
  --pn-text-faint: #6a6a6a;
  --pn-border: #2A2A2A;
  --pn-border-strong: #3A3A3A;
  --pn-red: #FF1449;
}
/* Inside the wrap, the nav itself shouldn't be sticky — the wrap is.
   It must still stack ABOVE the breadcrumb bar so open dropdown menus
   aren't painted behind it (the breadcrumb's backdrop-filter creates its
   own stacking context as a later sibling). */
.punch-nav-wrap .punch-nav {
  position: relative;
  top: auto;
  z-index: 2;
}
.punch-nav-wrap .punch-breadcrumbs {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Breadcrumbs (thin bar under the main nav)
   ========================================================================== */
.punch-breadcrumbs {
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--pn-border, #2A2A2A);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  color: var(--pn-text-muted, #9c9c9c);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}
.punch-breadcrumbs-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 7px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.pn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--pn-text-muted, #9c9c9c);
  letter-spacing: 0.05em;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 14px 4px 0;
  border-right: 1px solid var(--pn-border, #2A2A2A);
  transition: color 0.15s ease;
  flex-shrink: 0;
}
.pn-back:hover {
  color: var(--pn-text, #FAFAFA);
  text-decoration: none;
}
.pn-back-arrow {
  font-size: 13px;
  line-height: 1;
}
.pn-crumbs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pn-crumbs li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.pn-crumbs li:not(:last-child)::after {
  content: "/";
  color: var(--pn-text-faint, #6a6a6a);
  font-weight: 300;
}
.pn-crumbs a {
  color: var(--pn-text-muted, #9c9c9c);
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
}
.pn-crumbs a:hover {
  color: var(--pn-text, #FAFAFA);
  text-decoration: none;
}
.pn-crumbs li > span {
  white-space: nowrap;
}
.pn-crumbs li[aria-current="page"] > span {
  color: var(--pn-text, #FAFAFA);
  font-weight: 600;
}

@media (max-width: 720px) {
  .punch-breadcrumbs-inner { padding: 7px 18px; gap: 12px; }
  .pn-crumbs { gap: 6px; }
  .pn-crumbs li { gap: 6px; }
  /* Collapse middle crumbs on mobile — show Home / … / Current */
  .pn-crumbs li:not(:first-child):not(:last-child) { display: none; }
  .pn-crumbs li:first-child:not(:last-child)::after {
    content: "/ …";
  }
}

/* ==========================================================================
   Typography auto-layer — line-break rules borrowed from the Auria wireframe
   so headlines balance ("The new process / is here." not "The new process is /
   here.") and body copy stays even-rivered without manual <br> tags.

   Low-specificity, no font-size / color / weight properties — per-doc styles
   continue to control visual appearance. This layer only fills in the wrap
   behaviour the docs don't specify.

   Per-element override: a literal <br> in the markup still wins. Use sparingly
   for tuned headlines that the balancer can't get right.
   ========================================================================== */
h1, h2, h3, h4 {
  text-wrap: balance;
}
p, li, dd, blockquote {
  text-wrap: pretty;
  /* No automatic hyphenation anywhere in the microsite — whole words only. */
  hyphens: manual;
  -webkit-hyphens: manual;
}
/* CTAs never break mid-label */
button, .cta, .btn, .punch-nav-brand, .pn-crumbs a, .punch-nav-links a {
  white-space: nowrap;
}
/* Opt-out hook for headlines that intentionally want greedy wrapping
   (e.g. fixed-grid layouts, narrow columns where balance hurts). */
.no-balance, .no-balance h1, .no-balance h2, .no-balance h3, .no-balance h4 {
  text-wrap: wrap;
}

