:root {
  --background: white;
  --textcolor: black;
  --linkcolor: blue;
  --menubackground: lightgrey;
  /* ADDITION:
    Define navbar height as a variable.
    If you change your .responsive-nav height, just change it here.
  */
  --navbar-height: 40px;
}

body {
  /* MODIFICATION:
    This is now the *single* source of truth for body styling.
    It includes padding for the navbar (top), footer (bottom),
    and side margins (left/right).
  */
  /* REMOVED: padding-top: var(--navbar-height); */
  padding-bottom: 60px; /* Keeps footer from overlapping content */
  padding-left: 1rem; /* From the merged rule */
  padding-right: 2rem; /* From the merged rule */
  margin-top: 30px;
  margin-right: 10px;
  background: var(--background);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: normal;
  color: var(--textcolor);
  line-height: 1.5em;
  text-align: left;
}


a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 2em;
  font-weight: bold;
}

h2 {
  font-size: 1.5em;
  color: black;
  border-bottom: 2px solid lightgrey;
  padding-bottom: 10px;
  margin-top: 40px;
  font-weight: bold;

}

h3 {
  font-size: 1.2em;
  font-weight: bold;

}

/* This was a duplicate h3, I've removed it */

p {
  padding-top: 0em;
  padding-left: 0em;
  padding-bottom: 0em;
  margin-top: 0.2em;
  margin-bottom: 0.2em;
}

ul {
  margin-left: 0em;
  padding-left: 2em;
}

ol {
  margin-left: 0em;
  padding-left: 2.5em;
}

p.small {
  font-size: 0.9em;
}

p.big {
  font-size: 1.2em;
}

li {
  margin-bottom: 0.5em;
  margin-left: 0.5em;
}




/* Optional: make figures use full width too */
img, .figure, .figure > img {
  max-width: 100% !important;
  width: 80% !important;
  height: auto;
  margin-left:auto;
  margin-right: auto;
}


/* Keep the number and heading text on the same first line; wrap only within the text */
h2.anchored:has(.header-section-number),
h3.anchored:has(.header-section-number),
h4.anchored:has(.header-section-number),
h5.anchored:has(.header-section-number),
h6.anchored:has(.header-section-number) {
  display: flex;
  align-items: baseline;
  gap: .4em;        /* space between number and text */
  flex-wrap: nowrap;/* ⟵ don't allow items to move to a new line */
  white-space: normal;
}

/* Number is a fixed-size item */
h2 .header-section-number,
h3 .header-section-number,
h4 .header-section-number,
h5 .header-section-number,
h6 .header-section-number {
  flex: 0 0 auto;
}

/* Let the title text wrap within its own flex item */
h2.anchored, h3.anchored, h4.anchored, h5.anchored, h6.anchored {
  overflow-wrap: anywhere; /* wrapping inside the text flex item */
}

/* Keep the anchor icon parked at the far right if present */
h2.anchored .anchorjs-link,
h3.anchored .anchorjs-link,
h4.anchored .anchorjs-link,
h5.anchored .anchorjs-link,
h6.anchored .anchorjs-link {
  margin-left: auto;
  flex: 0 0 auto;
}

/* Chapter H1: keep number + title on the same line; wrap only the title text */
h1.title:has(.chapter-number) {
  display: flex;
  align-items: baseline;
  gap: .4em;          /* space between number and title (Quarto also has &nbsp;) */
  flex-wrap: nowrap;  /* keep both items on the first line */
  white-space: normal;
}

h1.title .chapter-number {
  flex: 0 0 auto;     /* fixed to its content width */
}

h1.title .chapter-title {
  flex: 1 1 auto;     /* take remaining width, allow wrapping */
  min-width: 0;       /* allow shrink so wrapping works */
  overflow-wrap: anywhere;
}



h1.part .part-number { flex: 0 0 auto; }
h1.part .part-title  { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

/* --- 1. HOMEPAGE LAYOUT  --- */

/* A. Center the Container and set Max Width (Keeps text readable) */
.container {
  max-width: 100vw;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* B. Define 79% width for the main content column (README area) */
 .col-md-9 {
  width: 77% !important; /* Reduced from 80% to fit Bootstrap gutters */
  flex: 0 0 77% !important;
  max-width: 77% !important;
}

/* C. Define 19% width for the right sidebar (Links/License/Developers) */
 .col-md-3 {
  width: 16% !important; /* Reduced from 20% to fit Bootstrap gutters */
  flex: 0 0 16% !important;
  max-width: 16% !important;
  visibility: visible !important;
}



