div.body {
    max-width: 100% !important;
}

h1 {
  padding: 0.2em;
  border-top: solid 2px;
  border-bottom: solid 2px;
}

.wy-table-responsive table td, .wy-table-responsive table th {
    white-space: normal;
}

table caption {
    text-align: left !important;
    caption-side: top; /* 省略可：上に表示 */
    padding-left: 0;
}

table.docutils th.head{
    background-color: rgba(50, 102, 153, 0.5);
}

table.docutils tr.row-odd{
    background-color: rgba(50, 102, 153, 0.2);
}

/* テーブル同士の間に下マージンを入れる */
table.docutils {
    margin-bottom: 2em;  /* 必要に応じて調整 */
    width: 100%;
    max-width: 100%;
}

table.docutils td, table.docutils th {
    white-space: normal;
}

/* パラメータテーブルのキャプション番号を非表示 */
table.no-caption-number caption span.caption-number {
    display: none;
}

/* genindexリンクを非表示 */
a[href*="genindex"] {
    display: none !important;
}

/* Adjust vertical spacing between list items for better readability.
   Adds spacing between items while removing extra space after the last item. */
div.body ul li {
  margin-bottom: 0.4em;
}

div.body ul li:last-child {
  margin-bottom: 0;
}

/* Restore the framed List heading (the code body is outside the frame in TeX). */
.angel-list-caption {
  border: 1px solid currentColor;
  padding: 0.25rem 0.5rem;
  margin: 1rem 0 0.5rem;
  font-weight: 600;
}

/* TeX \ovalbox and \doublebox equivalents used in the introduction. */
div.angel-ovalbox {
  border: 2px solid currentColor;
  border-radius: 0.9rem;
  padding: 1rem 1.25rem;
  margin: 1rem auto;
  max-width: 70rem;
  text-align: left;
}

div.angel-doublebox {
  border: 4px double currentColor;
  padding: 0.75rem 1rem;
  margin: 1rem auto;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

img.responsive-figure {
  max-width: 100%;
  height: auto;
}

/* TeX ovalboxes surround the example image, but leave its caption outside. */
img.angel-ovalbox-image {
  border: 2px solid currentColor;
  border-radius: 0.9rem;
  padding: 1rem 1.25rem;
  box-sizing: border-box;
}

/* Preserve TeX minipage rows while allowing figures to wrap on narrow screens. */
div.figure-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
  margin: 1rem 0;
}

div.figure-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

div.figure-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

div.figure-grid figure {
  width: 100%;
  margin: 0;
}

div.figure-grid img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 700px) {
  div.figure-grid-2,
  div.figure-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Image-backed legacy tables retain table numbering without a visible cell box. */
table.image-table,
table.image-table td {
  border: 0;
}

table.image-table td {
  padding: 0;
  text-align: center;
}
