:root {
  --main-width: 580px;
  --main-padding: 1.4em;
  --main-padding-bottom: 3rem;
  --background-rgb: 255, 255, 255;
  --sidebar-backdrop-color: rgba(0, 0, 0, 0.5);
  --search-result-background: rgba(var(--background-rgb), 0.7);
  --search-result-border: rgba(58, 58, 58, 0.5);
  --search-result-border-hover: rgba(58, 58, 58, 0.65);
  --search-result-highlight: rgba(245, 245, 245, 0.92);
  --sidebar-width: 250px;
  --sidebar-content-right: calc(var(--sidebar-width) - 20px);

  --caption-padding: calc(0.25 * var(--main-padding));

  /* header settings */
  --header-top-gap: 2.8rem;
  --header-bottom-gap: 2rem;
  --header-menu-side-gap: 0.5rem;
  --header-menu-top-gap: 1rem;

  /* Typography */
  --h1-margin-top: 2rem;
  --h1-margin-bottom: 1.5rem;
  --h2-margin-top: 2rem;
  --h2-margin-bottom: 1.5rem;
  --hx-margin-top: 1.5rem;
  --hx-margin-bottom: 1rem;
  --p-margin-top: 1rem;
  --p-margin-bottom: 1rem;
  --code-margin-top: 2rem;
  --code-margin-bottom: 2rem;

  --h1-font-size: 2em;
  --h2-font-size: 1.8em;
  --hx-font-size: 1.3em;
  --p-font-size: 1.0em;
  --p-line-height: 1.5em;
  --caption-font-size: 0.8em;

  /* List indentation */
  --li-indent: 1rem;
  --ul-margin-top: 0;
  --ul-margin-bottom: 1rem;

  --toc-margin-top: 2rem;
  --toc-margin-bottom: 3rem;

  /* Code */
  --code-padding: 1.5rem;
  --code-border-radius: 10px;

  /* Social section */
  --social-icons-bottom-margin: 3rem;

  /* Footer */
  --footer-height: 3rem;

  /* Content */
  --content-height: calc(100vh - var(--footer-height));

  /* Tables */
  --table-cell-padding: 0.5rem;
  --table-margin-top: 1.5rem;
  --table-margin-bottom: 1.5rem;
}

@media screen and (max-width: 1024px) {
  :root {
    --main-width: 580px;
    /* Maintaining consistent header spacing */
    --caption-padding: calc(0.25 * var(--main-padding));
  }
}

@media screen and (max-width: 640px) {
  :root {
    --main-width: 95%;
    /* Maintaining consistent header spacing */
    --social-icons-bottom-margin: 0rem;
    --caption-padding: calc(2 * var(--main-padding));
  }
}
