/*
 * Colors to set in root:
 *
 * --background-color (color of html body)
 *  --background-color-secondary (color of user attribution, code blocks, etc.)
 *  --background-color-ternary (color of code block and spoiler titles)
 *
 * --text-color (color of post content)
 *  --highlight-color (color of links)
 *  --highlight-color-secondary (color of hovered links)
 * --border-color (color of tables, etc)
 *
 */

:root {                                                                                                     
    --background-color: #f5f5f5;
    --background-color-secondary: #fff4e5;
    --background-color-ternary: #dfdfdf;

    --text-color: #141414;
    --highlight-color: #2577b1;
    --highlight-color-secondary: #185886;
    --border-color: #353535;
}                                                                                                           
~

html {
  font: 16px/1.4 sans-serif;
  word-wrap: break-word;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  margin: auto;
  max-width: 800px;
  padding-bottom: 3rem;
}

body > hr {
  width: 800px;
  margin: 20px auto;
}

body > h1, body > h2, body > h3, body > h4 {
  break-before: page;
}

body > h1 {
  font-size: 3rem;
}

body > h2 {
  font-size: 1.5rem;
}

body > h3 {
  font-size: 1rem;
}

body > h4 {
  font-size: 0.8rem;
}

ol#toc {
  font-size: 1.5rem;
  break-after: page;
}

ol#toc, ol#toc ol {
  counter-reset: item;
}

ol#toc li {
  display: block
}

ol#toc li:before {
  content: counters(item, ".")". ";
  counter-increment: item;
  font-weight: bold;
}

a {
  color: var(--highlight-color);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: var(--highlight-color-secondary);
  text-decoration: underline;
}

.message {
  margin: auto;
  margin-top: 2rem;
}

.message-user {
  margin-bottom: 10px;
}

.message-user, .message blockquote {
  break-inside: avoid;
}

.message-avatar {
  display: inline-block;
  height: 64px;
  width: 64px;
}

.avatar img {
  margin: 0px;
  max-width: 64px;
  max-height: 64px;
}

.message-user {
  background-color: var(--background-color-secondary);
  margin-bottom: 0;
  overflow: auto;
  padding: 10px;
}

.message-user > .username, .message-user > .timestamp {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.message-user > .username {
    float: left;
}

.message-user > .timestamp {
    float: right;
}

.bbImageWrapper {
    display: block;
    margin: auto;
    width: max-content;
}

.message-body {
    font-size: 18px;
    font-family: serif;
    line-height: 1.6;
    padding: 0 0.5em;
}

.message-body img {
  max-height: 400px;
  max-width: 100%;
  width: auto;
}

.bbCodeBlock {
  margin: .5em 0;
  font-size: .95rem;
  background: var(--background-color-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--highlight-color);
}

.bbCodeBlock-content {
  padding: 6px 8px;
}

.bbCodeBlock-title {
  padding: 6px 8px;
  color: var(--highlight-color);
  background: var(--background-color-ternary);
}

bbCodeInlineSpoiler {
  background-color: black;
  color: white;
  cursor: pointer;
}

.bbCodeBlock--spoiler::before {
  content: "SPOILER";
  display: block;
  font-weight: bold;
  font-size: 1.2rem;
  width: auto;
  background: var(--background-color-ternary);
  padding: 5px 8px;
  font-family: "courier new";
}

.bbTable {
  max-width: 100%;
  overflow: auto;
}

.bbTable > table {
  border: none;
  border-collapse: collapse;
  empty-cells: show;
  max-width: 100%;
}

.bbTable > table > thead > tr > td, .bbTable > table > tbody > tr > td {
  background: var(--background-color);
  border: 1px solid var(--border-color);
  padding: 4px;
}

.attachmentList {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.attachmentList li {
  list-style-type: none;
}

.bbCodeBlock--unfurl {
  padding: 6px;
  width: 650px;
  max-width: 100%;
  border-left: 2px solid #484d56;
  overflow: hidden;
}

.contentRow {
  display: flex;
}

.contentRow-figure.contentRow-figure--fixedSmall {
  width: 60px;
}

.bbCodeBlock--unfurl .bbCodeBlockUnfurl-icon {
  width: 12px;
  vertical-align: -2px;
}

.contentRow-figure {
  vertical-align: top;
  white-space: nowrap;
  word-wrap: normal;
  text-align: center;
}

.contentRow-main {
  flex: 1;
  min-width: 0;
  vertical-align: top;
  padding-left: 8px;
}

.bbCodeBlock--unfurl .contentRow-header {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  overflow: hidden;
  white-space: nowrap;
  word-wrap: normal;
  text-overflow: ellipsis;
}

.bbCodeBlock--unfurl .contentRow-snippet {
  font-size: .85rem;
  font-style: normal;
}

.bbCodeBlock--unfurl .contentRow-minor {
  font-size: .85rem;
}

.attribution, .quoteContainer {
    margin: 5px;
}

#pagination {
  font-family: "Courier New", monospace;
  margin-top: 2em;
  text-align: center;
}

#pagination .current {
  font-weight: bold;
}

#pagination .prev::after, #pagination .next::before {
  color: black;
  font-weight: bold;
  content: " | ";
}

ul#index {
  list-style-type: none;
}
