:root {
  --color-background: hsl(215, 30%, 95%); /*standard*/
  /* --color-background: hsl(215, 30%, 80%); exam */

  --color-textarea-bg: hsl(240, 30%, 98%);
  --color-focus-border: hsl(215 30% 55%);
  --color-border: hsl(215 20% 70%);
  --color-button-text: #222;
  --color-button-bg: hsl(215 50% 85%);
  --color-button-bg-hover: hsl(215 50% 80%);
  --color-menu-bg-hover: hsl(215, 50%, 92%);
  --color-shadow: rgba(0, 0, 0, 0.4);
  --color-backdrop-bg: rgba(0, 0, 0, 0.2);
}

html {
  height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 100%;
  /* this defines rem unit */
}

body {
  height: 100%;
  margin: 0;
  background: var(--color-background);
  padding: 0.5em;
  box-sizing: border-box;
  /* width specifications include border and padding */
}

/*Actual page*/
.page {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Only visible for screen reader. Used for lables. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: inherit;
  text-decoration: none;
}

#mascot {
  height: 6rem;
  width: auto;
}

#title-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#title-block p {
  margin: 0;
}

.editor-box {
  display: flex;
  gap: 0.3rem;
  overflow-y: auto;
  overflow-x: hidden;
  align-items: flex-start;
  padding: 0px;
}

textarea {
  background: var(--color-textarea-bg);
  border: 0.1rem solid var(--color-border);
  padding: 0.5rem;

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

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

  font-family: Consolas, "Courier New", monospace;
  font-size: inherit;
  line-height: 1.8rem;

  height: auto;
  resize: none;
}

textarea:focus-visible {
  outline: none;
  border: 0.1rem solid var(--color-focus-border);
}

#input-ta {
  flex: 3 1 0;
  min-width: 20ch;
}

#output-ta {
  flex: 1 1 0;
  min-width: 10ch;
}

.menu-container {
  position: relative;
  display: inline-block;
}

button {
  padding: 0.45rem 0.9rem;
  font: inherit;
  color: var(--color-button-text);

  background: var(--color-button-bg);
  border: 2px solid var(--color-border);
  border-radius: 0.5rem;

  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.05s;
}

button:hover {
  background: var(--color-button-bg-hover);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: none;
  border: 2px solid var(--color-focus-border);
}

.flyout {
  position: absolute;
  bottom: 0%;
  left: 0;
  margin-bottom: 1rem;
  min-width: 14rem;
  background: var(--color-textarea-bg);
  border: 1px solid var(--color-button-text);
  box-shadow: 0 0.2rem 0.6rem var(--color-shadow);
  display: none;
  z-index: 1000;
}

.flyout.open {
  display: block;
}

.flyout button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.8rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  /*prevent line breaks in buttons */
}

.flyout button:hover {
  background: var(--color-menu-bg-hover);
}

.button-row {
  display: flex;
  gap: 1rem;
}

.dialog {
  display: none;

  /* center on viewport */
  position: fixed;
  top: 3rem;
  bottom: 3rem;

  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100vw - 6rem);
  height: calc(100vh - 6rem);
  /*specify max-width and max-height directly on element*/

  background-color: var(--color-background);
  border: 3px solid var(--color-border);
  z-index: 1000;
}

.dialog.open {
  display: flex;
}

.dialog > button {
  align-self: center;
  margin: 1rem;
  flex: 0 0 auto;
}

.dialog-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: var(--color-backdrop-bg);
}

.dialog-backdrop.open {
  display: block;
}

.padding-1 {
  padding: 1rem;
}

.flex-column {
  /* display: flex; */
  flex-direction: column;
}

.flex-row {
  /* display: flex; */
  flex-direction: row;
}

.scrollable-content {
  padding: 1rem;
  flex: 1 1 auto;
  overflow-y: auto;

  background: white;
  border: 0.1rem solid hsl(215 20% 70%);
}
