/* Bulma does the design. This file only maps the Opencast colours onto
   Bulma's variables, and fixes up the shader editor.
   Navy #1E2356 = hsl(235 48% 23%), Green #C8FF02 = hsl(73 100% 50%). */

:root {
  --navy: #1e2356;
  --green: #c8ff02;
}

/* Light: navy for buttons and links on white. Also the fallback when the
   theme script can't run. */
:root,
[data-theme=light] {
  --bulma-primary-h: 235deg;
  --bulma-primary-s: 48%;
  --bulma-primary-l: 23%;
  --bulma-primary-invert-l: 100%;
  --bulma-primary-on-scheme-l: 23%;
  --bulma-link-h: 235deg;
  --bulma-link-s: 48%;
  --bulma-link-l: 23%;
  --bulma-link-on-scheme-l: 23%;
  --header-background: var(--navy);
}

/* Dark: a navy page, with green buttons and links (AAA on navy). */
[data-theme=dark] {
  --bulma-scheme-h: 235;
  --bulma-scheme-s: 35%;
  --bulma-scheme-main-l: 14%;
  --bulma-scheme-main-bis-l: 16%;
  --bulma-scheme-main-ter-l: 18%;
  --bulma-background-l: 19%;
  --bulma-primary-h: 73deg;
  --bulma-primary-s: 100%;
  --bulma-primary-l: 50%;
  --bulma-primary-invert-l: 10%;
  --bulma-primary-on-scheme-l: 50%;
  --bulma-link-h: 73deg;
  --bulma-link-s: 100%;
  --bulma-link-l: 50%;
  --bulma-link-on-scheme-l: 50%;
  --header-background: hsl(235deg 48% 10%);
}

/* Bulma gives buttons and other components a display, which beats the
   browser's own [hidden]. The hints and solution reveal with `hidden`. */
[hidden] { display: none !important; }

/* The header stays navy in both themes, with the current page in green. */
.site-header {
  background: var(--header-background);
}
.site-header .navbar {
  --bulma-navbar-background-color: transparent;
  --bulma-navbar-item-color: #fff;
  --bulma-navbar-item-hover-color: #fff;
  --bulma-navbar-item-hover-background-color: transparent;
}
/* The brand row is never collapsed, so it spans the bar to keep the toggle
   on the right. */
.site-header .navbar-brand { flex-grow: 1; }
.site-name { font-weight: 600; }
.site-nav {
  --bulma-tabs-border-bottom-color: transparent;
  --bulma-tabs-link-color: #d6d8ea;
  --bulma-tabs-link-hover-color: #fff;
  --bulma-tabs-link-hover-border-bottom-color: #fff;
  --bulma-tabs-link-active-color: var(--green);
  --bulma-tabs-link-active-border-bottom-color: var(--green);
}

/* The toggle shows what a press switches to. */
.theme-toggle {
  background: transparent;
  color: #fff;
}
[data-theme=dark] .theme-icon-dark,
:root:not([data-theme=dark]) .theme-icon-light {
  display: none;
}

/* The editor: canvas on top, code underneath, at any width. */
.glsl-editor {
  position: relative;
  border: 1px solid var(--bulma-border);
  border-radius: var(--bulma-radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.glsl-editor .ge_canvas_container {
  position: static !important;
  float: none !important;
  background: #000;
}
.glsl-editor .ge_canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 512 / 168;
}
.glsl-editor .CodeMirror {
  height: auto;
  min-height: 14rem;
  font-size: 0.9rem;
}

/* A picture shown on a page, such as a Technique's "before": the same width
   as an editor's canvas. */
.page-picture {
  display: block;
  width: 100%;
  height: auto;
}

/* The Techniques page's contents list */
.technique-contents {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-left: 4px solid var(--bulma-primary);
}
.technique-contents ol { margin: 0; }
.technique-contents li { margin: 0.25rem 0; }
