/* Update theme variables based on https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/styling.html#css-theme-variables */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,600;0,900;1,900&family=Open+Sans:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --dash-blue: #008de4;
  --dash-deep-blue: #012060;
  --dash-midnight-blue: #0b0f3b;
}

html[data-theme="light"] {
  --pst-color-primary: var(--dash-blue);
  --pst-color-secondary: var(--dash-blue);
  --pst-color-link: var(--pst-color-primary);
  --pst-color-link-hover: var(--dash-deep-blue);

  .search-button-field:hover {
    box-shadow: 0 0 0 .1875rem var(--pst-color-primary);
  }
 
  #pst-back-to-top:hover {
    background-color: var(--pst-color-link-hover);
  }
}

html[data-theme="dark"] {
  --pst-color-primary: var(--dash-blue);
  --pst-color-secondary: var(--pst-color-warning);
  --pst-color-link: var(--pst-color-primary);
  --pst-color-link-hover: var(--pst-color-secondary);
  --pst-color-table-row-hover-bg: var(--dash-deep-blue);

  /* ReadTheDocs search addon CSS variables*/
  /* See details on: https://github.com/readthedocs/addons/blob/0.23.2/src/search.css */
  /* --readthedocs-search-color: darkgray;
  --readthedocs-search-content-background-color: var(--bs-dark);
  --readthedocs-search-content-border-color: gray; */
  --readthedocs-search-input-background-color: darkgray;
  /* --readthedocs-search-result-section-border-color: darkgray;
  --readthedocs-search-result-section-subheading-color: darkgray;
  --readthedocs-search-result-section-highlight-color: var(--dash-blue);
  --readthedocs-search-filters-border-color: lightgray;   */

  /* Unused options */
  /* --readthedocs-search-font-family, */
  /* --readthedocs-search-font-size: 16px; */
  /* --readthedocs-search-result-section-color: darkgray; doesn't seem to do anything*/  
  /* --readthedocs-search-footer-code-background-color, #fff */
  /* --readthedocs-search-footer-background-color: rgb(234, 234, 234); */
  /* --readthedocs-search-backdrop-color: rgba(0, 0, 0, 0.3); */

  :host > div .results h2 {
    color: lightgray;
  }

  select {
    background-color: var(--pst-color-background);
  }

  .pst-navbar-icon:hover {
    color: var(--pst-color-link-hover);
  }

  .pst-navbar-icon:hover:before {
    border-bottom: max(3px,.1875rem,.12em) solid var(--pst-color-link-hover);
  }

  #pst-back-to-top:hover {
    background-color: var(--pst-color-link-hover);
    color: #000;
  }
}

html {
  /* Headers */
  --pst-font-size-h1: 28px;
  --pst-font-size-h2: 24px;
  --pst-font-size-h3: 20px;

  /* Sidebar styles */
  --pst-sidebar-font-size: 0.95em;
  --pst-sidebar-header-font-size: 1.2em;
}

html[data-theme=dark] .bd-content img:not(.only-dark):not(.dark-light) {
  background: none;
  border-radius: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

p,
a,
li,
ol {
  font-family: 'Open Sans', sans-serif;
}

a.headerlink {
  color: var(--pst-color-primary)
}

.sidebar-end-items__item {
  position: relative;
}

select {
  width: 100%;
  padding: 10px;
  appearance: none;
  background: transparent;
  border-radius: 0.25rem;
}

html[data-theme=dark] select {
  color: #fff;
}

html[data-theme="light"] select {
  color: #000;
}

html[data-theme="light"] {
  --table-bg-color-odd: #eeeeee;
  --table-bg-color-even: #ffffff;
}

tbody tr:nth-child(odd) { background-color: var(--table-bg-color-odd); }
tbody tr:nth-child(even) { background-color: var(--table-bg-color-even); }

.table thead th.head {
  vertical-align: middle;
}

/* Adjust scroll-to-top button */
#pst-back-to-top {
  background-color: var(--pst-color-primary);
  /* Make sure it doesn't display on to of the RTD search dialog */
  z-index: 499;
}

/* Adjust sphinx-design card */
.sd-card-hover:hover {
  border-color: var(--pst-color-primary)
}

/* Zoom example-app screenshots while keeping the preview viewport unchanged.
   A 1.4x scale displays roughly half of the source image area. */
.example-app-card .sd-card-img-top {
  height: 18rem;
  object-fit: cover;
  object-position: left top;
  transform: scale(1.4);
  transform-origin: left top;
  clip-path: inset(0 28.572% 28.572% 0);
}

@media (max-width: 767.98px) {
  .example-app-card .sd-card-img-top {
    height: 75vw;
    max-height: 28rem;
  }
}

/* These are hacks to hide the pydata-theme search popup behind the readthedocs
sphinx search extension interface.
*/
.search-button__wrapper.show .search-button__search-container,
.search-button__wrapper.show .search-button__overlay {
  z-index: 1;
}

.search-button__wrapper.show .search-button__overlay {
  display: none;
}

/* Make sure it doesn't stick out on the sides of the RtD search screen */
.search-button__wrapper.show .search-button__search-container {
  width: 15%;
}

/* Cap tall code blocks and make them scrollable. Short blocks are unaffected
   since max-height only kicks in when content exceeds it. */
.highlight pre {
  max-height: 60rem;
  overflow: auto;
}
/* Reusable, browser-executed blocks for safe tutorial operations. */
.interactive-tutorial {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px solid var(--pst-color-border);
  border-radius: 0.5rem;
  background: var(--pst-color-surface);
}

.interactive-tutorial__header,
.interactive-tutorial__controls,
.interactive-tutorial__summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.interactive-tutorial__header {
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Integrated runner layout used directly beneath a tutorial code example. */
.interactive-tutorial--integrated {
  margin-top: -0.5rem;
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
}

.interactive-tutorial__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -1rem -1rem 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--pst-color-border);
  font-size: 0.9rem;
}

.interactive-tutorial__help,
.interactive-tutorial__connection,
.interactive-tutorial__empty {
  color: var(--pst-color-text-muted);
  font-size: 0.85rem;
}

.interactive-tutorial__connection[data-state="connected"] {
  color: #16834a;
}

.interactive-tutorial__connection[data-state="error"] {
  color: var(--pst-color-danger);
}

.interactive-tutorial__connection:empty {
  display: none;
}

.interactive-tutorial__label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.interactive-tutorial__field {
  flex: 1 1 12rem;
  min-width: 0;
}

.interactive-tutorial__field--wide {
  flex-basis: 28rem;
}

.interactive-tutorial__field--small {
  flex: 0 1 6rem;
}

.interactive-tutorial__field .interactive-tutorial__input {
  width: 100%;
}

.interactive-tutorial__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.interactive-tutorial__controls--secondary {
  margin-top: 0.75rem;
}

.interactive-tutorial__input {
  flex: 1 1 28rem;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--pst-color-border);
  border-radius: 0.3rem;
  background: var(--pst-color-background);
  color: var(--pst-color-text-base);
  font-family: var(--pst-font-family-monospace);
}

.interactive-tutorial__button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--pst-color-primary);
  border-radius: 0.3rem;
  background: var(--pst-color-primary);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.interactive-tutorial__button--secondary {
  background: transparent;
  color: var(--pst-color-primary);
}

.interactive-tutorial__button--text {
  padding-right: 0.25rem;
  padding-left: 0.25rem;
  border-color: transparent;
  background: transparent;
  color: var(--pst-color-primary);
}

.interactive-tutorial__button--text:hover {
  text-decoration: underline;
}

.interactive-tutorial__button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.interactive-tutorial__help {
  margin-top: 0.45rem;
}

.interactive-tutorial__source {
  margin-top: 1rem;
}

.interactive-tutorial__source summary {
  cursor: pointer;
  font-weight: 600;
}

.interactive-tutorial__source pre {
  margin: 0.5rem 0 0;
  padding: 0.85rem;
  border: 1px solid var(--pst-color-border);
  border-radius: 0.3rem;
  background: var(--pst-color-on-background);
  overflow: auto;
}

.interactive-tutorial__result {
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: 0.3rem;
  background: var(--pst-color-on-background);
}

.interactive-tutorial--integrated .interactive-tutorial__result {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.interactive-tutorial--integrated .interactive-tutorial__summary {
  margin-bottom: 0.35rem;
}

.interactive-tutorial__summary {
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.interactive-tutorial__metric {
  min-width: 0;
  max-width: 100%;
  padding-right: 1rem;
}

.interactive-tutorial__metric strong,
.interactive-tutorial__metric span {
  display: block;
}

.interactive-tutorial__metric strong {
  overflow-wrap: anywhere;
}

.interactive-tutorial__metric span {
  color: var(--pst-color-text-muted);
  font-size: 0.75rem;
}

.interactive-tutorial__json {
  max-height: 28rem;
  margin: 0;
  overflow: auto;
  white-space: pre;
  font-size: 0.82rem;
}

.interactive-tutorial__error {
  color: var(--pst-color-danger);
}

@media (max-width: 767.98px) {
  .interactive-tutorial__controls,
  .interactive-tutorial__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .interactive-tutorial__input,
  .interactive-tutorial__field,
  .interactive-tutorial__field--wide,
  .interactive-tutorial__field--small {
    flex: none;
    width: 100%;
  }

  .interactive-tutorial__summary {
    align-items: stretch;
    flex-direction: column;
  }

  .interactive-tutorial__metric {
    padding-right: 0;
  }

  .interactive-tutorial__toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }
}
