<style>
 /* Style the button that is used to open and close the collapsible content */
 .collapsible {
  background-color: #eee;
  color: #444;
  cursor: pointer;
  padding: 18px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 15px;
}

/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
.active, .collapsible:hover {
  background-color: #ccc;
}

/* Style the collapsible content. Note: hidden by default */
.content {
  padding: 0 18px;
  display: none;
  overflow: hidden;
  background-color: #ffffff;
}

.collapsible:after {
  content: '+'; /* Unicode character for "plus" sign (+) */
  font-size: 18px;
  color: black;
  float: right;
  margin-left: 5px;
}

.active:after {
  content: "-"; /* Unicode character for "minus" sign (-) */
}
</style>

{% if 'context' in itemcollection %}
<div>
    <b>Matched: </b>{{itemcollection['context']['matched']}}
    <b>Returned: </b>{{itemcollection['context']['returned']}}
    <b>Limit: </b>{{itemcollection['context']['limit']}}
</div>
{% endif %}

{% for item in itemcollection.features %}
<button type="button" class="collapsible"><b>{{item.id}}</b></button>
<div class="content">
        {% include 'item.html' %}
</div>
{% endfor %}

<script>
var coll = document.getElementsByClassName("collapsible");
var i;

for (i = 0; i < coll.length; i++) {
  coll[i].addEventListener("click", function() {
    this.classList.toggle("active");
    var content = this.nextElementSibling;
    if (content.style.display === "block") {
      content.style.display = "none";
    } else {
      content.style.display = "block";
    }
  });
}
</script>
