:root {
  --font-size: 18px;
  --line-height: 25px;
  --line-height--h4: 35px;
  --font-size-small: 17px;
  --header-height: 2;
  --font-size--h1: 28px;
  --font-size--header: 50px;
  --body-font: 'Sligoil-Micro';
  --header-font: 'Sprat-RegularThin';
  --link-color: #7FFF00;
  --link-color--visited: #713600;
  --link-color--hover: #713600;
  --background-color: #f5f5f5;
  --black: #000;
}

html {
  padding: 0;
  margin: 0;
}

body {
  padding: 3rem 3rem 3rem 5rem;
  margin: 0;
  max-width: none;

  display: grid;
  grid-template-columns: 35ch minmax(60ch, 75ch);
  grid-template-rows: 1fr;
  column-gap: calc(2 * var(--line-height));

  font-size: var(--font-size);
  line-height: var(--line-height);
  font-family: var(--body-font);

  background-image: var(--body-background);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;

  color: var(--black);
  justify-content: start;
}

main {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  margin: 0 auto;
  max-width: 100ch;
  background: transparent;
}

h1 {
  display: none !important;
}

h2,
h3 {
  font-family: var(--header-font);
  font-size: var(--font-size);
  margin: calc(2 * var(--line-height)) 0 0 0;
  line-height: var(--line-height);
}

h4,
h5 {
  margin: var(--line-height) 0 0 0;
}

h6 {
  margin: var(--line-height) 0 0 0;
  display: none !important;
}

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

a:hover {
  color: var(--link-color--hover);
  text-decoration: none;
}

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

header {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  align-self: start;
}

.navbar--organisation {
  margin-left: 0;
  flex: none;
  width: auto;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

nav ul li {
  margin: 0 0 0.5em 0;
}

.navbar--reports,
.navbar--pages {
  display: none;
}

.navbar--reports--subnav,
.navbar--pages--subnav,
.navbar--labels--subnav {
  display: none;
}

/** References which aren't direct links (they don't have the data-direct-link attribute) */
[data-link-target-type="label"],
[data-link-target-type="label"]:visited {
  color: inherit;
  text-decoration: none;
}

[data-link-target-type="label"]:hover {
  color: var(--link-color);
}

[data-link-target-type="label"] .reference--target {
  float: right;
  clear: right;
  width: 20ch;
  margin-right: -22ch;
  text-align: left;
  text-decoration: none;
  color: var(--link-color);
}

[data-link-target-type="label"]:hover .reference--target {
  text-decoration: underline;
}

[data-link-target-type="label"] .reference--label--inline {
  text-decoration: underline;
  text-decoration-style: dotted;
}

[data-link-target-type="label"][data-direct-link] .reference--label,
[data-link-target-type="label"] .reference-label--target .reference-label--target--label {
  display: inline-block;
  background: #efefef;
  padding: .5ch;
  margin-top: -.5ch;
  font-family: var(--body-font);
}

.link-source {
  float: right;
  clear: right;
  width: 20ch;
  margin-right: -22ch;
  margin-top: 0;
  font-size: 85%;
}

ul.label--context-list {
  padding: 0;
  list-style-type: none;
}

ul.label--context-list li {
  margin-bottom: calc(2 * var(--line-height));
}

/** Hide elements which were marked as instructions in the pad */
.instruction {
  display: none;
}

.tag--question {
  font-size: 110%;
  color: green;
}

.tag--important {
  text-decoration-line: underline;
  text-decoration-style: double;
}

.tag--trouble {
  text-decoration-line: underline;
  text-decoration-style: wavy;
}

.tag--commentary {
  text-decoration-line: underline;
  text-decoration-style: dotted;
}

.tag--citation {
  background-color: beige;
}

b {
  border: solid black 2px;
}

.going-hybrid--labels ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.going-hybrid--labels ul li {
  margin-top: var(--line-height);
}

.going-hybrid--labels ul li a {
  padding: .3em .5em;
  border: 2px solid;
  text-decoration: none;
}

.going-hybrid--labels ul li a:hover {
  background: white;
}

img {
  max-width: 100%;
  height: auto;
}

/* Tablet */
@media screen and (max-width: 1100px) {
  body {
    grid-template-columns: 26ch minmax(0, 1fr);
    padding: 2rem;
    column-gap: var(--line-height);
  }

  main {
    max-width: none;
  }

  [data-link-target-type="label"] .reference--target,
  .link-source {
    width: 16ch;
    margin-right: -18ch;
    font-size: 90%;
  }
}

/* Mobile */
@media screen and (max-width: 800px) {
  body {
    display: block;
    padding: 1.25rem;
    margin: 0;
  }

  header {
    display: block;
    margin-bottom: calc(1.5 * var(--line-height));
  }

  main {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  nav ul {
    display: block;
  }

  nav ul li {
    margin: 0 0 0.35em 0;
  }

  [data-link-target-type="label"] .reference--target,
  .link-source {
    float: none;
    clear: none;
    width: auto;
    margin: 0;
    display: inline;
    text-align: inherit;
  }

  [data-link-target-type="label"][data-direct-link] .reference--label,
  [data-link-target-type="label"] .reference-label--target .reference-label--target--label {
    padding: .2ch .4ch;
  }

  .navbar--organisation {
    position: static;
    margin-left: 0;
    transform: none;
  }
}

/* Very small phones */
@media screen and (max-width: 480px) {
  :root {
    --font-size: 16px;
    --line-height: 23px;
    --font-size-small: 15px;
  }

  body {
    padding: 1rem;
  }
}
