/* Container for the paper effect */
.curved-paper {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  background: #ffffff;
  padding: 6px;
  margin: 20px auto 35px;

  /* 1. Subtle hairline border to clearly define all edges */
  border: 1px solid rgba(0, 0, 0, 0.18);

  /* 2. Soft top & ambient shadow: 
        - First shadow (0 -1px 3px): casts slightly upward to define the top edge
        - Second shadow (0 1px 4px): gives subtle baseline depth */
  box-shadow: 
    0 -1px 3px rgba(0, 0, 0, 0.05),
    0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Base style for both bottom corner shadow anchors */
.curved-paper::before,
.curved-paper::after {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: 12px;
  width: 50%;
  height: 20%;
  max-width: 300px;
  box-shadow: 0 15px 10px rgba(0, 0, 0, 0.4);
}

/* Left curved corner */
.curved-paper::before {
  left: 10px;
  transform: rotate(-4deg);
}

/* Right curved corner */
.curved-paper::after {
  right: 10px;
  transform: rotate(4deg);
}

/* Ensure the image stays strictly on top of the shadow */
.curved-paper img {
  display: block;
  position: relative;
  z-index: 1;
  max-width: 100%;
}

/* Preserve an explicit Quarto height; otherwise size images proportionally. */
.curved-paper img:not([height]) {
  height: auto;
}

/* Mobile chapter navigation: Quarto controls aria-expanded and the sidebar. */
.quarto-secondary-nav .quarto-btn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}

.chapter-menu-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.quarto-secondary-nav .quarto-btn-toggle > i {
  position: relative;
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 18px;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  transition: background-size 160ms ease;
}

.quarto-secondary-nav .quarto-btn-toggle > i::before,
.quarto-secondary-nav .quarto-btn-toggle > i::after {
  content: "";
  position: absolute;
  display: block;
  inset-inline-start: 0;
  top: 8px;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform 160ms ease;
}

.quarto-secondary-nav .quarto-btn-toggle > i::before {
  transform: translateY(-7px);
}

.quarto-secondary-nav .quarto-btn-toggle > i::after {
  transform: translateY(7px);
}

.quarto-secondary-nav .quarto-btn-toggle[aria-expanded="true"] > i {
  background-size: 0% 2px;
}

.quarto-secondary-nav .quarto-btn-toggle[aria-expanded="true"] > i::before {
  transform: rotate(45deg);
}

.quarto-secondary-nav .quarto-btn-toggle[aria-expanded="true"] > i::after {
  transform: rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
  .quarto-secondary-nav .quarto-btn-toggle > i,
  .quarto-secondary-nav .quarto-btn-toggle > i::before,
  .quarto-secondary-nav .quarto-btn-toggle > i::after {
    transition: none;
  }
}

/* marker-style strike for the colored \ccancel macro (math-macros.html):
   thicker, semi-transparent, round ends. Plain black \cancel is untouched,
   because only \ccancel puts an inline color on .cancel-lap. */
.katex .cancel-lap[style*="color"] svg {
  overflow: visible;
  /* pull the strike in, so it doesn't stick out past the word */
  width: 84%;
  margin-left: 8%;
}
/* put the strike behind the text (like zorder in matplotlib); isolation keeps
   the negative z-index inside the equation instead of behind the page background */
.katex .cancel-lap[style*="color"] {
  isolation: isolate;
}
.katex .cancel-lap[style*="color"] .svg-align {
  z-index: -1;
}
.katex .cancel-lap[style*="color"] svg line {
  stroke-width: 0.3em;
  stroke-opacity: 0.4;
  stroke-linecap: round;
  /* rough edges and grain, defined in math-macros.html */
  filter: url(#marker-texture);
  mix-blend-mode: multiply;
}
