/* ============================================================
   Viewer bar: the website copy of a document (aerl.com.au/docs/<slug>).
   scripts/publish-website-html.py adds it to each published page, with
   viewer-bar.js. Never loaded by the aer-docs HTML or its PDFs.

   A fixed bar across the top of the window: document name and revision
   (left), page count (centre), Download PDF and Print (right). The body
   is padded by the bar's height, so the pages keep their layout and only
   move down; anchors scroll clear of the bar. Hidden in print.
   ============================================================ */

:root { --aerl-vb-h: 56px; }
html { scroll-padding-top: calc(var(--aerl-vb-h) + 12px); }
body { padding-top: var(--aerl-vb-h); }

/* The bar's Download PDF replaces the cover's own button on the website. */
.download-pdf { display: none !important; }

/* Pages wider than the window (an A4 page is 794 px) are scaled to fit it
   on screen by viewer-bar.js (--aerl-vb-zoom); never in print. */
@media screen { .sheet { zoom: var(--aerl-vb-zoom, 1); } }

.aerl-vb {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--aerl-vb-h);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
}
.aerl-vb *, .aerl-vb *::before, .aerl-vb *::after { box-sizing: border-box; }
.aerl-vb p { margin: 0; font-size: inherit; line-height: inherit; color: inherit; }

.aerl-vb__start { display: flex; align-items: center; gap: 14px; min-width: 0; }
.aerl-vb__home { display: inline-flex; flex: none; border: 0 !important; border-radius: 4px; }
.aerl-vb__home img { display: block; width: 56px; height: auto; }
.aerl-vb__name {
  display: flex; align-items: baseline; gap: 10px;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}
.aerl-vb__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-brand, "Plus Jakarta Sans", "Inter", sans-serif);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: #fff;
}
.aerl-vb__rev {
  flex: none;
  font-family: var(--font-label, "JetBrains Mono", monospace);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a9a9a;
  white-space: nowrap;
}

.aerl-vb .aerl-vb__count {
  justify-self: center;
  font-variant-numeric: tabular-nums;
  color: #bfbfbf;
  white-space: nowrap;
}

.aerl-vb__actions { display: flex; justify-content: flex-end; gap: 8px; min-width: 0; }
.aerl-vb__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px;
  min-width: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 6px;
  background: transparent;
  color: #fff !important;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.aerl-vb__btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4) !important; }
.aerl-vb__btn--primary {
  background: #f2a332;
  border-color: #f2a332 !important;
  color: #0a0a0a !important;
}
.aerl-vb__btn--primary:hover { background: #f6c37b; border-color: #f6c37b !important; }
.aerl-vb__btn svg { width: 16px; height: 16px; flex: none; }
.aerl-vb__btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.aerl-vb a:focus-visible {
  outline: 2px solid #f2a332;
  outline-offset: 2px;
}

/* Narrow windows: the page count goes, then the button labels (the
   buttons keep their accessible names), then the revision. */
@media (max-width: 760px) {
  .aerl-vb { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 0 12px; }
  .aerl-vb__count { display: none; }
}
@media (max-width: 560px) {
  .aerl-vb__btn { padding: 0; width: 40px; height: 40px; }
  .aerl-vb__label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .aerl-vb__start { gap: 10px; }
  .aerl-vb__name { padding-left: 10px; }
  .aerl-vb__home img { width: 44px; }
  .aerl-vb__title { font-size: 14px; }
}
@media (max-width: 400px) {
  .aerl-vb__rev { display: none; }
}

@media print {
  .aerl-vb { display: none !important; }
  body { padding-top: 0 !important; }
}

/* /docs: the list of published documents (public/docs/index.html). */
.aerl-docs-index { margin: 0; background: #f8f8f8; color: #111; font-family: var(--font-sans, "Inter", system-ui, sans-serif); }
.aerl-docs-list { max-width: 880px; margin: 0 auto; padding: 40px 16px 80px; }
.aerl-docs-list h1 { font-family: var(--font-brand, "Plus Jakarta Sans", sans-serif); font-size: 32px; margin: 0 0 8px; }
.aerl-docs-list > p { color: #545454; margin: 0 0 24px; line-height: 1.5; }
.aerl-docs-list > p a { color: #a96612; }
.aerl-docs-list ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid #dcdcdc; }
.aerl-docs-list li { padding: 14px 0; border-bottom: 1px solid #dcdcdc; }
.aerl-docs-list li > a { font-weight: 600; color: #111; text-decoration: none; }
.aerl-docs-list li > a:hover { text-decoration: underline; }
.aerl-docs-list .rev { margin-left: 8px; font-size: 12px; color: #767676; }
.aerl-docs-list .rev a { color: #a96612; }
.aerl-docs-list li p { margin: 4px 0 0; font-size: 14px; color: #545454; line-height: 1.45; }
