html {
  font-family: roboto, sans-serif;
  font-size: 14px;
  }

body {
  margin-top: 0;
  }

main {
  width: 450px;
  }

a {
  color: peru;
  text-decoration: none;
  }
a h1, 
a h3 {
  color: initial;
  }
a:hover h1,
a:hover h3,
a:hover {
  color: orange;
  }
a:hover {
  border-bottom: 1px dotted orange;
  margin-bottom: -1px;
  }
a:visited {
  color: darkgoldenrod;
  }
a.unwritten {
  color: saddlebrown;
  }

h1,
h2,
h3 {
  margin: 0;
  margin-bottom: 2px;
  }
h2 {
  padding: 0;
  margin-top: 10px;
  margin-bottom: 2px;
  font-size: 1.2rem;
  color: dimgray;
  border-bottom: 1px dotted silver;
  }
h3 {
  font-size: 1rem;
  display: inline-block;
  }

h1 + p,
h2 + p,
h3 + p {
  margin-top: 0;
  }

p {
  margin: 0.6em 0;
  }
p:last-child {
  margin-bottom: 0;
  }
p:first-child {
  margin-top: 0;
  }
blockquote {
  margin: 0 50px 0 0;
  border-left: 5px double #ccc;
  padding: 0 5px;
  font-size: 1.3em;
  }

.get-started-tip {
  color: #ccc;
  margin-bottom: 0.5rem;
}

.node {
  width: 430px;
  padding: 10px;
  border: 1px solid white;
  border-left: 3px solid;
  background-color: white;
  opacity: 0.7;
  }
.node.primary {
  opacity: 1;
  background-color: #f9f7ed;
  border-left-color: peru;
  }
.node.linked {
  border-left-color: blue;
}
.node.editing {
  border-left-color: red;
}
.node.mentions {
  border-left-color: green;
}
.node.undefined {
  border-left-color: grey;
  color: #666;
}
.node.backlink {
  border-left-color: blue;
}
.node.mentionby {
  border-left-color: green;
}
.node.taggedas {
  border-left-color: crimson;
}
.node.classedas {
  border-left-color: orange;
}
.node:hover {
  border-top: 1px dashed #999 !important;
  border-bottom: 1px dashed #999 !important;
  border-right: 1px dashed #999 !important;
  }

.node-editor {
  display: none;
  background-color: #eee;
  margin: -10px;
  padding: 10px;
  }
.node.editing .node-editor {
  display: block;
  }
.node.editing .node-html {
  display: none;
  }

#nodes section h2 {
  margin-bottom: 0;
  }

button {
  color: black;
  background-color: whitesmoke;
  border: 1px silver solid;
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 9px;
  }
.primary button.btn-link {
  display: none;
  }
.node button.btn-link {
  background-color: greenyellow;
  }
.node.linked button.btn-link {
  background-color: pink;
  }
.node:not(.linked) button.btn-link:before {
  content: 'Make ';
  }
.node.linked button.btn-link:before {
  content: 'Break ';
  }


input.node-title,
textarea.node-md {
  border: 1px solid #ccc;
  padding: 5px;
  }
textarea.node-md {
  resize: vertical;
  width: 420px;
  height: 5em;
  min-height: 2em;
  max-height: 75vh;
  }
input:required:invalid {
  background-color: yellow;
  border-color: orange;
  }
input.node-title {
  width: 220px;
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 2px;    
  }

.node-html-title {
  display: inline-block;
  }
.node-html-buttons {
  float: right;
  display: none; /* TODO: make buttons, tweak positioning */
  }

.node-html h1, 
.node-html h3 {
  margin: 0;
  margin-bottom: 0.3rem;
}

.node-html ol,
.node-html ul {
  padding: 0 1.8em;
  }
.node-html ol:last-child,
.node-html ul:last-child {
  margin-bottom: 0;
  }
.node-html li ul:last-child,
.node-html li ul:last-child {
  margin-bottom: 1em;
  }
.node-html li {
  padding: 0;
  margin: 0.2em 0;
  }
.node-html li p {
  margin-bottom: 0;
  }


.node-html table {
  border-collapse: collapse;
  margin-bottom: 1rem;
  }
.node-html table th {
  text-align: left;
  }
.node-html table th, 
.node-html table td {
  vertical-align: text-bottom;
  font-size: 0.8rem;
  padding: 1px 2px;
  margin: 0;
  }
.node-html tr:last-child {
   border-bottom: 1px dotted silver;
  }
.node-html tr:nth-child(2n) {
  background-color: rgba(192, 192, 192, 0.2);
  }

.primary .tag,
.primary .class,
#nodes-direct .node.taggedas .node-html-title a,
#nodes-direct .node.classedas .node-html-title a {
  background: #ccc;
  border-radius: 5px 0 0 5px;
  color: #000;
  cursor: pointer;
  display: inline-block;
  font-size: 0.875rem;
  height: 25px;
  line-height: 25px;
  margin-right: 1rem;
  padding: 0 0.666rem;
  text-align: center;
  position: relative;  /* need this for the z-index to work */
  z-index: 0;          /* need this so the :after can be layered under */
  }

.primary .class,
#nodes-direct .node.classedas .node-html-title a {
  background: #e6ddb3;
  }

.primary .tag:after,
.primary .class:after,
#nodes-direct .node.taggedas .node-html-title a:after,
#nodes-direct .node.classedas .node-html-title a:after {
  background: inherit;
  border-radius: 5px;
  transform-origin: top left;
  transform: rotate(45deg);
  content: "";
  display: block;
  height: 21px;
  width: 20px;
  right: -19px;
  top: -2px;
  position: absolute;
  z-index: -1;
  }

#nodes-direct .node.taggedas .node-html-title a, 
#nodes-direct .node.classedas .node-html-title a {
  margin-left: -8px;
}

.primary .tag:hover, 
.primary .class:hover, 
#nodes-direct .node.taggedas .node-html-title a:hover,
#nodes-direct .node.classedas .node-html-title a:hover,
#nodes-direct .node.taggedas .node-html-title a:hover h3,
#nodes-direct .node.classedas .node-html-title a:hover h3 {
  border-bottom: none;  /* clear default a:hover behaviour set elsewhere */
  margin-bottom: 0;     /* clear default a:hover behaviour set elsewhere */
  background-color: crimson;
  color: white;
  }

/* don't display .tag or .class inside related content */
.node:not(.primary) .node-html-content .tag,
.node:not(.primary) .node-html-content .class {
  display: none;
  }


#heading-direct {
  display: none;
  }
#heading-reverse {
  font-style: italic;
  font-weight: normal;
  }

#page-btns {
  padding: 5px;
  background: white;
  position: sticky;
  top: 0;
  z-index: 1
  }

#help { /* iframe */
  width: 100%;
  height: -webkit-fill-available;
  border: none;
  white-space: pre-wrap;
}

#data-dump {
  font-size: 11px;
  }
#data-dump .hide {
  display: none;
  }

#help pre,
#data-dump pre {
  border: 1px dashed #ccc;
  background: #eee;
  padding: 10px;
  }
#data-dump pre:first-child {
  margin: 0;
  }

#pages {
  font-size: 0.8rem;
  }
#pages input#pages-finder {
  float: right;
}

#pages-list {
  column-count: 3;
  column-gap: 5px;
  }
#pages-list ul {
  margin-top: 0;
  padding-left: 0;
  list-style-type: none;
  }
#pages-list ul li {
  padding-left: 5px;
  text-indent: -5px;
  }

#pages-types {
  margin: 5px 0;
  }
#pages-types label {
  white-space: nowrap;
  }

.container {
  overflow-y: hidden;
  height: 100vh;
  position: relative;
  width: 100%;
  }


.column,
.column-content {
  width: 470px;
  }
.column {
  height: 100%;
  float: left;
  overflow: auto;
  margin-right: 10px;
  }
.column-content {
  overflow: hidden;
  }

:focus:not(:focus-visible) { /* hide focus outline if clicked, not if tabbed */
  outline: none; 
  }
