$column-break: 800px;
$secondary-color: #7a7a7a;

body {
  font-family: Helvetica, sans-serif;
  padding: 1rem;

  @media print {
    & {
      padding: 0;
    }
  }
}

a {
  color: inherit;
}

#top {
  font-size: 0;
  position: absolute;
  top: 0;
  visibility: hidden;
}

// based on
// https://www.w3schools.com/howto/howto_js_mobile_navbar.asp
.topnav .icon {
  fill: $secondary-color;
  position: fixed;
  right: 1rem;
  top: 1rem;

  // show above the TOC
  z-index: 200;

  &:hover {
    fill: black;
  }
}
#toc {
  background-color: white;
  bottom: 0;
  box-shadow: -3px 0 6px rgba(0, 0, 0, 0.4);
  padding-top: 6rem;
  position: fixed;
  right: 0;
  text-align: right;
  top: 0;

  // show above the contact info
  z-index: 100;

  // hide by default
  display: none;

  ul {
    padding-left: 0;
  }

  li {
    list-style-type: none;
  }
}
// override bootstrap-toc
nav[data-toggle="toc"] .nav > li > a {
  font-size: 1.5rem;
}

.name {
  color: #00be13;
  font-size: 5rem;
}

.meta .content-inner {
  color: $secondary-color;
  p {
    margin: 0.5rem 0;
  }
}

.grid-wrap {
  margin-bottom: 3rem;
  max-width: 1000px;

  display: grid;
  grid-column-gap: 2rem;
  // single column
  grid-template-columns: 1fr;
  grid-template-areas:
    "section"
    "content";
}

.listings .section {
  color: $secondary-color;
  grid-area: section;
}

.content {
  grid-area: content;
}

.listing {
  margin-bottom: 2rem;

  h3 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 0.4rem;
  }

  p {
    line-height: 1.5;
    margin: 0.5rem 0;
  }

  .url {
    display: none;
  }
}

.responsibilities {
  li {
    margin: 0.5rem 0;
  }
  .title {
    font-weight: bold;
  }
}

.dates {
  font-style: italic;
  font-weight: bold;
}

.talks,
.writing,
.writeups {
  h3 {
    font-size: 1em;
  }

  .dates {
    font-weight: normal;
  }
}

// https://css-tricks.com/hash-tag-links-padding/
*[id]::before {
  $anchor-offset: 2rem;

  display: block;
  content: " ";
  margin-top: -$anchor-offset;
  height: $anchor-offset;
  visibility: hidden;
  pointer-events: none;
}

// large screen - two columns
@media print, screen and (min-width: $column-break) {
  .name {
    font-size: 3rem;
    margin: 0;
  }
  .meta {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "section content";

    .content {
      position: relative;
    }
    .content-inner {
      position: absolute;
      bottom: 0;
      right: 0;
      text-align: right;
    }
  }

  .listings {
    grid-template-columns: 10rem 1fr;
    grid-template-areas: "section content";

    // vertically align tops of sections
    .section h2 {
      font-weight: normal;
      margin-top: 0;
    }
    .content :first-child {
      margin-top: 0;
    }
  }
}
@media screen and (min-width: $column-break) {
  body {
    padding: 3rem;
  }

  .listings .section h2 {
    font-size: 1.2rem;
  }
}
@media print {
  html {
    font-size: 0.8rem;
  }

  .topnav {
    display: none;
  }

  .listings {
    .section h2 {
      font-size: 1.1rem;
    }
  }

  .listing {
    p {
      line-height: 1.3;
    }

    // show the URLs; ideally would use 'revert'
    // https://developer.mozilla.org/en-US/docs/Web/CSS/revert
    .url {
      display: block;
    }
    span.url {
      display: inline;
    }
    li.url {
      display: list-item;
    }
  }
}
