/* CITForum — адаптивные стили */

*,
*::before,
*::after { box-sizing: border-box; }

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #000;
    background: #fff;
    line-height: 1.5;
}

a { color: #006; }
a:hover { color: #009; }
img { border: 0; max-width: 100%; height: auto; }

.site-wrap { max-width: 990px; margin: 0 auto; }

.site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 4px 5px;
}

.site-header b { font-size: 11px; white-space: nowrap; }

.site-brand {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    min-width: 0;
}

.site-logo {
    display: block;
    line-height: 0;
    flex-shrink: 0;
}

.site-label {
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
}

.site-label-archive {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 0.14em;
    color: #6f8f8b;
    margin-bottom: 2px;
}

.site-search { display: flex; gap: 4px; }
.site-search input[type="text"] {
    width: 200px;
    padding: 3px 6px;
    font-size: 12px;
    border: 1px solid #008080;
    outline: none;
}


.site-search {
    display: flex;
    gap: 4px;
    padding: 4px 5px;
    background: #F4F9F3;
}
.site-search input[type="text"] {
    flex: 1;
    padding: 3px 6px;
    font-size: 12px;
    border: 1px solid #008080;
    outline: none;
}
.site-search button {
    background: #008080;
    color: white;
    border: none;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 14px;
}
.site-search button:hover { background: #006060; }
.burger {
    display: none;
    background: #008080;
    color: white;
    border: none;
    font-size: 24px;
    line-height: 1;
    padding: 4px 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.burger:hover { background: #006060; }

.nav-line-top,
.nav-line-mid {
    display: none;
}

.site-nav {
    background: transparent;
    padding: 0;
    border-top: none;
}

.site-nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.site-nav a {
    display: block;
    background: #F4F9F3;
    text-align: center;
    padding: 3px 6px;
    font-size: 12px;
    text-decoration: none;
    color: #006;
    font-weight: bold;
    flex: 1 1 auto;
    white-space: nowrap;
}

.site-nav a:hover { text-decoration: underline; }

.columns { display: flex; gap: 0; padding-top: 3px; }
.col-main { flex: 1; min-width: 0; padding: 0 5px; }
.col-news { width: 240px; flex-shrink: 0; }

.news-box { border-left: 1px solid #008080; border-right: 1px solid #008080; }

.news-header {
    color: #008080;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 6px;
}

.news-line-thin { height: 1px; background: #008080; }
.news-line-gap { height: 3px; background: #daecd7; }
.news-content { padding: 5px 8px; font-size: 12px; line-height: 1.5; }

.news-content .news-item {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.news-content .news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.news-date { color: #666; font-size: 11px; }

.site-footer {
    padding: 8px 0;
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 12px;
}
.footer-counters {
    margin: 8px 0 6px;
}

.footer-counters img {
    vertical-align: middle;
}
/* документ: базовые заголовки и выравнивание */
.document {
    text-align: justify;
    padding-right: 2px;
}
.document h3 { font-size: 16px; margin: 8px 0; }
.document h4 {
    font-size: 15px;
    margin: 16px 0 8px;
    font-weight: bold;
    text-align: left;
}
.document h5 {
    font-size: 14px;
    margin: 14px 0 7px;
    font-weight: bold;
    text-align: left;
}
.document ul { padding-left: 20px; }
.document li { margin-bottom: 4px; }
pre {
    text-align: left;
    border: 1px solid;
    padding: 3px;
    width: 520px;
    max-width: 100%;
    overflow: auto;
    font-size: 9pt;
    white-space: pre;
}
.document .article-doi {
    text-align: left;
    font-size: 90%;
}

.document .article-meta {
    text-align: center;
}
/* на узком экране justify некрасиво растягивает строки */
@media (max-width: 650px) {
    .document { text-align: left; }
}

/* таблицы внутри статей, импортированных из Word */
.document .table-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.document .table-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    align-items: flex-start;
    margin: 12px 0;
}

.document table.article-table {
    border-collapse: collapse;
    margin: 12px 0;
    width: auto;
    max-width: none;
}

.document .table-scroll > table.article-table {
    min-width: max-content;
}

.document .table-group table.article-table {
    margin: 0 8px 12px 0;
    width: auto;
    max-width: none;
}

.document table.article-table th,
.document table.article-table td {
    border: 1px solid #777;
    padding: 3px 6px;
    vertical-align: middle;
}

.document table.article-table th {
    font-weight: bold;
}

.document math {
    font-family: "Cambria Math", "STIX Two Math", "Times New Roman", serif;
}

.document .ref-backs {
    white-space: nowrap;
    font-size: 90%;
}
.document .ref-back {
    text-decoration: none;
}

@media (prefers-color-scheme: dark) {
    .document table.article-table th,
    .document table.article-table td {
        border-color: #666;
    }
}

.archive-index td {
    padding: 0;
    vertical-align: top;
}

.archive-index a.topic {
    display: block;
    margin: 14px 0 4px;
    font-size: 20px;
    font-weight: bold;
    line-height: 1.2;
    text-decoration: none;
}

.archive-index font[size="-1"] {
    display: block;
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.7;
}

.archive-index img[src="/pictures/1x1.gif"] {
    display: none;
}
/*— адаптивность (бургер без flex-wrap!):*/

@media (max-width: 500px) {
    .burger { display: block; }
    .nav-block { display: none; }
    .nav-block.open { display: block; }
    .nav-block.open .site-nav-inner { flex-direction: column; gap: 0; }
    .nav-block.open .site-nav-inner a {
        text-align: left;
        padding: 8px 12px;
        border-bottom: 1px solid #008080;
    }
    .columns { flex-direction: column; }
    .col-news { width: 100%; margin-top: 12px; }
    .news-box { border-left: none; border-right: none; }
}

@media (max-width: 480px) {
    body { font-size: 13px; }
}

/*— главная страница:*/

.top-news { padding: 16px 5px 12px; }
.top-news-header { font-size: 22px; font-weight: bold; margin-bottom: 12px; color: #008080; }
.top-news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.news-card { border: 1px solid #ddd; padding: 12px; }
.news-card-main { grid-column: 1 / -1; border-left: 3px solid #008080; }
.news-card .news-title { font-size: 14px; font-weight: bold; line-height: 1.4; }
.news-card-main .news-title { font-size: 18px; }
.news-card .news-summary { font-size: 13px; color: #555; margin-top: 4px; line-height: 1.4; }
.news-more { text-align: right; margin-top: 8px; font-size: 12px; }

.sections { padding: 0 5px 16px; }
.sections-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
.section-block { border: 1px solid #ddd; padding: 12px; }
.section-block-title {
    font-size: 16px; font-weight: bold; color: #008080;
    margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid #ddd;
}
.section-block-title a { color: #008080; }
.section-item { padding: 5px 0; border-bottom: 1px solid #ddd; font-size: 13px; line-height: 1.4; }
.section-item:last-child { border-bottom: none; }
.section-item .item-author { font-size: 11px; color: #666; }
.section-more { margin-top: 8px; font-size: 12px; }

.edu-block { margin: 0 5px 16px; border: 1px solid #ddd; padding: 12px; }
.edu-title {
    font-size: 18px; font-weight: bold; color: #008080;
    margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid #ddd;
}
.edu-title a { color: #008080; }
.edu-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; }
.edu-item {
    font-size: 13px; padding: 6px 8px; background: #f5f5f5;
    border-left: 2px solid #ddd; line-height: 1.4;
}
.edu-item .item-author { font-size: 11px; color: #666; }
.archive-block {
    margin: 0 5px 16px; padding: 12px; background: #f5f5f5;
    border: 1px solid #ddd; font-size: 13px; line-height: 1.5;
}
.archive-block b { color: #008080; }

@media (max-width: 500px) {
    .top-news-grid { grid-template-columns: 1fr; }
    .sections-grid { grid-template-columns: 1fr 1fr; }
    .edu-grid { grid-template-columns: 1fr 1fr; }
    .site-label-archive {
        font-size: 13px;
        letter-spacing: 0.10em;
        margin-bottom: 1px;
    }
}

@media (max-width: 400px) {
    .edu-grid { grid-template-columns: 1fr; }
}

/*— тёмная тема:*/

@media (prefers-color-scheme: dark) {
    body { background: #000; color: #fff; }

    a { color: #a8ecec; }
    a:visited { color: #f0e39a; }
    a:hover { color: #c8f6f6; }

    .site-header b { color: #ccc; }
    .site-label-archive {
        color: #a8ecec;
        opacity: 0.9;
    }
    .site-search { background: #101414; }
    .site-search input[type="text"] {
        background: #111;
        color: #fff;
        border-color: #a8ecec;
    }
    .site-search button {
        background: #a8ecec;
        color: #000;
    }
    .site-search button:hover { background: #c8f6f6; }

    .burger {
        background: #a8ecec;
        color: #000;
    }
    .burger:hover { background: #c8f6f6; }
 
    .site-nav {
        background: transparent;
    }

    .site-nav a {
        background: #101414;
        color: #a8ecec;
    }

    .news-box {
        border-left-color: #a8ecec;
        border-right-color: #a8ecec;
    }

    .news-header {
        color: #a8ecec;
    }

    .news-line-thin { background: #a8ecec; }
    .news-line-gap { background: #2a3131; }

    .news-content .news-item { border-bottom-color: #333; }
    .news-date { color: #999; }

    .site-footer { color: #999; }

    .top-news-header { color: #a8ecec; }

    .news-card {
        border-color: #333;
        background: #111;
    }
    .news-card-main { border-left-color: #a8ecec; }
    .news-card .news-summary { color: #aaa; }

    .section-block {
        border-color: #333;
        background: #111;
    }
    .section-block-title {
        color: #a8ecec;
        border-bottom-color: #333;
    }
    .section-block-title a { color: #a8ecec; }

    .section-item { border-bottom-color: #333; }
    .section-item .item-author { color: #999; }

    .edu-block {
        border-color: #333;
        background: #111;
    }
    .edu-title {
        color: #a8ecec;
        border-bottom-color: #333;
    }
    .edu-title a { color: #a8ecec; }

    .edu-item {
        background: #1a1a1a;
        border-left-color: #333;
    }
    .edu-item .item-author { color: #999; }
    .archive-block {
        background: #111;
        border-color: #333;
    }
    .archive-block b { color: #a8ecec; }
    .archive-index a.topic {
        color: #a8ecec;
        }
    .document { color: #ddd; }
}