body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: #000;
  transition: background-color 0.3s, color 0.3s;
}

html {
  scroll-behavior: smooth;
}

.wrapper {
  display: flex;
  align-items: stretch;
}

.sidebar img {
  width: 100%;
  height: auto; 
  max-height: 200px; 
  display: block;
  margin: 0 auto; 
}

.sidebar {
  width: 230px;
  background-color: #f1f1f1;
  border-right: 2px solid #ccc;
  padding: 0;
  margin: 0;
  height: 100vh;
  position: fixed;
  overflow-y: auto;
  transition: background-color 0.3s, color 0.3s;
}

.sidebar h3 {
  padding: 15px;
  margin: 0;
  background: #ddd;
  text-align: center;
}

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

.sidebar ul li {
  border-bottom: 1px solid #ccc;
}

.sidebar ul li a {
  display: block;
  padding: 12px;
  color: #0077cc;
  text-decoration: none;
}

.sidebar ul li a:hover {
  background: #0077cc;
  color: white;
}

.content {
  margin-left: 230px;
  padding: 20px;
  max-width: 900px;
}

.toc {
  position: fixed;
  right: 20px;
  top: 80px;
  width: 250px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 15px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s, color 0.3s;
}

.toc h2 {
  margin-top: 0;
  font-size: 1.4em;
  color: #444;
}

.toc ul {
  list-style-type: none;
  padding: 0;
}

.toc ul li {
  margin: 8px 0;
}

.toc ul li a {
  text-decoration: none;
  color: #0077cc;
}

.toc ul li a:hover {
  text-decoration: underline;
}

section {
  margin-bottom: 40px;
}

footer {
  text-align: center;
  font-size: 0.9em;
  color: #777;
  border-top: 1px solid #ddd;
  padding-top: 10px;
  margin-top: 40px;
}

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

.dark-mode .sidebar {
  background-color: #1e1e1e;
  color: white;
  border-right: 2px solid #444;
}

.dark-mode .sidebar h3 {
  background: #333;
}

.dark-mode .sidebar ul li {
  border-bottom: 1px solid #444;
}

.dark-mode .sidebar ul li a {
  color: #66b3ff;
}

.dark-mode .sidebar ul li a:hover {
  background: #66b3ff;
  color: black;
}

.dark-mode .toc {
  background: #222;
  border: 1px solid #444;
  color: white;
}

.dark-mode .toc h2 {
  color: #fff;
}

.dark-mode .toc ul li a {
  color: #66b3ff;
}

.dark-mode-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  padding: 8px 15px;
  background-color: #333;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.dark-mode-toggle:hover {
  background-color: #555;
}

.gallery-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  padding: 20px;
}

.gallery-container img {
  width: 18%;
  max-width: 250px;
  height: auto;
  cursor: pointer;
}

#imageModal {
  display: none;
  position: fixed;
  z-index: 1;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

#modalContent {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
}

#imageModal .close {
  position: absolute;
  top: 20px;
  right: 45px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

#imageModal .close:hover,
#imageModal .close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

.image-adjuster {
  max-width: 100%;
  width: 200px;
  height: auto;
}
