/*
  Base: reset, type, links, focus, and the layout grid and utilities the views
  use. These used to come from Bootstrap; only the classes the templates
  actually use are kept, with the same names, on the --bq-* tokens.
*/

/* ---------- Reset and type ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bq-header-h) + 1rem); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bq-bg);
  color: var(--bq-text);
  font-family: var(--bq-font);
  font-size: var(--bq-fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  margin: 0 0 var(--bq-space-2);
  font-weight: 600;
  line-height: 1.25;
  color: var(--bq-text-strong, inherit);
}
h1, .h1 { font-size: var(--bq-fs-2xl); letter-spacing: -0.01em; }
h2, .h2 { font-size: var(--bq-fs-xl); }
h3, .h3 { font-size: var(--bq-fs-lg); }
h4, .h4, h5, .h5, h6, .h6 { font-size: var(--bq-fs-md); }
p { margin: 0 0 var(--bq-space-3); }
ul, ol { margin: 0 0 var(--bq-space-3); padding-left: 1.5rem; }
small, .small { font-size: var(--bq-fs-sm); }
b, strong { font-weight: 600; }
img, svg { vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--bq-border); margin: var(--bq-space-4) 0; }
code, kbd, pre, samp, .font-monospace { font-family: var(--bq-mono); font-size: 0.92em; }
code { color: var(--bq-code-text); background: var(--bq-code-bg); padding: 0.1em 0.35em; border-radius: var(--bq-radius-sm); word-break: break-word; }
pre { overflow: auto; padding: var(--bq-space-3); border-radius: var(--bq-radius-md); background: var(--bq-code-bg); }
pre code { padding: 0; background: none; }
table { border-collapse: collapse; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
/* The brand colour, see-through: plain on the light theme, still clear on the dark. */
::selection { background: color-mix(in srgb, var(--bq-link) 35%, transparent); }

a { color: var(--bq-link); text-decoration: none; }
a:hover { color: var(--bq-accent-hover); text-decoration: underline; text-underline-offset: 2px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid transparent; box-shadow: 0 0 0 3px var(--bq-focus-ring); border-radius: var(--bq-radius-sm); }
/* A field that shows its focus as a whole -- the search, the network
   finders, the call tree's search: the input inside takes no ring of its
   own, or there would be two frames, one in the other. */
:is(.bq-search, .bq-net-find, .bq-netsw-top, .q-tree-search) input:focus-visible { box-shadow: none; }

.visually-hidden, .sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.skip-link { position: absolute; left: var(--bq-space-4); top: -100px; z-index: 100; padding: var(--bq-space-2) var(--bq-space-4);
  border-radius: var(--bq-radius-md); background: var(--bq-accent); color: var(--bq-accent-contrast); }
.skip-link:focus { top: var(--bq-space-2); color: var(--bq-accent-contrast); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Page width ---------- */
.wrap, .container-fluid { width: 100%; max-width: var(--bq-page-width); margin-inline: auto; padding-inline: var(--bq-space-5); }
.wrap .container-fluid, .container-fluid .container-fluid { padding-inline: 0; }
main.page { flex: 1 0 auto; padding-bottom: var(--bq-space-7); }

/* ---------- Grid (the views' row / col-*) ---------- */
.row { display: flex; flex-wrap: wrap; margin-inline: calc(var(--bq-space-5) / -2); }
.row > * { flex: 0 0 100%; max-width: 100%; min-width: 0; padding-inline: calc(var(--bq-space-5) / 2); }
.row > .col { flex: 1 0 0%; }
.row > .col-auto { flex: 0 0 auto; width: auto; }
.col-3 { flex: 0 0 25% !important; max-width: 25% !important; }
.col-5 { flex: 0 0 41.666% !important; max-width: 41.666% !important; }
.col-6 { flex: 0 0 50% !important; max-width: 50% !important; }
.col-7 { flex: 0 0 58.333% !important; max-width: 58.333% !important; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 576px) {
  .row > .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
}
@media (min-width: 768px) {
  .row > .col-md-6 { flex: 0 0 50%; max-width: 50%; }
}
@media (min-width: 992px) {
  .row > .col-lg { flex: 1 0 0%; max-width: 100%; }
  .row > .col-lg-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
  .row > .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .row > .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .row > .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}
@media (min-width: 1200px) {
  .row > .col-xl-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .row > .col-xl-5 { flex: 0 0 41.666%; max-width: 41.666%; }
  .row > .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
  .row > .col-xl-7 { flex: 0 0 58.333%; max-width: 58.333%; }
}

/* ---------- Utilities ---------- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
@media (min-width: 768px) { .d-md-none { display: none !important; } .d-md-block { display: block !important; } }
@media (min-width: 992px) { .d-lg-none { display: none !important; } .d-lg-inline-block { display: inline-block !important; } }
.flex-grow-1 { flex-grow: 1 !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-top { vertical-align: top !important; }
.align-middle { vertical-align: middle !important; }
.align-bottom { vertical-align: bottom !important; }
.gap-2 { gap: var(--bq-space-2) !important; }
.gap-3 { gap: var(--bq-space-4) !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }
.img-fluid { max-width: 100%; height: auto; }
.rounded { border-radius: var(--bq-radius-md) !important; }
.shadow { box-shadow: var(--bq-shadow-lg) !important; }
.border { border: 1px solid var(--bq-border) !important; }
.border-bottom { border-bottom: 1px solid var(--bq-border) !important; }

.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: var(--bq-space-2) !important; } .mt-3 { margin-top: var(--bq-space-4) !important; } .mt-5 { margin-top: var(--bq-space-7) !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: var(--bq-space-1) !important; } .mb-2 { margin-bottom: var(--bq-space-2) !important; }
.mb-3 { margin-bottom: var(--bq-space-4) !important; } .mb-4 { margin-bottom: var(--bq-space-5) !important; } .mb-5 { margin-bottom: var(--bq-space-7) !important; }
.my-2 { margin-block: var(--bq-space-2) !important; }
.mx-auto { margin-inline: auto !important; }
.ml-1 { margin-left: var(--bq-space-1) !important; }
.me-2 { margin-right: var(--bq-space-2) !important; } .me-3, .mr-3 { margin-right: var(--bq-space-4) !important; }
.mr-auto { margin-right: auto !important; }
.p-0 { padding: 0 !important; }
.py-5 { padding-block: var(--bq-space-7) !important; }

.text-start, .text-left { text-align: left !important; }
.text-end, .text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-nowrap { white-space: nowrap !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-break, .word-wrap { word-wrap: break-word !important; overflow-wrap: anywhere !important; word-break: normal; }
.fw-normal { font-weight: 400 !important; }
.fw-bold { font-weight: 600 !important; }
.text-muted, .text-secondary, .text-second, .q-muted { color: var(--bq-text-muted) !important; }
.text-success, .q-ok { color: var(--bq-success) !important; }
.text-danger, .q-fail { color: var(--bq-danger) !important; }
.text-warning { color: var(--bq-warning) !important; }
.text-info, .text-primary, .text-default, .text-dark { color: inherit !important; }
.bg-success { background-color: var(--bq-success) !important; color: var(--bq-bg) !important; }
.bg-warning { background-color: var(--bq-warning-soft) !important; color: var(--bq-warning) !important; }
.bg-info { background-color: var(--bq-teal-soft) !important; color: var(--bq-teal-text) !important; }
.bg-secondary { background-color: var(--bq-surface-3) !important; color: var(--bq-text) !important; }
.underline-link { text-decoration: underline; text-underline-offset: 2px; }
.list-unstyled { list-style: none; padding-left: 0; }
