/*
 *  __                  __
 * /\ \                /\ \
 * \ \ \___   __  __   \_\ \     __
 *  \ \  _ `\/\ \/\ \  /'_` \  /'__`\
 *   \ \ \ \ \ \ \_\ \/\ \_\ \/\  __/
 *    \ \_\ \_\/`____ \ \___,_\ \____\
 *     \/_/\/_/`/___/> \/__,_ /\/____/
 *                /\___/
 *                \/__/
 *
 * Designed, built, and released under MIT license by @mdo. Learn more at
 * https://github.com/poole/hyde.
 */


/*
 * Contents
 *
 * Global resets
 * Sidebar
 * Container
 * Reverse layout
 * Themes
 */


/*
 * Global resets
 *
 * Update the foundational and global aspects of the page.
 */

html {
  font-family: "PT Sans", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
:root {
  --theme-sidebar-bg: #202020;
  --theme-sidebar-fg: #ffffff;
}
@media (min-width: 48em) {
  html {
    font-size: 18px;
  }
}
@media (min-width: 64em) {
  html {
    font-size: 18px;
  }
}


/*
 * Sidebar
 *
 * Flexible banner for housing site name, intro, and "footer" content. Starts
 * out above content in mobile and later moves to the side with wider viewports.
 */

.sidebar {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255,255,255,.5);
  background-color: #202020;
}

/* Mobile-first: collapsed sidebar */
.sidebar {
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 900;
  max-height: 100vh;
  overflow-y: auto;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 180ms ease-out, opacity 180ms ease-out, visibility 0s linear 180ms;
}
body.sidebar-open .sidebar {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 180ms ease-out, opacity 180ms ease-out;
}

@media (max-width: 47.999em) {
  body.sidebar-open {
    overflow: hidden;
  }
}

.sidebar-toggle {
  position: fixed;
  top: .75rem;
  right: 1rem;
  z-index: 1000;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0px solid var(--theme-sidebar-fg);
  border-radius: .35rem;
  background: var(--theme-sidebar-bg);
  color: var(--theme-sidebar-fg);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.sidebar-toggle .fa-solid {
  color: currentColor;
}
.sidebar-toggle:focus-visible {
  outline: 2px solid var(--theme-sidebar-fg);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 48em) {
  .sidebar-toggle {
    display: none;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    width: 22rem;
    padding: 1rem, 1rem;
    max-height: none;
    overflow-y: visible;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: none;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}

/* Sidebar links */
.sidebar a {
  color: #fff;
}

/* About section */
.sidebar-about h1 {
  color: #fff;
  margin-top: 0;
  font-family: "Abril Fatface", serif;
  font-size: 3.25rem;
}

/* Sidebar nav */
.sidebar-nav {
  margin-bottom: 1rem;
}
.sidebar-nav-item {
  display: block;
  line-height: 1.75;
}
a.sidebar-nav-item:hover,
a.sidebar-nav-item:focus {
  text-decoration: underline;
}
.sidebar-nav-item.active {
  font-weight: bold;
}

/* Sticky sidebar
 *
 * Add the `sidebar-sticky` class to the sidebar's container to affix it the
 * contents to the bottom of the sidebar in tablets and up.
 */

@media (min-width: 48em) {
  .sidebar-sticky {
    position: absolute;
    right:  1rem;
    bottom: 1rem;
    left:   1rem;
  }
}


/* Container
 *
 * Align the contents of the site above the proper threshold with some margin-fu
 * with a 25%-wide `.sidebar`.
 */

.content {
  padding-top:    4rem;
  padding-bottom: 4rem;
}

@media (min-width: 48em) {
  .content {
    max-width: 38rem;
    margin-left: 20rem;
    margin-right: 2rem;
  }
}

@media (min-width: 64em) {
  .content {
    margin-left: 22rem;
    margin-right: 4rem;
  }
}


/*
 * Reverse layout
 *
 * Flip the orientation of the page by placing the `.sidebar` on the right.
 */

@media (min-width: 48em) {
  .layout-reverse .sidebar {
    left: auto;
    right: 0;
  }

  .layout-reverse .content {
  --sidebar-width: 22rem;
  --content-max-width: 38rem;
  --sidebar-gap-min: 2rem;
  --left-gap-min: 2rem;        /* set your minimum left gap here */
  --sidebar-space-ratio: 0.65;
  --left-space-ratio: 0.35;
  --extra-space: max(
    0px,
    calc(100vw - var(--sidebar-width) - var(--content-max-width) - var(--sidebar-gap-min) - var(--left-gap-min))
  );

  margin-right: calc(var(--sidebar-width) + var(--sidebar-gap-min) + (var(--extra-space) * var(--sidebar-space-ratio)));
  margin-left: calc(var(--left-gap-min) + (var(--extra-space) * var(--left-space-ratio)));
  }
}

/*
 * Themes
 *
 * As of v1.1, Hyde includes optional themes to color the sidebar and links
 * within blog posts. To use, add the class of your choosing to the `body`.
 */

/* Base16 (http://chriskempson.github.io/base16/#default) */

/* Red */
.theme-base-08 {
  --theme-sidebar-bg: #ac4142;
}
.theme-base-08 .sidebar {
  background-color: #ac4142;
}
.theme-base-08 .content a,
.theme-base-08 .related-posts li a:hover {
  color: #ac4142;
}

/* Orange */
.theme-base-09 {
  --theme-sidebar-bg: #d28445;
}
.theme-base-09 .sidebar {
  background-color: #d28445;
}
.theme-base-09 .content a,
.theme-base-09 .related-posts li a:hover {
  color: #d28445;
}

/* Yellow */
.theme-base-0a {
  --theme-sidebar-bg: #f4bf75;
}
.theme-base-0a .sidebar {
  background-color: #f4bf75;
}
.theme-base-0a .content a,
.theme-base-0a .related-posts li a:hover {
  color: #f4bf75;
}

/* Green */
.theme-base-0b {
  --theme-sidebar-bg: #90a959;
}
.theme-base-0b .sidebar {
  background-color: #90a959;
}
.theme-base-0b .content a,
.theme-base-0b .related-posts li a:hover {
  color: #90a959;
}

/* Cyan */
.theme-base-0c {
  --theme-sidebar-bg: #75b5aa;
}
.theme-base-0c .sidebar {
  background-color: #75b5aa;
}
.theme-base-0c .content a,
.theme-base-0c .related-posts li a:hover {
  color: #75b5aa;
}

/* Blue */
.theme-base-0d {
  --theme-sidebar-bg: #6a9fb5;
}
.theme-base-0d .sidebar {
  background-color: #6a9fb5;
}
.theme-base-0d .content a,
.theme-base-0d .related-posts li a:hover {
  color: #6a9fb5;
}

/* Magenta */
.theme-base-0e {
  --theme-sidebar-bg: #aa759f;
}
.theme-base-0e .sidebar {
  background-color: #aa759f;
}
.theme-base-0e .content a,
.theme-base-0e .related-posts li a:hover {
  color: #aa759f;
}

/* Brown */
.theme-base-0f {
  --theme-sidebar-bg: #8f5536;
}
.theme-base-0f .sidebar {
  background-color: #8f5536;
}
.theme-base-0f .content a,
.theme-base-0f .related-posts li a:hover {
  color: #8f5536;
}
