/* The user guide's look. Colours, type and the wordmark follow the app (frontend/src/styles.css
   and the HexagonLogo component) so the guide reads as part of the product. */
:root {
  --primary: #228be6;
  --primary-wash: #e7f5ff;
  --link: #1971c2;
  --page: #f1f3f5;
  --surface: #ffffff;
  --border: #dee2e6;
  --row: #f8f9fa;
  --text: #212529;
  --text-muted: #495057;
  --brand-blue: #1793d1;
  --brand-red: #e61d3c;
  --brand-black: #111111;
  --measure: 46rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
    'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 2; background: var(--surface); padding: 0.5rem 0.75rem; }

/* Top bar: the app's mark and wordmark, and what this site is. */
.top {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.6rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 0.625rem; text-decoration: none; line-height: 1; }
.brand img { height: 3rem; width: auto; flex-shrink: 0; }
.brand-words { display: flex; flex-direction: column; gap: 0.2rem; }
.brand-name { font-size: 2rem; font-weight: 800; letter-spacing: -0.06em; line-height: 0.9; }
.brand-name .hex { color: var(--brand-blue); }
.brand-name .agon { color: var(--brand-red); }
.brand-tag {
  background: var(--brand-black);
  color: #ffffff;
  padding: 0.18rem 0.8rem 0.24rem;
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
  font-size: 0.7rem;
  font-style: italic;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
}
.guide-label {
  margin-left: auto;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* Menu on the left, the page in the middle, the page's own sections on the right. */
.layout {
  display: grid;
  grid-template-columns: 17rem minmax(0, var(--measure)) 14rem;
  gap: 2rem;
  align-items: start;
  max-width: 84rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.menu, .on-this-page { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.menu-fold { display: none; }

.menu ul, .menu-fold ul, .on-this-page ul { list-style: none; margin: 0; padding: 0; }
.menu a, .menu-fold a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.menu ul ul a, .menu-fold ul ul a { padding-left: 1.75rem; font-weight: 400; color: var(--text-muted); }
.menu a:hover, .menu-fold a:hover { background: var(--surface); }
.menu a[aria-current='page'], .menu-fold a[aria-current='page'] {
  background: var(--primary-wash);
  border-left-color: var(--primary);
  color: var(--link);
  font-weight: 600;
}

.on-this-page h2 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.on-this-page a { display: block; padding: 0.2rem 0; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.on-this-page a:hover { color: var(--link); text-decoration: underline; }

article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 2.25rem 2.25rem;
}
article > :first-child { margin-top: 0; }
article > :last-child { margin-bottom: 0; }

.trail { margin: 0 0 0.25rem; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.trail a { text-decoration: none; }

h1 { margin: 0 0 1rem; font-size: 2.1rem; line-height: 1.15; letter-spacing: -0.02em; }
h2 { margin: 2.25rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: 1.4rem; line-height: 1.25; }
h3 { margin: 1.75rem 0 0.5rem; font-size: 1.1rem; }
p, ul, ol { margin: 0 0 1rem; }
article ul, article ol { padding-left: 1.5rem; }
li { margin: 0.2rem 0; }
li > p { margin: 0; }

figure { margin: 1.5rem 0; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; }
figcaption { margin-top: 0.5rem; color: var(--text-muted); font-size: 0.875rem; text-align: center; }

.table-wrap { margin: 0 0 1rem; overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--row); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

code { font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 0.9em; background: var(--row); padding: 0.1em 0.3em; border-radius: 3px; }

.previous-next { display: flex; gap: 1rem; margin-top: 1.25rem; }
.previous-next a {
  flex: 1;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.previous-next a:hover { border-color: var(--primary); }
.previous-next span { display: block; color: var(--text-muted); font-size: 0.8rem; font-weight: 400; }
.previous-next .next { text-align: right; margin-left: auto; }
.previous-next .next:only-child { max-width: 50%; }

.bottom { padding: 1.25rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; text-align: center; }

/* Narrower than a laptop: the page's own section list goes first to give the text room. */
@media (max-width: 75rem) {
  .layout { grid-template-columns: 15rem minmax(0, 1fr); }
  .on-this-page { display: none; }
}

/* Phone and small tablet: the menu folds away above the page. */
@media (max-width: 52rem) {
  .layout { display: block; padding: 1rem 0.75rem 2rem; }
  .menu { display: none; }
  .menu-fold { display: block; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
  .menu-fold summary { padding: 0.7rem 1rem; font-weight: 600; cursor: pointer; }
  .menu-fold nav { padding: 0 0.5rem 0.75rem; }
  .menu-fold a:hover { background: var(--row); }
  article { padding: 1.25rem 1.1rem 1.5rem; }
  h1 { font-size: 1.7rem; }
  .brand-name { font-size: 1.5rem; }
  .brand img { height: 2.4rem; }
  .previous-next { flex-direction: column; }
  .previous-next .next:only-child { max-width: none; }
}

@media print {
  .top, .menu, .menu-fold, .on-this-page, .previous-next, .bottom, .skip { display: none; }
  .layout { display: block; padding: 0; }
  article { border: 0; padding: 0; }
  body { background: #ffffff; }
}
