body {
  margin: 0px;

  font-size: 18px;

  box-sizing: border-box;

  --darkest: black;
  --darker: #333;
  --dark: #444;

  --medium: #888;

  --light: #aaa;
  --lighter: #ccc;
  --lightest: white;

  --fontColor: var(--darkest);
  --linkColor: var(--darker);
  --linkHoverColor: var(--medium);
  --backgroundColor: var(--light);
}

#background {
  background-blend-mode: multiply;
  background: var(--backgroundColor) url('./background.svg');
  background-size: 100%;
  background-attachment: scroll;
  background-repeat: repeat;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

#content {
  width: 1400px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  font-family: sans-serif;
  padding: 23px 0;
}

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

a:hover {
  color: var(--linkHoverColor);
}

#navbar {
  display: block;
  padding-left: 0;
  margin: 0;
  padding-bottom: 5px;
  margin-top: -8px;
  margin-left: -2px;
}

#navbar li {
  display: inline-block;
  list-style-type: none;
  padding-left: 0px;
  margin-left: 0px;
  border: 1px solid black;
  background: #d4d3d0;
  cursor: pointer;
  margin-bottom: 8px;
  vertical-align: top;
  padding: 4px;
}

#navbar li.selected {
  font-weight: bold;
  background: #fffff6;
  padding-top: 8px;
  margin-bottom: 0px;
  border-radius: 0px 0px 6px 6px;
  border-bottom: 2px solid black;
}

#navbar a {
  color: inherit;
  text-decoration: none;
}

#main {
  background: #eee;
  position: relative;
  padding: 10px;
  padding-top: 0;
  border: 1px solid #999;
}

.ingredientlist {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.ingredient {
  margin: 0px;
  overflow: hidden;
  cursor: pointer;
  background: url('../img/background.png');
  background-size: cover;
  position: relative;
}

.ingredient img {
  display: block;
  width: 64px;
  height: 64px;
  border: none;
  margin: 4px;
}

.searchselector {
  display: inline-block;
  padding: 0px 0px 0px 2px;
  line-height: 22px;
  vertical-align: bottom;
  border: 1px solid #999;
  border-right: none;
  height: 100%;
  background: #ddd;
  border-radius: 3px 0px 0px 3px;
  transition: border-bottom-left-radius 100ms ease;
  cursor: pointer;
}

.searchselector.retracted:after {
  content: '';
  margin-left: 3px;
  margin-right: 2px;
  width: 0;
  height: 0;
  display: inline-block;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #444;
  margin-bottom: 2px;
}

.searchselector.extended:after {
  content: '';
  margin-left: 3px;
  margin-right: 2px;
  width: 0;
  height: 0;
  display: inline-block;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #444;
  margin-bottom: 2px;
}

.searchselector:active {
  background-color: #777;
}

.searchdropdown {
  z-index: 2;
  position: absolute;
  height: 0px;
  overflow: hidden;
  border-radius: 0px 0px 3px 3px;
  transition: height 200ms ease, border-top-left-radius 100ms ease;
  border-top-left-radius: 3px;
}

.searchdropdown div {
  background: #ccc;
  border: 1px solid #888;
  border-top: none;
  cursor: pointer;
  padding: 0px 2px 0px 2px;
}

.ingredientpicker {
  border: 1px solid #888;
  padding: 3px;
  height: 12pt;
  border-radius: 0px 4px 4px 0px;
}

#results, #discoverfood, #foodlist, #recipes, #statistics {
  overflow-x: auto;
}

.ingredientpicker:hover {
  border: 1px solid #aaa;
}

.ingredientdropdown {
  display: block;
  z-index: 1;
}

.ingredientdropdown div {
  margin: 4px 0;
  padding: 0px;
  margin-bottom: 4px;
  text-align: justify;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ingredientdropdown .item {
  border: 1px solid #aaa;
  font-size: 12pt;
  padding: 2px 4px;
  white-space: nowrap;
  text-align: center;
  line-height: 20px;
  display: inline-flex;
  align-content: center;
  vertical-align: middle;
  overflow: hidden;
  list-style-type: none;
  cursor: pointer;
  border-radius: 4px;
  background: #eaeaea;
}

.ingredientdropdown .item img {
  width: 20px;
  height: 20px;
  margin-right: 4px;
}

.ingredientdropdown.hidetext .item img {
  margin-right: 0;
}

.ingredientdropdown .item .text {
  vertical-align: middle;
}

.ingredientdropdown .item:hover {
  background: #eee;
  background: linear-gradient(to bottom, #ffffff 0%,#d8d8d8 2px,#d8d8d8 60%,#c8c8c8 85%,#aaaaaa 100%);
}

.ingredientdropdown .item:active {
  background: #fff;
  background: linear-gradient(to bottom, #ffffff 0%,#d5d5d5 2px,#ffffff 60%,#dddddd 85%,#aaaaaa 100%);
}

.ingredientdropdown .item.selected {
  background: #fff;
  background: linear-gradient(to bottom, #ffffff 0%,#d5d5d5 2px,#ffffff 60%,#dddddd 85%,#aaaaaa 100%);
}

.ingredientdropdown .item.faded {
  background: #bbb;
  color: #444;
}

.ingredientdropdown.hidetext div .text {
  display: none;
}
.ingredientdropdown.hidetext div .item img {
  width: 40px;
  height: 40px;
}

.toggleingredients, .clearingredients {
  color: black;
  display: inline-block;
  padding-left: 5px;
  padding-right: 5px;
  cursor: pointer;
  border: 1px solid #888;
  margin-left: 12pt;
  text-align: center;
  vertical-align: middle;
  font-size: 75%;
  opacity: 0.4;
}
.toggleingredients:hover, .clearingredients:hover {
  opacity: 1;
}

.clearingredients {
  color: red;
  border: 1px solid #c55;
}

h1 {
  color: #444;
}

h2 {
  font-size: 1.75;
  padding-left: 10px;
  color: #444;
  margin-bottom: 6pt;
}

h3 {
  font-size: 1.5;
  padding-left: 10px;
  color: #444;
  margin-bottom: 4pt;
}

p {
  margin-top: 0;
  margin-bottom: 12px;
}

p:last-child {
  margin-bottom: 0;
}

table {
  width: 100%;
  font-size: 16px;
  line-height: 22px;
  vertical-align: middle;
}

table td {
  border-left: 1px solid white;
  border-top: 1px solid white;
  border-bottom: 1px solid #aaa;
  border-right: 1px solid #aaa;
  background: #ddd;
  padding: 2px 5px;
  min-height: 26px;
  min-width: 40px;
}

td .cellRow:nth-child(n + 2) {
  margin-top: 1px;
}

td img {
  width: 32px;
  height: 32px;
}

table tr {
  border: 1px solid black;
}

table tr.highlighted td {
  background: #ffb;
  border-bottom: 1px solid #cc3;
  border-right: 1px solid #cc3;
}

table th {
  border-bottom: 2px solid black;
}

table.links span.link {
  padding-left: 2px;
  padding-right: 2px;
  padding-bottom: 1px;
  padding-top: 1px;
  display: inline-block;
  border: 1px solid #999;
  background: #ddd;
  margin-bottom: 1px;
  border-radius: 3px;
  cursor: pointer;
}

table.links span.link:hover {
  opacity: 0.8;
}

table.links span.link.left {
  border-top-left-radius: 0px;
  border-bottom-left-radius: 0px;
  border-left: none;
}

table.links span.link.right {
  border-top-right-radius: 0px;
  border-bottom-right-radius: 0px;
}

table span.link.strike {
  text-decoration: line-through;
  color: #755;
}

table.links span.link.strike {
  border: 1px solid #bbb;
}

span.link img {
  width: 20px;
  height: 20px;
  margin-bottom: -2px;
  vertical-align: text-bottom;
}

#footer {
  margin-top: 20px;
  padding: 10px 10px;
  color: #444;
  text-align: center;
  background-color: rgba(255,255,255,0.6);
  border-radius: 10px;
}

#footer a {
  color: #585858;
}

#footer a:hover {
  color: #777;
}

button.makablebutton {
  font-size: 14pt;
  margin: 4px;
  padding: 4px 8px;
  display: inline-block;
  border: 1px solid #999;
  background: #ddd;
  border-radius: 3px;
  cursor: pointer;
}

div.recipeFilter img {
  opacity: 0.6;
  margin: 4px;
  padding-left: 2px;
  padding-right: 2px;
  padding-bottom: 1px;
  padding-top: 1px;
  display: inline-block;
  border: 1px solid #999;
  background: #ddd;
  border-radius: 3px;
  cursor: pointer;
}

div.recipeFilter img:hover {
  opacity: 0.8;
}

div.recipeFilter img.selected {
  opacity: 1;
  border-width: 3px;
  margin: 2px;
}

div.recipeFilter img.excluded {
  opacity: 0.8;
  border-color: #711;
  border-width: 3px;
  margin: 2px;
  background: #fcc;
}

div.foodFilter img {
  width: 32px;
  height: 32px;
  opacity: 0.4;
  margin: 4px;
  padding-left: 2px;
  padding-right: 2px;
  padding-bottom: 1px;
  padding-top: 1px;
  display: inline-block;
  border: 1px solid #999;
  background: #ddd;
  border-radius: 3px;
  cursor: pointer;
}

div.foodFilter img:hover {
  opacity: 0.8;
}

div.foodFilter img.selected {
  border-width: 3px;
  margin: 2px;
  opacity: 1;
}

div.foodFilter img.excluded {
  border-width: 3px;
  border-color: #711;
  margin: 2px;
  opacity: 0.8;
  background: #fcc;
}

strong {
  color: #333;
}

#navbar li.mode {
  padding: 0;
  margin: 0;
  margin-top: 12px;
  cursor: default;
  line-height: 0;
  border: none;
  background: none;
  position: relative;
}

#navbar li.mode img {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 6px;
}

#navbar li.mode div.mode-button {
  cursor: pointer;
  display: inline-block;
  position: relative;
  margin: 0 2px;
  width: 48px;
  height: 48px;
  opacity: 0.25;
  padding: 4px;
  border-radius: 12px;
}

#navbar li.mode div.mode-button:first-child {
  margin-left: 0;
}

#navbar li.mode div.mode-button:hover {
  opacity: 0.66;
}

#navbar li.mode div.mode-button.enabled {
  opacity: 0.75;
}

#navbar li.mode div.mode-button.selected {
  opacity: 1;
  background-color: transparent;
}

#navbar li.mode div.mode-button.enabled:hover {
  opacity: 0.7;
}

#navbar li.mode div.mode-button.selected:hover {
  opacity: 0.9;
}

#navbar li.mode div.mode-button:before {
  display: block;
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 5px;
}

.highlighted {
  outline: 1px solid #ccb;
}

#results .highlighted td {
  border-bottom: 4px solid #ccb !important;
}

@media(max-width: 1000px) {
  #navbar .listmenu {
    margin-top: 5px;
    display: block;
  }
}

@media(max-width: 767px) {
  .ingredientdropdown {
    overflow: auto;
  }

  .ingredientdropdown div {
    min-width: 690px;
  }

  .ingredientdropdown div .item img {
    width: 40px;
    height: 40px;
  }

  .toggleingredients {
    display: none;
  }

  .ingredientdropdown div .text {
    display: none;
  }

  #content {
    padding: 0;
  }

  #background {
    background: none;
  }

  #navbar li.mode div.mode-button {
    width: 15%;
    height: 15%;
  }
}
