/*
  Copyright 1998-2023 Michalis Kamburelis, PasDoc developers.

  This file was part of "PasDoc" and is adapted to "Castle Game Engine".

  "PasDoc" is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  "PasDoc" is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with "PasDoc"; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

  ----------------------------------------------------------------------------
*/

/* The CSS file from PasDoc, adjusted,
   mainly to only change things inside .pasdoc-container (to not change
   the Castle Game Engine header/footer style, produced by body-begin/end.php
   files).
*/

.cge-version-form {
  margin-top: 2em;
}
.cge-version-form label {
  font-weight: normal;
}

/* Remove Bootstrap (used by Castle Game Engine header) customizations of <code> in .itemcode */
.pasdoc-container .itemcode code {
  background: transparent;
  color: inherit;
}

.pasdoc-container td,
.pasdoc-container th {
  border: 1px solid white;
}
.pasdoc-container th {
  text-align: center;
  padding: 0.2em;
}

/* Counter the padding of Bootstrap container-fluid around us.
   We cannot just remove padding from container-fluid, as it's needed
   for navbar to look right. */
.pasdoc-container {
  margin-left: -15px;
  /* margin-right: -15px; */
  /* The value -15px is what we precisely want.
     But Google Chrome does not calculate everything precisely then
     (the outer padding 15px, this margin -15px),
     and shows a useless horizontal scrollbar at the bottom of the page. */
  margin-right: -14px;
}

/* Match CGE sidebar size and look */
.pasdoc-container .navigation {
  background-image: linear-gradient(to bottom, #e8e8e8 0px, #f5f5f5 100%);
  background-repeat: repeat-x;
  border-color: #dcdcdc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) inset, 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* Disable the max-width 100% rule which breaks these images. */
.pasdoc-container img {
  max-width: none !important;
}

/* Our default left-aligned footer is obscured by PasDoc navigation */
.panel-footer {
  text-align: right;
}

/* Adjusted original pasdoc.css below ---------------------------------------- */

.pasdoc-container .container {
  margin: 0;
  padding: 0;
}

.pasdoc-container .container {
  width: 100%;
  height: 100%;
  border-spacing: 0;
}

/* Small screens, like phones */
@media (max-width: 1000px) {
  /* nothing necessary now */
}

/* Large screens, like desktops */
@media (min-width: 1001px) {
  .pasdoc-container .navigation {
    float: left;
    width: 20em; /* must match .content margin-left */
    height: 100%;
    position: fixed;
  }
  .pasdoc-container .content {
    margin-left: 20em; /* must match .navigation width */
  }
}

.pasdoc-container .navigation {
  background-color: #787878;
  margin: 0;
  box-sizing: border-box; /* without this, you could not have padding here, it would overlap with .content, causing errors on narrow screens */
  padding: 1em;
}
.pasdoc-container .navigation ul {
  margin: 0em;
  padding: 0em;
}
.pasdoc-container .navigation li {
  list-style-type: none;
  margin: 0.2em 0em 0em 0em;
  padding: 0.25em;
}
.pasdoc-container .navigation h2 {
  text-align: center;
  margin: 0em;
  padding: 0.5em;
}

.pasdoc-container .content {
  box-sizing: border-box; /* without this, you could not have padding here, it would overlap with .navigation, causing errors on narrow screens */
  padding: 1em;
}
.pasdoc-container .content h1 {
  margin-top: 0;
}

.pasdoc-container img { border:0px; }

.pasdoc-container hr {
    border-bottom: medium none;
    border-top: thin solid #888;
}

.pasdoc-container a:link {text-decoration: none; }
.pasdoc-container a:visited {text-decoration: none; }
.pasdoc-container a:hover {text-decoration: underline; }
.pasdoc-container a:active {text-decoration: underline; }

.pasdoc-container .content a:link {color:#C91E0C; text-decoration: none; }
.pasdoc-container .content a:visited {color:#7E5C31; text-decoration: none; }

.pasdoc-container a.navigation:link { text-decoration: none; }
.pasdoc-container a.navigation:visited { text-decoration: none; }
.pasdoc-container a.navigation:hover { font-weight: bold; text-decoration: none; }
.pasdoc-container a.navigation:active { text-decoration: none; }

.pasdoc-container a.bold:link {color:#C91E0C; text-decoration: none; font-weight:bold; }
.pasdoc-container a.bold:visited {color:#7E5C31; text-decoration: none; font-weight:bold; }
.pasdoc-container a.bold:hover {text-decoration: underline; font-weight:bold; }
.pasdoc-container a.bold:active {text-decoration: underline; font-weight:bold; }

.pasdoc-container a.section {color: green; text-decoration: none; font-weight: bold; }
.pasdoc-container a.section:hover {color: green; text-decoration: underline; font-weight: bold; }

.pasdoc-container ul.useslist a:link {color:#C91E0C; text-decoration: none; font-weight:bold; }
.pasdoc-container ul.useslist a:visited {color:#7E5C31; text-decoration: none; font-weight:bold; }
.pasdoc-container ul.useslist a:hover {text-decoration: underline; font-weight:bold; }
.pasdoc-container ul.useslist a:active {text-decoration: underline; font-weight:bold; }

.pasdoc-container ul.hierarchy { list-style-type:none; }
.pasdoc-container ul.hierarchylevel { list-style-type:none; }

.pasdoc-container p.unitlink a:link {color:#C91E0C; text-decoration: none; font-weight:bold; }
.pasdoc-container p.unitlink a:visited {color:#7E5C31; text-decoration: none; font-weight:bold; }
.pasdoc-container p.unitlink a:hover {text-decoration: underline; font-weight:bold; }
.pasdoc-container p.unitlink a:active {text-decoration: underline; font-weight:bold; }

.pasdoc-container tr.list { background: #FFBF44; }
.pasdoc-container tr.list2 { background: #FFC982; }
.pasdoc-container tr.listheader { background: #C91E0C; color: white; }

.pasdoc-container table.wide_list { border-spacing:2px; width:100%; }
.pasdoc-container table.wide_list td { vertical-align:top; padding:4px; }

.pasdoc-container table.markerlegend { width:auto; }
.pasdoc-container table.markerlegend td.legendmarker { text-align:center; }

.pasdoc-container .sections { background:white; }
.pasdoc-container .sections .one_section {
  background:lightgray;
  display: inline-block;
  margin: 0.2em;
  padding: 0.5em 1em;
}

.pasdoc-container table.summary td.itemcode { width:100%; }
.pasdoc-container table.detail td.itemcode { width:100%; }

.pasdoc-container td.itemname {white-space:nowrap; }
.pasdoc-container td.itemunit {white-space:nowrap; }
.pasdoc-container td.itemdesc { width:100%; }

.pasdoc-container p.nodescription { display: none; }

.pasdoc-container div.nodescription { color:red; }
.pasdoc-container dl.parameters dt { color:blue; }

/* Various browsers have various default styles for <h6>,
   sometimes ugly for our purposes, so it's best to set things
   like font-size and font-weight in out pasdoc.css explicitly. */
.pasdoc-container h6.description_section {
  /* font-size 100% means that it has the same font size as the
     parent element, i.e. normal description text */
  font-size: 100%;
  font-weight: bold;
  /* By default browsers usually have some large margin-bottom and
     margin-top for <h1-6> tags. In our case, margin-bottom is
     unnecessary, we want to visually show that description_section
     is closely related to content below. In this situation
     (where the font size is just as a normal text), smaller bottom
     margin seems to look good. */
  margin-top: 1.4em;
  margin-bottom: 0em;
}

/* Style applied to Pascal code in documentation
   (e.g. produced by @longcode tag) } */
.pasdoc-container span.pascal_string { color: #000080; }
.pasdoc-container span.pascal_keyword { font-weight: bolder; }
.pasdoc-container span.pascal_comment { color: #000080; font-style: italic; }
.pasdoc-container span.pascal_compiler_comment { color: #008000; }
.pasdoc-container span.pascal_numeric { }
.pasdoc-container span.pascal_hex { }

.pasdoc-container p.hint_directive { color: red; }

.pasdoc-container input#search_text { }
.pasdoc-container input#search_submit_button { }

.pasdoc-container acronym.mispelling { background-color: #ffa; }

/* Actually this reduces vertical space between *every* paragraph
   inside list with @itemSpacing(compact).
   While we would like to reduce this space only for the
   top of 1st and bottom of last paragraph within each list item.
   But, well, user probably will not do any paragraph breaks
   within a list with @itemSpacing(compact) anyway, so it's
   acceptable solution. */
.pasdoc-container ul.compact_spacing p { margin-top: 0em; margin-bottom: 0em; }
.pasdoc-container ol.compact_spacing p { margin-top: 0em; margin-bottom: 0em; }
.pasdoc-container dl.compact_spacing p { margin-top: 0em; margin-bottom: 0em; }

/* Style for table created by @table tags:
   just some thin border.

   This way we have some borders around the cells
   (so cells are visibly separated), but the border
   "blends with the background" so it doesn't look too ugly.
   Hopefully it looks satisfactory in most cases and for most
   people.

   We add padding for cells, otherwise they look too close.
   This is normal thing to do when border-collapse is set to
   collapse (because this eliminates spacing between cells).
*/
.pasdoc-container table.table_tag { border-collapse: collapse; }
.pasdoc-container table.table_tag td { border: 1pt solid gray; padding: 0.3em; }
.pasdoc-container table.table_tag th { border: 1pt solid gray; padding: 0.3em; }

.pasdoc-container table.detail {
  border: 1pt solid gray;
  border-collapse: separate;
  margin-top: 0.3em;
  margin-bottom: 0.3em;
}

.pasdoc-container .search-form { white-space: nowrap; }
.pasdoc-container .search-input input { max-width: 80%; } /* this provides some safe space to always fit even on very narrow screens */
.pasdoc-container .search-input input, .search-button { display: inline-block; vertical-align: middle; }
.pasdoc-container .search-input { display: inline-block; }

/* Do not make extra vertical space at the beginning/end of table cells.
   We need ">" selector, to not change paragraphs inside lists inside
   table cells. */
.pasdoc-container table.table_tag td > p:first-child,
.pasdoc-container table.table_tag th > p:first-child,
       td.itemdesc > p:first-child { margin-top: 0em; }

.pasdoc-container table.table_tag td > p:last-child,
.pasdoc-container table.table_tag th > p:last-child,
       td.itemdesc > p:last-child { margin-bottom: 0em; }

.pasdoc-container .navigation h2 {
    text-align: left;
    padding: 0 !important;
}
