/* Design and code for Joshua Clayton’s NYU course pages */

/*
Layout
*/

@charset "UTF-8";

:root {
  --accent-color: rgba(255, 240, 0, 0.5);
  --nyu-violet: rgba(87, 6, 140, 0.5);
}

body {
  margin: 12px;
  display: grid;
  gap: 36px;
  -webkit-text-size-adjust: none;
}

h1 {
  position: sticky;
  top: 28px;
}

nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* background color to text width */
}

/*article {
  border-radius: 12px;
  background-color: rgba(0, 0, 0, 0.09);
  margin-top: 1px;
  padding: 10px;
}*/

footer {
  display: flex;
  justify-content: center;
  position: sticky;
  bottom: 12px;
}

/*
Typography
*/

/* Legal Disclaimer
 *
 * Px Grotesk is licensed only for use on this domain and its subdomains:
 * cs.nyu.edu
 *
 * It is illegal to download or use it on other websites.
 *
 * While the @font-face statements below may be modified by the client, this
 * disclaimer may not be removed.
 *
 * Optimo webfonts are protected by copyright law and provided under license. To modify, alter, translate, convert, decode or reverse engineer in any manner whatsoever, including converting the Font Software into a different format is strictly prohibited. The webfont files are not to be used for anything other than web font use.
 *
 * optimo.ch
 */

@font-face {
   font-family: 'Px Grotesk';
   src: url('fonts/Px-Grotesk-Regular.woff2') format('woff2');
   font-style: normal;
 }
 
 @font-face {
   font-family: 'Px Grotesk';
   src: url('fonts/Px-Grotesk-Italic.woff2') format('woff2');
   font-style: italic;
 }
 
 @font-face {
   font-family: 'Jet Brains Mono';
   src: url('fonts/JetBrainsMono-Light.woff2') format('woff2');
   font-style: normal;
   font-weight: 300;
 }
 
 @font-face {
   font-family: 'Jet Brains Mono';
   src: url('fonts/JetBrainsMono-LightItalic.woff2') format('woff2');
   font-style: italic;
   font-weight: 300;
 }

h1, h4, p, ul, ol, dl {
  font-family: 'Px Grotesk', sans-serif;
  font-weight: normal;
}

h2, h3, h5, nav, footer > p, code {
  font-family: 'Jet Brains Mono', monospace;
  font-weight: normal;
}

h1 {
  font-size: 1.5em;
  margin-bottom: 0;
}

h2, h2.week:first-child {
  margin-top: 0;
}

h2.week {
  font-size: 0.8em;
  margin-top: 24px;
}

h4.section {
  border-top: 2px dotted var(--accent-color);
  padding-top: 6px;
}

nav > a, h2, h3, h4, dt.assignment {
  font-size: 1.1em;
}

nav > a, h2, h3 {
  line-height: 1.6em;
}

dt.assignment {
  margin-bottom: 12px;
}

p, code, ul, ol, dt, dd {
  font-size: 0.9em;
  line-height: 1.3em;
}

.selected {
  background-color: var(--accent-color);
  border-radius: 0.5em;
  display: inline; /* background color to text width */
}

em, .book {
  font-style: italic;
}

.slashed {
  font-feature-settings: "zero" 1;
}

ul {
  list-style: "→ ";
}

ul, ol, dd {
  margin-left: 0;
  padding-left: 0;
  list-style-position: inside;
}

div.notes > h3 {
  margin-top: 3px;
}

footer > p {
  font-size: 0.7em;
  padding: 1em;
  border-radius: 2em;
  border: 1px solid black;
  background-color: rgba(255, 255, 255, 0.9);
  margin-top: 0;
}

/*
Hypertext
*/

a {
  border-radius: 0.5em;
  transition-property: background-color;
  transition-duration: 400ms;
}

a:link, a:visited {
  color: black;
  text-decoration: underline;
}

a:hover, a:focus {
  background-color: var(--accent-color);
}

a:active {
  background-color: var(--nyu-violet);
  transition-duration: 0s;
}

a.course, a.selected {
  text-decoration: none;
}

/*
Media Queries
*/

@media only screen and (prefers-color-scheme: dark) {
  body {
    background-color: rgb(15, 15, 15);
    color: white;
  }

  a:link, a:visited {
    color: white;
  }

/*  article {
    background-color: rgba(255, 255, 255, 0.09);
  }*/

  footer > p {
    border-color: white;
    background-color: rgba(15, 15, 15, 0.9);
  }
}

@media (min-width: 420px) {
  nav {
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 1em;
  }
}

@media (min-width: 600px) {
  h1 {
    grid-area: heading;
  }

  nav {
    flex-direction: column;
    grid-area: navigation;
    position: sticky;
    align-self: start; /* for sticky positioning of grid item */
    top: 93px;
  }

  main {
    grid-area: main;
  }

  footer {
    grid-area: footer;
    justify-content: end;
  }

  body {
    grid-template-columns: 8em 1fr;
    grid-template-areas:
      "heading heading"
      "navigation main"
      ". footer";
  }
}

@media (min-width: 900px) {
  body {
    grid-template-areas:
      ". heading"
      "navigation main"
      ". footer";
  }

  main {
    display: grid;
    column-gap: 1em;
    grid-template-columns: 1fr 1fr;
  }

  main.schedule {
    column-gap: 1px;
  }

  h2.week {
    grid-column: 1 / 3;
  }

  section {
    grid-column: 2;
  }

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

@media (min-width: 1200px) {
  main {
    grid-template-columns: 1fr 1fr 1fr;
  }

  section {
    grid-column: initial;
  }

  section.wide {
    grid-column: 2 / 4;
  }

/*  article {
    grid-column: 1 / 4;
    display: flex;
    justify-content: space-between;
    padding: 0;
  }*/

  section.archive {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1em;
  }

  h3 {
    grid-column: 1 / 3;
  }

  h4 {
    margin-top: 0;
  }

  div.notes {
    width: calc(96% / 3);
    padding: 10px;
  }

  div.notes > :first-child {
    margin-top: 3px;
  }
  
  p.lead, ul.schedule {
    font-size: 1.1em;
    line-height: 1.3em;
  }
}

@media (min-width: 1500px) {
  body {
    max-width: 1476px;
    margin-left: auto;
    margin-right: auto;
  }
}