/*
 * The wiki uses the game's stylesheet and page shell (assets/css/game.css); this file only adds
 * what a game page never needed: long text, an info box, a contents list, notices and the search
 * box. Its rules join the game's "pages" layer.
 */
@layer pages {

/* long text reads badly on the full content width */
body.wiki .shell-page { max-width: 924px; }

/* breadcrumb and search, where the game shows the resources */
.wiki-bar { justify-content: space-between; padding: 6px 0; }
.wiki-crumbs { flex: 1 1 12em; margin: 0; font-weight: bold; }
#wiki-search { position: relative; display: flex; flex: 0 1 auto; gap: 4px; margin: 0; }
#wiki-search input[type="text"] { width: 190px; min-width: 0; padding: 2px 4px; }
#wiki-suggestions { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; background-color: #344566; border: 1px #415680 solid; text-align: left; }
#wiki-suggestions a { display: block; padding: 4px 6px; font-weight: normal; }
#wiki-suggestions a:hover, #wiki-suggestions a.wiki-active { background-color: #415680; text-decoration: none; }

/* the article */
.wiki-page { width: 100%; }
.wiki-page h1 { width: auto; font-size: 1rem; margin: 3px 0; }
td.c a { color: #E6EBFB; }
th.wiki-article { text-align: left; font-weight: normal; padding: 10px 14px; line-height: 1.55; vertical-align: top; }
.wiki-article p { margin: 0 0 10px; }
.wiki-article h2 { font-size: 1.125rem; margin: 18px 0 8px; padding-bottom: 3px; border-bottom: 1px #415680 solid; clear: left; }
.wiki-article h3 { font-size: 1rem; margin: 14px 0 6px; }
.wiki-article h4, .wiki-article h5, .wiki-article h6 { font-size: 0.875rem; margin: 12px 0 6px; }
.wiki-article ul, .wiki-article ol { margin: 0 0 10px; padding-left: 22px; }
.wiki-article li { margin-bottom: 3px; }
.wiki-article a { color: #9fc5ff; font-weight: normal; }
.wiki-article a:hover { color: #CDD7F8; }
.wiki-article img { max-width: 100%; height: auto; }
.wiki-article hr { border: 0; border-top: 1px #415680 solid; margin: 14px 0; }
.wiki-article blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px #415680 solid; }

/* tables inside an article: the game's cell colours */
.wiki-table { border-collapse: collapse; margin: 0 0 12px; max-width: 100%; }
.wiki-table caption { font-weight: bold; padding-bottom: 4px; }
.wiki-table th, .wiki-table td { border: 1px #415680 solid; padding: 3px 7px; font-size: 0.8125rem; text-align: center; }
.wiki-table th { background-color: #2a3a59; font-weight: bold; }
.wiki-table td { background-color: #344566; }
.wiki-table a { font-weight: normal; }

/* info box: floats beside the text like the picture on a game info page */
.wiki-infobox { float: right; width: 250px; margin: 0 0 12px 16px; }
.wiki-infobox th { font-weight: normal; padding: 3px 6px; font-size: 0.8125rem; text-align: left; }
.wiki-infobox th + th { text-align: right; }
.wiki-infobox th.wiki-infobox-image { text-align: center; padding: 6px; }
.wiki-infobox-image img { max-width: 230px; max-height: 230px; }
.wiki-infobox td.c { text-align: center; }

.wiki-contents { display: inline-block; min-width: 180px; margin: 0 0 12px; padding: 6px 12px; border: 1px #415680 solid; background-color: #2a3a59; }
.wiki-contents ul { list-style: none; margin: 4px 0 0; padding: 0; }
.wiki-contents li { margin: 1px 0; }
.wiki-contents-3 { padding-left: 14px; }
.wiki-contents-4, .wiki-contents-5, .wiki-contents-6 { padding-left: 28px; }

.wiki-notice { margin: 0 0 12px; padding: 6px 10px; border: 1px #415680 solid; border-left: 4px #ff8900 solid; background-color: #2a3a59; overflow: hidden; }
.wiki-notice-unavailable { border-left-color: #ff4040; }

/* pictures */
.wiki-thumb { float: right; clear: right; margin: 0 0 12px 16px; max-width: 260px; text-align: center; }
.wiki-thumb img { border: 1px #415680 solid; }
.wiki-thumb figcaption, .wiki-gallery figcaption { font-size: 0.8125rem; padding-top: 3px; }
.wiki-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; clear: both; }
.wiki-gallery figure { margin: 0; width: 170px; text-align: center; }
.wiki-gallery img { max-height: 150px; border: 1px #415680 solid; }

/* formulas */
.wiki-math-block { margin: 0 0 10px; overflow-x: auto; overflow-y: hidden; }
.wiki-math:not(.wiki-math-done) { font-family: monospace; }

/* lists of articles */
.wiki-list { list-style: square; }
.wiki-related .wiki-list { columns: 3; margin-bottom: 0; }
.wiki-summary { display: block; color: #b9c3dc; }
.wiki-results li { margin-bottom: 9px; }
.wiki-tag { font-size: 0.8125rem; color: #b9c3dc; border: 1px #415680 solid; padding: 0 4px; margin-left: 4px; white-space: nowrap; }
.wiki-more { margin: 4px 0 0; text-align: right; }
.wiki-letters a { display: inline-block; padding: 1px 5px; }

/* home page */
.wiki-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-items: start; }
.wiki-section-card { width: 100%; }
.wiki-section-card th.wiki-article { padding: 8px 10px; font-size: 0.8125rem; }
.wiki-section-card .wiki-list { margin-bottom: 0; padding-left: 16px; }
.wiki-settings td:first-child { text-align: left; }

/* phone: the info box and the pictures stop floating, lists go to one column */
@media (max-width: 699.98px) {
    th.wiki-article { padding: 8px; }
    .wiki-infobox, .wiki-thumb { float: none; width: 100%; max-width: none; margin: 0 0 12px; }
    .wiki-related .wiki-list { columns: 1; }
    #wiki-search { flex: 1 1 100%; }
    #wiki-search input[type="text"] { flex: 1 1 0; width: auto; }
    .wiki-article table.wiki-table { display: block; overflow-x: auto; }
}

}
