
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: #24292f;
  background: #ffffff;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

.container {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header */

.site-header {
  border-bottom: 1px solid #d0d7de;
  padding: 18px 0;
  margin-bottom: 30px;
}

.site-title {
  color: #24292f;
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}

/* Main page layout */

.page-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 45px;
  max-width: 1400px;
  width: calc(100% - 60px);
  margin: 0 auto;
  align-items: start;
}

.content {
  min-width: 0;
  padding-bottom: 180px;
}

/* Sidebar */

.sidebar {
  position: sticky;
  top: 25px;
  max-height: calc(100vh - 50px);
  overflow-y: auto;
  padding: 0 20px 20px 0;
  border-right: 1px solid #d0d7de;
}

.sidebar-nav h2 {
  font-size: 1.1rem;
  margin: 0 0 1em;
}

.sidebar-nav h3 {
  font-size: 0.95rem;
  margin: 1.5em 0 0.5em;
}

.sidebar-nav a {
  display: block;
  color: #57606a;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 5px 0;
}

.sidebar-nav a:hover {
  color: #0969da;
  text-decoration: underline;
}

/* Headings */

h1,
h2,
h3,
h4 {
  color: #1f2328;
  line-height: 1.3;
  margin-top: 1.8em;
  margin-bottom: 0.7em;
  overflow-wrap: break-word;
}

h1 {
  font-size: 2.1rem;
  margin-top: 0;
}

h2 {
  font-size: 1.55rem;
}

h3 {
  font-size: 1.25rem;
}

/* Text */

p {
  margin: 0 0 1.1em;
  overflow-wrap: break-word;
}

a {
  color: #0969da;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration: underline;
}

/* Lists */

ul,
ol {
  padding-left: 1.8rem;
}

/* Code */

code {
  padding: 0.15em 0.35em;
  background: #f6f8fa;
  border-radius: 4px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

pre {
  padding: 16px;
  overflow-x: auto;
  max-width: 100%;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
}

pre code {
  padding: 0;
  background: transparent;
  overflow-wrap: normal;
}

/* Tables */

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

th,
td {
  padding: 8px 12px;
  border: 1px solid #d0d7de;
  text-align: left;
  overflow-wrap: break-word;
}

th {
  background: #f6f8fa;
}

/* Images */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Blockquotes */

blockquote {
  margin: 1.5em 0;
  padding: 0.5em 1em;
  border-left: 4px solid #d0d7de;
  color: #57606a;
}

/* MathJax */

mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Footer */

.site-footer {
  border-top: 1px solid #d0d7de;
  margin-top: 120px;
  padding: 35px 0 45px;
  color: #57606a;
  font-size: 0.9rem;
}

.site-footer .container {
  width: min(1400px, calc(100% - 60px));
}

.site-footer p {
  margin: 0.3em 0;
}

.site-footer a {
  color: #57606a;
}

/* Tablet and smaller screens */

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 25px;
    width: calc(100% - 40px);
  }

  .sidebar {
    padding-right: 12px;
  }
}

/* Smartphone */

@media (max-width: 600px) {

  .page-layout {
    display: flex;
    flex-direction: column;
    width: calc(100% - 28px);
    gap: 25px;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    width: 100%;
    padding: 0 0 18px 0;
    border-right: none;
    border-bottom: 1px solid #d0d7de;
  }

  .sidebar-nav h2 {
    margin-top: 0;
  }

  .sidebar-nav a {
    font-size: 0.9rem;
  }

  .content {
    width: 100%;
    padding-bottom: 90px;
  }

  .container {
    width: calc(100% - 28px);
  }

  .site-header {
    margin-bottom: 25px;
    padding: 15px 0;
  }

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

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  h3 {
    font-size: 1.15rem;
  }

  body {
    font-size: 15px;
  }

  table {
    font-size: 13px;
  }

  th,
  td {
    padding: 6px 8px;
  }

  mjx-container[display="true"] {
    max-width: 100%;
    overflow-x: auto;
  }

  pre {
    font-size: 13px;
  }

  .site-footer .container {
    width: calc(100% - 28px);
  }
}