/*  Google fonts are self-hosted so that there is no delay due to unavailable
  network or firewalls within the @import tag, not just for loading the font
  itself, which is resolvable with "font-display: swap", but for the css import
  itself, which may still delay for a network timeout period before allowing
  the page to load, particularly for static file documentation downloads.
  Google does not offer stable font URLs.

  Source: https://fonts.googleapis.com/css?family=Libre+Franklin:400,700

*/

@font-face {
    font-family: "Libre Franklin";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://www.sqlalchemy.org/fonts/google_libre_franklin_400.woff2) format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
        U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Libre Franklin";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://www.sqlalchemy.org/fonts/google_libre_franklin_700.woff2) format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
        U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

$primary-font-family: "Libre Franklin", sans-serif;
$header-font-family: "Libre Franklin", Arial, sans-serif;
$top-header-font-family: "Libre Franklin", Arial, sans-serif;
$sidebar-font-family: "Libre Franklin", Verdana, sans-serif;

$narrow-max-screen-width: 980px;

$topmost-header-color: #ebebee;
$popout-color: #fbfbee;
$sidebar-color: #efefef;
$sidebar-header-background-color: inherit;
$sidebar-header-color: #222222;
$notebox-background-color: #eeffef;
$code-sig-background-color: #efefef;
$deprecated-background-color: #fcf0f6;
$warning-background-color: #fcf0f6;
$deepalchemy-background-color: #f6e8fd;
$versionchanged-background-color: #e8f4f8;
$outer-border-style: none;
$border-style: 1px solid #ccc;
$index-divider-line-style: 1px solid #ccc;
$member-table-cell-border: 1px solid #e1e4e5;
$member-table-cell-padding: 4px 16px;
$member-table-font-size: .85rem;

$box-top-margin: 10px;
$box-margin: $box-top-margin 10px 20px 0px;

// this is optimized for the site.  with the vanilla docs, the
// vertical padding is too much.   not sure how to fix
$box-padding: 1rem 1em 2px 1rem;

// looks better with vanilla docs but not w/ the site
// $box-padding: 0 1em 0 1rem;

$box-title-padding: 0 2em 0 1.5em;
$box-header-color: #c5cec2;
$box-background-color: #f8f9f0;

// note main text is on top of docs-body-background
$primary-background-color: #ffffff;

// passes:
// https://webaim.org/resources/linkcontrastchecker/?fcolor=110000&bcolor=FFFFFF&lcolor=BB0000
$docs-body-background: #ffffff;
$text-color: #110000;
$hyperlink-color: #990000;
$hyperlink-hover-color: #FF0000;

$section-hyperlink-color:  #990000;
$section-hyperlink-hover-color: #FF0000;
$section-hyperlink-font-weight: 400;
$section-hyperlink-code-font-weight: 600;

//$spacing-between-outer-boxes: 10px;
$spacing-between-outer-boxes: 0;

$keyword-color: #480717;
$keyword-background-color: #f2f2f2;

$highlighted-nav-link-background-color: #ddd;
$orm-background-color: #e2f3f4;
$core-background-color: #aecaf7;

$sidebar-popout-height: 171px;

$max-container-width: 100em; // 100 * 16 == 1600px;
$fixed-sidebar-width: 360px;
$inner-fixed-sidebar-width: $fixed-sidebar-width - 40px;

$docs-body-sidebar-left: 360px;
$docs-body-sidebar-horiz-padding: 45px;

/* global */

.body-background {
    background-color: $primary-background-color;
}

body {
    background-color: $primary-background-color;
    margin: 0 38px;
    color: $text-color;
}

blockquote {
    margin-right: inherit;
}

a {
    font-weight: normal;
    text-decoration: none;
}

form {
    display: inline;
}

label > input {
    margin: 10px 0px;
}

/* hyperlinks */

a:link,
a:visited,
a:active {
    color: $hyperlink-color;
}
a:hover {
    color: $hyperlink-hover-color;
    text-decoration: underline;
}

/* links within main content sections - dark mauve with underline */
#docs-body aside.topic a,
#docs-body .search a,
#docs-body section a,
#docs-body div.section a {
    color: $section-hyperlink-color;
    /*text-decoration: underline;*/
    text-underline-offset: 2px;
    font-weight: $section-hyperlink-font-weight;
}

#docs-body aside.topic a:hover,
#docs-body .search a:hover,
#docs-body section a:hover,
#docs-body div.section a:hover {
    color: $section-hyperlink-hover-color;
    /*text-decoration: underline;*/
    text-underline-offset: 2px;
    font-weight: $section-hyperlink-font-weight;
}

/* paragraph links after sections.
   These aren't visible until hovering
   over the <h> tag, then have a
   "reverse video" effect over the actual
   link
 */

a.headerlink {
    font-size: 0.8em;
    padding: 0 4px 0 4px;
    text-decoration: none;
    visibility: hidden;
}

*:hover > a.headerlink {
    visibility: visible;
}

a.headerlink:hover {
    background-color: #00f;
    /*background-color: #990000;*/
    color: white;
}

/* Container setup */

#docs-container {
    max-width: $max-container-width;
    margin: $spacing-between-outer-boxes auto;
    position: relative;
    font-size: 120%;
    line-height: 1.4em;
}

/* header/footer elements */

#docs-header {
    font-family: $primary-font-family;

    font-size: 0.9em;
    position: relative;

    background-color: $topmost-header-color;
    border: $outer-border-style;
    height: 75px;

    display: flex;
    align-items: center;

    h1 {
        font-size: 20px;
        color: #222222;
        margin-left: 10px;
    }
}

#docs-sidebar-popout,
#docs-bottom-navigation,
#index-nav,
#narrow-index-nav {
    font-family: $sidebar-font-family;
    background-color: $popout-color;
    border: $outer-border-style;
    font-size: 0.8em;
}

#docs-bottom-navigation,
#index-nav {
    padding: 10px;
}

#docs-version-header {
    position: absolute;
    right: 8px;
    bottom: 8px;
}

.docs-navigation-links {
    font-family: $primary-font-family;
}

#docs-bottom-navigation {
    margin: $spacing-between-outer-boxes 0 $spacing-between-outer-boxes 0;
}

#docs-bottom-navigation.withsidebar {
    margin-left: $fixed-sidebar-width;
}

#docs-copyright {
    font-size: 0.85em;
    padding: 5px 0px;
}

#docs-header h1,
#docs-narrow-top-navigation h1,
#docs-narrow-top-navigation h2 {
    font-family: $top-header-font-family;
    font-weight: normal;
}

#docs-top-page-control {
    position: absolute;
    right: 20px;
    bottom: 14px;
    ul {
        padding: 0;
        margin: 0;
    }
    li {
        font-size: 0.9em;
        list-style-type: none;
        padding: 1px 8px;
    }
}

#docs-container .version-num {
    font-weight: bold;
}

/* content container, sidebar */

#docs-body-container {
    position: relative;
}

#docs-body,
#index-nav {
    font-family: $primary-font-family;
    font-size: 0.9rem;
    line-height: 1.5em;

    h2 {
        line-height: 1.3em;
    }
}

#docs-body {
    min-height: 700px;
}

#index-nav {
    position: relative;
    margin-top: $spacing-between-outer-boxes;
    padding: 10px 10px 25px 10px;
}

#index-nav form {
    padding-top: 10px;
    float: right;
}

#sidebar-paginate {
    position: absolute;
    bottom: 4.5em;
    left: 10px;
}

#sidebar-topnav {
}

#sidebar-search {
    margin: 10px 0px 10px 0px;
}

#docs-sidebar {
    top: $sidebar-popout-height + 18px;
    width: $fixed-sidebar-width;
    margin-right: $fixed-sidebar-width - $inner-fixed-sidebar-width;
    bottom: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 5px;
    margin-right: 5px;
    z-index: 3;
}

#sidebar-banner {
    margin: 0px;
    padding: 0px;
}

#sidebar-prerelease,
#sidebar-legacy,
#sidebar-current,
#sidebar-beta {
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1.1em;
    padding: 2px 5px 2px 5px;
    width: 11em;
    text-align: center;
}

#sidebar-prerelease,
#sidebar-legacy {
    background: #f11;
    color: #bbb;
}

#sidebar-beta {
    background: #ffff80;
    color: #555;
}

#sidebar-current {
    background: #4c4;
    color: #555;
}

#docs-version-header {
    #sidebar-prerelease,
    #sidebar-legacy,
    #sidebar-current {
        width: 14em;
        font-size: 1em;
    }
}

#docs-sidebar-inner {
    padding-left: 10px;
    margin-right:40px;
    /*width:212px;*/

    font-family: $sidebar-font-family;

    font-size: 0.85em;

    border: $outer-border-style;
    background-color: $sidebar-color;

    > ul {
        font-size: 0.85em;
    }

    span.link-container {
        display: block;
        margin-left: -100px;
        padding-left: 100px;
        padding-top: 3px;
        padding-bottom: 3px;
        position: relative;
        z-index: -1;
    }

    li {
        position: relative;
        z-index: 1;
    }

    li.current > span.link-container {
        background-color: $highlighted-nav-link-background-color;
    }

    span.nav-toggle {
        position: absolute;
        right: -15px;  // so it lives outside the list items themselves, within the padding area
        top: 3px;
        width: 1em;
        text-align: center;
        cursor: pointer;
        user-select: none;
        font-size: 0.85em;
        color: #666;
        z-index: 2;

        &:hover {
            color: #000;
        }

        &.expanded {
            // The rotation is handled by changing the text from ▶ to ▼
        }
    }

    h3,
    h4,
    h5 {
        background-color: $sidebar-header-background-color;
        color: $sidebar-header-color;
        font-family: $sidebar-font-family;
        font-size: 1.1em;
        font-weight: normal;
        margin: 10px 0 0 -15px;
        padding: 15px 10px 5px 15px;
        text-shadow: 1px 1px 0 white;

        a {
            color: $sidebar-header-color;
        }
    }

    h3:first-child {
        margin-top: 0px;
    }

    ul {
        margin: 10px 0px 10px 0px;
        padding: 0;
        list-style: none outside none;
        ul {
            margin-bottom: 0;
            margin-top: 0;
            list-style: square outside none;
            margin-left: 20px;

        }
    }
}

#docs-sidebar-popout {
    height: $sidebar-popout-height;
    max-height: $sidebar-popout-height;
    width: auto;
    padding-left: 10px;
    padding-top: 10px;
    position: relative;
    line-height: 1.2em;
    font-size: 0.75em;

    p,
    form {
        margin: 5px 0 5px 0px;
    }

    h3 {
        margin: 0 0 10px 0;
    }
}

#fixed-sidebar {
    position: relative;
    box-sizing: border-box;
}


#fixed-sidebar.withsidebar {
    // note that init.js will change this dynamically
    // to "fixed" or "absolute"
    position: absolute;
    float: left;
    width: $fixed-sidebar-width;
    top: 0;
    bottom: 0;
    background-color: $sidebar-color;

}

#fixed-sidebar #docs-sidebar {
    position: absolute;
}

#fixed-sidebar #docs-sidebar:after {
    content: " ";
    display: block;
    height: 150px;
}

#docs-sidebar {
    position: fixed;
}

#docs-body {
    background-color: $docs-body-background;
    padding: 10px 10px 10px 10px;

    border: $outer-border-style;
    margin-top: $spacing-between-outer-boxes;
}

#docs-body.withsidebar {
    margin-left: $docs-body-sidebar-left;

    padding: 10px $docs-body-sidebar-horiz-padding 0 $docs-body-sidebar-horiz-padding;

    div.section,
    section {
        /* to limit text width inside the container */
        /*max-width: 1024px;*/
    }
}

#docs-narrow-top-navigation {
    display: none;
}

#narrow-index-nav {
    display: none;
}

/* disable sidebar on mobile / narrow screens */
@media only screen and (max-width: $narrow-max-screen-width) {
    #fixed-sidebar {
        display: none;
    }
    #narrow-index-nav {
        display: block;
        padding: 1rem;
        margin: $spacing-between-outer-boxes 0 $spacing-between-outer-boxes 0;
    }

    #docs-body.withsidebar {
        margin-left: 0;
    }
    #docs-bottom-navigation.withsidebar {
        margin-left: 0;
    }

    #docs-narrow-top-navigation {
        display: block;
    }
    #docs-top-navigation-container h1 {
        position: absolute;
        top: 10px;
        margin: 0;
        padding: 0;
        left: 8px;
    }

    #docs-header {
        height: 124px;
    }
    #docs-version-header {
        position: absolute;
        left: 8px;
        right: 0;
        bottom: 8px;
    }
}

#docs-narrow-top-navigation {
    border: $outer-border-style;
    background-color: $sidebar-color;
    font-family: $sidebar-font-family;
    font-size: 0.85rem;

    h2 {
        margin: 16px 4px 7px 5px;
        font-size: 1.6em;
    }
    p {
        margin: 0;
    }
}

#docs-body h1,
#docs-body h2,
#docs-body h3,
#docs-body h4,
#docs-body h5,
#docs-body .h2 {
    font-family: $header-font-family;
    font-weight: bold;
    /* don't put a clear:both here. use less floats */
}

#docs-body {
    #sqlalchemy-documentation h1 {
        /* hide the <h1> for each content section. */
        display: none;
        font-size: 2em;
    }

    h1 {
        font-size: 1.7rem;
    }

    h2 {
        font-size: 1.6rem;
        border-top: $index-divider-line-style;
        padding-top: 20px;
    }

    #sqlalchemy-documentation h2 {
        border-top: none;
        padding-top: 0;
    }
    h3 {
        font-size: 1.4rem;
    }

    h4 {
        font-size: 1.2rem;
    }

    h5 {
        font-size: 1.05rem;
    }
}

/* SQL popup, code styles */

.highlight {
    background: none;
}

#docs-container {
    pre {
        font-size: .85rem;
        background-color: #f0f0f0;
        border: $border-style;
        border-radius: 4px;
        padding: 10px;
        padding-right: 3em;
        margin: $box-margin;
        overflow: auto;
        line-height: 1.3em;
        clear: both;
        position: relative;
    }

    @media only screen and (max-width: ($narrow-max-screen-width + 300)) {
        pre {
            padding: 10px 10px 30px 10px;
        }
    }

    /* python annotation key */
    div.code-annotations-key, div.code-non-annotations-key {
        position:absolute;
        right:1.2em;
        bottom:.05em;
        width: 180px;
        background-size: 180px;
        height: 30px;
    }
    div.code-annotations-key {
        background-image: url("annotated.png");
    }
    div.code-non-annotations-key {
        background-image: url("nonannotated.png");
    }


    /* the [SQL] links used to display SQL */
    .sql_link {
        font-weight: normal;
        font-family: helvetica, arial, sans-serif;
        font-size: 0.9em;
        text-transform: uppercase;
        color: #990000;
        border: 1px solid;
        padding: 1px 2px 1px 2px;
        margin: 0px 10px 0px 15px;
        float: right;
        line-height: 1.2em;
    }

    a.sql_link,
    .sql_link {
        text-decoration: none;
        padding: 1px 2px;
    }

    a.sql_link:hover {
        text-decoration: none;
        color: #fff;
        border: 1px solid #900;
        background-color: #900;
    }

    a.changeset-link {
        font-size: 0.8em;
        padding: 0 4px 0 4px;
        text-decoration: none;
    }
}

.popup_sql,
.show_sql,
.show_sql_print {
    padding: 5px 10px;
    margin: 10px -5px 10px -5px;
    border: 1px dashed;
}
.popup_sql,
.show_sql {
    background-color: $popout-color;
}
/* SQL popups are always on at the moment, disable the button */
.sql_link {
    display: none;
}

/* tables */

.sliding-table {
    width: 100%;
    overflow: auto;
}

.section > table.docutils,
.sliding-table > table.docutils,
section > table.docutils {
    border: none;
    border-collapse: collapse;

    tr {
        border-collapse: collapse;
        border-spacing: 0;
        empty-cells: show;

        td,
        th {
            border: $member-table-cell-border;
            background-color: transparent;
            vertical-align: middle;
            font-size: $member-table-font-size;
            margin: 0;
            overflow: visible;
            padding: $member-table-cell-padding;
        }

        td.autosummary-name {
            vertical-align: top;
        }

    }

    tr.row-even {
        td {
            background-color: #f3f6f6;
        }
    }
}

/* docutils-specific elements */

th.field-name {
    text-align: right;
    position: absolute;
    padding: 0px;
    margin: 0px;
}


td.field-body {
    padding-top: 1em;
    ul.first {
        padding-left: 17px;
        padding-top: 1em;
    }

}

div.faq {
    background-color: #efefef;
}

div.faq ul {
    list-style: square outside none;
}

/* box styles */

.footnote-reference {
    vertical-align: super;
}
dl.footnote {
    font-size: 0.95em;
    border: $border-style;
    background-color: $box-background-color;
    margin: $box-margin;
    padding: 10px 20px 0 20px;

    dt {
        float: left;
        background-color: $box-header-color;
        margin: -10px 0 0 -20px;
        padding: 0 10px 0 10px;
    }
    dd {
        margin-right: 40px;

        p {
            margin-top: 0;
        }
    }
}

p.deprecated,
div.deprecated {
    background-color: $deprecated-background-color;
}

.versionchanged,
.versionadded,
.versionmodified added {
    background-color: $versionchanged-background-color;
}

div.warning .admonition-title {
    color: #ff0000;
}

div {
    .admonition,
    .sidebar,
    .topic,
    .docutils-header,
    .docutils-footer {
        clear: both;

        .admonition-title,
        .sidebar-title,
        .topic-title {
            background-color: #d4edda;
            padding: 8px 12px;

            margin: -10px -10px 10px -10px;

            font-weight: bold;
            border: none;
            border-radius: 4px 4px 0 0;
        }

        > p {
            font-size: 0.9rem !important;
        }

        padding: 10px;
        background-color: #ffffff;
        border: 1px solid #d0d0d0;
        border-left: 4px solid #5cb85c;
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);

        margin: $box-margin;
        font-size: 0.9rem !important;

        * {
            font-size: inherit !important;
        }
    }
}



aside.sidebar, div.tip {
    background-color: #ffffff;
    border-left: 4px solid #909090;

    .sidebar-title, .admonition-title {
        background-color: #c4e2e0;
        color: #404040;
        margin: -10px -10px 10px -10px;
        padding: 8px 12px;
        border-radius: 4px 4px 0 0
    }
}

div.deprecated,
div.versionadded,
div.versionchanged,
div.versionmodified {
    padding: $box-padding;
    border-radius: 4px;
    margin: $box-margin;
}

div .versionwarning,
div .version-warning {
    font-size: 12px;
    font-color: red;
    border: $border-style;
    padding: 4px 4px;
    margin: 8px 0px 2px 0px;
    background: #ffbbbb;
}

div.note,
div.warning {
    position: relative;
    > .admonition-title {
        background-color: #fff8e1;
        color: #795548;
        margin: -10px -10px 10px -150px;
        padding: 8px 12px;
        border-radius: 4px 4px 0 0;
    }
    background-color: #ffffff;
    clear: right;
    min-height: 160px;
    padding-left: 150px;
    padding-bottom: 10px;
    border-left: 4px solid #ffb74d;

    &::before {
        content: "";
        position: absolute;
        left: 0;
        top: 37px;
        bottom: 0;
        width: 130px;
        background-color: #ffecb3;
        background-image: url("dragons.png");
        background-position: 10px -28px;
        background-repeat: no-repeat;
        border-right: 1px solid #e0e0e0;
        border-radius: 0;
        box-shadow: none;
        z-index: 0;
    }

    > * {
        position: relative;
        z-index: 1;
    }
}

div.warning {
    > .admonition-title {
        background-color: #ffebee;
        color: #721c24;
    }
    border-left: 4px solid #ef5350;

    &::before {
        background-color: #ffcdd2;
    }
}

div.deepalchemy {
    position: relative;
    > .admonition-title {
        background-color: #e8d5f0;
        color: #6a1b9a;
        margin: -10px -10px 10px -150px;
        padding: 8px 12px;
        border-radius: 4px 4px 0 0;
    }
    background-color: #ffffff;
    clear: right;
    min-height: 140px;
    padding-left: 150px;
    padding-bottom: 10px;
    border-left: 4px solid #9c27b0;

    &::before {
        content: "";
        position: absolute;
        left: 0;
        top: 37px;
        bottom: 0;
        width: 130px;
        background-color: #f3e5f5;
        background-image: url("deepalchemy.png");
        background-size: auto 100px;
        background-position: 20px -3px;
        background-repeat: no-repeat;
        border-right: 1px solid #e0e0e0;
        border-radius: 0;
        box-shadow: none;
        z-index: 0;
    }

    > * {
        position: relative;
        z-index: 1;
    }
}

@media only screen and (max-width: $narrow-max-screen-width) {
    div.note,
    div.warning {
        > .admonition-title {
            margin-left: -10px;
            padding-left: 10px;
        }
        padding-left: 10px;

        &::before {
            display: none;
        }
    }
    div.deepalchemy {
        > .admonition-title {
            margin-left: -10px;
            padding-left: 10px;
        }
        padding-left: 10px;

        &::before {
            display: none;
        }
    }
}

/* grrr sphinx changing your document structures, removing classes.... */

.versionadded .versionmodified,
.versionchanged .versionmodified,
.deprecated .versionmodified,
.versionadded > p:first-child > span:first-child,
.versionchanged > p:first-child > span:first-child,
.deprecated > p:first-child > span:first-child {
    color: #990000;
    font-weight: bold;
}

div.class-bases, div.class-members {
    border: $border-style;
    padding: 5px 5px;

    padding: $box-padding;

    font-size: 0.9rem !important;
    margin: $box-margin;

    * {
        font-size: inherit !important;
    }
}
div.class-bases {
    background-color: #eefbfb;
}
div.class-members {
    background-color: #ebedfa;
}

table.class-members {
    border: none;
    border-collapse: collapse;
    margin: $box-margin;
    width: 100%;
    font-size: 0.9rem !important;

    tr {
        border-collapse: collapse;
        border-spacing: 0;
        empty-cells: show;

        td,
        th {
            border: $member-table-cell-border;
            background-color: transparent;
            vertical-align: middle;
            font-size: $member-table-font-size;
            margin: 0;
            overflow: visible;
            padding: $member-table-cell-padding;
        }

        td.autosummary-name {
            vertical-align: top;
        }
    }

    tr.row-even {
        td {
            background-color: #f3f6f6;
        }
    }

    thead {
        tr {
            th {
                font-weight: bold;
            }
        }
    }

    * {
        font-size: inherit !important;
    }
}

div.inherited-member {
    border: $border-style;
    border-radius: 4px;
    padding: 5px 5px;
    margin-left: 2em;
    margin-bottom: 1em;
    font-size: 0.9em;
    background-color: #eefbfb;

    p {
        margin: 0;
    }
}

main.docs dl.field-list.simple dd > p {
    padding-left: 1em !important;
}

.viewcode-back,
.viewcode-link {
    float: right;
}

dl.function > dt,
dl.attribute > dt,
dl.classmethod > dt,
dl.method > dt,
dl.exception > dt {
    border: none;
    border-top: 1px solid #e0e0e0;
    background-color: transparent;
    margin: 25px 0 10px 0;
    padding: 10px 0 0 0;
}

dl.class > dt {
    border: none;
    border-top: 1px solid #e0e0e0;
    background-color: transparent;
    margin: 25px 0 10px 0;
    padding: 10px 0 0 0;
}

dl.function > dd,
dl.attribute > dd,
dl.classmethod > dd,
dl.method > dd,
dl.class > dd,
dl.exception > dd {
    margin-left: 2em;
}

/* parameters / returns lists for functions and methods */
dl.field-list {
    border: none;
    margin: $box-top-margin 0 0 0;

    li > p {
        margin: 0.5em 0 0.5em 0;
    }
}

dl.field-list > dt {
    border: none;
    border-bottom: none;
    font-weight: bold;
    background-color: #f0f0f0;
    padding: 8px 12px;
    margin: 0;
}

dl.field-list > dd {
    padding: 0.5em 0;
}

dl.glossary > dt {
    font-weight: bold;
    font-size: 1.1em;
    padding-top: 10px;
}

dt:target,
span.highlight {
    background-color: #fbe54e;
}

.clearboth {
    clear: both;
}

.nowrap {
    white-space: nowrap;
}

/* copybutton styles
   requires https://sphinx-copybutton.readthedocs.io/
*/
button.copybtn {
    top: .6em !important;
    right: 1.2em !important;
    width: 2.5em !important;
    height: 2.5em !important;
    svg {
        width: 2em !important;
        height: 2em !important;
    }
}


/* sphinx 1.3 now using 'code' and not 'tt' for code / docstring elements */
/* sphinx 1.4 now using 'span' and not 'code' for code / docstring elements */

span.descclassname,
span.descname,
code,
tt {
    padding: 0 1px;

    color: $keyword-color;
    font-family: "Courier New", Courier, fixed, monospace;
    font-weight: 400;
    font-size: 95%;

    > .pre {
    }
}

span.descname,
code.descname,
tt.descname {
    background-color: transparent;
    font-size: 1.2em;
    font-weight: bold;
}

span.descclassname,
code.descclassname,
tt.descclassname {
    background-color: transparent;
}

a {
    code,
    tt {
        > .pre {
            color: $hyperlink-color;
        }
    }
    span.sig-name,
    code.sig-name {
        color: $hyperlink-color;
    }
}

/* override for links with code/span in main content sections */
#docs-body section a,
#docs-body div.section a {
    code,
    tt {
        > .pre {
            color: $section-hyperlink-color;
            font-weight: $section-hyperlink-code-font-weight;
        }
    }
    span.sig-name,
    code.sig-name {
        color: $section-hyperlink-color;
        font-weight: $section-hyperlink-code-font-weight;
    }
}

#docs-body section a:hover,
#docs-body div.section a:hover {
    code,
    tt {
        > .pre {
            color: $section-hyperlink-hover-color;
        }
    }
    span.sig-name,
    code.sig-name {
        color: $section-hyperlink-hover-color;
    }
}

/* syntax highlighting overrides */
.o {
    color: #bf0005;
}
.go {
    color: #804049;
}

/* special "index page" sections
   with specific formatting
*/

div#sqlalchemy-documentation {
    font-size: 0.95em;
}
div#sqlalchemy-documentation em {
    font-style: normal;
}
div#sqlalchemy-documentation .rubric {
    font-size: 14px;
    background-color: #eeffef;
    padding: 5px;
    border: 1px solid #bfbfbf;
}
div#sqlalchemy-documentation a,
div#sqlalchemy-documentation li {
    padding: 5px 0px;
}

div#getting-started {
    border-bottom: $index-divider-line-style;
}

div#tutorials {
    border-bottom: $index-divider-line-style;
}

/* new index layout thing */

#docs-body.index {
    padding: 0;
}

div.left-right-container {
    display: flex;

    p.h2 {
        display: block;
        font-weight: bold;
        font-size: 1.4em;
    }

    .container {
        border-bottom: $index-divider-line-style;
        //margin: 0 20px 0 20px;
        padding-right:10px;

    }

    &:last-of-type {
        .container {
            border-bottom: none;
        }
    }
    .orm {
        background-color: $orm-background-color;
        margin-right: 0;
    }
    .core {
        background-color: $core-background-color;
        margin-left: 0;
    }

    .leftmost {
        width: 15em;
        max-width: 15em;
        background-color: #e4e4e8;
        padding-left: 10px;
        border-bottom: none;
        margin: 0;
    }

    div {
        flex: 3;
        padding-left: 10px;
    }
}
@media only screen and (max-width: $narrow-max-screen-width) {
    div#docs-header {
        padding-bottom: 1rem;

    }
    div.left-right-container {
        display: block;
        margin: 0;
        max-width: none;
        .leftmost {
            width: auto;
            max-width: none;
            padding: 10px 10px 10px 10px;
        }

        div.container {
            padding-bottom: 1rem;
            max-width: none;
            margin: 0;
        }

        .orm, .core {
            padding-bottom: 1rem;
        }

    }

}

/* legacy index layout thing */

div#sqlalchemy-documentation {
    li p {
        margin: 0;
    }
}

div#sqlalchemy-documentation > .section,
div#sqlalchemy-documentation > section {
    padding-left: 10px;
}

div#sqlalchemy-documentation div#sqlalchemy-orm {
    float: left;
    width: 48%;
    min-height: 400px;
    padding-left: 10px;
    border-right: $index-divider-line-style;
    h2 {
        margin: 0;
    }
}

div#sqlalchemy-documentation div#sqlalchemy-core {
    margin: 0;
    padding-left: 10px;
    min-height: 400px;
    padding-left: 50%;

    h2 {
        margin: 0;
    }
}

div#dialect-documentation {
    border-top: $index-divider-line-style;
    clear: both;
}

/* core/orm tabbed thing */

@mixin card-line-style() {
    box-shadow: 0px 0px 2px #ccc;
    padding-top: 1px;
    padding-bottom: 1px;
    border-radius: 10px;

    h2 {
        border-top: none;
    }
}

#docs-body {
    div.orm-core, section.orm-core {
        h2,
        h3,
        h4,
        h5 {
            border: none;
        }
    }

    div.orm-header, section.orm-header {
        @include card-line-style();
        border-left: 2.2em solid $orm-background-color;

        padding-left: 1em;
        padding-right: 1em;
        margin-bottom: 2em;

        > h2,
        > h3 {
            border: none;
            padding-top: 0;
        }
    }

    div.core-header, section.core-header {
        @include card-line-style();
        border-right: 2.2em solid $core-background-color;

        padding-left: 1em;
        padding-right: 1em;
        margin-bottom: 2em;

        > h2,
        > h3 {
            border: none;
            padding-top: 0;
        }
    }

    div.orm-dependency, section.orm-dependency {
        border-left: .6em solid $orm-background-color;
    }

    div.orm-addin, section.orm-addin {
        @include card-line-style();
        border-left: .6em solid $orm-background-color;

        padding-left: 10px;
        margin: 10px 0 10px 0;
    }
}
