* {
  padding: 0;
  margin: 0;
  box-sizing: inherit;
  font-size: 20px;
  overflow: hidden;
}

p {
  font-weight: bold;
  background: rgba(41, 38, 38, 0.678);
  display: inline-block;
  outline: 2px red;
}
.panels {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

.panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  transition: font-size 0.7s cubic-bezier(0.61, -0.19, 0.5, -0.11),
    flex 0.7s cubic-bezier(0.61, -0.19, 0.5, -0.11), background 0.2s;
  font-size: 20px;
  justify-content: center;
  align-items: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 2px solid rgba(123, 13, 233, 0.7);
  color: blue;
}

.panel * {
  margin: 0;
  width: 100%;
  display: flex;
  font-size: 50px;
  font-weight: bolder;
  flex: 1;
  transition: transform 0.5s;
  justify-content: center;
  align-self: center;
  align-items: center;
}

.panel > *:first-child {
  transform: translateY(-100%);
}
.panel.active-op > *:first-child {
  transform: translateY(0);
}
.panel > *:last-child {
  transform: translateY(100%);
}

.panel.active-op > *:last-child {
  transform: translateY(0);
}

.panel1 {
  background: url(Photos/14.jpg) no-repeat center center/cover;
}
.panel2 {
  background: url(Photos/23.jpg) no-repeat center center/cover;
}
.panel3 {
  background: url(Photos/25.jpg) no-repeat center center/cover;
}
.panel4 {
  background: url(Photos/26.jpg) no-repeat center center/cover;
}
.panel5 {
  background: url(Photos/69.jpg) no-repeat center center/cover;
}
.panel.open {
  flex: 5;
  font-size: 60px;
}

@media (max-width: 660px) {
  .panels {
    flex-direction: column;
  }
}
