:root {
  --origin: 25% center;
}

.section.calendar {
  position: relative;
  overflow: hidden;
  background-size: auto 100%;
  padding: 120px 0 90px;
  background-repeat: no-repeat;
  background-position: center;
}

.section.calendar::after {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  background-image: inherit;
  background-size: 100% auto;
  background-position: center;
  filter: blur(2px);
}

.calendar-cards {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 20px;
  flex-flow: row wrap;
}

.calendar .box {
  border: 5px dashed #ff3a46;
  border-radius: 4px;
  position: relative;
  transition: all 250ms ease;
  background-color: rgb(245 245 247 / 50%);
  width: calc((100% / 4) - 15px);
  height: calc(((100vh - 72px) / 3) - 20px);
  max-height: 420px;
  min-height: 140px;
  cursor: pointer;
}

.calendar .box:hover {
  background-color: rgb(245 245 247 / 80%);
}

.calendar .box .number {
  background: none;
  transform: rotateY(0deg);
  color: #ff3a46;
  font-family: Roobert;
  font-size: 10vh;
  font-weight: 600;
  line-height: normal;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 32px;
  transform-origin: var(--origin);
  height: 100%;
}

.calendar .panel .left-panel {
  line-height: 0;
}

@media (orientation: portrait) and (width <=767px) {
  .calendar .box {
    width: calc((100% / 3) - 15px);
    height: calc(((100vh - 72px) / 4) - 20px);
  }
}

@media (orientation: portrait) and (width <=599px) {
  .calendar .box {
    width: calc(50% - 10px);
    height: calc(((100vh - 72px) / 6) - 20px);
    min-height: 80px;
  }

  .calendar .box .number {
    font-size: 6vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
}

/* Popup inside box */

.calendar .popup {
  position: fixed;

  /* Must be fixed for fullscreen overlay */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 60%);
  display: none;
  justify-content: center;
  align-items: center;
}

.calendar .popup.show {
  display: flex;
  z-index: 9999;
}

.calendar .popup-content {
  background: #fff;
  padding: 0;
  width: 650px;
  border-radius: 10px;
  position: relative;
  animation: fade 0.3s ease;
  /overflow: hidden;
  /
}

@keyframes fade {
  from {
    opacity: 0;
    transform: scale(0.7);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.calendar .close {
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 28px;
  cursor: pointer;
  border: 0;
  background: #000;
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.calendar .cta {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: black;
  color: white;
  text-decoration: none;
  border-radius: 6px;
}

.calendar .left-panel img {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  width: 100%;
  height: auto;
  max-width: 250px;
  object-fit: contain;
}

.calendar .panel {
  display: flex;
  justify-content: space-between;
  gap: 0;
  align-items: center;
}

.calendar .card-content {
  width: calc(100% - 290px);
  padding: 20px 50px 20px 0;
}

.calendar .card-content p {
  font-size: 20px;
  margin: 0 0 15px;
}

.calendar a.card-intro {
  margin-top: 24px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  text-decoration: none;
  align-items: center;
  transition: all .3s ease;
  color: #fff;
  display: inline-flex;
  flex-flow: row;
  gap: 6px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #121017;
  padding: 12px 12px 12px 20px;
}

.calendar a.card-intro::after {
  content: "";
  background-image: url("https://info.yugabyte.com/hubfs/19913802/themes/yugabytedb/images/button-arrow-white.svg"),
                    url("https://info.yugabyte.com/hubfs/19913802/themes/yugabytedb/images/button-arrow-orange.svg");
  background-size: auto, 0;
  width: 32px;
  height: 32px;
  margin-left: 6px;
}

.calendar a.card-intro:hover::after {
  background-size: 0, auto;
}

@media(width <=767px) {
  .calendar .card-content {
    width: 100%;
    padding: 50px 32px;
  }

  .calendar .left-panel {
    display: none;
  }

  .calendar .popup-content {
    width: 400px;
  }
}

@media(width <=480px) {
  .calendar .card-content {
    padding: 40px 24px;
    max-height: 90vh;
    overflow: auto;
  }

  .calendar .popup-content {
    width: calc( 100vw - 15px);
  }

  .calendar a.card-intro {
    font-size: 15px;
  }

  .calendar .close {
    position: absolute;
    top: 5px;
    right: 5px;
  }
}
