/* ===========================================================
   BackOffice brand book — shared chapter styles
   Layers on styles.css tokens + marketing.css scaffolding.
   LIGHT theme; dark tiles/bands set their own colors locally.
   =========================================================== */

/* ── Chapter sub-nav (sticky under the main nav) ─────────── */
.bb-subnav {
  position: sticky;
  top: 68px; /* sits below the sticky main nav (69px incl. border) */
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.bb-subnav__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 50px;
}
.bb-subnav__label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.bb-subnav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bb-subnav__links::-webkit-scrollbar { display: none; }
.bb-subnav__links a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.bb-subnav__links a:hover { color: var(--ink); background: var(--surface-2); }
body[data-bb="overview"] .bb-subnav a[data-k="overview"],
body[data-bb="logo"] .bb-subnav a[data-k="logo"],
body[data-bb="color"] .bb-subnav a[data-k="color"],
body[data-bb="type"] .bb-subnav a[data-k="type"],
body[data-bb="voice"] .bb-subnav a[data-k="voice"],
body[data-bb="apps"] .bb-subnav a[data-k="apps"],
body[data-bb="media"] .bb-subnav a[data-k="media"] {
  color: #fff;
  background: var(--ink);
}

/* ── Compact chapter hero ────────────────────────────────── */
.bb-hero { padding: 72px 0 40px; }
.bb-hero .eyebrow { justify-content: flex-start; }
.bb-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin: 10px 0 16px;
}
.bb-hero p {
  max-width: 640px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}

/* ── Big statement / mission quote ───────────────────────── */
.bb-quote {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}
.bb-quote .grad { white-space: nowrap; }

/* ── Grid helpers ────────────────────────────────────────── */
.bb-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bb-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ── Callout note ────────────────────────────────────────── */
.bb-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 860px;
  margin: 26px auto 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ── Chapter cards (overview index) ──────────────────────── */
.bb-chapters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
}
.bb-chap {
  display: block;
  padding: 26px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.bb-chap:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.bb-chap__num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-2);
}
.bb-chap h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 10px 0 6px; }
.bb-chap p { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 0; }
.bb-chap__go { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--brand); }

/* ── Logo stages (display tiles) ─────────────────────────── */
.bb-stage {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.bb-stage__view {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
}
.bb-stage__view--light { background: var(--surface); }
.bb-stage__view--tint { background: var(--surface-2); }
.bb-stage__view--dark { background: #052525; }
.bb-stage__view--grad { background: var(--grad); }
.bb-stage__view--checker {
  background:
    conic-gradient(#eef6f6 0 25%, #fff 0 50%, #eef6f6 0 75%, #fff 0) 0 0 / 20px 20px;
}
.bb-stage__meta {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
}
.bb-stage__meta strong { color: var(--ink); font-weight: 600; }

/* Live lockup rendered in HTML (wordmark uses the real webfont) */
.bb-lockup { display: inline-flex; align-items: center; gap: 12px; }
.bb-lockup svg { display: block; }
.bb-lockup__text {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 28px;
  color: var(--ink);
}
.bb-lockup--dark .bb-lockup__text { color: #fff; }
.bb-lockup--sm { gap: 8px; }
.bb-lockup--sm .bb-lockup__text { font-size: 18px; }

/* ── Clearspace diagram ──────────────────────────────────── */
.bb-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
}
.bb-clear__zone {
  position: relative;
  padding: 28px;
  border: 1.5px dashed var(--brand);
  border-radius: 18px;
}
.bb-clear__tag {
  position: absolute;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--brand);
  background: var(--surface);
  padding: 0 6px;
}
.bb-clear__tag--top { top: -8px; left: 50%; transform: translateX(-50%); }
.bb-clear__tag--side { left: -14px; top: 50%; transform: translateY(-50%) rotate(-90deg); }

/* ── Misuse (don't) cards ────────────────────────────────── */
.bb-dont {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.bb-dont__view {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  padding: 20px;
  overflow: hidden;
}
.bb-dont__label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.bb-dont__x {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: none;
}
.bb-ok__check {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #063;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: none;
}

/* ── Color swatches ──────────────────────────────────────── */
.bb-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.sw {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.sw__chip { height: 92px; }
.sw__meta { padding: 12px 14px 14px; }
.sw__name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.sw__role { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.sw__codes {
  margin-top: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
.sw__codes b { color: var(--ink); font-weight: 500; }

/* Proportion bar (90/10 rule) */
.bb-ratio {
  display: flex;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  max-width: 860px;
  margin: 0 auto;
}
.bb-ratio > div {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bb-ratio__legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ── Typography specimens ────────────────────────────────── */
.spec {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 26px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.spec:last-child { border-bottom: 0; }
.spec__meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
}
.spec__meta b { color: var(--ink); font-weight: 500; }
.spec__sample { min-width: 0; overflow-wrap: break-word; }

.bb-glyphs {
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: break-word;
}
.bb-weights { display: grid; gap: 6px; }
.bb-weights div { font-size: 26px; letter-spacing: -0.02em; line-height: 1.35; }

/* ── Asset download cards ────────────────────────────────── */
.bb-assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.bb-asset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bb-asset:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bb-asset__view {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    conic-gradient(#f3f8f8 0 25%, #fff 0 50%, #f3f8f8 0 75%, #fff 0) 0 0 / 18px 18px;
}
.bb-asset__view--dark { background: #052525; }
.bb-asset__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}
.bb-asset__name { font-size: 13px; font-weight: 600; color: var(--ink); }
.bb-asset__fmt {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--muted);
}
.bb-asset__dl {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}

/* ── Voice: do / don't copy cards ────────────────────────── */
.bb-tone { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.bb-tone__head {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
}
.bb-tone__body { padding: 6px 16px 14px; background: var(--surface); }
.bb-tone__row { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; }
.bb-tone__row:last-child { border-bottom: 0; }
.bb-tone__row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* Message architecture table */
.bb-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.bb-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 11px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.bb-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.55;
}
.bb-table tr:last-child td { border-bottom: 0; }
.bb-table td:first-child { font-weight: 600; white-space: nowrap; }
.bb-table__wrap { overflow-x: auto; }

/* ── Dark statement band (self-contained, like .replaces) ── */
.bb-band {
  background: #052525;
  color: #eef1f7;
  padding: 72px 0;
  position: relative;
  overflow: hidden;
}
.bb-band::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto auto;
  width: 60%;
  height: 120%;
  background: radial-gradient(closest-side, rgba(0, 128, 128, 0.28), transparent 70%);
  pointer-events: none;
}
.bb-band::after {
  content: '';
  position: absolute;
  inset: auto auto -50% -10%;
  width: 50%;
  height: 110%;
  background: radial-gradient(closest-side, rgba(13, 219, 212, 0.18), transparent 70%);
  pointer-events: none;
}
.bb-band > .container { position: relative; z-index: 1; }

/* ── Social post mocks ───────────────────────────────────── */
.bb-post {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: #052525;
  color: #fff;
  aspect-ratio: 1200 / 630;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7% 8%;
  position: relative;
}
.bb-post--square { aspect-ratio: 1 / 1; }
.bb-post::before {
  content: '';
  position: absolute;
  inset: -30% -20% auto auto;
  width: 70%;
  height: 100%;
  background: radial-gradient(closest-side, rgba(0, 128, 128, 0.4), transparent 70%);
}
.bb-post::after {
  content: '';
  position: absolute;
  inset: auto auto -40% -15%;
  width: 55%;
  height: 90%;
  background: radial-gradient(closest-side, rgba(13, 219, 212, 0.25), transparent 70%);
}
.bb-post > * { position: relative; z-index: 1; }
.bb-post__title {
  font-size: clamp(20px, 2.6vw, 34px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
}
.bb-post__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bb-post__url {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #9ca3af;
}
.bb-post--light {
  background: var(--surface);
  color: var(--ink);
}
.bb-post--light::before { background: radial-gradient(closest-side, rgba(0, 128, 128, 0.14), transparent 70%); }
.bb-post--light::after { background: radial-gradient(closest-side, rgba(13, 219, 212, 0.12), transparent 70%); }
.bb-post--light .bb-post__url { color: var(--muted); }

/* ── Video style cards ───────────────────────────────────── */
.bb-video {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.bb-video__frame {
  aspect-ratio: 16 / 9;
  background: #052525;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.bb-video__frame::before {
  content: '';
  position: absolute;
  inset: -30% -20% auto auto;
  width: 70%;
  height: 110%;
  background: radial-gradient(closest-side, rgba(0, 128, 128, 0.3), transparent 70%);
}
.bb-video__kinetic {
  position: relative;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.bb-video__body { padding: 18px 20px 20px; }
.bb-video__body h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.bb-video__body p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* ── Prev / next pager ───────────────────────────────────── */
.bb-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px 80px;
}
.bb-pager a {
  flex: 1;
  max-width: 380px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bb-pager a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bb-pager a.bb-pager--next { text-align: right; margin-left: auto; }
.bb-pager__dir {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
.bb-pager__title { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 4px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .bb-grid3, .bb-chapters { grid-template-columns: 1fr 1fr; }
  .spec { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 640px) {
  .bb-grid2, .bb-grid3, .bb-chapters { grid-template-columns: 1fr; }
  .bb-hero { padding: 48px 0 28px; }
  .bb-subnav__label { display: none; }
  .bb-subnav { position: static; } /* mobile nav height varies; don't chase it */
}


/* ── Rebrand: display face + drawn-lockup helpers ────────── */
.bb-hero h1, .bb-quote, .bb-post__title, .bb-video__kinetic {
  font-family: 'Chakra Petch', 'Inter', sans-serif;
  font-weight: 700;
}
.bb-logo-img { display: block; height: 40px; width: auto; }
.bb-logo-img--lg { height: 120px; }
.bb-pattern {
  background-color: #008080;
  background-image: url('/brand/assets/backoffice-pattern-tile.svg');
  background-size: 120px auto;
}

/* keep glyph specimens inside 3-col cards */
.bb-grid3 .bb-glyphs { font-size: clamp(20px, 2.2vw, 30px); }
