/*
.wy-nav-content {
    max-width: 1000px !important
}
*/
.wy-side-nav-search {
    background-color: #161f28 !important;
}

.wy-nav-side {
    background: #343a40 !important;
}

.wy-nav-top {
    background: #161f28;
}

td, th{
    border: 1px solid #c9c9c9 !important;
}

code  {
    font-size: 90% !important;
}

.my-custom-table td>p {
    font-size: 90% !important;
}

.my-custom-table td code, 
.my-custom-table td .line-block, 
.my-custom-table th .line-block  {
    font-size: 90% !important;
}

td .line-block, th .line-block {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 20px !important;
}

td .line-block .line, th .line-block .line {
    margin: 0;
}

.rst-content table.docutils td, .rst-content table.docutils th, .rst-content table.field-list td, .rst-content table.field-list th, .wy-table td, .wy-table th {
    padding: 8px 8px !important;
}

.page-break {
    break-after: page;
    /* Или: page-break-after: always; (устаревшее, но работает) */
}

/* Обычный режим (экран) — ничего не делаем */
.pdf-only-spacer, .pdf-only-toc {
    display: none; /* Скрываем в HTML */
}

h2 {
    padding-top: 20px;
    margin-top: 0 !important;
}

h1, h2, .uppercase-text {
    text-transform: uppercase;
}

p.sd-card-text:not(:last-child) { /*отступы для текста в dropdown*/
    margin-bottom: 0.5em;
}

td p.sd-card-text:not(:last-child) { /*отступы для текста в dropdown*/
    margin-bottom: 0.5em;
}

td p, th p { /*отступы для текста в dropdown*/
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.toctree-custom .toctree-l1 {
    font-size: 130%;
    margin-bottom: 0.2em
}

.download_pdf_button {
    background-color: #161f28;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 10px;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.download_pdf_button:hover {
    background-color: #0d1318;
}

.download_pdf_button:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

p {
    text-align: justify;
}

figcaption p, .after_button {
    text-align: center;
}

td > figure, th > figure { /*отступы для текста в dropdown*/
    margin-top: 0;
    margin-bottom: 0;
}

img {
    /*box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);*/
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    margin-bottom: 0.5em;
}

/* Только при печати (и в PDF) */

@media print {
    .pdf-only-spacer {
        display: block;
        height: 200px; /* Отступ вниз*/
        content: "";
        /* Можно сделать видимым для отладки: background: red; */
    }
    
    .pdf-only-toc {
        display: block;
        margin: 30px 0;
    }

    .no-print, div[role="navigation"]{
        display: none !important;
    }

    section > p {
        margin: 0 0 5px !important;
        text-indent: 2em;
    }

    html.writer-html5 .rst-content table.docutils td>p, 
    html.writer-html5 .rst-content table.docutils th>p {
        margin-bottom: 0.3rem;
    }

    .simple {
        margin-bottom: 5px !important;
    }

    img {
        /*box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);*/
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15))!important;
    }
}