/* Comfortable reading */
.md-content { max-width: 900px; }
.md-typeset { font-size: 17.5px; line-height: 1.7; }

/* Larger display math on wide screens */
@media (min-width: 1024px) {
  mjx-container[jax="CHTML"][display="true"] { font-size: 115%; }
}

/* Code blocks padding */
.md-typeset pre > code { padding: 0.9rem 1.1rem; }

.card-group {
  margin-bottom: 2rem; /* adjust spacing */
}

/* Reset counter at start of page */
.md-typeset { counter-reset: algo-counter; }

/* Increment counter and reserve space for icon + number */
.md-typeset .admonition.algorithm > .admonition-title,
.md-typeset details.algorithm > summary {
  counter-increment: algo-counter;
  position: relative;
  display: block;
  /* left padding = icon space (2rem) + number box (ch units) + a little gap */
  padding-left: calc(2.2rem + 10ch + 0.5rem);
}

/* Built-in icon stays on ::before; we add the number on ::after */
.md-typeset .admonition.algorithm > .admonition-title::after,
.md-typeset details.algorithm > summary::after {
  content: "Algorithm " counter(algo-counter) ":";
  position: absolute;
  left: 2.2rem;                 /* right after the icon */
  top: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  color: var(--md-default-fg-color--lighter);
  font-weight: 600;
  width: 10ch;                  /* matches the 10ch reserved above */
}

/* Narrow screens: fall back to inline (no overlap) */
@media (max-width: 700px) {
  .md-typeset .admonition.algorithm > .admonition-title,
  .md-typeset details.algorithm > summary {
    padding-left: 2.2rem;       /* only icon space */
  }
  .md-typeset .admonition.algorithm > .admonition-title::after,
  .md-typeset details.algorithm > summary::after {
    position: static;
    margin-left: 0.25rem;
    width: auto;
  }
}

/* Center all images in content */
.md-typeset img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
/* Center algorithm boxes */
.md-typeset .admonition.algorithm,
.md-typeset details.algorithm {
  margin-left: auto;
  margin-right: auto;
  *max-width: 800px;   /* optional: keep them from stretching too wide */
}

/* ---------- Table style: bright scheme ---------- */
[data-md-color-scheme="default"] .md-typeset table:not([class]) {
  border-collapse: collapse;
  width: 100%;
  font-size: 1rem;
  line-height: 1.6;
  background: #ffffff; /* white background */
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Header row */
[data-md-color-scheme="default"] .md-typeset table:not([class]) thead {
  background: #f2f6ff;   /* pale blue header */
  color: #1a1a1a;
  font-weight: 600;
}

/* Header cells */
[data-md-color-scheme="default"] .md-typeset table:not([class]) thead th {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 2px solid #ccc;
}

/* Body rows */
[data-md-color-scheme="default"] .md-typeset table:not([class]) tbody tr {
  background: #ffffff;
  border-bottom: 1px solid #eee;
}

/* Zebra striping */
[data-md-color-scheme="default"] .md-typeset table:not([class]) tbody tr:nth-child(even) {
  background: #f9f9f9;
}

/* Body cells */
[data-md-color-scheme="default"] .md-typeset table:not([class]) td {
  padding: 0.6rem 0.8rem;
  color: #222;
}

/* Highlight bold rows (like Baseline) */
[data-md-color-scheme="default"] .md-typeset table:not([class]) tbody tr strong {
  color: #0d47a1; /* blue accent */
}

/* Center all tables in the content */
.md-typeset table:not([class]) {
  margin-left: auto;
  margin-right: auto;
  max-width: 900px;  /* optional: match your .md-content width */
}

/* Desktop: centered & constrained */
@media (min-width: 768px) {
  .md-typeset table:not([class]) {
    margin-left: auto;
    margin-right: auto;
    max-width: 900px;  /* adjust to taste */
  }
}

/* Mobile: default full width */
@media (max-width: 767px) {
  .md-typeset table:not([class]) {
    width: 100%;
    max-width: none;
  }
}
.md-typeset table:not([class]) {
  margin: 1.5rem auto; /* space above/below and centered horizontally */
}


