/* ============================================================================
   BucketBill — Solutions + documentation pages (static, crawlable)
   Shared by every generated page under /docs/ and /solutions.html.
   Palette mirrors the live app's navy/blue tokens (projects/landing/styles.scss)
   so the docs read as part of the same site — NOT the olive/lime legal pages.
   Self-contained: these static files do not load the Angular CSS bundle.
   No inline styles anywhere in the HTML, so the pages' CSP stays style-src 'self'.
   Accessibility: --bb-sky is decorative only (fails WCAG on white); body text
   and links use --bb-text / --bb-accent, which pass on white.
   ========================================================================= */
:root {
  --bb-navy-1: #0b2b4d;
  --bb-navy-2: #0d3d74;
  --bb-ink: #0b2b4d;
  --bb-text: #33404d;
  --bb-muted: #5d6b7a;
  --bb-accent: #0969da;
  --bb-accent-dark: #0550ae;
  --bb-sky: #54a3ff;
  --bb-accent-soft: #ddf4ff;
  --bb-subtle: #f6f8fa;
  --bb-surface: #ffffff;
  --bb-line: #d0d7de;
  --bb-line-muted: #e9edf2;
  --bb-radius: 12px;
  --bb-radius-sm: 9px;
  --bb-shadow-sm: 0 1px 2px rgba(11, 43, 77, 0.05), 0 4px 12px rgba(11, 43, 77, 0.05);
  --bb-header-h: 64px;
  --bb-wrap: 1128px;
  --bb-prose: 760px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.doc {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--bb-text);
  background: var(--bb-surface);
  -webkit-font-smoothing: antialiased;
}

.doc a { color: var(--bb-accent); text-decoration: none; }
.doc a:hover { color: var(--bb-accent-dark); text-decoration: underline; }
.doc strong { color: var(--bb-ink); font-weight: 600; }
.doc [id] { scroll-margin-top: calc(var(--bb-header-h) + 16px); }
.doc code {
  font-family: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bb-subtle);
  border: 1px solid var(--bb-line-muted);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

/* ------------------------------------------------------------------ header */
.doc-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--bb-header-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--bb-line);
}
.doc-header__wrap {
  max-width: var(--bb-wrap);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.doc-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--bb-ink); }
.doc-brand:hover { text-decoration: none; }
.doc-brand__name { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--bb-ink); }
.doc-brand__name em { font-style: normal; color: var(--bb-accent); }
.doc-nav { display: flex; align-items: center; gap: 22px; }
.doc-nav a { color: var(--bb-text); font-weight: 500; font-size: 0.95rem; }
.doc-nav a:hover { color: var(--bb-accent); text-decoration: none; }
.doc-nav__cta {
  background: var(--bb-accent);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: var(--bb-radius-sm);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(11, 43, 77, 0.1), 0 8px 20px -12px rgba(9, 105, 218, 0.55);
}
.doc-nav__cta:hover { background: var(--bb-accent-dark); text-decoration: none; }

/* -------------------------------------------------------------------- main */
/* Default (Solutions, hub): the shell is transparent, so .doc-main centres
   itself. Topic pages add body.doc--docs, which turns the shell into a
   two-column grid (sidebar + article). */
.doc-shell { display: contents; }

.doc-main {
  max-width: var(--bb-prose);
  margin: 0 auto;
  padding: 40px 24px 88px;
}

.doc--docs .doc-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 48px;
  max-width: var(--bb-wrap);
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}
.doc--docs .doc-main { max-width: var(--bb-prose); margin: 0; padding: 40px 0 88px; min-width: 0; }

/* sidebar — grouped topic nav, sticky under the header on desktop */
.doc-sidebar {
  position: sticky;
  top: var(--bb-header-h);
  align-self: start;
  max-height: calc(100vh - var(--bb-header-h));
  overflow-y: auto;
  padding: 40px 4px 24px 0;
  font-size: 0.9rem;
}
.doc-sidebar__home {
  display: inline-block;
  font-weight: 600;
  color: var(--bb-ink);
  margin: 0 0 18px 10px;
}
.doc-sidebar__home:hover { color: var(--bb-accent); }
.doc-sidebar__group { margin-bottom: 18px; }
.doc-sidebar__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bb-muted);
  margin: 0 0 6px 10px;
}
.doc-sidebar ul { list-style: none; margin: 0; padding: 0; }
.doc-sidebar li { margin: 0; }
.doc-sidebar li a {
  display: block;
  padding: 5px 10px;
  margin: 1px 0;
  border-radius: 7px;
  color: var(--bb-text);
  border-left: 2px solid transparent;
}
.doc-sidebar li a:hover { background: var(--bb-subtle); color: var(--bb-accent); text-decoration: none; }
.doc-sidebar li a.is-active {
  color: var(--bb-accent);
  font-weight: 600;
  background: var(--bb-accent-soft);
  border-left-color: var(--bb-accent);
}

/* breadcrumb */
.doc-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--bb-muted);
  margin-bottom: 28px;
}
.doc-crumbs a { color: var(--bb-muted); }
.doc-crumbs a:hover { color: var(--bb-accent); }
.doc-crumbs [aria-current='page'] { color: var(--bb-ink); font-weight: 600; }
.doc-crumbs__sep { color: var(--bb-line); }

/* "You'll need" requirements banner */
.doc-requires {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  margin: 0 0 32px;
  background: var(--bb-subtle);
  border: 1px solid var(--bb-line-muted);
  border-radius: var(--bb-radius);
}
.doc-requires__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-muted);
}
.doc-requires__item {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bb-navy-2);
  background: var(--bb-surface);
  border: 1px solid var(--bb-line);
  border-radius: 999px;
  padding: 4px 12px;
}

/* ------------------------------------------------------------------- prose */
.doc-body h1 {
  color: var(--bb-ink);
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 0.5em;
}
.doc-body h2 {
  color: var(--bb-ink);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 2.2em 0 0.6em;
  padding-top: 0.4em;
}
.doc-body h3 {
  color: var(--bb-ink);
  font-size: 1.12rem;
  font-weight: 700;
  margin: 1.8em 0 0.5em;
}
.doc-body p { margin: 0 0 1.1em; }
.doc-body .doc-lead { font-size: 1.15rem; color: var(--bb-muted); margin-bottom: 1.6em; }
.doc-body ul, .doc-body ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.doc-body li { margin: 0.35em 0; }
.doc-body img { max-width: 100%; height: auto; border-radius: var(--bb-radius); border: 1px solid var(--bb-line); }
.doc-body hr { border: 0; border-top: 1px solid var(--bb-line); margin: 2.4em 0; }

/* screenshot / visual-guidance figure (see scripts/build-doc-shots.js) */
.doc-shot { margin: 1.4em 0 1.8em; }
.doc-shot > img {
  display: block;
  width: 100%;
  background: var(--bb-subtle);
  box-shadow: 0 1px 2px rgba(11, 43, 77, 0.06);
}
.doc-shot figcaption {
  margin-top: 0.6em;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--bb-muted);
}
/* a shot tied to a numbered step reads better nudged into the step column */
.doc-shot--sm { max-width: 560px; }

/* numbered step list */
.doc-steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 1.4em; }
.doc-steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0 46px;
  margin: 0 0 1.1em;
  min-height: 30px;
}
.doc-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--bb-accent-soft);
  color: var(--bb-navy-2);
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
}

/* callouts */
.doc-note, .doc-warn {
  border: 1px solid var(--bb-line);
  border-left-width: 4px;
  border-radius: var(--bb-radius-sm);
  padding: 14px 18px;
  margin: 0 0 1.4em;
  background: var(--bb-subtle);
}
.doc-note { border-left-color: var(--bb-accent); }
.doc-warn { border-left-color: var(--bb-warn, #9a6700); background: #fff8ea; }
.doc-note p:last-child, .doc-warn p:last-child { margin-bottom: 0; }
.doc-note strong, .doc-warn strong { color: var(--bb-ink); }

/* FAQ */
.doc-faq { margin: 1.6em 0; }
.doc-faq details {
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius-sm);
  padding: 4px 18px;
  margin: 0 0 10px;
  background: var(--bb-surface);
}
.doc-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--bb-ink);
  padding: 12px 0;
  list-style: none;
}
.doc-faq summary::-webkit-details-marker { display: none; }
.doc-faq details[open] summary { border-bottom: 1px solid var(--bb-line-muted); }
.doc-faq details > p { padding: 12px 0 4px; margin: 0; }

/* related links */
.doc-related {
  margin-top: 2.6em;
  padding-top: 1.6em;
  border-top: 1px solid var(--bb-line);
}
.doc-related h2 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bb-muted); margin: 0 0 0.6em; }
.doc-related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* -------------------------------------------------------------- hub / index */
.doc-hub__cat { margin: 2.2em 0; }
.doc-hub__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.doc-hub__list li {
  padding: 14px 16px;
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.doc-hub__list li:hover { border-color: var(--bb-accent); box-shadow: var(--bb-shadow-sm); }
.doc-hub__list a { font-weight: 600; font-size: 1.02rem; }
.doc-hub__desc { display: block; color: var(--bb-muted); font-size: 0.92rem; margin-top: 2px; }

/* --------------------------------------------------------- solutions extras */
.doc-solutions__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 1.6em 0; }
.doc-solutions__grid .doc-card {
  border: 1px solid var(--bb-line);
  border-radius: var(--bb-radius);
  padding: 18px 18px 16px;
  background: var(--bb-surface);
}
.doc-card h3 { margin: 0 0 0.3em; font-size: 1.05rem; }
.doc-card p { margin: 0 0 0.6em; color: var(--bb-muted); font-size: 0.94rem; }
.doc-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.8em 0 0; }
.doc-btn {
  display: inline-block;
  background: var(--bb-accent);
  color: #fff !important;
  padding: 13px 26px;
  border-radius: var(--bb-radius-sm);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(11, 43, 77, 0.1), 0 8px 20px -12px rgba(9, 105, 218, 0.55);
}
.doc-btn:hover { background: var(--bb-accent-dark); text-decoration: none; }
.doc-btn--ghost { background: var(--bb-surface); color: var(--bb-accent) !important; border: 1px solid var(--bb-line); box-shadow: none; }
.doc-btn--ghost:hover { background: var(--bb-subtle); }

/* ------------------------------------------------------------------ footer */
.doc-footer { border-top: 1px solid var(--bb-line); background: var(--bb-subtle); margin-top: 40px; }
.doc-footer__wrap { max-width: var(--bb-wrap); margin: 0 auto; padding: 56px 24px 40px; }
.doc-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.doc-footer__brand p { color: var(--bb-muted); font-size: 0.92rem; max-width: 34ch; }
.doc-footer__col h2 { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bb-muted); margin: 0 0 0.9em; }
.doc-footer__col ul { list-style: none; padding: 0; margin: 0; }
.doc-footer__col li { margin: 0.5em 0; }
.doc-footer__col a { color: var(--bb-text); font-size: 0.94rem; }
.doc-footer__col a:hover { color: var(--bb-accent); }
.doc-footer__legal {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--bb-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--bb-muted);
  font-size: 0.82rem;
}

/* ------------------------------------------------------------- responsive */
/* Below the two-column breakpoint the sidebar is hidden; readers navigate via
   the breadcrumb (→ the hub, which lists every topic), the "Related" links and
   the footer Help column. */
@media (max-width: 900px) {
  .doc--docs .doc-shell { display: block; max-width: var(--bb-prose); padding: 0 24px; }
  .doc--docs .doc-main { padding: 32px 0 72px; }
  .doc-sidebar { display: none; }
}
@media (max-width: 720px) {
  .doc-footer__grid { grid-template-columns: 1fr 1fr; }
  .doc-nav { gap: 14px; }
  .doc-nav a:not(.doc-nav__cta) { display: none; }
}
@media (max-width: 420px) {
  .doc-main { padding: 28px 18px 64px; }
  .doc--docs .doc-shell { padding: 0 18px; }
  .doc-footer__grid { grid-template-columns: 1fr; }
  .doc-header__wrap { padding: 0 18px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------------------------------------------------- language set (EN/DE/CZ)
   Mirrors src/styles/_header.scss so the control is identical whether you are
   on an Angular page or one of these generated ones. Typographic rather than a
   segmented pill: nothing else in this system is pill-shaped, and a filled chip
   here would outweigh the "Get the app" button beside it. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-set {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
}

.lang-set__opt + .lang-set__opt {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--bb-line-muted);
}

.doc-nav .lang-set__opt {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bb-muted);
  transition: color 0.15s ease;
}

.doc-nav a.lang-set__opt:hover { color: var(--bb-ink); }

.doc-nav .lang-set__opt[aria-current] {
  color: var(--bb-ink);
  font-weight: 700;
}

.doc-nav .lang-set__opt:focus-visible {
  outline: 2px solid var(--bb-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* The narrow-screen rule above collapses the nav to just the CTA. The language
   set has to survive that: a German reader on a phone would otherwise have no
   way back to their language. */
@media (max-width: 720px) {
  .doc-nav .lang-set,
  .doc-nav .lang-set a,
  .doc-nav .lang-set span { display: inline-flex; }
  .lang-set { margin-left: 0; }
}
