/* CSS for embedding Calcumber interactively in web pages*/

/*
 * General CSS
 */

/* only visible to screen readers */
.calcumber-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}

.calcumber-filler {
  flex: 1 1 0;
}

/* Colors */
:root {
  --color-calcumber-static-bg: hsl(215, 60%, 95%);
  --color-calcumber-static-bg-dark: hsl(215, 60%, 80%);

  --color-calcumber-window-bg: hsl(215 50% 50%);
  --color-calcumber-window-fg: white;
  --color-io-bg: hsl(215, 60%, 95%);
  --color-io-bg-focus: hsl(215, 60%, 98%);
  --color-io-fg: black;
}

/* Fonts */
.calcumber-table,
.calcumber-io-row {
  font-family: Consolas, "Courier New", monospace;
}

.calcumber-container {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
}

/* 
 * static calcumber table
 */

.calcumber-table {
  font-size: 80%;
  border-collapse: separate;
  border-spacing: 0.1em;
  margin-bottom: 1em;
}

.calcumber-table th,
.calcumber-table td {
  padding: 0.2em 1em 0.2em 0.4em;
}

/* hide header of calcumber tables */
.calcumber-table.no-header thead {
  display: none;
}

.calcumber-table th {
  background-color: var(--color-calcumber-static-bg-dark);
}

.calcumber-table td {
  background-color: var(--color-calcumber-static-bg);
}

/*
 * Embedded calcumber.
 */

.calcumber-container {
  display: flex;
  flex-direction: column;
  width: fit-content;

  background-color: var(--color-calcumber-window-bg);
}

.calcumber-container.calcumber-grow {
  width: 100%;
}

.calcumber-top-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  padding: 0em;
  gap: 0.3em;
  color: var(--color-calcumber-window-fg);
  font-size: 70%;
}

.calcumber-top-row .calcumber-icon-link {
  display: inline-flex;
  padding: 0;
}

.calcumber-top-row .calcumber-icon-link img {
  height: 1.2em;
  width: auto;
  margin: 0.1em 0.2em 0.1em 0.3em;
}

.calcumber-top-row .calcumber-title {
  color: inherit;
  margin: 0;
  line-height: 1;
}

.calcumber-full-app {
  width: fit-content;
  height: fit-content;
  padding: 0;
  margin: 0;
  color: inherit;
  background: none;
  border: none;
}

.calcumber-icon-link:hover,
.calcumber-full-app:hover {
  background-color: hsl(0 0% 100% / 15%);
}

.calcumber-icon-link:active,
.calcumber-full-app:active {
  background-color: hsl(0 0% 100% / 25%);
}

.calcumber-icon-link:focus-visible,
.calcumber-full-app:focus-visible {
  outline: 0.1em solid currentColor;
  outline-offset: 0.1em;
}

.calcumber-full-app svg {
  height: 0.8em;
  width: auto;
  margin-left: 0.3em;
  margin-right: 0.5em;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.18em;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calcumber-io-row {
  display: flex;
  flex-direction: row;
  flex: 1 1 0;
  gap: 0.1em;
  padding: 0;
  margin: 0.2em;
  margin-top: 0;
  color: var(--color-io-fg);
}

.calcumber-input,
.calcumber-output {
  font: inherit; /*otherwise browser default font settings are used*/
  padding: 0.1em 0.5em;

  color: inherit;
  background: var(--color-io-bg);
  border: none;

  line-height: 1.8em;

  overflow-x: auto; /* horizontal scroll */
  overflow-y: hidden; /* no own vertical scroll */

  white-space: pre; /* no wrapping */
  word-wrap: normal;
  overflow-wrap: normal;
  resize: none;
}

.calcumber-input {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: auto;
  min-width: 0;
}

.calcumber-input:focus-visible {
  background-color: var(--color-io-bg-focus);
  outline: none;
}

.calcumber-output {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: auto;
  min-width: 0;
}

.calcumber-output:focus-visible {
  outline: none;
}
