body {
  margin: 0;
  font-family: sans-serif;
  background-color: white;
  color: black;
  transition: background-color 0.3s, color 0.3s;
}

div p {
  line-height: 130%;
}

div h3 {
line-height: 14pt;
margin-top: 30pt;
margin-bottom: 0;
}

/* Dark mode styles */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

/* Ensure fixed elements adapt to dark mode */
.ahl {
  color: rgba(0, 0, 0, 0.829);
  font-family: Poppins;
  font-weight: 500;
  font-size: 19pt;
  margin: 20px;
  position: fixed;
  top: 0;
  left: 0;
  letter-spacing: -1pt;
  z-index: 1000;
  background-color: white;
}

body.dark-mode .ahl {
  background-color: #121212;
  color: #e0e0e0;
}

.ahl a {
  text-decoration: none;
  color: black;
}

body.dark-mode .ahl a {
  color: #e0e0e0;
}

.top-menu {
  position: fixed;
  right: 1em;
  top: 2em;
  margin-left: 20px;
  z-index: 999;
  background-color: white;
  padding: 0.5em;
  border-radius: 5px;
}

body.dark-mode .top-menu {
  background-color: #1e1e1e;
}

.filter-links {
  position: fixed;
  top: 0em;
  padding-top: 3.5em;
  width: 95%;
  z-index: 998;
  background-color: white;
}

body.dark-mode .filter-links {
  background-color: #121212;
}

.post-meta {
  line-height: 40%;
}

.post-list {
  margin-top: 1em;
  margin-left: 6em;
}

body.dark-mode .post-list {
  background-color: #121212;
}

.post-item {
  max-height: calc(70vh - 20px);
  font-size: 14pt;
  margin-bottom: 5px;
  margin-left: 5em;
  overflow-y: auto;
}

.post-item::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.post-item a {
  text-decoration: none;
  font-weight: bold;
  color: #000000;
}

body.dark-mode .post-item a {
  color: #e0e0e0;
}

.post-item a:hover {
  text-decoration: underline;
  color: #1e90ff;
}

.post-item p {
  color:rgb(114, 114, 114);
  line-height: 10px; /* adjust linespace in post list */
}

body.dark-mode .post-item a:hover {
  color: #40c4ff;
}

.filter-link {
  text-decoration: none;
  color: #0000008a;
}

body.dark-mode .filter-link {
  color: #722a2a;
}

.filter-link:hover {
  text-decoration: underline;
  color: #002aff;
}

body.dark-mode .filter-link:hover {
  color: #40c4ff;
}

.categorylinks {
  font-size: 10pt;
  margin-left: 20px;
  margin-top: 0em;
}

.taglinks {
  font-family: "arial";
  font-weight: bold;
  line-height: 130%;
  font-size: 11pt;
  margin-left: 20px;
}

.postlist-tag {
  font-family: "arial";
  font-weight: bold;
  line-height: 130%;
  font-size: 11pt;
}

div.post-item {
  color: rgb(0, 0, 0);
  line-height: 10px;
}

.post-content {
  margin: 3cm;
}

body.dark-mode .post-content {
  background-color: #121212;
}

.btn {
  display: inline-block;
  padding: 0.1em 0.7em;
  color: rgb(0, 0, 0);
  text-decoration: none;
  border-radius: 4px;
  border: 1pt solid rgb(110, 107, 107);
  font-size: 10pt;
  background-color: #f5f5f5;
  cursor: pointer;
}

body.dark-mode .btn {
  color: #e0e0e0;
  background-color: #2a2a2a;
  border-color: #666;
}

@media (max-width: 600px) {
  .top-menu {
    position: fixed;
    right: 0.5em;
    top: 1.5em;
    margin-left: 10px;
    font-size: 80%;
    background-color: white;
  }

  body.dark-mode .top-menu {
    background-color: #1e1e1e;
  }

  .filter-links {
    top: 0em;
    padding-top: 3em;
    left: 0px;
    background-color: white;
  }

  body.dark-mode .filter-links {
    background-color: #121212;
  }

  .filter-links p {
    font-size: 8pt;
  }

  .post-item {
    margin-top: 0em;
    margin-left: 0.5em;
    background-color: white;
  }

  .postlist-tag {
  font-size: 9px;
  }
  body.dark-mode .post-list {
    background-color: #121212;
  }

   .post-date {
    font-size: 9pt;
  }

  .pagination {
    margin-top: 2em;
    margin-left: 0.5em;
    display: flex;
    font-size: 9pt;
  }

  .ahl {
    font-size: 16pt;
  }

  body.dark-mode .ahl {
    background-color: #121212;
  }

  .post-content {
    margin-top: 3cm;
    margin-left: 0.5em;
    background-color: white;
    font-size: 90%;
  }

  body.dark-mode .post-content {
    background-color: #121212;
  }
}