.post-body {
  padding-bottom: 2rem;
}

.post-body h2 {
  margin-top: 3rem;
}

.post-body h3 {
  margin-top: 2.4rem;
}

.post-body h4 {
  margin-top: 2rem;
}

.post-body p,
.post-body li {
  line-height: 1.65;
}

.post-body ul,
.post-body ol {
  padding-left: 1.4rem;
}

.post-body li {
  margin-bottom: 0.6rem;
}

.tldr {
  margin: 2rem 0 2.5rem;
  padding: 1.2rem 1.35rem;
  border: 1px solid #bfd8ff;
  border-radius: 12px;
  background: #eaf3ff;
  color: #1e3a5f;
}

.tldr > strong {
  display: block;
  margin-bottom: 0.55rem;
}

.tldr p:last-child {
  margin-bottom: 0;
}

.method-details {
  margin: 1.2rem 0 1.8rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid #dedede;
  border-radius: 10px;
  background: #f6f6f6;
  font-size: 0.94rem;
}

.method-details summary {
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.method-details[open] summary {
  margin-bottom: 1rem;
}

.method-details > :last-child {
  margin-bottom: 0;
}

.method-details .equation {
  font-size: 1rem;
}

.table-scroll {
  width: 100%;
  margin: 1.5rem 0 0.4rem;
  overflow-x: auto;
}

.metric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.metric-table th,
.metric-table td {
  padding: 0.8rem 0.9rem;
  border: 1px solid #d7d7d7;
  text-align: left;
  vertical-align: top;
}

.metric-table th {
  background: #f1f3f4;
}

.metric-table p {
  margin: 0;
}

.table-note {
  margin-top: 0.4rem;
  color: #555;
  font-size: 0.9rem;
}

.footnote-ref {
  margin-left: 0.15em;
  font-size: 0.75em;
}

.footnote-ref a,
.table-note a {
  text-decoration: underline;
}

.plot-figure {
  margin: 2.2rem 0;
}

.plot-figure img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

.plot-crop {
  overflow: hidden;
  border-radius: 8px;
}

.plot-figure .plot-crop img {
  width: var(--full-width, 100%);
  max-width: none;
  margin: 0;
  border-radius: 0;
  transform: translateY(var(--crop-top, 0));
}

.plot-figure figcaption {
  margin-top: 0.9rem;
  color: #555;
  font-size: 0.93rem;
  line-height: 1.55;
}

.equation {
  margin: 0.65rem 0;
  overflow-x: auto;
  text-align: center;
}

.equation mjx-container[display="true"] {
  margin: 0.25em 0 !important;
}

.citation {
  margin: 2.5rem 0 4rem;
  padding-top: 1.4rem;
  border-top: 1px solid #ddd;
}

.bibtex {
  padding: 1rem;
  overflow-x: auto;
  border-radius: 8px;
  background: #f6f6f6;
  font-size: 0.86rem;
}

@media (min-width: 900px) {
  .wide-figure {
    position: relative;
    left: 50%;
    width: min(1120px, calc(100vw - 4rem));
    transform: translateX(-50%);
  }

  .wide-figure.figure-one {
    width: min(1040px, calc(100vw - 4rem));
  }

  .wide-figure.medium-figure {
    width: min(820px, calc(100vw - 4rem));
  }

  .wide-figure.small-figure {
    width: min(720px, calc(100vw - 4rem));
  }

  .wide-figure.slightly-smaller-figure {
    width: min(1000px, calc(100vw - 4rem));
  }

  .wide-figure.figure-eight {
    width: min(950px, calc(100vw - 4rem));
  }

  .wide-figure.large-figure {
    width: min(1360px, calc(100vw - 1rem));
  }
}

@media (max-width: 640px) {
  .tldr {
    padding: 1rem;
  }

  .metric-table {
    min-width: 620px;
  }

  .plot-figure figcaption {
    font-size: 0.88rem;
  }
}
