/*
** University of Manchester palette
**
** Manchester Purple 660099 (logo png colour is #6b2c91)
** Manchester Yellow  FFCC33
** Manchester Grey    999999
*/

:root {
  --mcr-purple: #6b2c91;
  --mcr-yellow: #FFCC33;
  --mcr-grey: #999999;
  --nav-height: 50px;
}

/* ---------- page frame ---------- */

body {
  color: #000000;
  font-family: Verdana, arial, Helvetica, sans-serif;
  margin: 0;
}

.container {
  max-width: 845px;
  margin: 15px auto 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4, h5 {
  color: #000000;
  font-family: arial, sans-serif;
}

img {
  border: none;
  margin: 0;
  padding: 0;
  max-width: 100%;
}

/* ---------- header: logo + nav ---------- */

/* The logo floats and is deliberately NOT cleared, so the page content flows up
   beside it. The nav gets its own block formatting context so it sits alongside
   the logo. */

.site-header .logo {
  float: left;
  display: block;
  line-height: 0;
  /* Clearance places the page body below this margin, so it sets the gap
     between the bottom of the logo and the start of the page body. */
  margin-bottom: 1.5rem;
}

.site-header .logo img {
  height: 175px;
  width: auto;
}

.site-nav {
  overflow: hidden;
}

.site-nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: var(--nav-height);
  background-color: var(--mcr-purple);
  border-left: 1px solid #000000;
}

.site-nav a,
.site-nav a:link,
.site-nav a:visited {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: var(--nav-height);
  padding: 0 0.5em;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  color: var(--mcr-grey);
}

.site-nav a:hover {
  color: #FFFFFF;
}

.site-nav .current a,
.site-nav .current a:link,
.site-nav .current a:visited,
.site-nav .current a:hover {
  color: var(--mcr-yellow);
}

a:focus-visible {
  outline: 2px solid var(--mcr-yellow);
  outline-offset: 2px;
}

.site-nav a:focus-visible {
  outline-offset: -4px;
}

/* ---------- content ---------- */

/* Wraps beside the floated logo, then reclaims the full width below it. */
main {
  margin: 0;
}

/* The page heading (the <h1> plus any front matter `subtitle` lines) sits beside
   the logo, then the body of the page starts below it. */
.page-heading > h1:first-child {
  margin-top: 0.4em;
}

.page-body {
  clear: left;
}

/* Nothing may wrap alongside the logo once the content has ended. */
.site-footer {
  clear: both;
}

.paper p {
  margin: 1em 0;
}

blockquote {
  margin: 1em 0 1em 40px;
}

pre {
  overflow-x: auto;
  background-color: #f4f4f4;
  border: 1px solid #dddddd;
  padding: 0.75em;
}

pre, code {
  font-family: Menlo, Consolas, "Courier New", monospace;
  font-size: 0.85em;
}

pre code {
  font-size: inherit;
  background: none;
  border: none;
  padding: 0;
}

.site-footer {
  font-size: 0.75em;
  margin-top: 2em;
  padding-bottom: 1em;
}

/* ---------- narrow screens ---------- */

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .site-header {
    text-align: center;
  }

  /* Stop the logo floating so the content stacks cleanly under the nav. */
  .site-header .logo {
    float: none;
    line-height: normal;
    margin-bottom: 0;
  }

  .site-header .logo img {
    height: 120px;
    margin-bottom: 0.5em;
  }

  .site-nav {
    overflow: visible;
  }

  .site-nav ul {
    display: block;
  }

  .site-nav li {
    border-left: none;
    border-top: 1px solid #000000;
  }

  .site-nav li:first-child {
    border-top: none;
  }
}
