html {
  background-image: url('../images/papertexture.jpg');
  width: 100%;
  min-height: 100vh;
  background-size: 100%;
  position: relative;
}

/* CSS Reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, img, ins, kbd, q, s, samp,
small, strike, sub, sup, tt, var, u, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

body {
  color: black;
  font-family: 'Times New Roman', Times, serif;
  text-align: left;
  margin: 0 auto 24px auto;
  overflow-x: auto;
}

.page-content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  gap: 15px;
  overflow-x: auto;
  align-items: flex-start; /* Add this line */
}

/* outer shell */
.sidebar {
  position: relative;
  width: 15vw;
  min-width: 12px;
  max-width: 1000px;
  background: linen;
  border-radius: 3px;
  padding: 0;
  float: left;
  margin-top: 0px;
  box-sizing: border-box;
}

/* scrollable layer */
.sidebar-inner {
  overflow-x: auto;
  overflow-y: auto;
  padding: 15px 0 15px 15px;
  box-sizing: border-box;
  height: 80vh;
  scrollbar-width: none; /* Firefox */
}
.sidebar-inner::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}

/* resizer glued to the visible right edge */
.sidebar-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 15px;
  height: 100%;
  cursor: ew-resize;
  background-image: url('../images/blackpapertexture.jpg');
  background-size: contain;
  border-radius: 3px;
  z-index: 10;
  pointer-events: auto;
}

/* Sidebar content styles (move padding-right from .sidebar-list to .sidebar-inner) */
.sidebar-list,
.sidebar-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
  /* Remove padding-right here, handled by .sidebar-inner */
  /* padding-right: 10px; */
}

.sidebar-list ul,
.sidebar-sublist ul {
  /* Remove or set to 0 to avoid double indentation */
  padding-left: 0;
  margin: 0;
}

.sidebar-list li,
.sidebar-sublist li {
  margin-bottom: 4px;
  display: block;
  white-space: nowrap;
  /* Remove previous padding-left, now handled inline for each li */
  position: relative;
}

.sidebar-list a,
.sidebar-sublist a {
  color: #222;
  text-decoration: none;
  display: block;
  padding: 6px 0px;
  border-radius: 3px;
  transition: background 0.2s, color 0.2s;
  font-size: 1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
}

.sidebar-list a:hover,
.sidebar-list a:focus,
.sidebar-sublist a:hover,
.sidebar-sublist a:focus {
  background: #333;
  color: #fff;
}

main {
  flex: 1 1 0;
  background: linen;
  border-radius: 3px;
  margin: 0;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  padding: 25px;
  position: relative;
}

/* Ensure the toggle and link are inline, but sublists stack below */
.sidebar-list > li,
.sidebar-sublist > li {
  display: block;
}

.sidebar-list > li > .sidebar-toggle,
.sidebar-list > li > a,
.sidebar-sublist > li > .sidebar-toggle,
.sidebar-sublist > li > a {
  display: inline;
  vertical-align: middle;
}

.sidebar-collapsible {
  transition: max-height 0.2s cubic-bezier(.4,2,.6,1), opacity 0.2s;
  overflow: visible;
  max-height: 1000px; /* or a large enough value */
  opacity: 1;
  margin-top: 4px; /* Add space above sublists */
}

.sidebar-collapsible.collapsed {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden !important;
}

.sidebar-indent {
  color: #888;
  letter-spacing: 1px;
  font-size: 1em;
  font-family: monospace;
  user-select: none;
  pointer-events: none;
}

/* Restore the previous look for the collapsible arrows */
.sidebar-toggle {
  background: none;
  border: none;
  color: #222;
  font-size: 1em;
  cursor: pointer;
  margin-right: 0;
  margin-left: 0;
  padding: 0;
  user-select: none;
  vertical-align: middle;
  line-height: inherit;
  display: inline-block;
  font-family: inherit;
  appearance: none;
}

/* Optional: make sure the arrow is not bold or stretched */
.sidebar-toggle {
  font-weight: normal;
  font-stretch: normal;
  letter-spacing: normal;
}