html,
body {
  height: 100%;
}

.expand {
  height: 100%;
}

.header {
  z-index: 2;
  border-bottom: 1px solid rgb(221, 221, 221);
}

.macommune-container #logo-aprona {
  background: url('../images/logo-aprona-mobile.png') center left / contain no-repeat;
  width: 42px;
  height: 50px;
}
@media (min-width: 380px) {
  .macommune-container #logo-aprona {
    background: url('../images/logo-aprona.png') center left / contain no-repeat;
    width: 140px;
    height: 50px;
  }
}
@media (min-width: 992px) {
  .macommune-container #logo-aprona {
    background: url('../images/logo-aprona.png') center left / contain no-repeat;
    width: 277px;
    height: 100px;
  }
}

.macommune-container {
  padding: 0;
  overflow: hidden;
}

.navbar-toggle-custom {
  padding: 0;
  width: 44px;
  height: 34px;
  font-size: 20px;
}

.content {
  position: relative;
  overflow: hidden;
  align-content: stretch;
}

.message-panel {
  position: absolute;
  width: 100%;
  z-index: 2;
  background: transparent;
  transition-property: top, bottom;
  transition-duration: 0.5s;
  transition-timing-function: ease;
}
.message-panel.collapse {
  bottom: 100%;
}
.message-panel.collapse.in {
  top: 0px;
}
.message-box {
  padding: 9px;
  border-radius: 3px;
}

.search-panel {
  position: absolute;
  z-index: 2;
  width: 100%;
  background: white;
  border-bottom: 1px solid rgb(221, 221, 221);
  transition-property: top;
  transition-duration: 0.5s;
  transition-timing-function: ease;
}
.search-panel.collapse {
  top: -65px;
  display: block;
}
.search-panel.collapse.in {
  top: 0;
}
.search-panel #commune-selector {
  margin: 15px;
  width: 226px;
  float: left;
}
.search-panel #commune-return {
  margin-top: 15px;
}
/* fix ms placeholer cutoff for first rendering */
.ms-inv {
  width: 200px !important;
}

.themes-panel {
  position: absolute;
  height: 100%;
  width: 300px;
  z-index: 1;
  background-color: white;
  padding: 5px;
  border-right: 1px solid rgb(221, 221, 221);
  transition-property: left;
  transition-duration: 0.5s;
  transition-timing-function: ease;
  overflow-y: auto;
}
.themes-panel.collapse {
  display: block;
  left: -300px;
}
.themes-panel.collapse.in {
  left: 0px;
}
.theme-btn {
  display: flex;
  margin-bottom: 1em;
}
.theme-icon {
  width: 32px;
  height: 32px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: auto 100%;
  margin-right: 5px;
}
.theme-title {
  display: flex;
  justify-content: center;
  flex-direction: column;
  flex: 1;
  line-height: 1em;
}
.theme-a1 {
  background-image: url('../images/themes/macommune/map_piezo1.png');
}
.theme-a2 {
  background-image: url('../images/themes/macommune/map_quality1.png');
}
.theme-a3 {
  background-image: url('../images/themes/macommune/epaisseur_nappe.png');
}
.theme-a4 {
  background-image: url('../images/themes/macommune/profondeur_nappe.png');
}
.theme-b1 {
  background-image: url('../images/themes/macommune/map_hydro1.png');
}
.theme-b2 {
  background-image: url('../images/themes/macommune/map_riv2.png');
}
.theme-b3 {
  background-image: url('../images/themes/macommune/rivieres.png');
}
.theme-c1 {
  background-image: url('../images/themes/macommune/innondation.png');
}
.theme-c2 {
  background-image: url('../images/themes/macommune/map_unites_prod1.png');
}
.theme-c3 {
  background-image: url('../images/themes/macommune/zones_protegees_simple.png');
}
.theme-c4 {
  background-image: url('../images/themes/macommune/info.png');
}

#map {
  height: 100%;
}

.data-panel {
  position: absolute;
  height: 100%;
  width: 300px;
  z-index: 1;
  background-color: white;
  padding: 5px;
  border-left: 1px solid rgb(221, 221, 221);
  transition-property: right;
  transition-duration: 0.5s;
  transition-timing-function: ease;
  overflow-y: auto;
}
.data-panel.collapse {
  display: block;
  right: -300px;
}
.data-panel.collapse.in {
  right: 0px;
}
.data-loading {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.data-header {
  padding: 5px 15px;
}
.detail-card {
  background-color: #d9edf7;
  cursor: pointer;
}
.group-card {
  background-color: #fcf8e3;
}
.selected-card {
  background-color: #f2dede;
}

.layer-switcher {
  top: 0.5em;
  z-index: 1;
}

.controls-group {
  position: absolute;
  top: 0.5em;
  left: 0.5em;
}
.ol-zoom,
.ol-rotate,
.center-view-control,
.extent-selection-control {
  position: static;
}
.center-view-control button.active,
.extent-selection-control button.active {
  background-color: rgba(0, 136, 60, 0.5);
}
.center-view-control button {
  top: 0;
}

.legend-control {
  position: absolute;
  bottom: 0.5em;
  right: 0.5em;
}
.ol-popup.legend {
  position: absolute;
  bottom: 0.5em;
  right: 0.5em;
  left: unset;
  z-index: 1;
  max-width: calc(100% - 1em);
}
.ol-popup.legend:before,
.ol-popup.legend:after {
  content: none;
}
.ol-popup.legend .collapse {
  display: none;
}
.ol-popup.legend .collapse.in {
  display: block;
}
.legend .ol-popup-content {
  max-width: 100%;
  overflow: auto;
}

/* Flex utilities */

.d-flex {
  display: flex;
  display: -webkit-flex;
}
.collapse.in.d-flex {
  display: flex;
  display: -webkit-flex;
}
.flex-column {
  flex-direction: column;
  -webkit-flex-direction: column;
}
.flex-row {
  flex-direction: row;
  -webkit-flex-direction: row;
}
.flex-grow-1 {
  flex-grow: 1;
  -webkit-flex-grow: 1;
}
.ol-viewport {
  flex-grow: 1;
  -webkit-flex-grow: 1;
}

@media (min-width: 992px) {
  #search-panel {
    display: inline-block;
    position: absolute;
    top: 0.5em;
    left: calc(50% - 150px);
    width: 300px;
    background: transparent;
    border: none;
  }
  #search-panel .form-control,
  #search-panel #commune-return {
    margin: 0;
  }
  #themes-panel {
    display: block;
    position: static;
    width: 300px;
  }
  #data-panel {
    display: block;
    position: static;
    width: 300px;
  }
}
