/* Variables */
:root {
  --yellow: #FFDE00;
  --lightgrey: #e0e0e0;
  --grey: #666666;
  --darkgrey: #333333;
  --white: #ffffff;
  --blue: #008EFF;
  --darkblue: #005395;
  --darkpurple: #2B2A88;
  --font-family-sans: retina, sans-serif;
  --font-family-serif: bressay, serif;
  --font-size: calc(17px + 0.3vw);
  --line-height: 1.3rem;

  --inset: 0.5rem;

  --large: 1100px;
  --medium: 960px;
  --small: 515px;
}

/* Globals */
* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
  font-family: var(--font-family-serif);
  font-feature-settings: normal;
  font-variant-ligatures: common-ligatures;
  font-size: var(--font-size);
  font-weight: 400;
  font-style: normal;
  line-height: 1.35rem;
  color: var(--darkgrey);
  background-color: var(--white);
}

/* General typography */

a {
  text-decoration: none;
  border-bottom: 2px solid;
  color: var(--blue);
}

a:hover {
  border-bottom: none;
  color: var(--darkblue);
}

a:visited {
  border-bottom: none;
  color: var(--darkpurple);
}

ul {
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

ul.nobullet li {
  list-style: none;
}

img a {
  border: none;
}

/* Layout */

.page-container {
  display: grid;
  grid-template-columns:
  [full-start] minmax(calc(calc(100% - var(--large))/2),1fr)
  [main-start] repeat(3,[col-start] 1fr) [main-end]
  minmax(calc(calc(100% - var(--large))/2),1fr) [full-end];
}

main,
.cover,
header,
.additional {
   display: grid;
   grid-template-columns:
   [full-start] minmax(calc(calc(100% - var(--large))/2),1fr)
   [main-start] repeat(3,[col-start] 1fr) [main-end]
   minmax(calc(calc(100% - var(--large))/2),1fr) [full-end];
   grid-column: full;
}

article,
footer,
.cover h1,
.cover p,
header h2  {
  grid-column: 2/5;
}

.panel  {
  grid-column: 1/6;
}

/* Homepage styling */
.cover {
  background: var(--yellow);
  height: 90vh;
}

.cover h1 {
  padding-top: 10vh;
  font-size: 3rem;
  line-height: 1.1;
}

.cover p {
  height: 70vh;
}

/* Header styling */
header {
  background: var(--yellow);
}

header h2 {
  font-family: var(--font-family-serif);
  font-weight: 600;
}

header a,
header a:visited {
  text-decoration: none;
  color: var(--black);
  border: none;
}

header a:hover {
  border-bottom: 2px solid;
}


h2, h3, h4, h5 {
  font-family: var(--font-family-sans);
  font-weight: 500;
  font-style: normal;
  margin: 1.2rem 0 0.5rem 0;;
}

footer {
  font-family: var(--font-family-sans);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.2rem;
  color: var(--grey);
  border-top: 1px solid var(--lightgrey);
  margin:2em 0;
}

.download {
  border-top: 1px solid var(--lightgrey);
  background: var(--yellow);
  padding: 1em;
  margin:2em 0;
}

.download a,
.download a:visited {
  text-decoration: none;
  color: var(--black);
  border-bottom: 2px solid;
}

.download a:hover {
  border-bottom: none;
}


@media only screen and (max-width: 960px) {
  .page-container {
    display: grid;
    grid-template-columns:
    [full-start] minmax(calc(calc(100% - 960px)/2),1fr)
    [main-start] repeat(3,[col-start] 1fr) [main-end]
    minmax(calc(calc(100% - 960px)/2),1fr) [full-end];
  }

  main,
  .cover,
  header,
  .additional {
     display: grid;
     grid-template-columns:
     [full-start] minmax(calc(calc(100% - 960px)/2),1fr)
     [main-start] repeat(3,[col-start] 1fr) [main-end]
     minmax(calc(calc(100% - 960px)/2),1fr) [full-end];
     grid-column: full;
  }

  article,
  footer,
  header h2,
  .cover h1,
  .cover p   {
    grid-column: 2/5;
  }

  .panel    {
    grid-column: 1/6;
  }
}

@media only screen and (max-width: 515px) {
  .page-container {
    display: grid;
    grid-template-columns:
    [full-start] minmax(calc(calc(100% - 515px)/2),0.3fr)
    [main-start] repeat(3,[col-start] 1fr) [main-end]
    minmax(calc(calc(100% - 515px)/2),0.3fr) [full-end];
  }

  main,
  .cover,
  header,
  .additional {
     display: grid;
     grid-template-columns:
     [full-start] minmax(calc(calc(100% - 515px)/2),0.3fr)
     [main-start] repeat(3,[col-start] 1fr) [main-end]
     minmax(calc(calc(100% - 515px)/2),0.3fr) [full-end];
     grid-column: full;
  }

  article,
  footer,
  header h2,
  .cover h1,
  .cover p   {
    grid-column: 2/5;
  }

  .panel   {
    grid-column: 1/6;
  }
}

/* Direct Links / Markdown Headers */
.direct-link {
  font-family: sans-serif;
  text-decoration: none;
  font-style: normal;
  margin-left: .1em;
}
a[href].direct-link,
a[href].direct-link:visited {
  color: transparent;
  border: none;
}
a[href].direct-link:focus,
a[href].direct-link:focus:visited,
:hover > a[href].direct-link,
:hover > a[href].direct-link:visited {
  color: var(--lightgrey);
}
