:root {
  /* Light theme (default) */
  --body-bg:     #ffffff;
  --body-color:  #212529;
  --card-bg:     #f8f9fa;
  --card-border: #f0f0f0;
  --hrule-color: #f3f3f3;
  --sidebar-bg:  #fcfcfc;
  --link-color:  #2196F3;
  --link-hover:  #064579;
  
  /* Syntax highlighting - light theme */
  --code-bg:          #f5f5f5;
  --code-color:       #1b1b1b;
  --keyword:          #0000ff;
  --constructor:      #ff00ff;
  --type-constructor: #ff7f50;
  --function:         #800080;
  --module:           #800000;
  --comment:          #008000;
  --number:           #008080;
  --string:           #800000;
  --char:             #800000;
  --symbol:           #666666;
  --identifier:       #000000;
  --warning:          #ff0000;
  --error:            #a52a2a;
  --not-parsed:       #c0c0c0;

  --md-code-color:    #6b6b6b;
}

[data-theme="dark"] {
  /* Dark theme */
  --body-bg:     #111111;
  --body-color:  #f0f0f0;
  --card-bg:     #2d2d2d;
  --card-border: #2d2d2d;
  --hrule-color: #2f2f2f;
  --sidebar-bg:  #3d3d3d;
  --link-color:  #4dabf7;
  --link-hover:  #a5d8ff;
  
  /* Syntax highlighting - dark theme */
  --code-bg:          #2a2a2a;
  --code-color:       #f0f0f0;
  --keyword:          #569cd6;
  --constructor:      #b57edc;
  --type-constructor: #ce9178;
  --function:         #c586c0;
  --module:           #d16969;
  --comment:          #6a9955;
  --number:           #b5cea8;
  --string:           #ce9178;
  --char:             #ce9178;
  --symbol:           #858585;
  --identifier:       #dcdcdc;
  --warning:          #f44747;
  --error:            #d86c6c;
  --not-parsed:       #7a7a7a;

  --md-code-color:    #adadad;
}

[data-theme="dark"] img.svg-icon {
  filter: invert(100%) brightness(150%);
}

hr {
  background-color: var(--hrule-color);
}

/* Changes to default bootstrap style: */
body {
  padding-top: 80px;
  background-color: var(--body-bg);
  color: var(--body-color);
}

pre {
  color: var(--md-code-color);
}

.jumbotron {
  padding: 10px 20px;
  background-color: var(--card-bg);
}

.jumbotron h1 {
  text-align: center;
}

/* padding for in-page bookmarks and fixed navbar */
section {
  padding-top: 30px;
}

/* ***************************************** */

.card {
  position: fixed;
  border-color: var(--card-border);
  background-color: transparent;
}

.list-group {
  border-color: var(--card-border);
}

/* The sidebar menu */
.list-group-item {
  z-index: 1;
  background-color: var(--sidebar-bg);
  border-color: var(--card-border);
  overflow-x: hidden;
  
  /* Allow shrinking below 100px if content is small */
  min-height: auto;
  height: auto;

  overflow-y: auto;  
  max-height: calc(100vh - 130px);

  /* When content is scrollable, enforce min-height */
  @supports (overflow-y: overlay) or (overflow-y: auto) {
    &:not(:-webkit-scrollbar) {
      min-height: 100px;
    }
  }
}

@media (max-width: 1199px) {
  .list-group {
    font-size: 14px;
  }
}

@media (max-width: 991px) {
  .list-group {
    font-size: 10px;
  }
}

@media (max-width: 767px) {
  .card {
    display: none;
  }
}

/* ****************************************** */

.anchored {
  padding-top: 40px;
}

.typeheader {
  font-size: 24px;
  font-weight: bold;
}

.opname {
  font-weight: bold;
}

.conscomment {
  padding: 5px 0px 0px 20px;
}

.indent1 {
  text-indent: 15px;
}

.indent2 {
  text-indent: 30px;
}

.indent3 {
  text-indent: 45px;
}

.indent4 {
  text-indent: 60px;
}

.explaincat {
  font-style: italic;
}

/* ****************************************** */
/* syntax highlighting */

code {
  color: var(--code-color);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

.keyword { color: var(--keyword); }
.constructorname_constrpattern,
.constructorname_constrcall,
.constructorname_constrdecla,
.constructorname_otherconstrkind { color: var(--constructor); }
.typeconstructor_typedecla,
.typeconstructor_typeuse,
.typeconstructor_typeexport { color: var(--type-constructor); }
.function_infixfunction,
.function_typsig,
.function_fundecl,
.function_functioncall,
.function_otherfunctionkind { color: var(--function); }
.moduleName { color: var(--module); }
.commentary { color: var(--comment); }
.numberCode { color: var(--number); }
.stringCode,
.charCode { color: var(--string); }
.symbol { color: var(--symbol); }
.identifier_iddecl,
.identifier_idoccur,
.identifier_unknownid { color: var(--identifier); }
.codeWarning { font-weight: bold; font-style: italic; color: var(--warning); }
.codeError { font-style: italic; color: var(--error); }
.notParsed { font-style: italic; color: var(--not-parsed); }

/* ****************************************** */
/* Theme toggle button styles */

#theme-toggle {
  position: relative;
  top: 6px;
  border-color: transparent;
  background-color: transparent;
}

#theme-toggle:hover,
#theme-toggle:focus {
  background-color: transparent;
  box-shadow: none;
}

[data-theme="dark"] .theme-icon-light {
  display: none;
}
[data-theme="dark"] .theme-icon-dark {
  display: inline;
}
[data-theme="light"] .theme-icon-light {
  display: inline;
}
[data-theme="light"] .theme-icon-dark {
  display: none;
}