
* {
  box-sizing: border-box;
}


.container {
  display: flex;
  width: 100%;
}

.panel .title{
  font-size: 2.75em;
  font-weight: 600;
  transform: rotate(-90deg);
  -ms-transform: rotate(-90deg); 
  position: absolute;
  top: 45%;
  left: 0;
  right: 0;
  transition: opacity 0.3s linear 0.7s; 
}
.panel.active .title{
  opacity:0;
  transition: opacity 0s; 
}

.panel {
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 12px;
  color: #fff;
  flex: 0.5;
  cursor: pointer;
  height: 80vh;
  position: relative;
  margin: 10px;
  transition: flex 0.7s cubic-bezier(0.05, 0.6, 0.4, 0.9);
  background-color: black;
}

.panel .text {
  font-size: 18px;
  opacity: 0;
  position: absolute;
  bottom: 20px;
  left: 20px;
  margin: 0;
  transition: opacity 0s ease-in 0s;
}

.panel .text h3{
  font-size: 2.75em;
  font-weight: 600;
}

.panel.active {
  flex: 5;
}

.panel.active .text {
  opacity: 1;
  transition: opacity 0.3s ease-in 0.4s;
  text-align: left;
}


@media screen and (max-width: 500px) {
  .container {
    width: 100%;
  }
  
  .panel:nth-of-type(4) {
    display: none;
  }
  
  .panel:nth-of-type(5) {
    display: none;
  }

  .panel .text h3{
    font-size: 2em;
    font-weight: 600;
  }
}

/* Image gallery stlyling */
.container {
  /*max-width: 900px;*/
  margin: 80px auto 0;
  text-align: center;
}

.container__img-holder {
  max-width: 280px;
  display: inline-block;
  vertical-align: top;
  margin-bottom: 20px;
  margin-left: 16px;
  cursor: pointer;
}

.container .container__img-holder:nth-child(3n+1) {
  margin-left: 0;
}

.container__img-holder img {
  width: 100%;
  height: 220px;
  display: block;
}


/* Popup Styling */
.img-popup {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, .6);
  display: flex;
  justify-content: center;
  align-items: center;
  display: none;
}

.img-popup img {
  max-width: 900px;
  width: 100%;
  /* max-height: 90% */
  opacity: 0;
  transform: translateY(-100px);
  -webkit-transform: translateY(-100px);
  -moz-transform: translateY(-100px);
  -ms-transform: translateY(-100px);
  -o-transform: translateY(-100px);
  border-radius: 12px;
}

.close-btn {
  width: 35px;
  height: 30px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
}

.close-btn .bar {
  height: 4px;
  background: #333;
}

.close-btn .bar:nth-child(1) {
  transform: rotate(45deg);
}

.close-btn .bar:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}

.opened {
  display: flex;
}

.opened img {
  animation: animatepopup 1s ease-in-out .8s;
  -webkit-animation: animatepopup .3s ease-in-out forwards;
}

@keyframes animatepopup {

  to {
    opacity: 1;
    transform: translateY(0);
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
  }

}

@media screen and (max-width: 880px) {

  .container .container__img-holder:nth-child(3n+1) {
    margin-left: 16px;
  }

}

@media screen and (max-width: 500px) {
  .container {
    margin: 0 !important;
    display: block;
    padding: 0 !important;
  }

  .panel {
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    color: #fff;
    flex: 0.5;
    cursor: pointer;
    height: 50vh;
    position: relative;
    margin: 10px;
    transition: flex 0.7s cubic-bezier(0.05, 0.6, 0.4, 0.9);
    background-color: black;
    max-width: 100%;
  }

}
