:root {
  color-scheme: light dark;
}

body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  background: light-dark(white, #1c2020);
  color: light-dark(#222, #ccc);

  display: flex;
  flex-direction: column;
  gap: 0;

  > img {
    margin: 0;
    padding: 0;
    width: 100%
  }
  img {
    max-width: 100%;
  }

  a {
    color: light-dark(teal, lightseagreen);
    > img {
      margin: 0;
      padding: 0;
      width: 100%
    }
;
  }

  .material-symbols-outlined {
    font-variation-settings:
      "FILL" 0,
      "wght" 400,
      "GRAD" 0,
      "opsz" 24;
    vertical-align: top;
    margin-top: 0.25rem;
    font-size: 125%;
  }

  h1, h2, h3, h4, h5, h6 {
    display: flex;
    align-items: center;
    gap: 0.125em;
    line-height: 150%;
    font-weight: normal;
    margin: 0.5em 0 0 0;
    padding: 0.125em 0;

    .material-symbols-outlined {
      margin-top: 1.25%rem;
    }
  }

  h1 {
    font-size: 2rem;
    color: light-dark(saddlebrown, rosybrown);
  }

  h1.job-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  h2 {
    font-size: 1.75rem;
    color: light-dark( darkred, lightsalmon);
  }

  h3 {
    font-size: 1.5rem;
    color: light-dark( sienna, lightcoral);
  }

  h4 {
    font-size: 1.25rem;
    color: light-dark(darkgoldenrod, goldenrod);
  }

  h5 {
    font-size: 1.125rem;
    color: light-dark(firebrick, lightsalmon);
  }

  h6 {
    font-size: 1rem;
    font-weight: bold;
    text-decoration: underline;
  }

  table {
    border-collapse: collapse;
    td {
      border: 1px solid  light-dark(lightgray, darkslategray);
      padding: 0 0.5rem;
    }
    td:first-child {
      background-color: light-dark(whitesmoke, #333);
    }
  }

  .site-header {
    position: sticky;
    z-index: 10;
    top: 0px;

    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0.5rem 1rem;
    gap: 1rem;
    background: light-dark(#f4faf8, #202824);

    .site-title {
      margin: 0;
      font-size: 1.6rem;
      a {
        text-decoration: none;
      }
    }

    .site-nav {
      ul {
        list-style: none;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        margin: 0;
        padding: 0;

        li {
          padding: 0 0.75rem;
        }
      }
    }

    #search-form {
      display: flex;
      align-items: center;
      padding: 4px;
      border-radius: 4px;
      outline: 1px solid light-dark(darkslategray, lightgray);
      width: 20rem;
      background: light-dark(white, #1c2020);;

      #search-word {
        flex-grow: 1;
        appearance: none;
        -webkit-appearance: none;
        border: none;
        outline: none;
        height: 2rem;
        background: transparent;
        font-size: 100%;
      }

      button {
        appearance: none;
        -webkit-appearance: none;
        border: none;
        outline: none;
        background-color: transparent;
        cursor: pointer;

        img {
          width: 1.5rem;
          min-width: 1.5rem;
          height: 1.5rem;
        }
      }
    }
  }

  #content-wrap {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;

    main {
      flex: 2;
      padding: 1rem;
      line-height: 175%;

      .image-right,
      .image-left {
        width: 30%;
        border-radius: 1rem;
      }

      .image-right {
        float: right;
        margin-left: 1rem;
      }

      .image-left {
        float: left;
        margin-right: 1rem;
      }

      .latest-posts {
        list-style: none;
        padding-left: 1rem;
      }

      .post-nav {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        margin: 1rem 0;
        font-size: 0.9rem;
        line-height: 125%;
      }

      .return-index {
        margin: 0;
        padding: 0;
        text-align: right;
      }

      .articles {
        list-style: none;
        gap: 0.5rem;
        margin: 0;
        padding: 0;
      }

      .pagination {
        list-style: none;
        padding-left: 1rem;
        display: flex;
        gap: 1rem;
        margin: 1rem 0;

        a {
          text-decoration: none;
        }

        .disabled,
        .active {
          a {
            color: lightsteelblue;
            cursor: default;
          }
        }
      }
    }

    .site-footer {
      flex: 1;
      margin: 0;
      padding: 0.5rem 1rem;
      font-size: 0.9rem;

      .material-symbols-outlined {
        vertical-align: bottom;
        font-size: 150%;
      }

      .social-media {
        display: flex;
        justify-content: start;
        gap: 1rem;

        a {
          text-decoration: none;

          img {
            width: 2rem;
            height: 2rem;
          }
        }
      }
    }
  }
}

@media (max-width: 640px) {
  body {
    .site-header {
      position: static;
      height: 128px;
      gap: 0.125rem;
      padding: 0.125rem 0.25rem;
      justify-content: center;

      .site-title {
        font-size: 1.2rem;
      }

      .site-nav {
        ul {
          list-style: none;
          display: flex;
          flex-wrap: wrap;
          align-items: center;
          gap: 0.25rem;
          margin: 0;
          padding: 0;

          li {
            padding: 0 0.75rem;
            width: 40%;
            line-height: 125%;
          }
        }
      }

      #search-form {
        width: calc(100vw - 2rem);

        #search-word {
          width: calc(100vw - 8rem);
        }
      }
    }

    #content-wrap {
      flex-direction: column;

      main {
        .image-right,
        .image-left {
          width: 60%;
          float: none;
          margin: 0 20%;
          text-align: center;
        }
      }

      .site-footer {
        .social-media {
          display: flex;
          justify-content: center;
        }

        .mobile-center {
          text-align: center;
        }
      }
    }
  }
}

@media (prefers-color-scheme: dark) {
  img.with-dark-mode {
    filter: invert(12.5%);
  }
}

#dark-mode-selection {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  display: flex;
  gap: 0.5rem;

  button {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    cursor: pointer;
    background: light-dark(white, #1c2020);
    color: light-dark(#222, #ccc);

    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;

    .material-symbols-outlined {
      margin: 0;
      vertical-align: auto;
    }
  }
}

.qrcode {
  border-radius: 0.5rem;
}
