@import url("https://fonts.googleapis.com/css2?family=PT+Mono&family=PT+Sans:wght@400;700&display=swap");

/* === Grid and base layout === */

:root {
  --highlight: #aabf9f;
  --highlight-darker: #91a18b;
  --body-pad-top: 60px;
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

a {
  color: #788673;
}

body {
  display: grid;
  margin: 0;
  padding: var(--body-pad-top) 15px;
  min-width: 350px;
  grid: auto / 235px minmax(300px, 600px);
  align-items: start;
  justify-content: center;
  column-gap: 50px;
  font: 16px/1.3 "PT Sans", sans-serif;
  color: #333;
  background: #f7f5f0;
  font-size: 17px;
}

@media (scripting: enabled) {
  [loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s;
  }
}

ol li,
ul li {
  margin-bottom: 10px;
}

ol,
ul {
  margin: 0;
}

.wide {
  grid-column: 1 / -1;
  text-align: center;
  margin-bottom: 70px;
  margin-top: 25px;
  z-index: 9;
}

nav {
  position: sticky;
  top: var(--body-pad-top);
  max-height: calc(100vh - var(--body-pad-top));
  overflow-y: auto;
  overflow-x: hidden;
}

/* For Chrome, Safari, WebKit-based browsers */
nav::-webkit-scrollbar {
  width: 6px; /* width of the entire scrollbar */
}

nav::-webkit-scrollbar-track {
  background-color: #ffffff; /* track (behind the thumb) */
}

nav::-webkit-scrollbar-thumb {
  background-color: var(--highlight-darker); /* scrollbar thumb */
  border-radius: 4px; /* rounded corners, optional */
}

nav::-webkit-scrollbar-thumb:hover {
  background-color: #555; /* darker on hover, optional */
}

nav {
  scrollbar-width: thin; /* "auto" or "thin" */
  scrollbar-color: var(--highlight-darker) #ffffff; /* thumb color, then track color */
}

article {
  margin-top: -50px;
  padding-top: 50px;
}

/* === Navbar and marker === */

nav ul {
  margin: 0;
  padding-left: 8px;
  list-style: none;
}

nav ul li {
  margin-bottom: 6px;
}

nav ul li:first-child {
  padding-top: 0;
}

nav li > ul {
  padding-left: 30px;
}

nav ul ul {
  padding-left: 15px;
  margin-bottom: 0;
  margin-top: 0;
}

nav a {
  display: inline-block;
  color: #7f7f7f;
  text-decoration: none;
  transition: all 300ms ease-in-out;
  padding-top: 5px;
  padding-bottom: 3px;
  font-size: 15px;
  text-wrap: pretty;
  line-height: 17px;
}

nav a:hover {
  color: #222;
}

nav li.visible > a {
  color: #000000;
  transform: translate(8px);
}

nav svg {
  position: absolute;
  left: -5px;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

nav path {
  transition: all 300ms ease;
  fill: transparent;
  stroke: var(--highlight);
  stroke-width: 3px;
  stroke-dasharray: 0 0 0 1000;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Body contents === */

section[id] {
  margin: 0;
  padding: 70px 0 0;
}

h1,
h2 {
  margin: 0;
  padding: 0;
  font-size: 36px;
}

h2 {
  padding-left: 10px;
  border-left: 4px solid var(--highlight);
  font-size: 24px;
}

h1 span,
.subheading {
  display: block;
  color: #666;
  font-size: 24px;
}

article a {
  /* color: #222; */
  -webkit-text-decoration-color: var(--highlight);
  text-decoration-color: var(--highlight);
}

article a:hover {
  margin: -2px;
  padding: 2px;
  border: 0;
  background: var(--highlight);
}

/* === Adjustments === */

/* Scroll all the way up even if the first section starts a couple hundred pixels down the page */
section:first-of-type {
  margin-top: -300px;
  padding-top: 300px;
}

article,
section:last-of-type,
section:last-of-type p:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
}

section img {
  cursor: zoom-in;
}

.indent {
  text-indent: 2em;
}

.italic {
  font-style: italic;
}

table {
  border: 1px solid #ccc;
  border-spacing: 0;
  margin-bottom: 25px;
}

table td,
table th {
  padding: 5px 10px;
  min-width: 50px;
  text-wrap: pretty;
  text-align: left;
}

@media (max-width: 980px) {
  .overflow-table {
    overflow-x: auto;
  }
  table.parents {
    max-width: 700px;
    white-space: nowrap;
  }
}

@media all and (min-width: 981px) {
  table.parents .sticky {
    position: sticky;
    top: 40px;
  }
}

table.parents td,
table.parents th {
  min-width: 10px;
  font-size: 15px;
  padding: 5px;
}

table tr:last-child td {
  border: 0;
}

table td,
table th {
  border-bottom: 1px solid #ccc;
}

table tr:hover {
  background: #d6d6d6;
}

h2.inner-chapter-heading {
  border: 0;
  text-align: center;
  font-size: 22px;
}

h3.subheading {
  margin-top: 5px;
  font-size: 20px;
  font-weight: normal;
  text-align: center;
}

p + h3 {
  margin-top: 30px;
  margin-bottom: -5px;
}

p a {
  font-weight: bold;
}

.bold {
  font-weight: bold;
}

img {
  width: 100%;
  height: auto;
  border: 1px solid #dce0d8;
  box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px;
}

mark {
  background: yellow;
}

mark.current {
  background: orange;
}

.header {
  padding: 10px;
  width: 100%;
  background: #eee;
  position: fixed;
  top: 0;
  left: 0;
  text-align: center;
  z-index: 999;
}

.header button {
  padding: 2px 6px;
  font-size: 15px;
}

@media all and (max-width: 400px) {
  .header button {
    padding: 1px 3px;
    font-size: 11px;
  }
}

.header input {
  background: #fff;
  font-size: 16px;
  margin-right: 5px;
  border: 0;
  padding: 3px;
}

/* Overlay container */
.image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Expanded image */
.image-overlay img {
  max-width: 1200px;
  width: 98%;
  max-height: 75vh;
  object-fit: contain;
  box-shadow: none;
  border: 0;
  background: #fff;
}

/* Close button */
.image-overlay .close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  z-index: 1001;
}

.two-cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.two-cols .column {
  width: 48%;
}

span.caption {
  display: block;
  text-align: center;
}

@media all and (max-width: 930px) {
  img {
    min-height: auto !important;
  }
}

.nav-toggle,
.nav-toggle-bg {
  display: none;
}

/* Mobile navigation styles */
/* Mobile navigation styles */
@media all and (max-width: 760px) {
  body {
    display: block;
    padding-left: 25px;
    padding-right: 25px;
    padding-top: 95px; /* Add space for the fixed dropdown */
  }

  .nav-toggle-bg {
    position: fixed;
    display: block;
    background: #eee;
    width: 100%;
    height: 75px;
    left: 0;
    top: 0px;
    padding: 5px;
    z-index: 99;
  }

  /* Mobile dropdown nav */
  .nav-toggle {
    display: inline-flex;
    position: fixed;
    top: 55px;
    left: 0;
    z-index: 1001;
    background: #cadcc1;
    border: none;
    border-radius: 4px;
    padding: 12px 15px;
    padding-right: 30px;
    cursor: pointer;
    font-size: 15px;
    /* font-weight: bold; */
    color: #474747;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: left;
  }

  .nav-toggle svg {
    flex-shrink: 0;
  }

  .nav-toggle::after {
    content: "▼";
    font-size: 12px;
    transition: transform 0.3s ease;
    position: absolute;
    z-index: 99;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
  }

  /* .nav-toggle.open::after {
    transform: rotate(180deg);
    top: 30%;
  } */

  /* Mobile nav container */
  nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 15px;
    right: 15px;
    max-height: 80vh;
    background: white;
    z-index: 1000;
    padding: 15px;
    overflow-y: auto;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  }

  nav ul {
    margin-top: 35px;
  }

  /* When nav is open */
  nav.open {
    display: block;
  }

  nav.open svg {
    display: none;
  }

  /* Style nav items for mobile */
  nav ul li {
    margin-bottom: 10px;
  }

  nav a {
    font-size: 16px;
    padding: 8px 0;
    display: block;
  }

  .two-cols .column {
    width: 100%;
  }

  table {
    font-size: 15px;
  }

  section[id] {
    padding-top: 105px;
  }

  section:first-of-type {
    padding-top: 270px;
  }
}
