* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;  
  
  --text-color: #000;
  --back-color: #fff;
  --link-color: blue; 
}

@media only screen and (prefers-color-scheme: dark) {
  * {
    --text-color: #fff;
    --back-color: #000;
  }
}

body {
  font: 18px / 1.45 system-ui, sans-serif;
  color: var(--text-color);
  background: var(--back-color);
  position: relative;
  max-width: 72ch; /* column width */
  margin: 0 auto;
}

/* Show & hide sections */

section, section:target ~ section:last-of-type {
  height: 0;
  overflow: hidden;
  padding: 0;
}

section:target, section:last-of-type {
  height: auto;
  overflow: visible;
  padding: calc(5vw + 3.4em) 4vw 2.1em;
}

/* tabindex="0" */

section:focus {
  outline: 0;
}

/* Vertical spacing */

section * + * {
  margin-top: .8em;
}

/* Header */

/* header {
  padding: 5vw 4vw 0 4vw;
  position: absolute;
  width: 100%;
  z-index: 1;
} */

/* Ensure the header uses flexbox to align items in a row */
/* Ensure header menu and title are in a row */
header {
  padding: 5vw 4vw 0 4vw;
  position: absolute;
  width: 100%;
  z-index: 1;
  display: flex;
  justify-content: space-between; /* Pushes title left, menu right */
  align-items: center;
}

/* Header nav (top-right menu) */
.header-nav {
  margin-left: auto; /* Pushes nav to the right */
}

.header-nav ul {
  list-style: none;
  display: flex;
  gap: 20px; /* Spaces out menu items */
  padding: 0;
  margin: 0;
}

.header-nav ul li {
  margin: 0;
}

.header-nav ul li a {
  color: var(--link-color);
  text-decoration: none;
  overflow-wrap: break-word;
  /* color: black;
  font-weight: bold; */
  padding: 10px 15px;
  display: block;
}

.header-nav ul li a:hover {
  /* color: #007bff; */
  color: var(--link-color);
  text-decoration: underline;
}


/* Styles for the main list (inside <section>) */
.main-nav ul {
  display: block; /* Ensures it's a vertical list */
  text-align: left; /* Aligns it to the left */
}

/* Ensure nav follows flexbox behavior */
.main-nav {
  margin-top: 20px;
}

.main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block; /* Keeps items in a vertical list */
  text-align: left; /* Ensures left alignment */
}

/* Styles for the main list items */
.main-nav ul li {
  margin-bottom: 10px;
}

.main-nav ul li a {
  text-decoration: none;
  color: var(--text-color);
}

.main-nav ul li time {
  font-size: 0.9em;
  color: gray;
}


/* Footer */

footer {
  padding: 0 4vw 5vw 4vw;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

footer * + * {
  margin-top: 0;
}

/* Table of contents */

ul.toc {
  overflow: hidden;
}

ul.toc * + * {
  margin: 0;
}

ul.toc li {
  position: relative;
  display: flex;
  align-items: flex-end;
  margin: 0;
}

ul.toc li + li {
  margin: .25em 0 0 0;
}

ul.toc li a {
  color: currentColor;
  flex: 1;
}

ul.toc li a:hover {
  color: var(--link-color);
}

ul.toc li a span {
  background: var(--back-color);
  padding-right: .3em;
}

ul.toc li time {
  font-variant-numeric: tabular-nums;
  z-index: 1;
  padding-left:.3em;
  background: var(--back-color);
}

ul.toc li a:after {
  width: 100%;
  font-size: .55em;
  position: absolute;
  bottom: .4em;
  white-space: nowrap;
  content:
  ' . . . . . . . . . . . . . . . . . . . . . .'
  ' . . . . . . . . . . . . . . . . . . . . . .'
  ' . . . . . . . . . . . . . . . . . . . . . .'
  ' . . . . . . . . . . . . . . . . . . . . . .'
  ' . . . . . . . . . . . . . . . . . . . . . .'
  ' . . . . . . . . . . . . . . . . . . . . . .';
}

/* General */

a {
  color: var(--link-color);
  text-decoration: none;
  overflow-wrap: break-word;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {text-decoration: underline;}
}

/* a[href*="//"]:after, a[href^="mailto:"]:after {
  font-size: .8em;
  content: "\2197"; /* top right arrow: ↗ */
} */

a.external[href*="//"]::after, 
a.external[href^="mailto:"]::after {
  font-size: 0.8em;
  content: "\2197"; /* top right arrow: ↗ */
  display: inline-block; /* Ensures it appears */
  margin-left: 5px; /* Adds spacing from text */
}

/* Headings */

/* header h1 a {
  font-weight: normal;
  display: block;
} */

section h1 {
  margin-bottom: 1.2em;
}

h1, h2, h3, h4, strong, b, dt {
  font-size: 1em;
  font-weight: bold;
}

* + h2, * + h3, * + h4 {
  margin-top: 1.4em;
}

h3 {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .9em;
  font-weight: normal;
}

/* Lists */

li, dd {
  margin-left: 1.25em;
}

li + li, li ol, li ul {
  margin-top: .1em;
}

.footnotes li {
  margin-top:.5em;
  max-width:95%;
}

/* Images */

img {
  display: block;
  max-width: 100%;
  min-height:4em;
  height: auto;
  position: relative;
}

img:after { /* style offline images */
  content: attr(alt);
  display: grid;
  align-content:center;
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-size: .865em;
  text-align: center;
  border:1px dashed;
  background-color: var(--back-color);
}

figure {
  padding: 1em;
}

figcaption {
  opacity: .6;
}

figcaption, small, .footnotes {
  font-size: .865em;
}

/* Other elements */

blockquote {
  padding-left: 1em;
  border-left:1px dotted;
}

abbr[title] {
  text-decoration: none;
  cursor: help;
}

a abbr[title] {
  cursor: pointer;
  color: inherit;
}

hr {
  border: 0;
  height: 0;
  border-bottom: 1px solid;
  opacity: .1;
  margin: 1.4em 0;
}

sup {
  line-height: 1;
  font-size: .75em;
}

code, kbd {
  font-family: ui-monospace, SF Mono, SFMono-Regular, Menlo, Andale Mono, monospace;
  overflow-wrap: break-word;
  font-size:.98em;
  opacity: .7;
}

kbd {
  box-shadow:0 .5px 1px;
  border-radius:2px;
  padding:.1em .325em .075em .325em;
  margin: 0 .1em;
}

pre {
  overflow: auto;
  padding: .5em .85em .6em .85em;
  background: rgba(0,0,0,.025);  
  border-radius: 4px;
  margin: 1em 0;
}

pre code {
  position: relative;
  display:block;
  overflow-wrap: normal;
}

pre code:after {
  content: attr(class);
  position: absolute;
  right: -.6em;
  top: -.3em;
  text-transform: uppercase;
  font-size: .7em;
  opacity:.6;
}

.published-paragraph {
  margin: 0 0 30px 0;
}

.small {
  font-size: 0.75em;
}

/* Tables */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

thead {
  text-align: left;
  border-bottom: 1px solid;
}

th, td {
  padding: .4em .3em .2em;
}

/* Disable footnotes #links */

sup a {
  color: currentColor;
  pointer-events: none;
}

a.footnote-backref {
  display: none;
}

/* Print */

@media print {
  
  * {
    --back-color: #fff;
  } 
  
  header {
    position: relative;
  }
  
  section {
    height: auto;
    overflow: visible;
    
    page-break-after: always;
    page-break-inside: avoid;
    break-inside: avoid;
    display: block;
    padding: 2em 4vw;
  }

  section * {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  footer {
    display: none;
  }
  
}

/* Smaller screens */

@media only screen and (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1em;
  }

  .header-nav ul {
    flex-direction: column;
    gap: 0.5em;
  }

  ul.toc li {
    flex-direction: column;
    align-items: flex-start;
  }

  ul.toc li time {
    padding-left: 0;
    margin-top: 0.3em;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
  }
}

@supports (-webkit-touch-callout: none) {
  nav ul {
    display: flex !important;
    flex-wrap: nowrap !important; /* Prevents wrapping */
  }
}
