/* Site-wide navigation for the static pages, drawn by js/site-nav.js.
   One white bar (header Version 1, approved 2026-11-02, from learn/mockup-nav-v.html): the logo,
   the sections with the current one as a navy pill and its menu, the cart and the menu button.
   Lesson and case pages get the lesson bar: logo, "Section n of N", the way back, the menu button
   and a progress line. Geist, navy #03202F, red #bd202e. Every class is prefixed ssn- so nothing
   here can collide with page styles; the rules that pages restyle carry nav.ssn-global-nav. */

:root { --ssn-global-nav-h: 56px; }
/* The lesson bar is 3 px taller (its progress line); sections that scroll into view clear it. */
html.ssn-gn-lesson-page { --ssn-global-nav-h: 59px; scroll-padding-top: calc(var(--ssn-global-nav-h) + 12px); }

/* These pages draw most of their content with JavaScript. Holding a screen's height keeps the
   footer and the policy links from jumping down as the content arrives. */
body > main { min-height: 100vh; }

.ssn-global-nav {
  position: sticky;
  top: 0;
  z-index: 60; /* above the tools .app-header (z-40) */
  width: 100%;
  height: var(--ssn-global-nav-h);
  background: #ffffff;
  box-shadow: 0 1px 0 #e2e7ea;
  color: #03202F;
  font-size: 15px;
  line-height: 1.5;
}

.ssn-gn-container {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.ssn-gn-logo { display: flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
.ssn-gn-logo img { width: auto; height: 28px; display: block; }
.ssn-gn-sp { flex: 1; min-width: 0; }

/* The sections. The current one is the navy pill. */
.ssn-gn-sec { position: relative; flex: none; }
nav.ssn-global-nav .ssn-gn-sec > .ssn-gn-sec-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 7px 10px;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #03202F;
  font: 700 15px/1.4 Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
nav.ssn-global-nav .ssn-gn-sec > .ssn-gn-sec-btn:hover { background: #f4f5f6; color: #03202F; }
nav.ssn-global-nav .ssn-gn-sec > .ssn-gn-sec-btn.on { background: #03202F; color: #ffffff; border-radius: 99px; padding: 6px 14px; }
nav.ssn-global-nav .ssn-gn-sec > .ssn-gn-sec-btn.on:hover { background: #193748; color: #ffffff; }
.ssn-gn-caret { font-size: 0.85em; line-height: 1; }

/* The section's menu */
nav.ssn-global-nav .ssn-gn-dd {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 1000;
  min-width: 220px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #e2e7ea;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(3, 32, 47, 0.14);
}
nav.ssn-global-nav .ssn-gn-dd[hidden] { display: none; }
nav.ssn-global-nav .ssn-gn-dd a[role] {
  display: block;
  min-height: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  color: #03202F;
  font: 500 15px/1.4 Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
nav.ssn-global-nav .ssn-gn-dd a[role]:hover, nav.ssn-global-nav .ssn-gn-dd a[role].on { background: #f4f5f6; color: #03202F; }
nav.ssn-global-nav .ssn-gn-dd a[role].on { font-weight: 700; }
nav.ssn-global-nav .ssn-gn-dd hr { height: 0; border: 0; border-top: 1px solid #e2e7ea; margin: 6px 4px; }

/* Beta chip (Learn: the section pill and the menu panel heading) */
.ssn-gn-beta {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(189, 32, 46, 0.12);
  color: #bd202e;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
}
/* On the navy Learn pill the light chip is hard to read: solid red with white text. */
nav.ssn-global-nav .ssn-gn-sec-btn.on .ssn-gn-beta { background: #bd202e; color: #ffffff; }

/* Sign out in the menu panel */
.ssn-gn-signout {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 500;
  color: #333333;
  text-align: left;
  cursor: pointer;
}
.ssn-gn-signout:hover { background: #F5F5F5; color: #bd202e; }

/* Cart and menu button */
.ssn-gn-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #03202F;
  text-decoration: none;
  min-width: 40px;
  min-height: 40px;
  flex: none;
}
.ssn-gn-cart:hover { color: #bd202e; }
.ssn-gn-cart svg { width: 22px; height: 22px; }
.ssn-gn-cart-badge {
  position: absolute;
  top: 0;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #bd202e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
nav.ssn-global-nav .ssn-gn-container .ssn-gn-toggle {
  display: inline-flex;
  flex: none;
  width: 40px;
  height: 40px;
  margin: 0;
  background: #fff;
  border: 1px solid #e2e7ea;
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
}
.ssn-gn-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #03202F; }

/* The lesson bar: position, the way back to the topic, and the progress line under the bar. */
.ssn-global-nav.ssn-gn-lesson { height: auto; }
.ssn-gn-lesson .ssn-gn-container { height: 56px; }
.ssn-gn-count { flex: none; color: #5d6d79; font-size: 14px; white-space: nowrap; }
nav.ssn-global-nav .ssn-gn-back {
  display: block;
  min-width: 0;
  color: #03202F;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
nav.ssn-global-nav .ssn-gn-back:hover { text-decoration: underline; }
.ssn-gn-count[hidden], nav.ssn-global-nav .ssn-gn-back[hidden] { display: none; }
.ssn-gn-prog { height: 3px; background: #e2e7ea; }
.ssn-gn-prog i { display: block; height: 100%; width: 0; background: #03202F; transition: width 0.25s; }

/* ---------- The one breadcrumb pattern ---------- */
.ssn-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.86rem; color: #5e6b78; }
.ssn-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; list-style: none; margin: 0; padding: 0; }
.ssn-crumbs li { display: inline-flex; align-items: center; }
.ssn-crumbs li + li::before { content: "\203A"; color: #8a9aa5; margin: 0 8px; }
.ssn-crumbs a { color: #03202F; font-weight: 600; text-decoration: none; border-bottom: 1px solid #d3dde3; }
.ssn-crumbs a:hover { border-color: #03202F; }
.ssn-crumbs li[aria-current] { color: #5e6b78; }
.ssn-crumbs-back { display: none; }
.ssn-crumbs .ssn-crumbs-from {
  margin-left: auto;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f7e9ec;
  color: #bd202e;
  font-size: 0.82rem;
  font-weight: 700;
}
.ssn-crumbs .ssn-crumbs-from:hover { background: #efd2d8; }

/* The tools pages' own sticky header now sits below this bar. */
.app-header { top: var(--ssn-global-nav-h); }
/* Lesson sidebar offset follows too (learning.css pins it at 82px). */
.lesson-nav { top: calc(var(--ssn-global-nav-h) + 82px); }

/* ---------- Narrower screens ---------- */
@media (max-width: 1024px) {
  nav.ssn-global-nav .ssn-gn-container .ssn-gn-toggle { width: 44px; height: 44px; }
  .ssn-gn-cart { min-width: 44px; min-height: 44px; }

  /* Breadcrumbs shrink to one link back to the parent. */
  .ssn-crumbs ol { display: none; }
  .ssn-crumbs-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-weight: 700;
    font-size: 0.95rem;
  }
  .ssn-crumbs a.ssn-crumbs-back { border: 0; }
  .ssn-crumbs .ssn-crumbs-from { min-height: 44px; }
}

/* Phones: Tools (or Learn, on Tools pages) moves to the menu panel, which lists both sections;
   the section's menu spans the screen; the lesson bar says "n of N" and the way back ends in an ellipsis. */
@media (max-width: 520px) {
  .ssn-gn-container { gap: 8px; padding: 0 12px; }
  .ssn-gn-logo img { height: 22px; }
  nav.ssn-global-nav .ssn-gn-sec > .ssn-gn-sec-btn { padding: 7px; }
  nav.ssn-global-nav .ssn-gn-sec > .ssn-gn-sec-btn.on { padding: 6px 14px; }
  .ssn-gn-sec-alt { display: none; }
  nav.ssn-global-nav .ssn-gn-dd { position: fixed; left: 12px; right: 12px; top: auto; margin-top: 6px; }
  .ssn-gn-count { font-size: 13px; }
  .ssn-gn-w { display: none; }
}

/* The narrowest phones (and 400% zoom): the logo shrinks to its S mark so the bar fits 320 px
   without scrolling sideways. */
@media (max-width: 360px) {
  .ssn-gn-container .ssn-gn-logo img { width: 44px; height: 32px; object-fit: cover; object-position: left center; }
}

/* The menu panel (the menu button, at every width) */
.ssn-gn-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 32, 47, 0.45);
  font-family: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.ssn-gn-drawer[hidden] { display: none; }
body.ssn-gn-open { overflow: hidden; }
.ssn-gn-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(100%, 440px);
  background: #fff;
  overflow-y: auto;
  padding-bottom: 24px;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  animation: ssn-gn-in 0.2s cubic-bezier(.2, .8, .2, 1);
}
@keyframes ssn-gn-in { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.ssn-gn-dtop { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 16px; border-bottom: 1px solid #dfe4e8; }
.ssn-gn-close {
  width: 44px;
  height: 44px;
  border: 1px solid #dfe4e8;
  border-radius: 10px;
  background: #fff;
  color: #03202F;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.ssn-gn-dh { margin: 18px 16px 8px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #5e6b78; }
.ssn-gn-dgrid { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); gap: 8px; padding: 0 16px; }
.ssn-gn-dgrid a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dfe4e8;
  text-decoration: none;
  color: #03202F;
  font-weight: 700;
  font-size: 1.02rem;
}
.ssn-gn-dgrid a small { font-weight: 500; font-size: 0.78rem; color: #5e6b78; line-height: 1.3; }
.ssn-gn-dgrid a.on { background: #03202F; color: #fff; border-color: #03202F; }
.ssn-gn-dgrid a.on small { color: #cfdae0; }
.ssn-gn-dl { list-style: none; margin: 0; padding: 0 8px; }
.ssn-gn-dl a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 1rem;
  color: #03202F;
}
.ssn-gn-dl a:hover { background: #F5F5F5; }
.ssn-gn-dl small { font-size: 0.8rem; color: #5e6b78; }
.ssn-gn-dacct { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; padding: 18px 16px 0; margin-top: 12px; border-top: 1px solid #dfe4e8; }
.ssn-gn-dbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid #dfe4e8;
  text-decoration: none;
  font-weight: 700;
  color: #03202F;
  background: #fff;
}
.ssn-gn-dbtn.red { background: #bd202e; border-color: #bd202e; color: #fff; }
button.ssn-gn-dbtn { width: 100%; font: inherit; font-weight: 700; text-align: center; cursor: pointer; }
/* A founder's badge, as a row of its own in the phone menu. */
.ssn-gn-dfounder { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 8px; background: #fbeaec; color: #bd202e; font-weight: 700; text-decoration: none; }
.ssn-gn-dfounder::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #bd202e; }

/* Keyboard focus is always visible. */
.ssn-global-nav a:focus-visible, .ssn-global-nav button:focus-visible,
.ssn-gn-drawer a:focus-visible, .ssn-gn-drawer button:focus-visible,
.ssn-crumbs a:focus-visible {
  outline: 3px solid #bd202e;
  outline-offset: 2px;
  border-radius: 4px;
}
.ssn-global-nav .ssn-gn-toggle:focus-visible { outline-offset: -3px; }
/* Menu items draw the ring inside, clear of their neighbours. */
nav.ssn-global-nav .ssn-gn-dd a:focus-visible { outline-offset: -3px; }

@media (prefers-reduced-motion: reduce) {
  .ssn-gn-prog i { transition: none; }
  .ssn-gn-panel { animation: none; }
}

/* Skip link: off screen until a keyboard user reaches it. */
.ssn-skip{position:absolute;left:-9999px;top:8px;z-index:10000;padding:10px 14px;border-radius:6px;background:#03202f;color:#fff;font-weight:700;text-decoration:none}
.ssn-skip:focus-visible{left:8px;outline:3px solid #bd202e;outline-offset:2px}
main:focus{outline:none}
@media (max-width: 1024px) {
  .ssn-skip { min-height: 44px; display: inline-flex; align-items: center; }
}

@media print {
  .ssn-global-nav, .ssn-gn-drawer, .ssn-crumbs, .ssn-founding-bar { display: none !important; }
}

/* Founding Membership bar above the nav and the founder badge (match src/components/membership/founding-bar.module.css). */
.ssn-founding-bar { background: #03202f; color: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.45; }
.ssn-founding-bar[hidden] { display: none; }
.ssn-founding-bar.urgent { background: #bd202e; }
.ssn-fb-in { position: relative; max-width: 1200px; margin: 0 auto; padding: 8px 48px 8px 16px; text-align: center; }
.ssn-fb-in a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.ssn-fb-close { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #c9d6de; font-size: 22px; line-height: 1; padding: 4px 8px; cursor: pointer; }
.ssn-founding-bar.urgent .ssn-fb-close { color: #f3d3d9; }
.ssn-fb-in a:focus-visible, .ssn-fb-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 3px; }
.ssn-gn-founder { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #fbeaec; color: #bd202e; font-size: .8rem; font-weight: 700; white-space: nowrap; text-decoration: none; }
.ssn-gn-founder::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #bd202e; }
/* No room for the badge on a phone; My account in the menu leads to the same page. This comes after the rule above so it wins. */
@media (max-width: 1024px) { .ssn-gn-founder { display: none; } }
/* Course and tool pages style plain buttons; keep the close control a bare cross. */
.ssn-founding-bar button.ssn-fb-close { background: transparent; border: 0; box-shadow: none; min-width: 0; min-height: 0; width: auto; height: auto; margin: 0; border-radius: 4px; font: inherit; font-size: 22px; line-height: 1; color: #c9d6de; padding: 4px 8px; }
.ssn-founding-bar.urgent button.ssn-fb-close { color: #f3d3d9; }
.ssn-founding-bar p.ssn-fb-in { margin: 0 auto; max-width: 1200px; font-size: 14px; line-height: 1.45; color: #fff; }
.ssn-founding-bar p.ssn-fb-in a { color: #fff; }
