html, body {
  min-height: 100%;
  height: 100%;
  margin: 0;
}

body {
  color: black;
  background-color: white;
  font-family: sans-serif;
  align-items: stretch;
}

.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;

  @media (min-width: 960px) {
    width: 960px;
  }

  li {
    margin-bottom: 0.3rem;

    &:last-child {
      margin-bottom: 0;
    }
  }
}

.service-grid {
  margin-top: 2rem;

  h3 {
    font-weight: bold;
    color: black;
  }

  blockquote {
    border-left: unset;
    background-color: unset;
    font-style: italic;
    padding-left: 2.5rem;
  }
}

.index-grid, .service-grid {
  display: grid;
  width: 100%;
  grid-template-columns: 4fr 2fr;
  grid-gap: 1rem;

  @media(max-width: 960px) {
    display: block;
    width: auto;
  }

  .left {
    grid-column-start: 1;
  }

  .right {
    grid-column-start: 2;
  }
}

img, video {
  display: block;
  max-width: 100%;
  box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.4);
  margin: 0 auto;
}

.clearfix {
  clear: both;
}

.text-muted {
  color: #666;
}

.text-success {
  color: #2bb34b;
}

.text-warning {
  color: darken(#ffc107, 10);
}

.text-danger {
  color: #ff3e3e;
}

pre {
  background: #eee;
  padding: 0.5rem;
  margin: 0 -0.5rem;
  overflow-x: auto;

  code {
    font-size: 0.9rem;
  }
}

code {
  background: #eee;
  font-size: 1rem;
}

.pricing-grid {
  display: grid;
  width: 100%;
  margin-bottom: 1rem;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: 1rem;

  @media(max-width: 960px) {
    display: block;
  }

  .col-1 {
    grid-column-start: 1;
  }

  .col-2 {
    grid-column-start: 2;
  }

  .col-3 {
    grid-column-start: 3;
  }
}

nav {
  padding: 0.5rem 1rem 0 1rem;
  max-width: 960px;
  margin: 0 auto;
  clear: both;

  a:not(:first-child):not(.btn) {
    margin-left: 1rem;
    color: #666;
  }

  .brand {
    a {
      text-decoration: none;
      color: $black !important;
      margin-left: 0 !important;
    }

    font-size: 1.25rem;
    position: relative;
    top: 1px;

    .icon {
      width: 1.2rem;
    }
  }

  @media(max-width: 900px) {
    .hidden-small {
      display: none;
    }
  }
}

.icon {
  display: inline-block;
  line-height: .75em;

  path {
    fill: currentColor;
  }

  width: 0.4em;
  vertical-align: -0.17em;
}

form {
  margin-bottom: 1rem;
}

// Place this above a:hover styles for that to take effect
a.blog-link, nav a {
  text-decoration: none;
}

a {
  color: $primary;

  &:hover {
    color: darken($primary, 15);
    text-decoration: underline;
  }
}

.btn {
  display: inline-block;
  padding: .1rem .75rem;
  background: #e9ecef;
  border: #343a40 1px solid;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
  color: #000;
  border-radius: 0;
  transition: color .15s ease-in-out,
    background-color .15s ease-in-out,
    border-color .15s ease-in-out,
    box-shadow .15s ease-in-out;

  &:hover {
    text-decoration: none;
    background: #f8f9fa;
    color: #000;
  }

  &.btn-primary {
    border: #001933 1px solid;
    background: #007bff;
    color: #fff;

    &:hover {
      background: #0069d9;
      color: #fff;
    }
  }

  &.btn-info {
    border: #062a30 1px solid;
    background: #17a2b8;
    color: #fff;

    &:hover {
      background: #138496;
      color: #fff;
    }
  }

  &.btn-block {
    display: block;
    text-align: center;
  }

  $parent: &;
  @at-root a#{&} {
    text-decoration: none;
  }
}

.form-group {
  margin-bottom: 1rem;
}

input[type="text"], input[type="password"], input[type="email"] {
  display: block;
  width: calc(100% - 1rem);
  border: 1px solid #888;
  padding: .375rem;
  font-size: 1rem;
  line-height: 1.5;
  background-color: #fff;
  background-clip: padding-box;
  transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
  border-radius: 0;

  &:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
  }
}

label {
  display: inline-block;
  margin-bottom: 0.25rem;
}

.alert {
  padding: 0.5rem;
  border: 1px solid transparent;
  margin-bottom: 1rem;

  &.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
  }

  &.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
  }
}

h3 {
  font-size: 1.3rem;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  margin-top: 0;
}

h4 {
  font-size: 1.1rem;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}

.pull-right {
  float: right;
}

.event {
  padding: 0.5rem;
  margin: 0.5rem 0;
  background: #f5f5f5;

  &:first-child {
    margin-top: 0;
  }

  &:last-child {
    margin-bottom: 0;
  }

  h4 {
    margin-bottom: 0;
    padding: 0;
  }

  blockquote {
    margin-bottom: 0.5rem;

    *:last-child {
      margin-bottom: 0;
    }
  }

  *:last-child {
    margin-bottom: 0;
  }
}

header {
  margin-top: 0.5rem;
  min-height: auto;
  display: flex;
  padding: 0.5rem 0;
  flex-direction: row;
  align-items: flex-end;
  background: darken($primary, 10);
  border-width: 1px 0;
  border-color: #001933;
  border-style: solid;

  .heading {
    width: 100%;
  }

  h1 {
    padding: 0.25rem 1rem;
    margin: 0 -1rem 0.5rem -1rem;
    background: rgba(255, 255, 255, 1.0);
    border: 1px solid rgba(0, 0, 0, 0.2);

    @media (max-width: 960px) {
      margin: 0 -1rem 0.5rem -1rem;
    }

    a {
      color: black;
      cursor: pointer;

      &:hover {
        color: black;
      }

      small {
        color: darken($primary, 15);
      }
    }
  }

  &.inline-header {
    h1 {
      font-size: 1.2rem;
    }

    .info a {
      color: white;
    }
  }
}

.info {
  padding-bottom: 0.25rem;
  color: white;
	font-size: 0.9rem;
}

footer {
  margin-top: 2rem;
}

footer, .infobox {
  p:first-child {
    margin-top: 0;
  }

  .box {
    background: #f4f4f4;
    padding: 2rem 0;
  }

  strong, h4 {
    color: #333;
  }

  form {
    max-width: 480px;
    margin: 0;
    align-self: flex-end;
  }

  .footer-links {
    margin: 1rem 0;
    text-align: center;

    & > * {
      margin-right: 2rem;

      &:last-child {
        margin-right: 0;
      }
    }
  }
}

footer blockquote {
  background: transparent;
  text-align: center;
  max-width: 600px;
  margin: 1rem auto;
  color: #444;
  border: none;
}

.stub {
  h2 {
    margin-bottom: 0;
  }
}

article.content {
  max-width: 720px;
  line-height: 1.3;
}

.next-prev {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;

  .prev {
    align-self: flex-start;
  }

  .next {
    align-self: flex-end;
  }
}

blockquote {
  margin-left: calc(-4px - 1rem);
  margin-right: calc(-4px - 1rem);
  padding: 0.25rem 1rem;
  border-left: 4px solid #333;
  background: #eee;
}

iframe {
  display: block;
  margin: 0 auto;
}

details {
  padding: 0 1rem;
  margin: 0 -1rem 1rem;

  summary {
    background: #dee2e6;
    padding: 0 1rem;
    margin: 0 -1rem;
    cursor: pointer;
  }

  &[open] {
    padding: 0 1rem;
    margin-left: calc(-1rem - 4px);
    border-left: 4px solid #dee2e6;
  }
}

.projects {
  padding-top: 2rem;

  .content {
    background: #f4f4f4;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 1rem;
    justify-items: center;
    align-items: center;

    & > *:not(:last-child) {
      margin-right: 0.5rem;
    }
  }
}

.nav-highlight {
  border-bottom: 2px solid transparent;
  border-top: 2px solid transparent;
  border-image: linear-gradient(to bottom right, #b827fc 0%, #2c90fc 25%, #b8fd33 50%, #fec837 75%, #fd1892 100%);
  border-image-slice: 1;
}

.consultancy {
  li {
    margin-top: 1rem;
  }
  dl {
    clear: both;
  }
  dt {
    font-weight: bold;
  }
  dt:not(:first-child) {
    margin-top: 0.5rem;
  }
  .event img {
    float: left;
    margin-right: 1rem;
    margin-bottom: 1rem;
    width: 128px;
    height: 128px;
  }
}

.caption {
  text-align: center;
  font-size: 0.8rem;
}

.toc {
  margin-top: 1rem;

  ul {
    margin: 0;
  }

  & > nav > ul {
    padding: 0;
  }
}

.contributions .article-content {
  ul {
    display: flex;
    flex-wrap: wrap;
    margin-left: -3rem;

    li {
      list-style: none;
      width: calc(50% - 3rem);
      margin: 0.5rem 1rem;
      padding: 0.5rem;
      background: #eee;
    }
  }
}

table {
	color: #333;
	background: white;
	border: 1px solid grey;
	font-size: 12pt;
	border-collapse: collapse;
  margin-bottom: 1rem;
}
table thead th,
table tfoot th {
	background: rgba(0,0,0,.1);
  text-align: left;
}
table caption {
	padding:.5em;
}
table th,
table td {
	padding: .5em;
	border: 1px solid lightgrey;
}

.pricing-table {
  width: 100%;
  max-width: 20rem;

  // Right-align first column
  > thead > tr > th:first-child,
  > tbody > tr > td:first-child {
    text-align: right;
  }

  // Increase table headers to be larger than first column
  > thead > tr > th {
    font-size: 1.2rem;
  }

  // Distinguish services from prices by making them a bit larger
  > tbody > tr > td:first-child {
    font-size: 1.1rem;
  }

  // Emphasize services which require payment
  .payment-required {
    font-weight: bold;
  }
}
