/* the Algobank dex: dexweb's structure and colors, laid out like a GitHub README */
@font-face {
  font-family: 'Italiana';
  src: url('assets/Italiana-Regular.ttf') format('truetype');  /* SIL Open Font License, assets/OFL.txt */
}
body {
  background-color: black; color: rgb(240, 240, 240);
  font-family: Arial, sans-serif;
  font-size: 18px; line-height: 1.5;
  max-width: 1012px; margin: 0 auto; padding: 32px 32px 64px;
  overflow-wrap: anywhere;  /* a word or link wider than a small phone breaks instead of widening the page */
}
h1 {
  font-family: 'Italiana', serif; font-weight: 400; letter-spacing: 0.05em; font-size: 3rem; line-height: 1.25;
  margin: 0 0 24px;
}
header.top h1 {  /* page titles are Arial; Italiana is only the name algobank, on the homepage and in the footer */
  font-family: Arial, sans-serif; font-weight: 400; letter-spacing: 0.05em; text-transform: uppercase;
  font-size: 2.4rem;  /* 20% smaller than the homepage title */
}
footer h3 {
  font-family: 'Italiana', serif; font-weight: 400; letter-spacing: 0.05em; font-size: 1.5rem;
  color: white; margin-top: 48px; padding-top: 16px; border-top: 1px solid rgb(220, 220, 220);
}
p, ul, ol, table {
  margin: 0 0 16px;
}
a {
  color: #00ff41; text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
nav {
  margin-top: 32px;
}
.indexlink {
  padding: 4px 0;
}
code {
  font-family: monospace;
  font-size: 85%; padding: 0.2em 0.4em; border-radius: 6px; background-color: rgb(20, 20, 20);
}
/* code blocks: never wider than the page; long lines scroll inside them (as in the ledgdex docs) */
pre {
  background-color: rgb(20, 20, 20); border-radius: 6px; padding: 16px; overflow-x: auto;
  font-size: 85%; line-height: 1.45; white-space: pre; max-width: 100%; box-sizing: border-box; margin: 0 0 16px;
}
pre code {
  font-size: 100%; padding: 0; background-color: transparent; color: rgb(230, 230, 230);
}
img {
  display: block; max-width: 100%; margin: auto;
}
@media screen and (max-width: 600px) {
  body { padding: 16px 16px 48px; font-size: 16px; }
  h1 { font-size: 2.25rem; }
  header.top h1 { font-size: 1.8rem; }
}
/* bank: a search bar and the records, in monospace for fast reading */
#q {
  width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 10px 12px;
  font: 16px monospace;
  color: rgb(240, 240, 240); background-color: rgb(20, 20, 20); border: 1px solid #00ff41; border-radius: 0;
}
#q:focus {
  outline: none; border-color: #00ff41;
}
#msg:not(:empty) {
  margin: 8px 0 16px; font-family: monospace; color: #ff4141;  /* "... not algobanked" is red */
}
:is(#bank, table.known) {
  width: 100%; border-collapse: collapse; font: 14px monospace; color: rgb(220, 220, 220); margin: 0 0 16px;
}
:is(#bank, table.known) th, :is(#bank, table.known) td {
  text-align: left; padding: 6px 16px 6px 0;
}
:is(#bank, table.known) th {
  color: white; font-weight: 400; border-bottom: 1px solid rgb(220, 220, 220);
}
:is(#bank, table.known) tbody {
  border-bottom: 1px solid rgb(20, 20, 20);
}
:is(#bank, table.known) td.pkg {
  overflow-wrap: anywhere;
}
:is(#bank, table.known) tr.entry:focus-visible {
  outline: 1px solid #00ff41;
}
:is(#bank, table.known) tr.details td {
  padding: 4px 0 12px;
}
:is(#bank, table.known) dl {  /* the record's details: a label column and a value column */
  display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; padding: 8px 12px;
}
:is(#bank, table.known) dt {
  color: white;
}
:is(#bank, table.known) dd {
  margin: 0; overflow-wrap: anywhere;
}
:is(#bank, table.known) dd code {
  padding: 0; background: none; font-size: 100%;
}
button.copy {
  font-size: 12px; padding: 1px 8px; margin: 0 0 0 8px; border-radius: 0;
}
/* wide screens: every field in its own column, no details; narrow screens: package and findings, details on click */
:is(#bank, table.known) .narrow, :is(#bank, table.known) tr.details {
  display: none;
}
:is(#bank, table.known) tr.entry {
  cursor: default;
}
:is(#bank, table.known) tr.entry:hover, :is(#bank, table.known) tr.entry[aria-expanded=true] {
  background-color: transparent;
}
:is(#bank, table.known) td.wide, :is(#bank, table.known) th.wide {
  white-space: nowrap;
}
@media screen and (max-width: 1044px) {  /* the full table is 981px: it fits from 1045px */
  :is(#bank, table.known) .wide {
    display: none;
  }
  :is(#bank, table.known) td.narrow, :is(#bank, table.known) th.narrow {
    display: table-cell;
  }
  :is(#bank, table.known) span.narrow {
    display: inline;
  }
  :is(#bank, table.known) tr.details:not([hidden]) {
    display: table-row;
  }
  :is(#bank, table.known) tr.entry {
    cursor: pointer;
  }
  :is(#bank, table.known) tr.entry:hover, :is(#bank, table.known) tr.entry[aria-expanded=true] {
    background-color: rgb(20, 20, 20);
  }
}
@media screen and (max-width: 600px) {
  :is(#bank, table.known) dl {
    grid-template-columns: 1fr; gap: 0 0; padding: 8px 4px;
  }
  :is(#bank, table.known) dd {
    margin-bottom: 6px;
  }
}
button {
  font: 14px monospace; cursor: pointer;
  color: #00ff41; background-color: rgb(20, 20, 20); border: 1px solid #00ff41; border-radius: 6px; padding: 8px 12px; margin: 0 8px 8px 0;
}
button:hover {
  background-color: black;
}
footer {
  margin-top: 48px;
}
footer h3 {
  margin-bottom: 8px;
}
footer nav {
  margin-top: 0;
}
h1, #q::placeholder {
  text-align: center;
}
/* wide screens: the footer is one row, algobank and then the page links */
@media screen and (min-width: 980px) {  /* the row fits from 980 pixels; narrower screens wrap it */
  footer {
    display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
    margin-top: 48px; padding-top: 16px; border-top: 1px solid rgb(220, 220, 220);
  }
  footer h3 {
    margin: 0; padding: 0; border: none;
  }
  footer nav {
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 24px;
  }
  footer .indexlink {
    padding: 0;
  }
  footer .indexlink br {
    display: none;
  }
}
h1 small {
  display: block; font-size: 1.25rem; line-height: 1.6; letter-spacing: 0.1em; text-transform: uppercase;  /* the subtitle under the title */
  font-family: monospace;
}
/* documents rendered from Markdown (Architecture): sections, lists and tables */
h2 {
  font-size: 1.5rem; font-weight: 600; line-height: 1.25; margin: 40px 0 16px; padding-bottom: 0.3em;
  border-bottom: 1px solid rgb(20, 20, 20); color: white;
}
.doc h3 {
  font-size: 1.25rem; font-weight: 600; margin: 32px 0 16px; color: white;
}
.doc h4, .doc h5, .doc h6 {
  font-size: 1rem; font-weight: 600; margin: 24px 0 12px; color: white;
}
.doc ol {
  padding-left: 2em;
}
.doc li + li {
  margin-top: 4px;
}
.doc table {
  display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; font-size: 16px; overflow-wrap: normal;
}
.doc th, .doc td {
  text-align: left; vertical-align: top; padding: 6px 13px; border: 1px solid rgb(20, 20, 20);
}
.doc th {
  color: white; font-weight: 600;
}
/* severities: red high, yellow warning and medium, green low; TOP is red wherever it is a scope */
.high, code.top {
  color: #ff4141;
}
.warning, .medium {
  color: #ffd700;
}
.low {
  color: #00ff41;
}
.findings .sev {
  display: flex; align-items: baseline; gap: 16px; margin: 32px 0 8px; padding-bottom: 8px; border-bottom: 1px solid rgb(20, 20, 20);
}
.findings .sev:first-child {
  margin-top: 0;
}
.tag {
  font: 600 1.1rem monospace; text-transform: uppercase; letter-spacing: 0.08em;
}
.exit {
  margin-left: auto; font: 14px monospace; color: rgb(220, 220, 220);
}
/* no bullets anywhere; only Findings marks its items, with a band in the severity's color */
ul {
  list-style: none; padding-left: 0;
}
ul > li {
  margin: 8px 0;
}
.findings ul > li {
  position: relative; padding-left: 32px;
}
.findings ul > li::before {
  content: ""; position: absolute; left: 0; top: 0.72em; width: 18px; height: 4px; border-radius: 2px;
}
.findings ul {
  margin: 0;
}
.findings [data-sev=high] li::before { background-color: #ff4141; }
.findings [data-sev=warning] li::before, .findings [data-sev=medium] li::before { background-color: #ffd700; }
.findings [data-sev=low] li::before { background-color: #00ff41; }
.findings [data-sev=info] li::before { background-color: rgb(220, 220, 220); }
/* narrow screens: the footer is one left-aligned row, algobank first, that continues onto the next lines */
@media screen and (max-width: 979px) {
  footer {
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 20px; row-gap: 6px;
    margin-top: 48px; padding-top: 16px; border-top: 1px solid rgb(220, 220, 220);
  }
  footer h3 {
    margin: 0; padding: 0; border: none;
  }
  footer nav {
    display: contents;  /* its links join the row */
  }
  footer .indexlink {
    padding: 0;
  }
  footer .indexlink br {
    display: none;
  }
}
/* the magazine: a dateline under the title, sections with counts, summaries that wrap */
.dateline {  /* Dated, Packages, Advisories, Open: one row, a tab's width apart; it wraps on phones */
  display: flex; flex-wrap: wrap; justify-content: center; column-gap: 4ch; row-gap: 4px; margin: 16px 0 0; font: 1rem monospace; color: rgb(220, 220, 220);
}
.dateline b {  /* the data: green */
  font-weight: 400; color: #00ff41;
}
h2 .count {
  font: 1rem monospace; color: rgb(220, 220, 220); margin-left: 8px;
}
:is(#bank, table.known) td.summary {  /* as specific as the no-wrap rule for wide columns, so summaries wrap */
  white-space: normal; color: rgb(240, 240, 240);
}
table.known td.wide:first-child {
  color: rgb(220, 220, 220);
}
.withdrawn {
  font-size: 12px; color: rgb(220, 220, 220); border: 1px solid rgb(220, 220, 220); padding: 0 4px;
}
table.known tr.entry td:nth-child(2) {  /* an advisory identifier stays on one line */
  white-space: nowrap;
}
.claim {  /* the one claim algobank makes */
  font-size: 1.15rem; color: white;
}
/* the link back to the homepage: on the title's line, at its left; the title stays centered */
header.top {
  position: relative;
}
header.top h1 {
  padding: 0 3rem;  /* the same on both sides, so the title stays centered and never runs into the arrow */
}
a.back {  /* the arrow back to the homepage: green Arial, no border */
  position: absolute; left: 0; top: 0; text-decoration: none;
  font: 600 2.5rem Arial, sans-serif; line-height: 3rem;  /* the height of the title's first line */
  -webkit-text-stroke: 2px currentColor;  /* doubles the arrow's 2px shaft to 4px */
}
a.back:hover, a.back:focus-visible {
  text-decoration: none; color: white;
}
@media screen and (max-width: 600px) {
  a.back {
    line-height: 2.25rem;
  }
  header.top h1 {
    padding: 0 2.5rem;  /* the arrow's width */
  }
}
p:has(+ p:empty + pre) {  /* Usage: the plain-text heading above each code block */
  color: #00ff41;
}
ul.plain > li {  /* Limits: a little more space between items */
  margin: 12px 0;
}
