@import url("https://fonts.googleapis.com/css2?family=Bitter:wght@400;600&family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap");

@font-face {
    font-family: "TaraType";
    src: url("/_static/fonts/TaraType.ttf") format("truetype");
}

:root {
    --border-radius: 0.5em;
}

body {
    font-family: "Open Sans", sans-serif;

    --color-brand-primary: #404040;
    --color-brand-content: #93774b;
    --color-foreground-primary: #404040;
    --color-background-primary: #f9f8f7;
    --color-background-secondary: #f3f2f1;
    --color-admonition-background: #eeeeee;
    --color-table-border: #e1e4e5;
    --color-background-border: #dddddd;
    --color-guilabel-background: #f3f2f1;
    --color-guilabel-border: #dddddd;
    --color-admonition-title--note: #93774b;
    --color-admonition-title-background--note: #e4e0d7;
    --color-admonition-title--seealso: #93774b;
    --color-admonition-title-background--seealso: #e4e0d7;
    --color-admonition-title: #93774b;
    --color-admonition-title-background: #e4e0d7;

    --color-border: #dddddd;
    --color-button: #f3f6f6;
    --color-background-highlight: #f3f2f1;
    --color-title: #303030;
    --color-link-hover: #bf431d;

    --color-carbon-ads-link: #606060;
    --color-carbon-ads-text: #637381;
    --color-carbon-ads-poweredby: #d0d0d0;
    --color-carbon-ads-background: #f7f6f5;
    --color-carbon-ads-border: #dddddd;

    --color-pyrogram-text: #3b3936;
    --color-strong: #404040;

    --color-green: darkgreen;
    --color-red: darkred;

    --font-size--small: 100%;
    --font-size--small--2: 97%;
    --font-size--small--3: 94%;
    --font-size--small--4: 91%;

    --header-height: calc(var(--sidebar-item-line-height) + var(--sidebar-item-spacing-vertical)*6);
    -webkit-font-smoothing: auto;

    font-size: 16px;
}

@media (prefers-color-scheme: dark) {
    body:not([data-theme=light]) {
        --color-brand-primary: #bfbcb9;
        --color-brand-content: #b7a280;
        --color-foreground-primary: #bfbcb9;
        --color-background-primary: #202020;
        --color-background-secondary: #181818;
        --color-admonition-background: #282828;
        --color-table-border: #707070;
        --color-guilabel-background: #323232;
        --color-guilabel-border: #505050;
        --color-admonition-title--note: #b7a280;
        --color-admonition-title-background--note: #303030;
        --color-admonition-title--seealso: #b7a280;
        --color-admonition-title-background--seealso: #303030;
        --color-admonition-title: #b7a280;
        --color-admonition-title-background: #303030;

        --color-border: #505050;
        --color-button: #303030;
        --color-background-highlight: #323232;
        --color-title: #b9b9b9;
        --color-link-hover: #e85823;

        --color-carbon-ads-link: #aaaaaa;
        --color-carbon-ads-text: #bfbcb9;
        --color-carbon-ads-poweredby: #505050;
        --color-carbon-ads-background: #323232;
        --color-carbon-ads-border: #505050;

        --color-pyrogram-text: #b9b9b9;
        --color-strong: #cfccc9;

        --color-green: green;
        --color-red: red;
    }
}

/* start: headings size and font */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: Bitter, serif;
    font-weight: 600;
    color: var(--color-title);
}

h1 {
    font-size: 175%
}

h2 {
    font-size: 150%
}

h3 {
    font-size: 125%
}

h4 {
    font-size: 115%
}

h5 {
    font-size: 110%
}

h6 {
    font-size: 100%
}

/* end: heading size and font */

/* start: code highlight */
article[role=main] .highlight pre {
    font-family: "Ubuntu Mono", monospace;
    font-size: var(--font-size--normal);
    line-height: 1.2;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: var(--color-background-highlight);
}

.highlight {
    border-radius: var(--border-radius);
}

p code.literal {
    padding: 0 4px;
    background-color: var(--color-background-highlight);
    border-color: var(--color-border);
    border-width: 0px;
    border-radius: 0.5em;
}

p code.xref.literal {
    border-width: 1px;
}

/* end: code highlight */

/* start: admonitions */
.admonition {
    border-radius: var(--border-radius);
    font-size: var(--font-size--normal);
    border-left: 0;
}

p.admonition-title {
    font-size: var(--font-size--normal);
    font-weight: bold;
}

/* admonition title icon */
p.admonition-title:before {
    height: 21px;
    width: 21px;
}

/* end: admonitions */

/* start: prev and next buttons */
.related-pages a {
    font-size: var(--font-size--normal);
    background-color: var(--color-button);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, .1);
    box-shadow: inset 0 1px 2px -1px hsl(0deg 0% 100% / 50%), inset 0 -2px 0 0 rgb(0 0 0 / 10%);
}

.related-pages a.prev-page {
    padding: 6px 10px 6px 10px;
}

.related-pages a.next-page {
    padding: 6px 10px 6px 10px;
}

.page-info .context {
    font-size: 18px;
    color: var(--color-foreground-primary);
}

/* end: prev and next buttons */

/* start: bigger mobile left and right menus */
.sidebar-container {
    width: 18em;
}

@media (max-width: 67em) {
    .sidebar-drawer {
        width: 18em;
        left: -18em;
    }
}

.toc-drawer {
    width: 18em;
}

@media (max-width: 82em) {
    .toc-drawer {
        right: -18em;
    }
}

/* end: bigger mobile left and right menus */

/* start: table tweaks */
table.docutils {
    border: 1px solid var(--color-table-border);
    border-radius: var(--border-radius);
    border-collapse: separate;
    overflow: hidden;
    width: 100%;
}

table.docutils th {
    border-right: none;
}

table.docutils td {
    border-bottom-width: 1px;
    border-left-width: 1px;
    border-top-width: 0;
    border-right-width: 0;
}

table.docutils td p {
    padding: 5px;
}

table.docutils:not(.field-list) tr:nth-child(2n-1) td {
    background-color: var(--color-background-highlight);
}

table.docutils tbody>td:first-child {
    border-left-width: 0;
}

table.docutils tbody>tr:last-child td {
    border-bottom-width: 0;
}

table.docutils th:last-child {
    width: 100%;
}

table>caption {
    font-size: 24px;
    font-weight: bold;
    font-family: 'Bitter';
    border-bottom: 1px solid var(--color-table-border);
    padding: 5px;
}

/* end: table tweaks */

/* start: docstrings paragraph titles (parameters, return, ...) */
dt {
    text-transform: none !important;
    background-color: var(--color-background-highlight) !important;
    border-radius: var(--border-radius) !important;
    padding: 2px 8px 2px 8px;
    width: fit-content;
    border-left: 2px solid var(--color-border) !important;
}

.sig-prename,
.sig-name {
    color: var(--color-foreground-primary);
}

/* end: docstrings paragraph titles (parameters, return, ...) */

/* start: adblocker banner */
.banner {
    border-radius: var(--border-radius);
    border: 1px solid #888888;
    color: #888888;
    padding: 15px;
    margin: 20px auto;
    text-align: center;
    font-size: 20px;
    width: auto;
    /*max-width: 330px;*/
    background-image:
        /*url(/_static/img/bgnoise.png),*/
        repeating-linear-gradient(135deg,
            rgba(128, 128, 128, 0.1),
            transparent 10%);
}

/* end: adblocker banner */

/* start: github link, stars and used-by top bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.github-buttons {
    display: flex;
}

.github-button {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-left: 10px;
    border: 1px solid var(--color-border);
    border-spacing: 0;
}

.github-button td {
    padding: 4px 8px;
    border-left: 1px solid var(--color-border);
    width: 100%;
    height: 100%;
}

.github-button td:first-child {
    border-left-width: 0;
    background-color: var(--color-background-highlight);
}

.horizontal-line {
    margin-top: 25px;
    border-top: 1px solid var(--color-background-border);
}

@media (max-width: 67em) {
    .top-bar {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .view-on-github {
        margin-bottom: 10px;
    }
}

/* end: github link, stars and used-by top bar */

/* start: pyrogram logo */
.index-logo {
    margin-bottom: -30px;
}

.sidebar-brand {
    margin-bottom: 10px;
    padding: 0 2px 0 2px;
}

.sidebar-logo-container {
    margin-top: 20px;
    margin-bottom: 0;
}

.sidebar-logo {
    width: 48px;
    display: inline;
}

.pyrogram-text {
    font-family: TaraType, sans-serif;
    font-size: calc(var(--font-size--normal) * 3);
    color: var(--color-pyrogram-text);
    letter-spacing: 0.0425em;
    position: relative;
    top: -15px;
    font-weight: bold;
    display: inline;
}

.pyrogram-text-index {
    font-size: 72px;
    position: relative;
}

.pyrogram-logo-index {
    display: inline
}

.pyrogram-logo-index img {
    width: 72px;
}

/* end: pyrogram logo */

/* start: pyrogram version */
.pyrogram-version {
    border-top: 1px solid var(--color-background-border);
    border-bottom: 1px solid var(--color-background-border);
    border-radius: 0;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 20px;
    text-align: center;
    color: var(--color-foreground-muted);
}

/* end: pyrogram version */

/* start: carbon ads */
.ca-wrap {
    text-align: center;
    margin-top: 20px;
}

#carbonads {
    display: inline-block;
    overflow: hidden;
    padding: 6px;
    line-height: 1.25;
    max-width: 330px;
    font-size: 14px;
    border: 1px var(--color-carbon-ads-border) solid;
    background-color: var(--color-carbon-ads-background);
    border-radius: var(--border-radius);
}

#carbonads a {
    color: var(--color-carbon-ads-link);
    text-decoration: none;
}

#carbonads span {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 0;
}

.carbon-img {
    float: left;
    margin-right: 1em;
}

.carbon-img img {
    display: block;
    border-radius: var(--border-radius);
}

.carbon-text {
    display: block;
    float: left;
    max-width: calc(100% - 128px - 1em);
    text-align: left;
    color: var(--color-carbon-ads-text);
    margin-left: -6px;
}

.carbon-poweredby {
    position: absolute;
    left: calc(100% - 74px - 1em);
    bottom: 0;
    display: block;
    font-size: 12px;
    color: var(--color-carbon-ads-poweredby);
    font-weight: 500;
}

#carbonads a.carbon-poweredby {
    color: var(--color-carbon-ads-poweredby);
}

/* end: carbon ads*/

/* start: footer */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size--normal)
}

.right {
    float: right
}

.left {
    float: left
}

.footer-logo {
    display: flex;
    max-height: 80px;
    padding-right: 5px;
}

.copyright {
    display: flex;
    align-items: center;
}

.links a {
    padding-left: 5px
}

/* end: footer */

/* start: mobile header */
.mobile-header {
    font-family: TaraType, monospace;
    font-weight: bold;
    font-size: 38px;
    letter-spacing: .0425em;
}

.mobile-header .header-center img {
    width: 38px;
}

.mobile-header .header-center a {
    display: flex;
    align-items: flex-end;
}

@media (max-width: 67em) {
    .mobile-header {
        align-items: center;
    }

    .mobile-header .header-right {
        padding-top: 10px;
        align-items: baseline;
        margin-right: 20px;
        height: unset;
    }

    .mobile-header .header-left {
        align-items: baseline;
        margin-left: 10px;
        height: unset;
    }
}

/* end: mobile header */

/* start: Pyrogram text in the middle of mobile view */
.mobile-header-title {
    position: absolute;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    left: 0;
    right: 0;
    text-align: center;
    margin-top: 10px;
}

.mobile-header-title a {
    color: var(--color-foreground-primary);
}

/* end: Pyrogram text in the middle of mobile view */

/* start: misc */
.theme-toggle svg {
    width: 1.75rem;
    height: 1.75rem;
}

.icon svg {
    width: 1.75rem;
    height: 1.75rem;
}

.sidebar-tree label {
    margin-right: 10px;
}

blockquote {
    border-radius: var(--border-radius);
}

.bottom-of-page {
    font-size: var(--font-size--normal);
}

a {
    text-decoration: none;
}

a:hover,
a.reference:hover,
.sidebar-tree .toctree-l1>.reference:hover {
    color: var(--color-link-hover);
}

b,
strong {
    color: var(--color-strong);
}

/* fix empty spaces in raw api pages */
.content {
    justify-content: unset;
}

/* add dot before selected page in sidebar */
.sidebar-tree .current>.reference::before {
    content: "➤ ";
}

.toc-tree .reference::before {
    content: "• ";
}

.toc-tree li.scroll-current>.reference:before {
    content: "➤ ";
}

table.hlist {
    margin-top: -20px;
}

.highlight button.copybtn svg {
    color: var(--color-foreground-primary);
}

/* .sidebar-tree .toctree-l1>.reference {
    color: var(--color-foreground-primary);
}

.toctree-checkbox~label .icon svg {
    color: var(--color-foreground-primary);
} */

.toc-tree .reference {
    color: var(--color-brand-primary);
}

ul.breadcrumbs {
    margin-bottom: 0;
    padding: 0;
    list-style: none;
    font-size: 18px;
}

ul.breadcrumbs li {
    display: inline;
}

.usable-by {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 2px 5px;
    background-color: var(--color-background-highlight);
}

.content-icon-container {
    margin-top: 1.9rem;
    margin-bottom: 0;
}

/* end: misc */
