/* =========================
   Base / Reset
   ========================= */
* {
  margin: 0;
  padding: 0;
  display: border-box;
}

body {
  margin: 0;
  padding: 2rem;
  height: 100%;
  font-size: small;
  font-family: 'Roboto', system-ui, sans-serif;

  display: flex;
  justify-content: center;
  align-items: center;

  background: #d5d6d7;
}

/* =========================
   Wrappers
   ========================= */
#wrapper {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  width: 100%;

  border-radius: 8px;
  background: #ffffff;
  color: #333333;
  overflow: hidden;
}

#home-wrapper {
  display: flex;
  flex: 1;
  padding: 2rem;
  gap: 2rem;
}

#page-wrapper {
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

#page-wrapper > p > img {
  max-width: 100%;
}

/* =========================
   Header
   ========================= */
header {
  display: flex;
  justify-content: space-between; /* title left, nav right */
  align-items: center;
  padding: 1rem 2rem;
  background-color: #f8f8f8;
  border-bottom: 1px solid #ddd;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

header .navbar ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

header .navbar a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

/* =========================
   Main Content Layout
   ========================= */

.heading {
  font-family: 'Montserrat', system-ui, sans-serif;
}
#home-wrapper,
#page-wrapper {
  gap: 2rem;
}

#page-wrapper .footnotes ol {
  padding: 1;
}

#pagelist {
  flex: 3; /* 75% */
}

#sidebar {
  flex: 1; /* 25% */
}

#pagelist article {
  margin-bottom: 2rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

#pagelist h2,
#sidebar h2 {
  margin-top: 0;
}

/* Base tree styling */
#sidebar ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.95rem;
}

#sidebar li {
  margin: 0.25rem 0;
  line-height: 1.4;
}

/* Optional arrow marker inside the li content */
#sidebar li > a::before {
  content: "› "; /* note space after arrow */
  color: #888;
  font-size: 0.85em;
}

/* Nested lists (children) */
#sidebar li ul {
  padding-left: 1.2em;  /* better than margin-left */
  margin-top: 0.21rem;
}


#sidebar li ul li::before {
  content: "›";           /* repeat marker for children */
  left: 0;
  color: #aaa;            /* lighter for nested */
}

/* Link styling */
#sidebar a {
  text-decoration: none;
  color: #333;
  transition: color 0.2s;
}

#sidebar a:hover {
  color: #2563eb;         /* accent color */
}

/* Optional: compact visual separator for nested group */
#sidebar li ul li {
  margin: 0.15rem 0;
}

/* =========================
   Pagination
   ========================= */
#pagelist > ul.pagination {
  list-style: none;
  display: flex;
  justify-content: space-between; /* split edges + center numbers */
  align-items: center;
  padding: 0;
  margin: 2rem auto;
  max-width: 500px;
}

#pagelist > ul.pagination li {
  margin: 0 0.25rem;
}

#pagelist > ul.pagination a.page-link {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  background: #f2f2f2;
  transition: background 0.2s, color 0.2s;
}

#pagelist > ul.pagination a.page-link:hover:not([aria-disabled="true"]) {
  background: #e5e7eb;
  color: #111;
}

#pagelist > ul.pagination li.active a.page-link {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

#pagelist > ul.pagination li.disabled a.page-link {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f2f2f2;
}

#pagelist > ul.pagination li:first-child,
#pagelist > ul.pagination li:nth-child(2) {
  margin-right: auto;
}

#pagelist > ul.pagination li:last-child,
#pagelist > ul.pagination li:nth-last-child(2) {
  margin-left: auto;
}

/* =========================
   Footer
   ========================= */
footer {
  border-top: 1px solid #ddd;
  background-color: #f8f8f8;
  padding: 1rem 0;
  display: flex;
  justify-content: center;
}

footer .navbar ul {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

footer .navbar a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}
