nav.navbar {
  background-color: #eee;
}

.center {
  text-align: center;
}

.flex {
  display: flex;
  flex-flow: wrap;
  column-gap: .5rem;
  justify-content: space-between;
}

.right {
  text-align: right;
}

.expired {
  color: red;
}

a[inert] {
  opacity: 20%;
}

fieldset,
.fieldset {
  align-items: center;
  border: 1px solid;
  padding: 0 .25rem .1rem;
  display: flex;
  flex-flow: wrap;
  column-gap: 2rem;
}

input[type="checkbox"] {
  margin-right: .25rem;
}

input:invalid {
  border-color: red;
}

legend {
  float: none;
  font-size: 1rem;
  margin: 0;
  padding: 0 .5rem;
  width: auto;
}

textarea {
  width: 100%;
}

td {
  vertical-align: top;
}

th {
  text-align: left;
  vertical-align: bottom;
}

/* Standard Form Elements */
div.checkbox,
div.radio {
  display: inline-block;
  white-space: nowrap;
}

div.checkbox label,
div.radio label {
  vertical-align: text-bottom;
}

div.radio label {
  margin-left: .2rem;
}

div.textinput label {
  margin-right: .2rem;
}

/* Modal Dialogs */
dialog form input {
  margin-bottom: .2rem;
}

dialog form input[type="text"] {
  width: 100%
}

/* Autocomplete */
#autocomplete {
  border: solid 1px;
  width: max-content;
  position: fixed;
  list-style-type: none;
  padding: 0;
}

#autocomplete li {
  background-color: #ddd
}

#autocomplete li[data-highlight] {
  background-color: #fff
}

/* Responsive Table */
table {
  margin: auto;
  width: 100%;
}

table thead {
  display: none;
}

table tbody tr {
  display: grid;
  grid-template-columns: 2fr 1fr;
}

table tbody tr:nth-of-type(even)>* {
  background: lightgray;
}

/* Data table column styles */
td.c-num,
th.c-num {
  text-align: right;
}

td.c-cn {
  grid-column: 2;
  grid-row: 1 / 3;
}

td.c-odet {
  text-align: left;
}

td.c-oin {
  display: none;
}

/* Project member columns */
/* Number of observations */
td.c-no {
  text-align: right;
}

/* Filter Form */
div.section {
  margin-top: .25rem;
}

div.filter {
  border-radius: 5px;
  padding: .25rem;
}

#f1 {
  background-color: lightgreen;
}

#f2 {
  background-color: #ff000088;
}

#search-crit {
  /* See https://css-tricks.com/books/greatest-css-tricks/flexible-grids/ */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 49.9%));
  justify-content: space-between;
}

#search-crit.no-exclude {
  grid-template-columns: repeat(auto-fill, 100%);
}

div.buttons {
  display: flex;
  column-gap: .5rem;
}

div.buttons input {
  flex: 1;
}

div.options {
  display: flex;
  justify-content: space-between;
}

div#coordoptions {
  display: flex;
  column-gap: 1rem;
  width: fit-content;
}

div.displayoptions {
  display: flex;
  column-gap: 1rem;
  flex-flow: wrap;
}

div.form-input {
  display: flex;
  align-items: center;
  column-gap: .5rem;
  margin-top: .1rem;
}

div.fieldset {
  margin-top: .25rem;
}

/* Align the labels in a filter form. */
div.filter div.form-input label {
  min-width: 4rem;
}

div.form-input input.year {
  width: 4rem;
}

fieldset.group div.form-input label {
  min-width: auto;
}

div.form-input input[type="text"],
div.form-input input:not([type]) {
  width: 100%;
}

div.summary,
#progress {
  background-color: lightgreen;
  border-radius: 5px;
  padding: .25rem;
}

div.flex-fullwidth {
  column-gap: 1rem;
  display: flex;
  justify-content: space-between;
}

#svg-datehisto {
  margin: auto;
  min-height: 400px;
}

/* Summary Table */
tr.branch {
  font-weight: bold;
}

@media (min-width: 600px) {

  table {
    width: auto;
  }

  table thead {
    display: table-header-group;
  }

  table tbody tr {
    display: table-row;
  }

  td,
  th {
    border: solid 1px black;
  }

  th.c-odet {
    text-align: center;
  }

  /* iNat observation link header is combined with previous column (link to detail page). */
  th.c-oin {
    display: none;
  }

  td.c-odet {
    border-right: none;
    text-align: right;
  }

  td.c-oin {
    border-left: none;
    display: table-cell;
    padding-left: .25rem;
  }

  span.sm-label {
    display: none;
  }

  #search-crit div.buttons {
    grid-column: 1/span 2;
  }

}
