/* Image compare utility. */

.image-compare {
  max-width: 100%;
  overflow: hidden;
  position: relative;
  box-sizing: content-box;
  cursor: pointer;
  user-select: none;
  box-shadow: 0.1em 0.1em 0.5em rgba(0, 0, 0, 0.1);
}
.image-compare::before {
  /* Prevent selection, similar to user-select: none. */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
}
.image-compare img {
  max-width: 100%;
  background: #fff;
  display: block;
}
.image-compare img:not(:first-child) {
  position: absolute;
  top: 0;
  height: 100%;
  left: 0;
  object-fit: cover;
  object-position: top left;
  width: 50%;
  overflow: hidden;
  z-index: 1;
}
.image-compare-handle {
  height: 100%;
  width: 0.5em;
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  z-index: 20;
}
.image-compare-handle i {
  background: #fff;
  border-radius: 50%;
  line-height: 2em;
  width: 2em;
  display: block;
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  text-align: center;
  box-shadow: 0em 0.1em 0.5em rgba(0, 0, 0, 0.1);
}
.image-compare-handle::before {
  /* Centered line! */
  box-shadow: 0.1em 0.1em 0.5em rgba(0, 0, 0, 0.4);
  content: "";
  height: 100%;
  position: absolute;
  left: -1px;
  right: -1px;
  background: #fff;
}
.image-compare-before,
.image-compare-after {
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  position: absolute;
  overflow: hidden;
}
.image-compare-before > div,
.image-compare-after > div {
  position: absolute;
  bottom: 0.5em;
  background: #fff;
  line-height: 1.5em;
  text-align: center;
  padding: 0.2em 0.6em;
  border-radius: 0.5em;
  white-space: nowrap;
  box-shadow: 0.1em 0.1em 0.5em rgba(0, 0, 0, 0.2);
}
.image-compare-before > div {
  z-index: 2;
  left: 0.5em;
}
.image-compare-after > div {
  z-index: 0;
  right: 0.5em;
}
/* .image-compare-handle div { */
/*   bottom: 0.5em; */
/*   left: 0.5em; */
/*   position: absolute; */
/*   background: #fff; */
/*   line-height: 1.5em; */
/*   text-align: center; */
/*   padding: 0.2em 0.4em; */
/*   border-radius: 0.2em; */
/*   white-space: nowrap; */
/*   z-index: 10; */
/*   box-shadow: 0.1em 0.1em 0.5em rgba(0, 0, 0, 0.2); */
/* } */
/* .image-compare-handle div:first-child { */
/*   right: 0.5em; */
/*   z-index: 10; */
/*   left: initial; */
/* } */

.switcher {
  position: relative;
  overflow: hidden;
  box-shadow: 0.1em 0.1em 0.5em rgba(0, 0, 0, 0.1);
  margin-top: 1em;
  margin-bottom: 3em;
  display: block;
}
.switcher > *:not(.switcher-labels) {
  opacity: 1;
  transition: 0.5s all;
  z-index: 1;
}
.switcher > *:not(:first-child):not(.switcher-labels) {
  position: absolute;
  top: 0;
}

.switcher > .switcher-hidden {
  opacity: 0;
  z-index: 0;
}

.switcher .switcher-labels {
  text-align: center;
  font-weight: 600;
  padding: 1em 1.5em;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 0.75em;
}

.switcher .switcher-labels > div {
  white-space: nowrap;
}

.switcher .switcher-labels label {
  transition: 0.5s all;
  cursor: pointer;
  padding: 0 0.3em;
  color: #777;
}
.switcher .switcher-labels label.switcher-hidden {
  opacity: 0.7;
}
.switcher .switcher-labels input {
  vertical-align: middle;
  transform: translateY(-1px);
}
