* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #fffff8;
  margin-top: 20px;
}

.exa-logo {
  width: 100px; /* adjust size */
  margin-left: 50px; /* align with toc-column */
  margin-top: 20px;
  margin-bottom: 10px;
  display: block;
}




/* Table of Contents (Left Column) */
.toc-column {
   margin-left: 50px;  
  width: 15%;
  padding: 20px;
  position: sticky;
  top: 110px;
  height: calc(100vh - 110px);
  overflow-y: auto;
  /* background-color: #f0f0ea; */
  background-color: #fffff8;
  /* border-right: 1px solid #ddd; */
  /* box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.1); */
  display: flex;
  flex-direction: column;
}

.toc-column h2 {
  font-size: 18px;
  margin-bottom: 15px;
  margin-top: 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #ccc;
}

.toc-column ul {
  list-style: none;
  padding-left: 16px;
  color: black;
}

.toc-column li {
  margin: 10px 0;
  color: black;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-column a {
  text-decoration: none;
  color: black;
  font-size: 13px;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}


.github-button {
  display: block;           /* makes it take up a full line */
  width: fit-content;       /* shrinks to fit the content */
  margin: 20px auto;        /* centers horizontally */
  background-color: #eee;
  color: #24292e;
  border: 1px solid #d1d5da;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.github-button:hover {
  background-color: #d1d5da;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-decoration: none;
}

.github-button:active {
  background-color: #c0c4c8;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}


.image-pair {
  display: flex;
  justify-content: center;
  gap: 15px;             /* space between images */
  flex-wrap: nowrap;     /* force one line */
  margin: 20px auto;
  max-width: 900px;      /* increased from 800px */
}

.image-pair img {
  width: 50%;            /* slightly larger than before */
  max-width: none;       /* allow width to control size */
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}


/* Main Content (Middle Column) - Blog Style */
.content-column {
  width: 100%;
  max-width: 750px;        /* typical readable blog width */
  margin: 0 auto;          /* center the content */
  padding: 20px 30px 40px; /* reasonable padding for readability */
  color: #222;
  box-sizing: border-box;
}


/* Center only main page title */
.content-column > h1 {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 20px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Section headers aligned with no max-width or centering */
.section-header {
  margin-top: 40px;
  margin-bottom: 10px;
  /* start flush with content-column padding */
  /* no max-width or margin auto */
  text-align: left;
}

/* Paragraph immediately after section header */
.section-header + p {
  margin-top: 0; /* no gap between header and paragraph */
  margin-bottom: 20px;
  line-height: 1.6;
  text-align: left;
  /* start flush with content-column padding */
}

.content-column .image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 20px;
  max-width: 650px;
  margin: 20px auto;
}

.content-column .image-grid img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}


/* Other paragraphs */
.content-column p:not(.section-header + p) {
  margin-top: 20px;
  margin-bottom: 20px;
  line-height: 1.6;
  text-align: left;
  /* start flush with content-column padding */
}

.content-column ul,
.content-column ol {
  padding-left: 40px; /* good indentation */
  margin-top: 20px;
  margin-bottom: 20px;
  color: #222;
  text-align: left;
  list-style-position: outside; /* default, bullets outside padding */
}


/* GIF Column (Right Column) */
.gif-column {
  width: 17%;
  padding: 40px 20px;
  background-color: transparent;
}

.video-row {
  display: flex;
  justify-content: center;
  gap: 20px; /* space between videos */
  flex-wrap: wrap; /* allows wrapping on smaller screens */
  margin: 20px 0;
}

.video-row video {
  width: 45%;
  max-width: 400px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.centered-img {
  display: block;
  margin: 0 auto;
}


.gif-sticky {
  position: relative;
  padding-top: 115px;
}

.gif-sticky img {
  width: 100%;
  margin-bottom: 20px;
}

.equations-container {
  display: flex;
  align-items: center;
  justify-content: space-between; /* space items evenly across the line */
  flex-wrap: nowrap;
  margin-top: 20px;
  max-width: 100%;
  overflow-x: auto;
  gap: 0; /* no gap, spacing done by justify-content */
}

.equation, .equation-definitions {
  flex: 1;              /* each takes equal space */
  min-width: 0;         /* prevent overflow */
  white-space: nowrap;  /* keep content in one line */
  font-size: 1.1em;
  text-align: center;   /* center content inside each block */
}

.equation-definitions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.95em;
  color: #333;
  text-align: left;     /* override to left-align definitions for readability */
  white-space: normal;  /* allow definitions to wrap if needed */
  padding-left: 10px;   /* add a little padding on left */
}

.equation-definitions p {
  margin: 0;
}

.ekf-images img {
  display: block;
  margin: 15px auto;
  max-width: 85%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}


#distance img {
  display: block;        /* make the image block to allow margin auto */
  margin: 20px auto;     /* center horizontally with vertical spacing */
  max-width: 70%;        /* shrink the image to 80% of its container width */
  height: auto;          /* maintain aspect ratio */
  max-height: 400px;     /* optional max height */
  border-radius: 6px;    /* optional: nice rounded corners */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* optional: subtle shadow for style */
}

/* Responsive - Collapse to single column */
@media screen and (max-width: 1000px) {
  body {
    flex-direction: column;
    margin-top: 0;
  }

  .toc-column,
  .content-column,
  .gif-column {
    width: 100%;
    position: static;
    height: auto;
    padding: 20px;
  }

  .gif-sticky {
    position: static;
    padding-top: 0;
  }
}
