.mah-sidebar-section {
  margin-bottom: var(--mah-spacing-xl);
  background-color: var(--mah-bg-white);
  border: 1px solid var(--mah-border-color);
  border-radius: 8px;
  padding: var(--mah-spacing-md);
}

.mah-sidebar-heading {
  font-size: 20px;
  font-weight: 600;
  color: var(--mah-color-blue);
  margin-bottom: var(--mah-spacing-sm);
  margin-top: var(--mah-spacing-sm);
  padding-left: 4px;
  text-align: center;
}

.mah-sidebar-list,
.mah-sidebar-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}


.mah-sidebar-list--numbered {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.mah-sidebar-list--numbered li {
  display: flex;
  gap: 8px; /* space between number and title */
  align-items: flex-start;
  counter-increment: list-counter;
  border-bottom: 1px solid var(--mah-border-color);;
}

.mah-sidebar-list--numbered li::before {
  content: counter(list-counter) ".";
  color: var(--mah-color-blue);
  font-weight: bold;
  flex-shrink: 0;
}

.mah-sidebar-list--bordered li {
  border-bottom: 1px solid var(--mah-border-color);
  padding-bottom: var(--mah-spacing-xs);
  margin-bottom: var(--mah-spacing-xs);
}

.mah-sidebar-item,
.mah-sidebar-subitem {
  margin-bottom: var(--mah-spacing-xs);
}

.mah-sidebar-sublist {
  margin-top: var(--mah-spacing-xs);
  margin-left: var(--mah-spacing-sm);
  border-left: 2px solid var(--mah-border-color-light);
  padding-left: var(--mah-spacing-sm);
}

.mah-sidebar-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-size: 18px;
  color: var(--mah-color-pink);
  transition: color 0.2s ease;
}

.mah-sidebar-link:hover {
  color: var(--mah-color-link-hover);
}

.mah-sidebar-icon {
  margin-right: 15px;
}

.mah-sidebar-text {
  flex: 1;
  word-break: break-word;
}

.mah-notes-posts-sidebar section {
  margin-bottom: var(--mah-spacing-md);
}

.mah-notes-posts-sidebar ol {
  list-style-position: inside;
  padding-left: 0;
  margin: 0;
}

.mah-notes-posts-sidebar li {
  font-size: 16px;
  margin-bottom: var(--mah-spacing-xs);
}

.mah-notes-posts-sidebar li a {
  color: var(--mah-color-blue);
  text-decoration: none;
  border-bottom: 1px solid ;
  border-color: var(--mah-color-pink);
}

.mah-notes-posts-sidebar li a:hover {
  text-decoration: underline;
}


.mah-sidebar-toggle {
  display: none;
  background-color: #2b6cb0;
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-size: 16px;
  border-radius: 5px;
  position: fixed;
  top: 125px;
  left: 1px;
  z-index: 1001;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mah-sidebar-toggle {
    display: inline-block;
  }

  .mah-topic-sidebar {
    position: fixed;
    top: 150px;
    left: 10px;
    right: 10px;
    max-height: 70vh;
    overflow-y: auto;
    background-color: #fff;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 6px;
    padding: 1rem;
  }

  .mah-topic-sidebar.visible {
    display: block !important;
  }
}


.mah-topic-sidebar {
  background-color: #ffffff;
}

.mah-topic-sidebar-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d3748;
}

.mah-topic-group {
  margin-bottom: 1.5rem;
}

.mah-topic-group h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #1a202c;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
}

.mah-topic-post-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.mah-topic-post-list li {
  margin-bottom: 0.25rem;
}

.mah-topic-post-list a {
  text-decoration: none;
  color: #2b6cb0;
  font-size: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-height: 2.8em;
}

.mah-topic-post-list a:hover {
  text-decoration: underline;
}





/* ========== Class Subject Sidebar ========== */
.mah-class-sidebar {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  max-width: 320px;
  margin: 0 auto;
}

.mah-class-sidebar h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
  color: #2d3748;
}

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

.mah-class-sidebar ul li {
  margin-bottom: 0.5rem;
}

.mah-class-sidebar ul li a {
  display: block;
  padding: 8px 12px;
  background-color: #edf2f7;
  border-radius: 4px;
  color: #2b6cb0;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

.mah-class-sidebar ul li a:hover {
  background-color: #e2e8f0;
  text-decoration: underline;
}