/* Breadcrumb */
        .breadcrumb {
            padding: 15px 0;
            background-color: var(--bg-color);
            border-bottom: 1px solid var(--border-color);
        }

        .breadcrumb .container {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .breadcrumb a {
            color: var(--primary-color);
            text-decoration: none;
            transition: color 0.3s;
        }

        .breadcrumb a:hover {
            color: var(--secondary-color);
        }

        .breadcrumb span {
            color: var(--text-color);
        }
        
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: #f9f9f9;
  color: #222;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}
header {
  background: #0066cc;
  color: white;
  padding: 10px 20px;
  transition: background 0.3s ease;
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.logo {
  display: flex;
  align-items: center;
}
.logo img {
  height: 40px;
  margin-right: 10px;
}
.nav-links ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}
.mobile-menu-btn {
  display: none;
  cursor: pointer;
  font-size: 22px;
}

#search-bar {
  width: 90%;
  max-width: 600px;
  margin: 15px auto;
}
#search-input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.container-main {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 15px;
  flex-wrap: wrap; /* Changed to wrap to handle smaller screens better */
}

.main-content {
  flex: 1;
  background: #fff;
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-left: 0; /* Removed margin-left to avoid unnecessary spacing on phones */
  margin-right: 0;
  order: 1;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.sidebar {
  flex: 0 0 250px;
  order: 2; /* Changed to ensure sidebar appears after main content */
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 80px;
  height: fit-content;
  transition: background 0.3s ease, border-color 0.3s ease;
  display: none; /* Hidden by default */
}

h1, h2, h3 {
  color: #333;
  transition: color 0.3s ease;
}

ol li { margin-bottom: 20px; }

.essay-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
  border: 1px solid #ccc;
  border-radius: 5px;
  transition: border-color 0.3s ease;
}

footer {
  background: #0066cc;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 20px;
  transition: background 0.3s ease;
}

.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #007bff;
  color: white;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

body.dark {
  background: #222;
  color: #ddd;
}
body.dark .main-content, body.dark .sidebar {
  background: #333;
  border-color: #555;
}
body.dark h1, body.dark h2, body.dark h3 {
  color: #f0f0f0;
}
body.dark a {
  color: #9cf;
}
body.dark #search-input {
  background: #444;
  border-color: #666;
  color: #ddd;
}
body.dark .essay-image {
  border-color: #666;
}

/* Hide sidebar on phone screens (below 768px) */
@media (max-width: 767px) {
  .container-main {
    flex-direction: column; /* Stack main content and sidebar (if visible) vertically */
  }
  .sidebar {
    display: none; /* Ensure sidebar is hidden on phone screens */
  }
  .main-content {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Show sidebar on tablet, PC, and desktop (screens >= 768px) */
@media (min-width: 768px) {
  .sidebar {
    display: block; /* Show sidebar on larger screens */
    margin-left: 15px;
  }
  .container-main {
    flex-direction: row; /* Side-by-side layout for main content and sidebar */
  }
  .main-content {
    margin-right: 15px;
  }
}

/* Adjustments for tablet and smaller desktop screens (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar {
    flex: 0 0 200px; /* Slightly narrower sidebar for tablets */
    margin-left: 10px;
  }
  .main-content {
    margin-right: 10px;
  }
}