/* Increase overall width of page while keeping centered layout */
.bd-page-width {
  max-width: 1600px; /* default is usually ~1200px */
  width: 95%;
  margin: 0 auto;
}

/* Let the main content use more horizontal space */
.bd-content .bd-article-container {
  max-width: 100%;
  width: 100%;
}

.bd-content img {
  display: block;
  margin-top: 1.5em;
  margin-bottom: 2.5em;

  margin-left: auto;
  margin-right: auto;
  /* Drop shadow */
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* Add space before later sections, but not the first H2 section after the page H1 */
.bd-content section:not(:first-child):not(:nth-child(2)) {
  margin-top: 8em;
}

.bd-content section > h2,
.bd-content section > h3,
.bd-content section > h4 {
  scroll-margin-top: 5rem;
}

html[data-theme="light"] .bd-content hr {
  border: 0;
  border-top: 4px solid rgba(0, 0, 0, 0.524);
}

html[data-theme="dark"] .bd-content hr {
  border: 0;
  border-top: 4px solid rgba(255, 255, 255, 0.35);
}

html[data-theme="light"] .bd-content img {
  box-shadow:
    0 7px 10px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.14);
}

html[data-theme="dark"] .bd-content img {
  box-shadow:
    0 2px 10px rgba(255, 255, 255, 0.26),
    0 0 0 8px rgba(255, 255, 255, 0.08);
}

.bd-content video {
  display: block;
  margin-bottom: 2em;
  margin-left: auto;
  margin-right: auto;
  border-radius: 8px;
}

html[data-theme="light"] .bd-content video {
  box-shadow:
    0 1px 10px rgba(0, 0, 0, 0.15),
    0 0 0 2px rgba(0, 0, 0, 0.14);
}

html[data-theme="dark"] .bd-content video {
  box-shadow:
    0 2px 10px rgba(255, 255, 255, 0.15),
    0 0 0 8px rgba(255, 255, 255, 0.08);
}

.video-card {
  display: block;
  margin: 2.5em auto;
  padding: 0.75em; /* space around the video so shadow shows */
  border-radius: 10px;
  overflow: visible !important; /* prevent clipping */
  background: none;

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.15); /* symmetric outline */
}

.video-card video {
  display: block;
  width: 100%;
  height: auto;
  margin: 0; /* reset video margins */
  border-radius: 8px;
}

/* ========= Shared Box Styling ========= */

dl.py.function,
dl.py.class,
dl.py.attribute {
  margin: 2em 0;
  padding: 3.5em 1.2em 0.5em;
  border-left: 4px solid var(--pst-color-primary);
  border-radius: 6px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.05),
    0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* ========= Header Bar Styling ========= */

dl.py.function > dt,
dl.py.class > dt,
dl.py.attribute > dt {
  font-weight: 700;
  font-size: 1em;
  padding: 0.1em 0.75em;
  margin: -1.2em -1.2em 0.6em -1.2em;
  border-bottom: 1px solid var(--pst-color-border);
  border-radius: 6px 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ========= Light Mode Theme Overrides ========= */
html[data-theme="light"] dl.py.function,
html[data-theme="light"] dl.py.class,
html[data-theme="light"] dl.py.attribute {
  background-color: #fcfcfc;
  border-left-color: #0066cc;
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.07),
    0 0 0 1px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] dl.py.function > dt,
html[data-theme="light"] dl.py.class > dt,
html[data-theme="light"] dl.py.attribute > dt {
  background-color: #eef6ff;
  color: #003366;
}

/* ========= Dark Mode Theme Overrides ========= */
html[data-theme="dark"] dl.py.function,
html[data-theme="dark"] dl.py.class,
html[data-theme="dark"] dl.py.attribute {
  background-color: #181a1b;
  border-left-color: #4fa3ff;
  box-shadow:
    0 1px 2px rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] dl.py.function > dt,
html[data-theme="dark"] dl.py.class > dt,
html[data-theme="dark"] dl.py.attribute > dt {
  background-color: #202324;
  color: #9ecbff;
  border-bottom: 1px solid #2d2d2d;
}

/* ========= Inside Class Body: spacing between method/attr blocks ========= */
dl.py.class dd > dl.py.method,
dl.py.class dd > dl.py.attribute {
  margin-top: 1.2em;
  margin-left: 1.5em;
}

/* ========= Field list (Parameters, Returns, etc.) styling ========= */
dl.field-list > dt {
  font-weight: 300;
  font-size: 1em;
  color: var(--pst-color-text-base);
  margin-bottom: 0.4em;
}

dl.field-list > dd {
  margin-bottom: 0.4em;
  line-height: 1.6;
}

/* Spacing right before a list in a deflist */
.bd-content dl dd > p + ul {
  margin-top: -0.8em;
}

/* For generic prompt, console */
.gp {
  user-select: none;
  -webkit-user-select: none;
}

.center-text {
  text-align: center;
}


.url-callout {
    margin: 1em auto;
    padding: .3em .5em;
    max-width: 900px;
    text-align: center;

    border-radius: 10px;
    border: 2px solid var(--pst-color-primary);
    background-color: var(--pst-color-surface);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.06);
}

.url-callout p {
    margin: 0.4em 0;
}

.url-callout a {
    display: inline-block;
    max-width: 100%;

    font-size: 1.1em;
    font-weight: 700;

    overflow-wrap: anywhere;
    word-break: normal;
}



/* ===== Admonition Colors ===== */

/* Custom generic admonition: green */
html[data-theme="light"] .bd-content .admonition:not(.note):not(.caution):not(.warning):not(.danger):not(.error) {
    border-left-color: #2e7d32;
    background-color: #eef8ee;
}

html[data-theme="light"] .bd-content .admonition:not(.note):not(.caution):not(.warning):not(.danger):not(.error) > .admonition-title {
    background-color: #d8efd8;
    color: #1b5e20;
}

/* Note: yellow */
html[data-theme="light"] .bd-content .admonition.note {
    border-left-color: #c49000;
    background-color: #fff8db;
}

html[data-theme="light"] .bd-content .admonition.note > .admonition-title {
    background-color: #ffef9c;
    color: #5f4600;
}

/* Caution: red */
html[data-theme="light"] .bd-content .admonition.caution {
    border-left-color: #c62828;
    background-color: #fff0f0;
}

html[data-theme="light"] .bd-content .admonition.caution > .admonition-title {
    background-color: #ffd6d6;
    color: #7f0000;
}



html[data-theme="dark"] .bd-content .admonition:not(.note):not(.caution):not(.warning):not(.danger):not(.error) {
    border-left-color: #66bb6a;
    background-color: #142414;
}

html[data-theme="dark"] .bd-content .admonition:not(.note):not(.caution):not(.warning):not(.danger):not(.error) > .admonition-title {
    background-color: #1f3a20;
    color: #b8f5ba;
}

html[data-theme="dark"] .bd-content .admonition.note {
    border-left-color: #ffca28;
    background-color: #2b250f;
}

html[data-theme="dark"] .bd-content .admonition.note > .admonition-title {
    background-color: #3a310f;
    color: #ffe082;
}

html[data-theme="dark"] .bd-content .admonition.caution {
    border-left-color: #ef5350;
    background-color: #2a1414;
}

html[data-theme="dark"] .bd-content .admonition.caution > .admonition-title {
    background-color: #3a1f1f;
    color: #ffcdd2;
}


.grouped-block {
    margin: 1.5em 0;
    padding: 1.2em 1.4em;
    border: 1px solid var(--pst-color-border);
    border-radius: 8px;
    background-color: var(--pst-color-surface);
}

.grouped-block > :first-child {
    margin-top: 0;
}

.grouped-block > :last-child {
    margin-bottom: 0;
}