/* The console's own stylesheet: the components of docs/design/system.md, each
   one built from the tokens and from nothing else. */

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

html { background: var(--sib-bg); }

body {
  margin: 0 auto;
  padding: var(--sib-space-6);
  max-width: 60rem;
  font-family: var(--sib-font-sans);
  font-size: var(--sib-text-base);
  line-height: var(--sib-leading);
  color: var(--sib-text);
  overflow-wrap: break-word;
}

h1 {
  font-size: var(--sib-text-xl);
  line-height: var(--sib-leading-tight);
  font-weight: var(--sib-weight-bold);
  margin: 0 0 var(--sib-space-2);
}

h2 {
  font-size: var(--sib-text-lg);
  line-height: var(--sib-leading-tight);
  font-weight: var(--sib-weight-bold);
  margin: var(--sib-space-8) 0 var(--sib-space-3);
}

p { margin: 0 0 var(--sib-space-3); }

a { color: var(--sib-link); }

code {
  font-family: var(--sib-font-mono);
  font-size: var(--sib-text-sm);
  background: var(--sib-raised);
  padding: 1px var(--sib-space-1);
  border-radius: var(--sib-radius-sm);
}

:focus-visible {
  outline: var(--sib-focus-width) solid var(--sib-link);
  outline-offset: var(--sib-focus-offset);
}

/* Site header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sib-space-4);
  border-bottom: 1px solid var(--sib-border);
  padding-bottom: var(--sib-space-2);
  margin-bottom: var(--sib-space-6);
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: var(--sib-space-2);
  color: var(--sib-text);
  text-decoration: none;
  font-weight: var(--sib-weight-bold);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sib-space-4);
  align-items: baseline;
  font-size: var(--sib-text-sm);
}

.site-header .email { color: var(--sib-muted); }

.site-header button {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--sib-link);
  cursor: pointer;
}

/* Page header */
.page-header {
  border-bottom: 1px solid var(--sib-border);
  padding-bottom: var(--sib-space-2);
  margin-bottom: var(--sib-space-6);
}

.page-header h1 { margin: 0; }

/* The menu of a project's pages. */
.menu {
  display: flex;
  gap: var(--sib-space-4);
  font-size: var(--sib-text-sm);
  margin: 0 0 var(--sib-space-6);
}

.menu a[aria-current="page"] {
  color: var(--sib-text);
  font-weight: var(--sib-weight-bold);
  text-decoration: none;
}

/* Button */
.button {
  font-family: inherit;
  font-size: var(--sib-text-sm);
  height: var(--sib-control-height);
  padding: 0 var(--sib-space-3);
  border-radius: var(--sib-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
}

.button-primary {
  background: var(--sib-primary);
  color: var(--sib-on-primary);
  border-color: var(--sib-primary);
  font-weight: var(--sib-weight-bold);
}

.button-secondary {
  background: var(--sib-surface);
  color: var(--sib-text);
  border-color: var(--sib-control);
}

.button-danger {
  background: var(--sib-surface);
  color: var(--sib-danger);
  border-color: var(--sib-danger);
}

/* Input */
.field { margin-bottom: var(--sib-space-3); }

.field label {
  display: block;
  font-size: var(--sib-text-sm);
  margin-bottom: var(--sib-space-1);
}

.field input {
  font-family: inherit;
  font-size: var(--sib-text-sm);
  height: var(--sib-control-height);
  padding: 0 var(--sib-space-2);
  width: 20rem;
  max-width: 100%;
  background: var(--sib-surface);
  color: var(--sib-text);
  border: 1px solid var(--sib-control);
  border-radius: var(--sib-radius-sm);
}

/* Table, in its own sideways scroll so the page never scrolls. */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--sib-radius);
  margin-bottom: var(--sib-space-3);
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--sib-surface);
}

th, td {
  text-align: left;
  font-size: var(--sib-text-sm);
  padding: var(--sib-space-2) var(--sib-space-3);
  border-bottom: 1px solid var(--sib-border);
  vertical-align: top;
}

th { font-weight: var(--sib-weight-bold); }

tbody tr:hover { background: var(--sib-raised); }

td.ref, td.key, td.url, td.number { white-space: nowrap; }

td.ref, td.key, td.number { font-family: var(--sib-font-mono); }

/* Notice: one border in the color of its kind, and the kind's word in bold. */
.notice {
  background: var(--sib-raised);
  border: 1px solid;
  border-radius: var(--sib-radius-sm);
  padding: var(--sib-space-3);
  font-size: var(--sib-text-sm);
  margin-bottom: var(--sib-space-4);
}

.notice-info { border-color: var(--sib-info); }
.notice-success { border-color: var(--sib-success); }
.notice-warning { border-color: var(--sib-warning); }
.notice-danger { border-color: var(--sib-danger); }

.notice b { font-weight: var(--sib-weight-bold); }

/* Status */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--sib-space-2);
  font-size: var(--sib-text-sm);
  white-space: nowrap;
}

.status i {
  width: var(--sib-dot);
  height: var(--sib-dot);
  border-radius: var(--sib-radius-pill);
  display: block;
  flex: none;
}

.status-healthy i, .status-live i { background: var(--sib-success); }
.status-coming-up i, .status-upgrading i, .status-going-down i { background: var(--sib-info); }
.status-failed i { background: var(--sib-danger); }
.status-removed i { background: var(--sib-muted); }

/* Code block */
pre.code {
  font-family: var(--sib-font-mono);
  font-size: var(--sib-text-sm);
  background: var(--sib-raised);
  border-radius: var(--sib-radius);
  padding: var(--sib-space-4);
  overflow-x: auto;
  margin: 0 0 var(--sib-space-3);
}

.muted {
  color: var(--sib-muted);
  font-size: var(--sib-text-sm);
}

.token { word-break: break-all; }

.facts th {
  width: 12rem;
  font-weight: var(--sib-weight-normal);
  color: var(--sib-muted);
  border-bottom: 1px solid var(--sib-border);
}
