html {
  font-family: var(--sans-font);
  font-weight: var(--mid-font-weight);
  scroll-behavior: smooth;
  scroll-padding-top: 0; /* Ensure no padding above the topmost element */
}

body {
  color: var(--text-light);
  background-color: var(--bg);
  font-size: 1.15rem;
  line-height: 1.5;
  display: grid;
  grid-template-columns: auto 1fr;
  height: 100vh; /* Ensure the body takes full viewport height */
  overflow: hidden; /* Prevent body scrolling */
  margin: 0;
  padding: 0;
  cursor: default;
  scroll-snap-type: y mandatory; /* Enable scroll snapping */
}
body>nav {
  grid-column: 1;
}

main {
  grid-column: 2;
  overflow-y: auto; /* Enable scrolling for the main content */
  margin: 0;
  padding: 0;
  height: 100%; /* Ensure main takes full height of the body */
}
article h2:first-child,
section h2:first-child,
article h3:first-child,
section h3:first-child {
  margin-top: 1rem;
}
section {
  margin-block: 0rem;
  padding: 1rem calc((100% - 75rem) / 2);
  justify-content: center;
  align-items: center;
}

section:last-child {
  padding-bottom: 1rem;
}
section h2 {
  color: var(--sub-accent);
}
section:nth-child(even) {
  background-color: var(--bg-alt);
}
section:nth-child(even) article {
  background-color: var(--bg);
}

/* Ensure proper theming for table rows */
tr:nth-child(odd) {
  background-color: var(--accent-bg);
}

section > * {
  grid-column: 2;
}

section > table {
  width: 100%;
  border-collapse: collapse;
}
footer {
  width: 100%;
  border-top: 1px solid var(--text-light);
  user-select: none;
  place-items: center; /* Simplify centering */
  z-index: 1;
  margin-top: auto; /* Ensure footer stays at the bottom */
  position: relative; /* Default position */
}

footer p
{
  margin: 0.5rem;
  font-size: 0.75rem;
}

td,
th {
  text-align: start;
  padding: 0.5rem;
}

tr.divide {
  border-top: var(--light-border-weight) dashed var(--text-light);
}

table caption {
  line-height: 1.1;
  font-weight: var(--light-font-weight);
  font-size: 1.5rem;
  color: var(--sub-accent);
}
aside,
details,
pre,
progress {
  background-color: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--standard-border-radius);
  margin-bottom: 1rem;
}

aside {
  font-size: 1rem;
  width: 100%;
  padding: 0 1rem;
  margin-inline-start: 1rem;
  float: right;
}

*[dir="rtl"] aside {
  float: left;
}

/* Misc body elements */
hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 1rem auto;
}

/* Use mono font for code elements */
code,
pre,
pre span,
kbd,
samp {
  font-family: var(--mono-font);
  color: var(--code);
}

kbd {
  color: var(--preformatted);
  border: 1px solid var(--preformatted);
  border-bottom: 3px solid var(--preformatted);
  border-radius: var(--standard-border-radius);
  padding: 0.1rem 0.4rem;
}

pre {
  padding: 1rem 1.4rem;
  max-width: 100%;
  overflow: auto;
  color: var(--preformatted);
}

pre code {
  color: var(--preformatted);
  background: none;
  margin: 0;
  padding: 0;
}
