/*
  Colour scheme. Main colour: #FF914D (orange).
  Header and buttons use the main colour with dark brown text, because white text on
  #FF914D is too faint (about 2.2:1). Dark brown on #FF914D is about 7.6:1.
  Links use a deeper shade of the main colour (about 5:1 on white). Navy is the
  complementary colour, used for the footer and the dark theme background.
*/
:root > * {
  --md-primary-fg-color:        #FF914D;
  --md-primary-fg-color--light: #FFB27F;
  --md-primary-fg-color--dark:  #E0722B;
  --md-primary-bg-color:        #2B1A0E;
  --md-primary-bg-color--light: #4A3220;
  --md-accent-fg-color:         #B8500A;
  --md-accent-fg-color--transparent: rgba(184, 80, 10, 0.1);
  --md-accent-bg-color:         #2B1A0E;
  --md-typeset-a-color:         #B8500A;
  --md-footer-bg-color:         #1F2F46;
  --md-footer-bg-color--dark:   #16233A;
  --md-footer-fg-color:         #FFFFFF;
  --md-footer-fg-color--light:  #D5DEEB;
  --md-footer-fg-color--lighter:#A9B8CC;
}

[data-md-color-scheme="slate"] {
  --md-hue: 218;                      /* navy-tinted greys */
  --md-accent-fg-color:         #FFB27F;
  --md-accent-fg-color--transparent: rgba(255, 178, 127, 0.1);
  --md-typeset-a-color:         #FFB27F;
  --md-footer-bg-color:         #0F1A2B;
  --md-footer-bg-color--dark:   #0A1220;
}

/* Buttons: outlined in the deep orange, filled with the main colour on hover. */
.md-typeset .md-button {
  color: var(--md-typeset-a-color);
  border-color: var(--md-typeset-a-color);
}
/* Primary (filled) button: dark brown text on the main colour, like the header. */
.md-typeset .md-button--primary {
  color: #2B1A0E;
  background-color: #FF914D;
  border-color: #FF914D;
}
.md-typeset .md-button:hover,
.md-typeset .md-button:focus {
  color: #2B1A0E;
  background-color: #FF914D;
  border-color: #FF914D;
}

/* Table header row: a light tint of the main colour. */
.md-typeset table:not([class]) th {
  background-color: rgba(255, 145, 77, 0.16);
}

/* Lab diagrams: full content width, with a light frame so the white card stands out. */
.md-typeset figure.lab-diagram {
  display: block;
  width: 100%;
  max-width: 1000px;
  margin: 1.5em auto;
}
.md-typeset figure.lab-diagram img {
  width: 100%;
  height: auto;
  border: 1px solid rgba(31, 47, 70, 0.18);
  border-radius: 14px;
}
.md-typeset figure.lab-diagram figcaption {
  max-width: none;
  font-size: 0.75rem;
}

/* Full-size diagram viewer (javascripts/diagram-viewer.js). */
.diagram-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: auto;
  padding: 3.5rem 1rem 1rem;
  background: rgba(0, 0, 0, 0.8);
  text-align: center;
}
.diagram-viewer img {
  background: #fff;
  border-radius: 6px;
  min-width: min(1100px, 100%);
  max-width: none;
  width: min(1600px, 100%);
}
.diagram-viewer__close {
  position: fixed;
  top: 0.75rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #3b2314;
  background: #FF914D;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.diagram-viewer__close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
body.diagram-viewer-open { overflow: hidden; }
