/* Styles shared by the FoamTree demo pages: the visualization on the left, a side panel
   with the description on the right (stacked on narrow screens). */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fg: #1d1d1f;
  --muted: #6b6b70;
  --bg: #fff;
  --accent: #2a6db0;
  --code-fg: #00366e;
  --code-bg: #edf2f7;
  --border: #d8e1eb;
  --panel: rgba(255, 255, 255, 0.92);
  --side-width: 430px;
}

body.dark {
  --fg: #f2f2f2;
  --muted: #a0a0a6;
  --bg: #1d1c1b;
  --accent: #83bffb;
  --code-fg: #b3d8ff;
  --code-bg: #333;
  --border: #444;
  --panel: rgba(29, 28, 27, 0.92);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font: 14px / 1.5 var(--font);
  color: var(--fg);
  background: var(--bg);
}

a {
  color: var(--accent);
}

h2 {
  margin: 0 0 0.6em;
  font-size: 1.6em;
  font-weight: 500;
  line-height: 1.2;
}

h3,
h4 {
  margin: 1.4em 0 0.5em;
  font-size: 1.1em;
  font-weight: 600;
}

p,
ul,
ol {
  margin: 0 0 0.8em;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.3em;
}

code {
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--code-fg);
  background: var(--code-bg);
  white-space: nowrap;
}

pre {
  overflow-x: auto;
  padding: 0.6em 0.8em;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--code-bg);
}

pre code {
  padding: 0;
  border: 0;
  background: none;
  white-space: pre;
}

kbd,
.key {
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: var(--font);
  font-size: 0.85em;
  text-transform: uppercase;
  color: var(--fg);
  background: var(--code-bg);
}

small,
.muted {
  color: var(--muted);
}

button,
input,
select,
textarea {
  font: inherit;
}

/* The visualization area and the element FoamTree is embedded in. */
#container {
  position: relative;
  background: var(--bg);
}

#visualization {
  position: absolute;
  inset: 10px;
}

/* The description of the demo. */
#side {
  padding: 10px;
}

@media (min-width: 1024px) {
  #container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: var(--side-width);
  }

  #side {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--side-width);
    overflow-y: auto;
    padding: 10px 20px 10px 10px;
  }
}

@media (max-width: 1023px) {
  #container {
    height: 70vh;
  }
}

/* A page with the visualization only, no side panel. */
body.full #container {
  position: absolute;
  inset: 0;
  height: auto;
}

body.full #visualization {
  inset: 0;
}
