/* CSS RESET */
*, *::before, *::after {
  box-sizing: border-box;
}
button, input, select, textarea {
  font: inherit;
}

/* GENERAL STYLING */
:root {
  --color-gray-drk: #404040;
  --color-gray-mid: #505050;
  --color-gray-lit: #606060;
  --color-orange: #eeaa00;
  --color-red: #ff1111;
  --color-tan: #ddccaa;
  --color-blue: #bbaaee;

  --color-bg-drk: var(--color-gray-drk);
  --color-bg-mid: var(--color-gray-mid);
  --color-bg-lit: var(--color-gray-lit);
  --color-text: var(--color-tan);
  --color-link: var(--color-blue);
}

body {
  font-size: 18px;
  font-family: sans-serif;
  line-height: 1.25;
  margin: 1rem auto;
  max-width: 80ch;
  background-color: var(--color-bg-drk);
  color: var(--color-text);
}
body *::selection {
  background-color: var(--color-bg-mid);
}

header nav {
  text-align: center;
}
footer {
  text-align: center;
  color: var(--color-gray-lit);
}

h1 {
  color: var(--color-orange);
  margin-top: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}
h2, h3, h4 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

a {
  color: var(--color-link);
  text-decoration: none;
  outline: 0;
}
a:hover {
  text-decoration: underline;
}

table td, table td * {
  vertical-align: top;
}

/* MEDIA ELEMENTS */
canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}
img {
  display: block;
  margin: 0 auto;
  max-width: 90%;
}
audio {
  display: block;
  margin: 0 auto;
  max-width: 90%;
}
video {
  display: block;
  margin: 0 auto;
  max-width: 90%;
}
iframe {
  display: block;
  margin: 0 auto;
  max-width: 90%;
}
/* Label for a media elements */
.label {
  display: block;
  margin: 0 auto;
  max-width: 90%;
  text-align: center;
}

/* <blockquote> elements assume the last child is attribution */
blockquote {
  background: var(--color-gray-drk);
  border-left: 10px solid var(--color-gray-lit);
  margin:  1.5em 10px;
  padding: 0.5em 10px;
}
blockquote > *:not(:last-child) {
  font-style: italic;
}
blockquote > p:not(:last-child):before  {
  content: '“';
}
blockquote > p:not(:last-child):after {
  content: '”';
}
blockquote > *:last-child {
  font-style: bold;
}

/* CODE (GENERATED FROM CMARK) */
main pre {
  padding: 0.5rem;
  margin: 0 auto;

  background-color: var(--color-bg-mid);
  border: solid  1px var(--color-orange);
  font-size: 15px;
  overflow-x: auto;
}
main code {
  color: var(--color-orange);
}
main a code {
  color: var(--color-link);
}
* pre code {
  color: var(--color-text);
}
* pre code * {
  color: var(--color-text);
}
* pre *::selection {
  background-color: var(--color-bg-lit);
}
* pre * a:hover {
  text-decoration: none;
}

/* RECIPES STYLING */
.recipe-primary-image {
  max-width: 60%; /* recipe pages look better when the primary image occupies less screen space */
}

/* MELLIFERA STYLING */
textarea.mellifera {
  background-color: var(--color-bg-mid);
  color: var(--color-text);
  border: solid 1px var(--color-orange);
  display: block;
  font-size: 16px;
  font-family: monospace;
  resize: none;
  width: 100%;
  padding-left: 2px;
  padding-right: 2px;
}
textarea.mellifera::selection {
  background-color: var(--color-bg-lit);
}
textarea.mellifera:focus {
  outline: 1px solid var(--color-orange);
  box-shadow: 0 0 8px #7799cc;
}
button.mellifera {
  display: block;
  margin: 0 auto;
  width: 100%;
  /* Make the "run" buttons bigger so that they are easier to press on
   * mobile. The 1.25rem measurement was just from eyeballing things, and is
   * not particularly meaningful in any way if it needs to change in the
   * future.
   */
  font-size: 1.25rem;
}

/* {{Wave}} - RUNESCAPE WAVE EFFECT */
@keyframes wave {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}

.wave-container {
  display: inline-block;
}

.wave-character {
  display: inline-block;
  animation: wave 2s ease-in-out infinite;
  vertical-align: baseline; /* animation should not affect surrounding text */
}

/* {{Dialogue}} - SOCRATIC DIALOGUE TEXT BOXES */
.dialogue-container {
  display: flex;
  align-items: flex-start;
  background-color: var(--color-bg-mid);
  border: 2px solid var(--color-orange);
  border-radius: 4px;
  padding: 16px;
  margin: 20px 0;
  font-family: sans-serif;
}

.dialogue-portrait {
  flex-shrink: 0;
  margin-right: 16px;
}

.dialogue-portrait img {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  border: 1px solid var(--color-gray-lit);
  background-color: var(--color-bg-lit);
  object-fit: cover;
  object-position: center;
}

.dialogue-content {
  flex: 1;
  min-width: 0; /* allows text to wrap properly */
}
.dialogue-content *::selection {
  background-color: var(--color-bg-lit);
}

.dialogue-name {
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--color-orange);
  text-decoration: underline;
  text-decoration-color: var(--color-gray-orange);
}
