:root {
  --color-main-header: #183b59;
  --color-main-background: #ecf0f5;
  --color-main-foreground: rgba(0, 0, 0, 0.5);
  --color-violet: #8e6ecf;
  --color-fuchsia: #db509f;
  --color-aqua: #7ac8cc;
  --color-orange: #e8533b;
  --color-news-and-events: var(--color-violet);
  --color-jobs-and-studentships: var(--color-aqua);
  --color-tools: var(--color-orange);
  --color-projects: var(--color-fuchsia);
}

html,
body {
  margin: 0;
  padding: 0;
  font: 11pt 'Open Sans';
  color: var(--color-main-foreground);
  background: var(--color-main-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: rgba(26,75,165,0.75);
  text-decoration: none;
}

ul:not(.c-list) li, ol li {
  margin-bottom: .7em;
}

#site-grid {
  display: grid;
  grid-template-areas: "header"
                       "main"
                       "footer";
  grid-template-rows: auto 1fr auto;
  width: 100%;
  height: 100vh;
}

header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-main-header);
  padding: 16px 32px;
}

header nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
}

header nav ul li {
  padding: 0;
}

header nav ul li a {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px;
  position: relative;
}

header nav ul li.active a {
  color: #FFF;
}

header nav ul li a::after {
  content: '';
  display: block;
  position: absolute;
  width: calc(100% - 32px);
  margin-left: 16px;
  height: 2px;
  background: #fff;
  opacity: 0;
  bottom: 0;
  transform: translateY(12px);
  transition: transform .3s, opacity .3s;
}

header nav ul li a:hover::after,
header nav ul li.active a::after {
  transform: translateY(-4px);
  opacity: 1;
}

footer {
  grid-area: footer;
  background: #232323;
  color: white;
  padding: 24px 0;
}

footer #footer-contents {
  width: 90%;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

footer .contacts p {
  font-size: 11px;
  margin: 0;
}

main {
  grid-area: main;
  display: flex;
  gap: 12px;
  width: 90%;
  max-width: 1280px;
  margin: 2em auto;
}

main > section {
  min-width: 250px;
}

.box {
  background-color: #ffffff;
  border-top: 4px solid #212121;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  border-radius: 3px;
}

.box.violet {
  border-top-color: var(--color-violet);
}

.box.violet .title {
  color: var(--color-violet);
}

.box.aqua {
  border-top-color: var(--color-aqua);
}

.box.aqua .title {
  color: var(--color-aqua);
}

.box.jobs-and-studentships {
  border-top-color: var(--color-jobs-and-studentships);
}

.box.jobs-and-studentships .title {
  color: var(--color-jobs-and-studentships);
}

.box.news-and-events {
  border-top-color: var(--color-news-and-events);
}

.box.news-and-events .title {
  color: var(--color-news-and-events);
}

.box .title.bar h2 {
  margin: 0;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(0,0,0,.1);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.box .contents ul.c-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.box .contents ul.c-list li {
  padding: 20px;
}

.box .contents ul.c-list li:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.box .contents ul.c-list li h3 {
  margin: 0;
  font-size: 12px;
}

.box .contents ul.c-list li.top-article h3 {
  text-transform: uppercase;
}

.box .contents ul.c-list li h3 a {
  text-decoration: none;
}

.box .contents ul.c-list li h3 a:hover {
  color: #212121;
}

.box.violet .contents ul.c-list li h3 a:hover,
#category .box.violet .contents ul.c-list li h3 a {
  color: var(--color-violet);
}

.box.aqua .contents ul.c-list li h3 a:hover,
#category .box.aqua .contents ul.c-list li h3 a {
  color: var(--color-aqua);
}

.box.jobs-and-studentships .contents ul.c-list li h3 a:hover,
#category .box.jobs-and-studentships .contents ul.c-list li h3 a {
  color: var(--color-jobs-and-studentships);
}

.box.news-and-events .contents ul.c-list li h3 a:hover,
#category .box.news-and-events .contents ul.c-list li h3 a {
  color: var(--color-news-and-events);
}

.box .contents ul.c-list li.top-article h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
}

.box .contents ul.c-list li.top-article h3 a {
  color: #212121;
}

.box.violet .contents ul.c-list li.top-article h3 a {
  color: var(--color-violet);
}

.box.aqua .contents ul.c-list li.top-article h3 a {
  color: var(--color-aqua);
}

.box .contents ul.c-list li .article-meta {
  font-size: 12px;
  margin: 0;
}

.box .contents ul.c-list li .summary {
  font-size: 14px;
  margin: .75em 0;
  color: rgba(0, 0, 0, .6);
}

:not(.box).publications ol {
  margin: 0; padding: 0;
}

:not(.box).publications ol li {
  margin: .5em 0 .5em 24px;
}

.box.publications {
  padding: 16px;
}

.publications ol li {
  margin: 1em 0;
  font-size: 14px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.pagination button.page-select {
  border: 0;
  background: none;
  outline: none;
  padding: 0;
  min-height: 36px;
}

.pagination .page-select a {
  border: 0;
  background: rgba(0, 0, 0, .1);
  color: #000;
  padding: 8px 12px;
  border-radius: 8px;
}

.pagination .page-select:disabled:not(.current) a {
  opacity: 0.5;
}

.pagination .page-select.current a {
  background: var(--color-main-header);
  color: #ffffff;
}

.pagination .page-select.page {
  aspect-ratio: 1;
  width: auto;
  box-sizing: border-box;
}

#recents-side {
  max-width: 250px;
}

#recents-side,
#page,
#category {
  align-self: flex-start;
}

#page {
  width: 100%;
  box-sizing: border-box;
  border-top-color: rgba(0, 38, 109, 0.53);
  padding: 20px 30px;
}

#page h1 {
  color: rgba(0, 0, 0, 0.75);
}

#page .title h1 {
  margin: 0;
  padding: 0;
  font-size: 26px;
  font-weight: 600;
  text-transform: uppercase;
}

#page .contents h1 {
  margin: 0;
  font-size: 20px;
  text-transform: uppercase;
}

#category {
  width: 100%;
  border-top-color: #212121;
}

#category .title h1 {
  margin: .75em 0;
  padding: 0;
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
}

span.small-sub {
  font-size: 10px;
  opacity: 0.75;
  display: block;
}

span.wip-marker::before {
  content: "WIP";
  font-size: 12px;
}

span.wip-marker {
  color: var(--color-main-background);
  background-color: var(--color-main-foreground);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0;
  display: inline-block;
}

@media only screen and (max-width: 1024px) {
  main {
    flex-wrap: wrap;
  }

  #page {
    padding: 20px;
  }

  header {
    position: relative;
  }

  header nav ul {
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease-in-out;
  }

  header nav.toggled ul {
    opacity: 1;
    pointer-events: all;
  }

  header nav button {
    border: 0;
    outline: none;
    background: #FFFFFF;
    color: #000000;
    width: 32px;
    height: 32px;
    padding: 8px;
    box-sizing: border-box;
    cursor: pointer;
    border-radius: 4px;
  }

  header nav button span {
    width: 100%;
    height: 2px;
    background: #000000;
    display: block;
    transition: opacity .3s ease, transform .3s ease-in-out;
    transform-origin: center;
  }

  header nav button span:not(:last-child) {
    margin-bottom: 4px;
  }

  header nav.toggled button span:first-child {
    transform: translateY(6px) rotate(45deg);
  }

  header nav.toggled button span:nth-child(2) {
    opacity: 0;
  }

  header nav.toggled button span:last-child {
    transform: translateY(-6px) rotate(-45deg);
  }

  header nav ul {
    display: block;
    background: #232323;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
  }

  header nav ul li a {
    display: block;
    padding: 12px 32px;
  }

  header nav ul li a::after {
    display: none;
  }

  main > #recents-side {
    width: 100%;
    max-width: 100%;
  }

  main #index {
    flex-wrap: wrap;
  }

  main section#index > section {
    width: 100%;
    max-width: 100%;
  }

  footer #footer-contents {
    gap: 2em;
    flex-direction: column;
    justify-content: center;
  }
}

@media only screen and (min-width: 1025px) {
  header nav button {
    display: none;
  }
}
