.page-python-article {
  --py-left-col-width: 47.5%;
  --py-right-col-width: 52.5%;
  --py-columns-gap: 18px;
}

.page-python-article .python-section {
  max-width: 960px;
  margin: 98px auto 40px;
  padding: 20px;
  transform: none;
  position: relative;
  font-family: "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1.6;
}

.page-python-article #python-local-menu,
.page-python-article .python-local-menu-slot {
  position: absolute;
  top: 66px;
  left: 20px;
  right: auto;
  margin: 0;
  width: auto;
  padding: 0;
  transform: translateY(-100%);
  z-index: 2600;
  isolation: isolate;
}

.page-python-article #python-local-menu .python-local-menu {
  width: fit-content;
}

.page-python-article #python-local-menu .python-menu-title,
.page-python-article #python-local-menu .python-menu-list li a,
.page-python-article #python-local-menu .python-menu-group-title {
  white-space: nowrap;
}

.page-python-article #python-local-menu,
.page-python-article #python-local-menu .python-local-menu,
.page-python-article #python-local-menu .python-menu-nav {
  width: auto;
}

.page-python-article #python-local-menu .python-menu-title {
  width: fit-content;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 10px;
  padding-right: 24px;
  min-width: 0;
}

.page-python-article #python-local-menu .python-menu-nav {
  width: max-content;
  min-width: 100%;
}

.page-python-article .python-header-section {
  margin: 0 0 24px;
  text-align: right;
  max-width: 100%;
}

.page-python-article .python-header-title {
  font-family: "Arial Narrow", "Liberation Sans Narrow", "Nimbus Sans Narrow", Arial, sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.4px;
  font-stretch: condensed;
}

.page-python-article .python-header-subtitle {
  font-family: "Arial Narrow", "Liberation Sans Narrow", "Nimbus Sans Narrow", Arial, sans-serif;
  font-size: 35px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.4px;
  font-stretch: condensed;
  margin: 4px 0 0;
}

.page-python-article .python-header-divider {
  margin: 0 0 18px;
  transform: translateY(-39px);
}

@media (min-width: 901px) {
  .page-python-article {
    --python-article-right-edge-offset: max(0px, calc((min(100vw, 1200px) - min(100vw, 960px)) / 2));
  }

  .page-python-article #site-header .brand-lines {
    margin-left: max(0px, calc((min(100vw, 1200px) - min(100vw, 960px)) / 2));
    align-items: flex-end;
  }

  .page-python-article #site-header #header-menu {
    position: absolute;
    right: var(--python-article-right-edge-offset);
    bottom: 0;
    transform: none;
  }

  .page-python-article #site-header .brand-main {
    transform: translate(0, var(--brand-main-shift-y));
  }

  .page-python-article #site-header .brand-sub {
    transform: translate(0, var(--brand-sub-shift-y));
  }

  .page-python-article #site-header .slogan-img {
    margin-left: auto;
    margin-right: var(--python-article-right-edge-offset);
    flex: 0 0 auto;
    transform: translate(0, var(--tryjesus-shift-y));
  }

  .page-python-article #site-header .tryjesus-img {
    height: var(--tryjesus-height);
    width: auto;
    max-width: none;
  }

  .page-python-article .python-header-section {
    text-align: right;
    padding-right: 0;
    margin-right: 0;
  }
}

.page-python-article .python-main-content {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 18px;
  margin: 20px 0 30px;
  max-width: 100%;
}

.page-python-article .python-leftbox {
  flex: 0 0 47.5%;
  max-width: 47.5%;
  min-width: 0;
  padding: 22px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.page-python-article .python-rightbox {
  flex: 0 0 52.5%;
  max-width: 52.5%;
  min-width: 0;
  padding: 22px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.page-python-article .python-leftbox h2,
.page-python-article .python-rightbox h2 {
  font-size: 34px;
  font-weight: 600;
  margin: 0 0 16px;
  line-height: 1.2;
}

.page-python-article .python-leftbox ul,
.page-python-article .python-rightbox ul {
  margin: 0 0 20px;
  padding-left: 24px;
  font-size: 19px;
  line-height: 1.65;
}

.page-python-article .python-leftbox li,
.page-python-article .python-rightbox li {
  margin-bottom: 12px;
}

.page-python-article .python-leftbox img,
.page-python-article .python-rightbox img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 18px auto 6px;
  border-radius: 6px;
}

.page-python-article .python-bottombox {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 30px 0;
  margin-right: auto;
  padding: 10px 16px;
  background: #fff;
  border: 3px solid var(--py-primary);
  border-radius: 8px;
  text-align: center;
}

.page-python-article .python-bottombox h1,
.page-python-article .python-bottombox h2 {
  font-family: "Segoe UI", SegoeUI, system-ui, -apple-system, sans-serif;
  font-size: 31px;
  font-weight: 500;
  color: var(--py-primary);
  margin: 0;
  line-height: 1.4;
}

.page-python-article .python-bottombox p {
  margin: 10px 0 0;
  line-height: 1.6;
  text-align: center;
  color: var(--py-text);
  font-size: 19px;
}

/* Formula/content overflow safeguards */
.page-python-article .python-leftbox p,
.page-python-article .python-rightbox p,
.page-python-article .python-leftbox li,
.page-python-article .python-rightbox li,
.page-python-article .python-leftbox blockquote,
.page-python-article .python-rightbox blockquote {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-python-article .python-leftbox pre,
.page-python-article .python-rightbox pre,
.page-python-article .python-leftbox code,
.page-python-article .python-rightbox code {
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}

.page-python-article .python-leftbox pre,
.page-python-article .python-rightbox pre {
  white-space: pre;
}

.page-python-article .python-leftbox table,
.page-python-article .python-rightbox table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}

.page-python-article .python-leftbox table th,
.page-python-article .python-leftbox table td,
.page-python-article .python-rightbox table th,
.page-python-article .python-rightbox table td {
  white-space: nowrap;
}

.page-python-article .formula-inline,
.page-python-article .math-inline {
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: 0.95em;
  overflow-wrap: anywhere;
}

.page-python-article .formula-block,
.page-python-article .math-block {
  font-size: 0.95em;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .page-python-article .python-section {
    margin: 20px auto 30px;
    padding: 14px;
  }

  .page-python-article #python-local-menu,
  .page-python-article .python-local-menu-slot {
    position: static;
    width: 100%;
    max-width: 100%;
    margin: calc(var(--header-height, 88px) + 8px) 0 20px 0;
    transform: none;
  }

  .page-python-article #python-local-menu .python-local-menu {
    width: 100%;
  }

  .page-python-article .python-header-title {
    font-size: 40px;
  }

  .page-python-article .python-header-subtitle {
    font-size: 26px;
  }

  .page-python-article .python-header-section {
    text-align: left;
  }

  .page-python-article .python-main-content {
    flex-direction: column;
  }

  .page-python-article .python-leftbox,
  .page-python-article .python-rightbox {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .page-python-article .python-bottombox h1,
  .page-python-article .python-bottombox h2 {
    font-size: 28px;
  }
}
