:root {
  --primary-background-color: white;
  --body-font-color: #45474f;
  --heading-font-color: black;
  --subtle-font-color: #757575;
  --standard-border-color: #e8e8e8;
  --table-secondary-color: #f8f8f8;
  --focus-background-color: #f1f1f1;
  --code-border-color: #e7eaed;
  --code-font-color: #383a42;
  --menu-link-color: #b1b1b1;
  --menu-background-color: #fafafa;
  --checkbox-checked-border-color: #d8d8d8;
  --menu-item-border-color: #efefef;
  --menu-border-color: #e1e1e1;
  --slight-focus-background-color: #f6f6f6;
  --button-foreground-color: white;
  --slider-background-color: white;
  --blog-title-image: url("/images/jr_site_title_black.png");
  --blog-title-image-underline: url("/images/jr_site_title_black_underline.png");
  --info-image: url("/images/info.png");
  --arrow-right-image: url("/images/arrow-right.svg");
  --arrow-left-image: url("/images/arrow-left.svg");
  --linkedin-image: url("/images/linkedin.svg");
  --reddit-image: url("/images/reddit.svg");
  --github-image: url("/images/github.svg");
  --gitlab-image: url("/images/gitlab.svg");
  --icon-image: url("/images/icon.svg");
  --gpg-image: url("/images/gpg.svg");
  --selection: #b3d8ff;
}

/* S1: FONT FACES */

::selection {
  background: var(--selection);
}

@font-face {
  font-family: "Euclid Circular A Regular";
  src:
    url("../fonts/EuclidCircularA-Regular-WebS.woff2") format("woff2"),
    url("../fonts/EuclidCircularA-Regular-WebS.woff") format("woff"),
    url("../fonts/EuclidCircularA-Regular-WebS.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A Regular";
  src:
    url("../fonts/EuclidCircularA-BoldItalic-WebS.woff2") format("woff2"),
    url("../fonts/EuclidCircularA-BoldItalic-WebS.woff") format("woff"),
    url("../fonts/EuclidCircularA-BoldItalic-WebS.ttf") format("truetype");
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A Regular";
  src:
    url("../fonts/EuclidCircularA-Bold-WebS.woff2") format("woff2"),
    url("../fonts/EuclidCircularA-Bold-WebS.woff") format("woff"),
    url("../fonts/EuclidCircularA-Bold-WebS.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Euclid Circular A Regular";
  src:
    url("../fonts/EuclidCircularA-RegularItalic-WebS.woff2") format("woff2"),
    url("../fonts/EuclidCircularA-RegularItalic-WebS.woff") format("woff"),
    url("../fonts/EuclidCircularA-RegularItalic-WebS.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

/* S2: GENERIC ELEMENTS */

body {
  margin: 0;
  font:
    19px "Euclid Circular A Regular",
    "Helvetica",
    "Arial",
    sans-serif;
  background-color: var(--primary-background-color);
  line-height: 1.3;
  box-decoration-break: clone;
  animation: fadeIn 1s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

p {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

strong {
  font-weight: 600;
}

h1 {
  font-size: 2em;
  margin: 0 0 0.4rem 0;
  color: var(--heading-font-color);
  padding-top: 38px;
  line-height: 1.2em;
  text-align: center;
}

h1#pageTitleNoDate {
  margin: 0 0 1.3rem 0;
}

h2,
h3,
h4,
h5,
h6 {
  margin: 1.2em 0 1.2em 0;
  line-height: 1.35em;
  color: var(--heading-font-color);
}

h2 {
  font-size: 1.7em;
}

h3 {
  font-size: 1.5em;
}

h4 {
  font-size: 1.2em;
}

a {
  text-decoration: none;
  color: var(--subtle-font-color);
}

a:hover,
a:focus {
  text-decoration: underline;
}

a,
a:active,
a:focus {
  outline: none;
}

button::-moz-focus-inner {
  border: 0;
}

/* S3: HEADER AND WEBSITE NAV */

header#fixedPageHeader {
  background-color: var(--primary-background-color);
  display: inline-flex;
  height: 50px;
  width: 100%;
  white-space: nowrap;
  border-bottom: 1px solid var(--standard-border-color);
  position: fixed;
  left: 0;
  top: 0;
  justify-content: space-between;
  z-index: 50;
}

a#blogTitleImage {
  height: 100%;
  background: var(--blog-title-image) no-repeat;
  background-size: contain;
  width: 240px;
  font-size: 0;
}

a#blogTitleImage:focus,
a#blogTitleImage:hover {
  background: var(--blog-title-image-underline) no-repeat;
  background-size: contain;
}

nav#mainNav {
  text-transform: uppercase;
  height: 100%;
}

nav#mainNav a {
  font-size: 13px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
}

div#leftSideOfPageHeader a:hover,
div#leftSideOfPageHeader a:focus {
  background-color: var(--focus-background-color);
}

div#rightSideOfPageHeader {
  padding-right: 15px;
  display: inline-flex;
  align-items: center;
}

/* S4: PAGE NAVIGATION BAR */

img#me {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

div#me {
  max-width: 50%;
  margin-left: auto;
  margin-right: auto;
  display: block;
  width: 50%;
  height: auto;
}

div#certs {
  margin: 1.5rem;
  display: block;
  text-align: center;
}

div#certs img {
  height: auto;
  width: 30%;
}

nav.defaultCollapsedNav {
  display: none !important;
}

nav#pageNav {
  display: inline-block;
  height: calc(100vh - 51px);
  background-color: var(--menu-background-color);
  border-right: 1px solid var(--standard-border-color);
  position: fixed;
  box-sizing: border-box;
  left: 25px;
  top: 51px;
  padding: 13px 1.5rem 0 0;
  overflow: auto;
}

span#pageNavFirstItem {
  margin-left: 15px;
  font: bold 16px/16px "Euclid Circular A Regular";
  color: var(--subtle-font-color);
  display: inline-block;
}

nav#pageNav ul {
  list-style-type: none;
  padding-left: 1.5rem;
  margin: 0.8rem 0 0.8rem 0;
}

nav#pageNav li {
  margin-bottom: 0.8rem;
  line-height: 16px;
}

nav#pageNav a {
  font-size: 16px;
}

div#pageNavCollapse {
  position: fixed;
  left: 0;
  top: 51px;
  width: 25px;
  height: calc(100vh - 51px);
}

button#pageNavCollapseButton {
  border: none;
  border-right: 1px solid var(--standard-border-color);
  height: 100%;
  width: 100%;
  display: inline-block;
}

/* S5: PAGE CONTENT */

/* The date that appears in articles */
div#publishedDate {
  margin: 0.5rem 0 0.75rem 0;
  color: var(--subtle-font-color);
  font-size: 15px;
  text-align: center;
}

/* The date that appears in pages with lists of links, e.g. /notes, /articles */
div.publishedDateList {
  color: var(--subtle-font-color);
  font-size: 14px;
}

section#pageContent {
  line-height: 30px;
  min-height: calc(100vh - 177px);
  color: var(--body-font-color);
  margin-top: 51px;
  overflow: hidden;
}

section#pageContent a {
  color: var(--body-font-color);
  font-style: italic;
}

section#pageContent img {
  max-width: 100%;
}

/* Let headings determine the spacing after them */
section#pageContent h1 + p,
section#pageContent h2 + p,
section#pageContent h3 + p,
section#pageContent h4 + p,
div#publishedDate + ul,
div#publishedDate + p {
  margin-top: 0 !important;
}

code {
  background-color: var(--table-secondary-color);
  border-radius: 6px;
  color: var(--code-font-color);
  border: 1px solid var(--code-border-color);
  font: 14px/18px monospace;
  white-space: pre;
  overflow: auto;
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
  padding: 2px 8px;
  box-sizing: border-box;
}
ul code {
  margin: 0.4rem 0 0.4rem 0;
}

/* Code within three grave signs */
section#pageContent div code {
  display: block;
  width: 100%;
  padding: 16px;
  line-height: 21px;
}

/* A fix for unnecessary spacing in pre blocks*/
pre.highlight {
  margin: 0;
}

section#pageContent ul {
  line-height: 26px;
  margin: 1.5rem 0;
}

section#pageContent ul.indexPage {
  columns: 100px 2;
}

/*Spacing between li elements*/
section#pageContent li + li {
  margin-top: 0.6em;
}

/* Fix for Jekyll adding annoying extra paragraphs in lists */
section#pageContent li p {
  margin: 0;
}

section#pageContent table {
  margin: 1.5rem 0;
  border: 1px solid var(--code-border-color);
  border-collapse: collapse;
  box-sizing: border-box;
  width: 100%;
}

section#pageContent th,
section#pageContent td {
  border: 1px solid var(--code-border-color);
  text-align: left;
  padding: 0.75rem;
}

section#pageContent th {
  background-color: var(--table-secondary-color);
}

section#pageContent tr:nth-child(even) {
  background-color: var(--table-secondary-color);
}

footer#pageFooter {
  max-width: 666px;
  margin: 25px auto;
  padding-top: 25px;
  line-height: 50px;
  text-align: center;
  border-top: 1px solid var(--standard-border-color);
  font-size: 16px;
  color: var(--subtle-font-color);
}

/* S6: RESPONSIVE DESIGN AND WRAPPERS */

/* #rightContainer is a wrapper for everything on the right side of the page*/

/* Centres content within #rightContainer and ensures footer is at the bototm */
div#mainColumn {
  min-height: calc(100vh - 51px);
}

button#pageNavCollapseButton {
  background-color: var(--slight-focus-background-color);
}

button.navCollapsedButton {
  background: var(--slight-focus-background-color) var(--arrow-right-image)
    no-repeat center center !important;
}

button.navCollapsedButton:hover {
  background: var(--focus-background-color) var(--arrow-right-image) no-repeat
    center center !important;
}

button.navExpandedButton {
  background: var(--slight-focus-background-color) var(--arrow-left-image)
    no-repeat center center !important;
}

button.navExpandedButton:hover {
  background: var(--focus-background-color) var(--arrow-left-image) no-repeat
    center center !important;
}

@media (min-width: 0px) {
  div#mainColumn {
    margin: 0 6vw 0 calc(6vw + 25px);
    max-width: 100%;
  }

  nav#pageNav {
    width: 400px;
    max-width: calc(100vw - 25px);
    display: none;
  }

  div#rightContainer {
    margin-left: 0;
  }

  div#rightContainer a {
    font-style: italic;
  }

  div.rightContainerWithNav,
  div.rightContainerNoNav {
    margin-left: 0 !important;
  }

  nav#mainNav {
    display: none;
  }

  label#cookiesCheckbox,
  label#desktopCookiesLabel {
    display: none !important;
  }

  ul.dropdown_menu li.mobile_only {
    display: inline-flex;
    /*visibility: visible;*/
  }

  nav.dropdown {
    margin-left: 0;
  }
}

@media (min-width: 720px) {
  nav#pageNav {
    display: inline-block;
    width: 30vw;
  }
  div#rightContainer {
    margin-left: 30vw;
  }
  div.rightContainerWithNav {
    margin-left: 30vw !important;
  }
  div.rightContainerNoNav {
    margin-left: 25px !important;
  }
}

@media (min-width: 1157px) {
  div#mainColumn {
    margin: 0 auto;
    max-width: 666px;
  }
  nav.dropdown {
    margin-left: 15px;
  }
  nav#mainNav {
    display: inline-flex;
    align-items: center;
  }
  label#desktopCookiesLabel {
    display: inline-flex !important;
  }
  label#cookiesCheckbox {
    display: inline-block !important;
  }
  ul.dropdown_menu li.mobile_only {
    display: none !important;
  }
}

@media (min-width: 1333px) {
  nav#pageNav {
    width: 400px;
  }

  div#rightContainer {
    margin-left: 400px;
  }

  div.rightContainerWithNav {
    margin-left: 400px !important;
  }

  div.rightContainerNoNav {
    margin-left: 25px !important;
  }
}

/* S7: Checkboxes
Modified CSS from:
https://www.w3schools.com/howto/howto_css_switch.asp
*/

/* The containing label */

label.switch {
  position: relative;
  display: inline-block;
  width: 49px; /* The overall length */
  height: 28px; /* The overall height */
}

/* The checkbox provides the toggle behvaiour but we don't want to see it */

label.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The background of the slider when it is unchecked */

span.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--slider-background-color);
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border: 1px solid var(--standard-border-color);
  box-sizing: border-box;
}

/* highlight on active/focus */

label.switch:focus-within span.slider,
span.slider:hover {
  -webkit-box-shadow: 0px 0px 3px 1px rgba(200, 200, 200, 0.6);
  box-shadow: 0px 0px 3px 1px rgba(200, 200, 200, 0.6);
}

/* The white button in the middle of the slider, unchecked */

span.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--button-foreground-color);
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border: 1px solid var(--standard-border-color);
  box-sizing: border-box;
}

/* The background of the slider after it is checked */

input:checked + span.slider {
  background-color: var(--standard-border-color);
  border: 1px solid var(--checkbox-checked-border-color);
}

/* The border of the slider after it is checked */

input:focus + span.slider {
  box-shadow: 0 0 1px var(--standard-border-color);
}

/* The white button in the middle of the slider, checked */
input:checked + span.slider:before {
  -webkit-transform: translateX(20px);
  -ms-transform: translateX(20px);
  transform: translateX(20px);
  border: 1px solid var(--checkbox-checked-border-color);
}

/* Rounded sliders */
span.slider.round {
  border-radius: 28px;
}

span.slider.round:before {
  border-radius: 50%;
}

label.cookiesLabel a {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--menu-link-color);
  line-height: 50px;
  display: inline-flex !important;
  align-items: center;
}

label.cookiesLabel a:hover,
label.cookiesLabel a:focus {
  color: var(--subtle-font-color);
}

a.cookiesLink {
  background: var(--info-image) no-repeat right center/17px;
  padding-right: 23px;
  padding-left: 1em;
}

nav.dropdown {
  display: inline-grid;
  place-items: center;
  position: relative;
  background-color: var(--menu-background-color);
  border: 1px solid var(--menu-border-color);
}

nav.dropdown button {
  background-color: transparent;
  color: var(--menu-link-color);
  font-size: 13px;
  height: 32px;
  padding: 0 0.8em;
  text-transform: uppercase;
  border: none;
}

nav.dropdown:focus-within,
nav.dropdown:focus,
nav.dropdown:active,
nav.dropdown button:hover {
  background-color: var(--focus-background-color);
}

nav.dropdown button:hover {
  text-decoration: underline;
  color: var(--subtle-font-color);
}

ul.dropdown_menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  position: absolute;
  top: 34px;
  left: calc(50% - 120px);
  transform: rotateX(-90deg) translateX(-50%);
  transform-origin: top center;
  opacity: 0.3;
  transition: 280ms all 120ms ease-out;
  background-color: var(--menu-background-color);
  border: 1px solid var(--standard-border-color);
  box-shadow: 0 0.15em 0.25em rgba(0, 0, 0, 0.05);
  padding: 0;
  width: 300px;
  font-size: 13px;
}

ul.dropdown_menu li {
  padding: 0;
  border-bottom: 1px solid var(--menu-item-border-color);
  box-sizing: border-box;
}

ul.dropdown_menu a.standardLinks {
  width: calc(100% - 15px);
  padding-left: 1em;
  color: var(--menu-link-color);
  display: inline-block;
  line-height: 50px;
  text-transform: uppercase;
}

ul.dropdown_menu a:hover,
ul.dropdown_menu li:hover,
ul.dropdown_menu a:focus,
ul.dropdown_menu li:focus-within {
  background-color: var(--focus-background-color);
  color: var(--subtle-font-color);
}

ul.dropdown_menu a:hover,
ul.dropdown_menu a:focus,
ul.dropdown_menu li:focus-within label,
ul.dropdown_menu li:hover label {
  text-decoration: underline;
  color: var(--subtle-font-color);
}

ul.dropdown_menu li.checkbox_li {
  line-height: 50px;
  display: inline-flex;
  text-transform: uppercase;
  justify-content: space-between;
  align-items: center;
  color: var(--menu-link-color);
  padding-right: 1em;
}

ul.dropdown_menu li.checkbox_li_padding {
  padding-left: 1em;
}

nav.dropdown:hover ul.dropdown_menu,
nav.dropdown:focus-within ul.dropdown_menu {
  opacity: 1;
  transform: rotateX(0) translateX(-50%);
  visibility: visible;
}

div#leftSideOfPageHeader {
  display: inline-flex;
  align-items: center;
}

div#cookiesContainer {
  padding: 0 15px;
}

div#cookiesContainer:focus-within,
div#cookiesContainer:hover {
  background-color: var(--focus-background-color);
}

/* S8: Images on the index.md page */

a.contactLinks {
  width: 64px;
  height: 85px;
  display: inline-flex;
  font-size: 13px;
  background-repeat: no-repeat;
  justify-content: center;
  align-items: flex-end;
}

a#linkedin {
  background-image: var(--linkedin-image);
}

a#reddit {
  background-image: var(--reddit-image);
}

a#github {
  background-image: var(--github-image);
}

a#gitlab {
  background-image: var(--gitlab-image);
}

a#icon {
  background-image: var(--icon-image);
}

a#gpg {
  background-image: var(--gpg-image);
}

p.sidebarP {
  color: var(--subtle-font-color);
  font-size: 15px;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

p.sidebarP a {
  font-style: italic;
}

ul.sidebarUL {
  color: var(--subtle-font-color);
  list-style-type: initial !important;
  font-size: 15px;
  padding-left: 3rem !important;
  margin-top: 1rem !important;
}
