/* Imports */
@import url("pygments.css");
@import url("css/tango.css");

/* CSS custom properties replacing Sass variables */
:root {
  --vspace: 1.4rem;
  --hspace: 1.2rem;
  --on-palm: 600px;
}

/* Reset some basic elements */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
hr,
dl,
dd,
ol,
ul,
figure {
  margin: 0;
  padding: 0;
}

body {
  background-color: #fefefe;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted",
    "Segoe UI", "Liberation Sans", sans-serif;
}

.titletext {
  font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-style: normal;
  letter-spacing: -0.5px;
  line-height: 130%;
}

.bodytext {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted",
    "Segoe UI", "Liberation Sans", sans-serif;
  line-height: 170%;
  text-align: start;
  width: auto;
  word-break: break-word;
}

@media screen and (max-width: var(--on-palm)) {
  .bodytext {
    font-size: 105%;
  }
}

.linktext {
  color: black;
  text-decoration: underline;

  :visited {
    color: hsl(330, 50%, 50%);
  }

  :hover {
    color: orange;
  }
}

/* WRAPPER */
.wrapper {
  margin-left: auto;
  margin-right: auto;
  max-width: 80ch;
  padding: 0 var(--hspace);
}

@media screen and (max-width: var(--on-palm)) {
  .wrapper {
    padding: 0;
  }
}

/* NAV */
nav {
  background-color: black;
  margin-bottom: var(--vspace);
  padding: 10px var(--hspace);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted",
    "Segoe UI", "Liberation Sans", sans-serif;
  line-height: 170%;
  text-align: start;
  width: auto;
  word-break: break-word;
  font-size: smaller;

  #logo {
    float: left;
    a {
      color: white;
      text-decoration: none;
    }

    img {
      height: 30px;
    }
  }

  #categories {
    text-align: right;
    color: black;
     a {
      color: white;
      margin-left: 0.5em;
      text-decoration: none;
    }

    span {
      display: none;
    }
  }
}

/* MAIN */

main {
  margin-left: auto;
  margin-right: auto;
  max-width: 70ch;

  #post-list {
    line-height: 170%;
    text-align: start;
    width: auto;
    word-break: break-word;
    border-collapse: collapse;
    padding: calc(var(--vspace)) var(--hspace);

    @media screen and (max-width: var(--on-palm)) {
      padding: 0 calc(var(--hspace) / 2);
    }

    #category-logo {
      display: block;
      margin: auto;
      margin-bottom: 0.5em;
    }

    h1 {
      font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif;
      font-style: normal;
      letter-spacing: -0.5px;
      line-height: 130%;
      text-align: center;
      margin-bottom: 1em;
    }

    .date {
      font-size: smaller;
      color: hsl(300, 0%, 40%);
    }

    .link {
      font-size: 1.3em;
      margin-bottom: 1.5em;
      line-height: 1.4em;

      a {
        color: black;
        text-decoration: underline;
      }

      a:visited {
        color: #666;
      }

      a:hover {
        color: orange;
      }
    }
  }

  /* ARTICLE HEADINGS */
  article {
    h1 {
      margin: calc(var(--vspace) * 2) var(--hspace) calc(var(--vspace) / 2)
        var(--hspace);
      font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif;
      font-style: normal;
      letter-spacing: -0.5px;
      line-height: 130%;
    }

    @media screen and (max-width: var(--on-palm)) {
      h1 {
        margin-top: calc(var(--vspace) * 1.5);
      }
    }

    h2 {
      margin: calc(var(--vspace) * 1.5) var(--hspace) var(--vspace) var(--hspace);
      font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif;
      font-style: normal;
      letter-spacing: -0.5px;
      line-height: 100%;
      font-size: 120%;
    }

    h3 {
      margin: calc(var(--vspace) * 1.5) 0 var(--vspace) 0;
      font-family: sohne, "Helvetica Neue", Helvetica, Arial, sans-serif;
      font-style: normal;
      letter-spacing: -0.5px;
      line-height: 100%;
      font-size: 110%;
    }

    /* POST META */
    header .post-meta {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted",
        "Segoe UI", "Liberation Sans", sans-serif;
      font-size: smaller;
      color: #444;
      margin: 0 var(--hspace) calc(var(--vspace) * 1.5) var(--hspace);
    }

    @media screen and (max-width: var(--on-palm)) {
      header .post-meta {
        margin-bottom: var(--vspace);
      }
    }

    header .post-meta a {
      color: #444;
      text-decoration: none;
    }

    /* INTRO */
    #intro {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted",
        "Segoe UI", "Liberation Sans", sans-serif;
      line-height: 170%;
      margin-bottom: var(--vspace);
    }

    #intro p {
      margin: 0;
      background: linear-gradient(
          104deg,
          rgba(130, 255, 173, 0) 0.9%,
          rgba(130, 255, 173, 1.25) 2.4%,
          rgba(130, 255, 173, 0.5) 5.8%,
          rgba(130, 255, 173, 0.1) 93%,
          rgba(130, 255, 173, 0.7) 96%,
          rgba(130, 255, 1732, 0) 98%
        ),
        linear-gradient(
          183deg,
          rgba(130, 255, 173, 0) 0%,
          rgba(130, 255, 173, 0.3) 7.9%,
          rgba(130, 255, 173, 0) 15%
        );
      padding: 0.6em var(--hspace);
    }

    /* LINKS IN ARTICLE */
    a {
      color: black;
      text-decoration: underline;
    }

    a:visited {
      color: hsl(330, 50%, 50%);
    }

    a:hover {
      color: orange;
    }

    /* PARAGRAPHS */
    p {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted",
        "Segoe UI", "Liberation Sans", sans-serif;
      line-height: 170%;
      text-align: start;
      word-break: break-word;
      margin: 0 var(--hspace) var(--vspace) var(--hspace);
      -webkit-font-smoothing: antialiased;
    }

    /* LISTS */
    ul,
    ol {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted",
        "Segoe UI", "Liberation Sans", sans-serif;
      line-height: 170%;
      margin: 0 var(--hspace) var(--vspace) calc(var(--hspace) * 2.5);
    }

    @media screen and (max-width: var(--on-palm)) {
      ul,
      ol {
        margin-left: calc(var(--hspace) * 2);
      }
    }

    ul li,
    ol li {
      margin-bottom: 0;
    }

    ul :last-child,
    ol :last-child {
      margin-bottom: 0;
    }

    /* IMAGES */
    img {
      max-width: 100%;
      vertical-align: middle;
    }

    /* WARNING BOX */
    .warning {
      margin: 0 var(--hspace) var(--vspace) var(--hspace);
    }

    .warning p {
      font-style: italic;
    }

    .warning p:last-child {
      margin: 0;
    }

    .warning p:first-child:before {
      content: "⚠️  ";
      margin-right: 5px;
    }

    /* PRE & CODE */
    pre,
    code {
      font-family: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono",
        Menlo, Consolas, monospace;
      font-size: 95%;
    }

    /* Inline code */
    p code,
    li code {
      background-color: hsl(53, 100%, 89%);
      border: 1px solid #dbce7a; /* Precomputed Sass color */
      border-radius: 3px;
      padding: 3px 3px;
    }

    .highlight {
      border-radius: 5px;
      background-color: hsl(320, 0%, 93%);
    }

    pre.highlight {
      line-height: 160%;
      margin-bottom: var(--vspace);
      overflow-x: auto;
      padding: calc(var(--vspace) / 2) var(--hspace);
    }

    /* BLOCKQUOTE */
    blockquote {
      border-radius: 5px;
      background-color: #ffd;
      padding: var(--vspace) var(--hspace);
      margin-bottom: var(--vspace);

      p {
        font-style: italic;
        margin-bottom: var(--vspace);
        margin: 0;
      }

      p:first-child:before {
        content: "\201C  ";
        font-size: 60px;
        position: relative;
        top: 20px;
        line-height: 0%;
        color: #1f4d33; /* Precomputed darken(...) */
      }

      cite {
        margin-top: calc(var(--vspace) / 2);
        font-size: smaller;
        font-style: normal;
        color: #666;
        text-align: right;
        display: block;
        line-height: 150%;
      }

    }

    /* VIDEO CONTAINER */
    .video-container {
      background-color: black;
      position: relative;
      padding-bottom: 56.25%;
      padding-top: 30px;
      height: 0;
      overflow: hidden;
      margin-top: var(--vspace);
      margin-bottom: var(--vspace);
    }

    .video-container iframe,
    .video-container object,
    .video-container embed {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }

    /* ICONS */
    .icon > svg {
      display: inline-block;
      width: 16px;
      height: 16px;
      vertical-align: middle;
    }

    .icon > svg path {
      fill: #444;
    }

    /* WIDE LOGOS */
    .wide-logos {
      float: right;
      margin-left: var(--hspace);
    }

    @media screen and (max-width: var(--on-palm)) {
      .wide-logos {
        display: none;
      }
    }

    /* FOOTER */
    footer {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted",
        "Segoe UI", "Liberation Sans", sans-serif;
      font-size: smaller;
      line-height: 170%;
      margin: calc(var(--vspace) * 2) var(--hspace) var(--vspace) var(--hspace);
      text-align: left;
    }

    footer a {
      color: black;
      text-decoration: underline;
    }

    footer a:visited {
      color: hsl(330, 50%, 50%);
    }

    footer a:hover {
      color: orange;
    }
  }
}
