html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  box-sizing: border-box;
  margin: 0;
  font-family: "Google Sans Flex";
  padding: 2rem 4rem 0 4rem;
  background-color: var(--background);
  color: var(--foreground);
  transition: color var(--transition-time) ease,
    background-color var(--transition-time) ease;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #888 transparent;

}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #aaa;
}

.layout {
  width: 100%;
  height: calc(100dvh - var(--navHeight));
  display: flex;
}

svg {
  fill: var(--foreground);
  transition: fill var(--transition-time) ease;
}
.layout__content {
  overflow-y: scroll;
  padding: 0rem 1rem 2rem 0rem;
}


.whereAmI {
  color: var(--muted);
  margin-top: 2rem;
  font-family: "Google Sans", sans-serif;
}
/* Nav Bar */
nav {
  padding: 0 0 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.searchBar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0rem 1rem;
  border-radius: 30rem;
  margin: 0rem 4rem 0 1rem;
  border: 1px solid, var(--border);
  transition: border-color var(--transition-time) ease;
}

.searchInput {
  color: var(--foreground);
  transition: color var(--transition-time) ease;
  background-color: transparent;
  width: 100%;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 1rem 0;
}

.searchInput::placeholder {
  color: var(--muted);
}

.hamburgerMenu {
  height: 30px;
  width: 30px;
  display: none;
}
.searchIcon {
  height: 20px;
  width: 20px;
}
.gitHub,
.theme-toggler,
.sun,
.moon {
  height: 30px;
  width: 30px;
  cursor: pointer;
}
.githubAndLightToggler {
  display: flex;
  gap: 1.3rem;
  align-items: center;
}

.theme-toggler {
  height: 30px;
  width: 30px;
  position: relative;
}
.theme-icon {
  position: absolute;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.hide {
  opacity: 0;
  pointer-events: none;
}

/* Side Bar */
.sidebar {
  box-sizing: border-box;
  padding: 2rem 1rem;
  width: 300px;
  height: calc(100dvh - var(--navHeight));
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li {
  margin: 0;
  padding: 0;
  line-height: 1;
}
.sidebar .folder-toggle:hover,
.sidebar a:hover {
  color: var(--accent);
  border-radius: 5px;
}
.openedArticle {
  font-weight: 900;
  color: var(--accent);
}
.sidebarHeader {
  display: none;
  align-items: center;
}
.sidebarTitle {
  font-size: 1.5rem;
  margin: 0;
}

a {
  text-decoration: none;
  color: var(--foreground);
  transition: color var(--transition-time) ease;
  display: block;
  padding: 0.3rem 0; /* only this creates spacing now */
}

.folder-toggle {
  cursor: pointer;
  display: block;
  margin: 6px 0;
}

.folder-toggle::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0var (--transition-time);
}

.folder.open > .folder-toggle::before {
  transform: rotate(90deg);
}

.folder ul {
  display: none;
  border-left: 1px solid var(--border);
  transition: border-color var(--transition-time) ease;
  margin-left: 0.25rem;
  padding: 0.5rem 1rem;
}

.folder.open > ul {
  display: block;
}

.nextPrev {
  font-size: 1.1rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin: 2rem 0 0rem 0;
}
.nextPrev a {
  display: flex;
  align-items: center;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0 1rem 0;
}
.logo {
  height: 40px;
  width: auto;
}
.sidebarItems {
  overflow-y: scroll;
}


/* Media Query */
@media screen and (max-width: 500px) {
  :root {
    --navHeight: 80px;
  }
  body {
    padding: 1rem 1.5rem 0 1.5rem;
  }
  .hamburgerMenu {
    display: block;
  }
  .nav {
    gap: 0.75;
  }
  .logo {
    display: none;
  }
  .searchInput {
    padding: 0.6rem 0;
  }
  .gitHub,
  .theme-toggler,
  .sun,
  .moon {
    height: 25px;
    width: 25px;
  }
  .githubAndLightToggler {
    gap: 0.5rem;
  }
  .searchBar {
    margin-right: 1rem;
  }
  .sidebar {
    width: 320px;
    position: absolute;
    left: 0;
    top: 0;
    padding: 0;
    background-color: var(--background);
    overflow-y: hidden;
    z-index: 1000;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.1s ease-in-out;
  }
  .sidebarItems {
    height: calc(100dvh - var(--navHeight) - 1rem);
  }
  .level-0 {
    margin-left: 2rem !important;
  }
  .logo-phone {
    height: 30px;
    width: 30px;
  }
  .sidebarHeader {
    padding-bottom: 1rem;
    margin: 1.5rem;
    margin-bottom: 1rem;
    gap: 1rem;
    display: flex;
    justify-content: space-between;
    border-bottom: solid 1px var(--border);
  }
  .sidebarLogoContainer {
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  .sidebarTitle::after {
    display: none;
  }
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    pointer-events: none;
    z-index: 999;
    transition: background-color 0.1s ease, backdrop-filter 0.1s ease;
  }
  .overlay.active {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    pointer-events: all;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .whereAmI {
    margin-top: 1rem;
  }
}
