/* 
   Page and Layout adjustment for MkDocs Material 
*/
:root {
  --md-admonition-width: 60rem;
}

.md-grid {
  max-width: 90%;
}

/* Adjust column ratios for desktop screens */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary {
    width: 15%;
  }

  .md-sidebar--secondary {
    width: 15%;
  }

  .md-content {
    width: 70%;
  }
}

/* --- WIKIPEDIA STYLE TABLES --- */

.md-typeset table:not([class]) {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  border: 1px solid #a2a9b1;
  background-color: #ffffff;
  font-family: var(--md-text-font-family) !important;
  font-size: var(--md-typeset-font-size) !important;
}

.md-typeset th,
.md-typeset td {
  border: 1px solid #a2a9b1 !important;
  padding: 0.5em 0.8em !important;
  font-family: inherit !important;
  font-size: 100% !important;
  line-height: 1.6 !important;
  vertical-align: middle !important;
}

.md-typeset th {
  background-color: #eaecf0 !important;
  font-weight: bold !important;
  text-align: center !important;
  color: #000000 !important;
}

/* --- WIKI-STYLE MATH RENDERING (NO SCROLLBARS) --- */

/* Remove ALL overflow restrictions from math containers */
.md-typeset .arithmatex,
.md-typeset td .arithmatex,
.md-typeset mjx-container,
.md-typeset td mjx-container,
.md-typeset mjx-math,
.md-typeset td mjx-math {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Center math in table cells */
.md-typeset td .arithmatex {
  display: block !important;
  text-align: center !important;
  margin: 0.3em 0 !important;
}

/* Ensure table cells expand to fit math content */
.md-typeset td {
  white-space: nowrap;
  min-width: fit-content;
}

/* Wikipedia-like caption style */
.md-typeset p+table:not([class]) {
  margin-top: 0.5rem;
}

.md-typeset p:has(+ table:not([class])) {
  font-weight: bold;
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 0.2rem;
  color: #202122;
}

.md-typeset td p {
  margin: 0 !important;
}