/*
 * MyHealthWeb's own styles. Bootstrap 5.3.8 and Bootstrap Icons 1.13.2 are
 * vendored (vendor/assets/stylesheets) and linked before this file by the
 * layout. Propshaft serves each file as is: there's no build step.
 */

/*
 * Release 1's look on Bootstrap 5. Bootstrap 3 used 14px text, links
 * underlined only on hover, a white "default" button and dark checkboxes.
 * Bootstrap 5's 16px text wrapped IDs and dates in the tables, and its
 * pale outline buttons and checkboxes looked disabled.
 */
html {
  font-size: 87.5%; /* 14px with the browser's default 16px; keeps the user's own setting */
}
a {
  text-decoration: none;
}
main a:not(.btn):hover {
  text-decoration: underline;
}
.btn-outline-secondary {
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-bg: var(--bs-body-bg);
  --bs-btn-border-color: #ccc;
  --bs-btn-hover-color: var(--bs-body-color);
  --bs-btn-hover-bg: #e6e6e6;
  --bs-btn-hover-border-color: #adadad;
  --bs-btn-active-color: var(--bs-body-color);
  --bs-btn-active-bg: #e6e6e6;
  --bs-btn-active-border-color: #adadad;
  --bs-btn-disabled-color: var(--bs-secondary-color);
  --bs-btn-disabled-border-color: #ccc;
}
.form-check-input {
  border-color: #949ba1;
}
.table .btn {
  white-space: nowrap;
}

/*
 * Checkbox groups (simple_form's fieldsets): Bootstrap floats the legend and
 * clears only the element after it, which is simple_form's hidden input, so
 * the first checkbox floated up beside the legend.
 */
legend + input[type="hidden"] + * {
  clear: left;
}

/* Footer pinned to the bottom of short pages. */
html, body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
}
.footer {
  flex-shrink: 0;
  background-color: var(--bs-tertiary-bg);
  padding: 1.25rem 0 0.75rem;
}

/* Each page's title row. */
.page-header {
  border-bottom: 1px solid var(--bs-border-color);
  margin: 0.75rem 0 1.25rem;
  padding-bottom: 0.5rem;
}

/* Detail pages: term and value on one line where there's room. */
dl.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1.5rem;
  row-gap: 0.25rem;
}
dl.details dt {
  font-weight: 600;
}
dl.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 575.98px) {
  dl.details {
    grid-template-columns: 1fr;
  }
  dl.details dd {
    margin-bottom: 0.5rem;
  }
}

/* The organization configuration's JSON body. */
textarea#organization_configuration_configuration_body {
  height: 400px;
  font-family: var(--bs-font-monospace);
}

/* The device page's QR code. */
.qr-code svg {
  width: 200px;
  height: 200px;
}

/* Inline forms (button_to) inside tables and menus. */
form.button_to {
  display: inline;
}
