/* Keep API signatures and long type hints readable. */
.sig {
  line-height: 1.45;
}

.sig-param,
.sig-return {
  white-space: normal;
}

/* The Read the Docs theme keeps signatures on one line by default. */
.rst-content .sig,
.rst-content .sig-param,
.rst-content .sig-return {
  white-space: normal;
  overflow-wrap: anywhere;
}

.wy-table-responsive table td,
.wy-table-responsive table th {
  white-space: normal;
}

/* Separate the next section from the final literal-include disclosure. */
.rst-content details + h2 {
  margin-top: 0 !important;
  padding-top: 1.5em !important;
}

.rst-content details:has(+ h2) {
  margin-bottom: 1.5em;
}

.rst-content details {
  margin-bottom: 1.5em !important;
}

/* Present folded literal includes as one cohesive file row and code panel. */
.rst-content details > summary {
  cursor: pointer;
  padding: 0.42rem 0.7rem 0.42rem 0.55rem;
  border: 1px solid #d5dee5;
  border-radius: 0.35rem;
  font-size: 1.02em;
  font-weight: 600;
  list-style-position: inside;
}

.rst-content details > summary:hover {
  border-color: #b8c9d5;
  background: #edf3f6;
}

.rst-content details > summary:focus-visible {
  outline: 2px solid #2f6f98;
  outline-offset: 2px;
}

.rst-content details > summary::marker {
  color: #557386;
}

.rst-content details > summary code {
  margin-left: 0.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.rst-content details[open] > summary {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.rst-content details > div[class^="highlight-"] {
  margin: 0;
  border: 1px solid #d5dee5;
  border-top: 0;
  border-radius: 0 0 0.35rem 0.35rem;
}

/* The page title is already represented by the active global entry. */
.api-local-toc > ul > li > a {
  display: none !important;
}

.api-local-toc > ul > li > ul {
  margin-top: 0;
  margin-left: 1.2em !important;
}

.api-local-toc {
  background: #ccc !important;
}

/* Keep only second-level API headings; autodoc object entries are deeper. */
.api-local-toc > ul > li > ul > li > ul {
  display: none !important;
}

/* Match the native RTD submenu appearance below the active API page. */
.api-local-toc > ul > li > ul > li > a {
  padding: 0.4045em 1.618em 0.4045em 2.4em;
  color: #404040;
  font-size: 100%;
}

.wy-menu-vertical .api-local-toc a.reference.internal {
  display: block;
  padding: 0.4045em 1.618em 0.4045em 2.4em !important;
  background: none !important;
  color: #404040 !important;
  font-size: 80% !important;
}

.wy-menu-vertical .api-local-toc a.reference.internal code {
  color: inherit !important;
  background: none;
  border: 0;
}

.sig-param > .p,
.sig-return-icon {
  color: #6d7f90;
}

/* Keep qualified namespaces regular while the documented API name stays bold. */
.rst-content .sig-prename,
.rst-content .sig-prename .pre {
  color: inherit;
  font-size: inherit;
  font-weight: normal;
}

.rst-content figure,
.rst-content figure figcaption {
  text-align: center;
}

/* Distinguish glossary cross-references from ordinary documentation links. */
span.xref.std.std-term {
  color: #7a3e00;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.14em;
}

a.reference.internal:hover > span.xref.std.std-term {
  color: #4b2600;
}

a.reference.internal:focus-visible > span.xref.std.std-term {
  outline: 2px solid #4b2600;
  outline-offset: 2px;
}

.sig-param > .default_value {
  color: #6b5a3d;
}

/* Make parameter-list type annotations read more like typed code than prose. */
dl.field-list > dd > ul.simple > li > p > em,
dl.field-list > dd > ul.simple > li > p > em a {
  color: #1f4f74;
  font-style: normal;
  font-weight: 600;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86em;
  background: #eef4f8;
  border: 1px solid #d4e1ea;
  border-radius: 0.2rem;
  padding: 0.02rem 0.14rem;
}

/* Keep API entries separate without changing other documentation lists. */
.rst-content dl.field-list > dd.api-parameters > ul.simple,
.rst-content dl.field-list > dd.api-raises > ul.simple {
  list-style: none;
  margin-left: 0;
}

.rst-content dl.field-list > dd.api-parameters > ul.simple > li,
.rst-content dl.field-list > dd.api-raises > ul.simple > li {
  list-style: none;
  margin-left: 0;
}

/* Reduce visual noise in long autodoc sections. */
.autosummary.longtable td,
.autosummary.longtable th {
  vertical-align: top;
}

.api-summary-table {
  width: 100%;
  table-layout: fixed;
}

.api-summary-table colgroup col:first-child {
  width: 29%;
}

.api-summary-table colgroup col:last-child {
  width: 71%;
}

.overload-table td,
.overload-table th {
  vertical-align: top;
}

.overload-signature-block {
  display: inline-block;
  margin: 0;
  white-space: pre;
  font-size: 0.84rem;
  line-height: 1.35;
}

.overload-signature-block .highlight {
  display: inline-block;
}

.overload-table .hll {
  display: block;
  margin: 0 -0.45rem;
  padding: 0.04rem 0.45rem;
  background: #fff6dd;
  border-left: 3px solid #d38a17;
}

.overload-toggle {
  margin: 0.7rem 0 1rem;
  border: 1px solid #d9e2e8;
  border-radius: 0.3rem;
  background: #fbfcfd;
  padding: 0.25rem 0.8rem 0.8rem;
  overflow-x: auto;
  box-sizing: border-box;
}

.overload-toggle > summary {
  cursor: pointer;
  font-weight: 600;
  color: #264760;
  padding: 0.35rem 0;
}

.overload-toggle > summary + p {
  margin-top: 0.4rem;
}

.overload-toggle .overload-table {
  width: max-content;
  table-layout: auto;
}

.overload-toggle .overload-table th:last-child,
.overload-toggle .overload-table td:last-child {
  white-space: nowrap;
}

/* Improve code block readability for tutorial literalincludes. */
div.highlight pre {
  font-size: 0.88rem;
}

/* Show the source language on every highlighted code block. */
div.highlight-text,
div.highlight-python,
div.highlight-bash,
div.highlight-jcm,
div.highlight-jcmp,
div.highlight-jcmt,
div.highlight-jcmpt {
  position: relative;
}

div.highlight-text::before,
div.highlight-python::before,
div.highlight-bash::before,
div.highlight-jcm::before,
div.highlight-jcmp::before,
div.highlight-jcmt::before,
div.highlight-jcmpt::before {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  z-index: 1;
  padding: 0.15rem 0.4rem;
  border-radius: 0.15rem;
  color: rgba(214, 222, 235, 0.82);
  background-color: rgba(38, 50, 56, 0.72);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-in-out;
}

div.highlight-text:hover::before,
div.highlight-python:hover::before,
div.highlight-bash:hover::before,
div.highlight-jcm:hover::before,
div.highlight-jcmp:hover::before,
div.highlight-jcmt:hover::before,
div.highlight-jcmpt:hover::before {
  opacity: 1;
}

div.highlight-text::before {
  content: "text";
}

div.highlight-python::before {
  content: "Python";
}

div.highlight-bash::before {
  content: "Terminal";
}

div.highlight-jcm::before,
div.highlight-jcmp::before,
div.highlight-jcmt::before,
div.highlight-jcmpt::before {
  content: "jcm (JCM syntax + Python scripting)";
}

/* Mark the template boundary portion of each line. */
div.highlight-jcm span.cp,
div.highlight-jcmp span.cp,
div.highlight-jcmt span.cp,
div.highlight-jcmpt span.cp {
  display: inline-block;
  background-color: rgba(64, 112, 160, 0.12);
}

/* Mark values substituted into a JCM file. */
div.highlight-jcmt span.nv,
div.highlight-jcm span.nv,
div.highlight-jcmp span.nv,
div.highlight-jcmpt span.nv {
  background-color: rgba(64, 112, 160, 0.12);
  border-radius: 0.15rem;
  padding: 0 0.08rem;
}

/* Shade one contiguous section for embedded Python code. */
div.highlight-jcm span.jcmt-line,
div.highlight-jcmp span.jcmt-line,
div.highlight-jcmt span.jcmt-line,
div.highlight-jcmpt span.jcmt-line {
  display: block;
}

div.highlight-jcm span.jcmt-python-line,
div.highlight-jcmp span.jcmt-python-line,
div.highlight-jcmt span.jcmt-python-line,
div.highlight-jcmpt span.jcmt-python-line {
  background-color: rgba(64, 112, 160, 0.12);
}

/* Match the JCM input palette used in the reference editor. */
div.highlight-jcm span.nc,
div.highlight-jcmp span.nc,
div.highlight-jcmt span.nc,
div.highlight-jcmpt span.nc {
  color: #9c2b9f;
  font-weight: 700;
}

div.highlight-jcm span.na,
div.highlight-jcmp span.na,
div.highlight-jcmt span.na,
div.highlight-jcmpt span.na {
  color: #6266d8;
  font-weight: normal;
}

div.highlight-jcm span.o,
div.highlight-jcmp span.o,
div.highlight-jcmt span.o,
div.highlight-jcmpt span.o,
div.highlight-jcm span.p,
div.highlight-jcmp span.p,
div.highlight-jcmt span.p,
div.highlight-jcmpt span.p {
  color: #f47721;
  font-weight: normal;
}

div.highlight-jcm span.s2,
div.highlight-jcmp span.s2,
div.highlight-jcmt span.s2,
div.highlight-jcmpt span.s2 {
  color: #d93636;
}

div.highlight-jcm span.c1,
div.highlight-jcmp span.c1,
div.highlight-jcmt span.c1,
div.highlight-jcmpt span.c1 {
  color: #3d9aa6;
}

div.highlight-jcm span.m,
div.highlight-jcmp span.m,
div.highlight-jcmt span.m,
div.highlight-jcmpt span.m,
div.highlight-jcm span.no,
div.highlight-jcmp span.no,
div.highlight-jcmt span.no,
div.highlight-jcmpt span.no,
div.highlight-jcm span.kc,
div.highlight-jcmp span.kc,
div.highlight-jcmt span.kc,
div.highlight-jcmpt span.kc {
  color: #333333;
}
