/*
  *  __                  __
  * /\ \                /\ \
  * \ \ \___   __  __   \_\ \     __
  *  \ \  _ `\/\ \/\ \  /'_` \  /'__`\
  *   \ \ \ \ \ \ \_\ \/\ \_\ \/\  __/
  *    \ \_\ \_\/`____ \ \___,_\ \____\
  *     \/_/\/_/`/___/> \/__,_ /\/____/
  *                /\___/
  *                \/__/
  *
  * 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.
  */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --text-primary: #313131;
  --text-secondary: #767676;
  --sidebar-bg: #202020;
  --sidebar-text: rgba(0, 0, 0, 0.5);
  --sidebar-link: #000;
  --border-color: #e5e5e5;
  --code-bg: #f4f4f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e5e5e5;
    --text-secondary: #b0b0b0;
    --sidebar-bg: #0f0f0f;
    --sidebar-text: rgba(0, 0, 0, 0.5);
    --sidebar-link: #000;
    --border-color: #404040;
    --code-bg: #2d2d2d;
  }
}

html.dark-mode {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #e5e5e5;
  --text-secondary: #b0b0b0;
  --sidebar-bg: #0f0f0f;
  --sidebar-text: rgba(0, 0, 0, 0.5);
  --sidebar-link: #000;
  --border-color: #404040;
  --code-bg: #2d2d2d;
}

html.light-mode {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --text-primary: #313131;
  --text-secondary: #767676;
  --sidebar-bg: #202020;
  --sidebar-text: rgba(0, 0, 0, 0.5);
  --sidebar-link: #000;
  --border-color: #e5e5e5;
  --code-bg: #f4f4f4;
}

html {
  font-family: "PT Sans", Helvetica, Arial, sans-serif;
}
@media (min-width: 48em) {
  html {
    font-size: 16px;
  }
  img {
    max-width: 50%;
  }
}
@media (min-width: 68em) {
  html {
    font-size: 18px;
  }
  img {
    max-width: 100%;
  }
}

/*
  * 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.
  */

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--sidebar-text);
  background-color: var(--sidebar-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}
@media (min-width: 48em) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 18rem;
    text-align: left;
    overflow-y: auto;
  }
}

/* Sidebar links */
.sidebar a {
  color: var(--sidebar-link);
}

/* About section */
.sidebar-about h1 {
  color: var(--sidebar-link);
  margin-top: 1rem;
  font-family: "Abril Fatface", serif;
  font-size: 2.5rem;
  text-align: center;
}

.lead {
  text-align: center;
}

/* Sidebar nav */
.sidebar-nav {
  padding-left: 0;
  list-style: none;
}
.sidebar-nav-item {
  display: block;
}
a.sidebar-nav-item:hover,
a.sidebar-nav-item:focus {
  text-decoration: underline;
}
.sidebar-nav-item.active {
  font-weight: bold;
}

/* Search */
.search-page input[type="search"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  margin: 1rem 0;
}

/* 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;
  }
}

/* Sidebar tags collapsible section */
.sidebar-tags {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-tags input[type="checkbox"] {
  display: none !important;
  position: absolute;
  opacity: 0;
}

.tags-toggle-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  /* color: rgba(255, 255, 255, 0.5); */
  padding: 0.5rem 0;
  user-select: none;
}

@media (min-width: 48em) {
  .tags-toggle-label {
    justify-content: flex-start;
  }
}

/* Dark mode toggle switch */
.theme-toggle-container {
  margin: 1rem 0;
}

.theme-toggle-checkbox {
  display: none;
}

.theme-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  justify-content: center;
}

.theme-toggle-label:hover {
  color: var(--sidebar-link);
}

.toggle-slider {
  display: inline-flex;
  align-items: center;
  width: 2.5rem;
  height: 1.4rem;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.7rem;
  padding: 0.2rem;
  transition: background-color 0.3s ease;
  position: relative;
}

.toggle-slider::after {
  content: "";
  width: 1rem;
  height: 1rem;
  background-color: var(--sidebar-text);
  border-radius: 50%;
  transition: transform 0.3s ease;
  display: block;
}

.theme-toggle-checkbox:checked + .theme-toggle-label .toggle-slider {
  background-color: rgba(255, 255, 255, 0.4);
}

.theme-toggle-checkbox:checked + .theme-toggle-label .toggle-slider::after {
  transform: translateX(1.1rem);
}

@media (min-width: 48em) {
  .theme-toggle-label {
    justify-content: flex-start;
  }
}

.tags-toggle-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  margin-right: 0.5rem;
  width: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
}

.sidebar-tags
  input[type="checkbox"]:checked
  + .tags-toggle-label
  .tags-toggle-arrow {
  transform: rotate(90deg);
}

.tags-list {
  padding-left: 1rem;
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-tags input[type="checkbox"]:checked + .tags-toggle-label + .tags-list {
  max-height: 1000px;
  overflow: visible;
}

.tags-list li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.tags-list a {
  /* color: rgba(255, 255, 255, 0.7); */
  text-decoration: none;
}

.tags-list a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Tags page specific styles */
.posts > h1:first-child {
  color: #425f7f;
}

html.dark-mode .posts > h1:first-child {
  color: #a8c5e8;
}

/* 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;
  color: var(--text-primary);
}

@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 {
    margin-left: 2rem;
    margin-right: 20rem;
  }
}

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

.contact input,
.contact textarea {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-sizing: border-box;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

.contact textarea {
  height: 10rem;
}

.contact button {
  background-color: #4caf50;
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/*
  * 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) */

/* TDG */

.theme-base-06 {
  background-color: #ede4c5;
}

.theme-base-06 .logo {
  padding: 10px;
  background-color: #e9d694;
}

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

.theme-base-08 .contact button {
  background-color: #ac4142;
}

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

.theme-base-09 .contact button {
  background-color: #d28445;
}

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

.theme-base-0a .contact button {
  background-color: #f4bf75;
}

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

.theme-base-0b .contact button {
  background-color: #90a959;
}

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

.theme-base-0c .contact button {
  background-color: #75b5aa;
}

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

.theme-base-0d .contact button {
  background-color: #6a9fb5;
}

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

.theme-base-0e .contact button {
  background-color: #aa759f;
}

/* Brown (ish) */
.theme-base-0f .sidebar {
  background-color: #fdce66;
}
.theme-base-0f .content a,
.theme-base-0f .related-posts li a:hover {
  color: #faad03;
}

.theme-base-0f .contact button {
  background-color: #fdce66;
}

.theme-base-0f .contact button:hover {
  background-color: #fdce66;
}

.theme-base-0f .sidebar {
  color: rgba(0, 0, 0, 0.5);
}

.theme-base-0f .sidebar a {
  color: #000;
}

.theme-base-0f .sidebar-about h1 {
  color: #000;
}

.theme-base-0f .contact button {
  color: #000;
}

.theme-base-0f .posts > h1:first-child {
  color: #000;
}

/* Podcast icons */

.feed-icons {
  float: left;
  width: 100%;
}

.podcast-icon {
  float: left;
  width: 5rem;
  margin: 0.5rem;
}

.podcast-icon.overcast {
  width: 6rem;
  margin: 0;
}

/*
 * Pagination
 *
 * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when
 * there are no more previous or next posts to show.
 */

.pagination {
  overflow: hidden; /* clearfix */
  margin-left: -1rem;
  margin-right: -1rem;
  font-family: "PT Sans", Helvetica, Arial, sans-serif;
  color: #ccc;
  text-align: center;
  list-style: none;
}

/* Pagination items can be `span`s or `a`s */
.page-item {
  float: left;
  cursor: pointer;
}
.page-item a {
  display: block;
  padding: 1rem;
}
.page-item:hover {
  text-decoration: underline;
}
.page-item:first-child {
  margin-bottom: -1px;
}
.page-item.active {
  background-color: #faad03;
}
.page-item.active a {
  color: white;
}
.page-item.disabled {
  cursor: default;
}
.page-item.disabled a {
  color: black;
}
.page-item.disabled:hover,
.page-item.disabled a:hover {
  text-decoration: none;
}

/* Only provide a hover state for linked pagination items */
a.page-item:hover {
  background-color: #f5f5f5;
}

@media (max-width: 30em) {
  .pagination {
    margin: 3rem 0;
  }
  .page-item {
    float: left;
    width: 50%;
  }
  .page-item:first-child {
    margin-bottom: 0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }
  .page-item:last-child {
    margin-left: -1px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
  }
}
