.calendar {
  position: relative;
  width: 295px;
  height: fit-content;
  padding: 1%;
  background-color: rgba(237, 237, 237, 1);
  border-radius: 6px;
  border: 1px solid hsl(0, 0%, 80%);
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}

.calendar .calendar-header {
  font-size: small;
  justify-content: space-evenly;
  display: flex;
  height: 3em;
  background-color: rgba(237, 237, 237, 1);
  padding-bottom: 5%;
  position: relative;
  z-index: 12;
}

.calendar .calendar-body {
  overflow: hidden;
}

.calendar .calendar-header :is(.prev-month, .next-month) {
  background: unset;
  border: unset;
  cursor: pointer;
  text-align: center;
}

.calendar .calendar-header :is(.prev-month, .next-month) img {
  width: 10px;
}

.calendar .calendar-header :is(.month-select, .year-select) {
  background: unset;
  border: unset;
  border: solid 1px hsl(0, 0%, 80%);
  cursor: pointer;
  padding: 2px 10px;
  border-radius: 3px;
  text-align: center;
  margin: 0;
}

.calendar .calendar-header :is(.month-select, .year-select):is(:hover, :focus),
.calendar .calendar-header :is(.prev-month, .next-month):is(:hover, :focus) {
  background-color: rgba(237, 237, 237);
  border-color: hsl(0, 0%, 80%);
}

.calendar ul.calendar-weekdays,
.calendar .calendar-days ol {
  display: grid;
  font-size: small;
  grid-row-gap: 0.33em;
  grid-template-columns: repeat(7, 1fr);
  list-style: none;
  margin: 0 0 4px 0;
  padding: unset;
  position: relative;
  background-color: rgba(237, 237, 237, 1);
  z-index: 10;
}

.calendar ul.calendar-weekdays {
  z-index: 11 !important;
}

.calendar ul.calendar-weekdays li,
.calendar .calendar-days ol li {
  border-color: hsl(0, 0%, 80%);
  border-style: solid;
  border-width: 0 0 1px 0;
  text-align: center;
}

.calendar .calendar-days ol li {
  height: 4em;
}

.calendar .calendar-days ol li abbr.weeknumber {
  color: hsl(0, 0.5%, 43.3%);
  display: inline-block;
  position: absolute;
  font-size: xx-small;
  inset-inline-start: 0;
}

.calendar .calendar-days ol li[data-weekend=""] time {
  color: hsl(0, 89.8%, 42.4%) !important;
}

.calendar .calendar-days ol li.outside-month time {
  color: hsla(0, 0%, 0%, 0.55) !important;
}

.calendar .calendar-days ol li[data-weekend=""].outside-month time {
  color: hsla(0, 100%, 23.7%, 0.67) !important;
}

.calendar ul.calendar-weekdays li abbr,
.calendar .calendar-days ol li abbr {
  text-decoration: none;
}

.calendar .calendar-days ol li .day-button {
  background-color: unset;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;

  font-family: 'Noto Sans', sans-serif;
  font-size: 13px;
}

.calendar .calendar-days ol li .day-button.outside-month-button {
  cursor: default;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.calendar .calendar-days ol li .day-button .day-title .events-count {
  visibility: hidden;
  display: block;
  height: 0;
  width: 0;
}

.calendar .calendar-days ol li .day-button .events {
  display: flex;
  justify-content: center;
  column-gap: 1px;
  min-height: 5px;
}

.calendar div.events-container ul li span.event,
.calendar .calendar-days ol li .day-button .events .event {
  display: inline-block;
  background-color: var(--event-color);
  border-radius: 3px;
  height: 5px;
  width: 5px;
}

.calendar div.events-container {
  position: absolute;
  left: 0;
  width: calc(100% - 5px);
  height: 100px;
  z-index: 15;
  background-color: #fff;
  box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
  border: solid 1px hsl(0, 0%, 80%);
  border-radius: 3px;
  overflow: auto;
  padding: 12px 0px 0px 2px;
}

.calendar div.events-container .close-button {
  position: absolute;
  top: 1px;
  right: 4px;
  cursor: pointer;
  border: 0;
  padding: 0;
  margin: 0;
  height: 16px;
  width: 16px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  font-size: large;
}

.calendar div.events-container ul {
  list-style: none;
  padding: 2px;
  margin: 2px;
}

.calendar div.events-container ul li a {
  text-decoration: none;
  color: inherit;
  width: 100%;
  overflow-wrap: anywhere;
}

.calendar div.events-container ul li.event-item {
  display: flex;
  width: 100%;
  align-items: first baseline;
  gap: 4px;
  font-size: small;
}

.calendar div.events-container ul li.event-item:hover {
  background-color: hsl(0, 0%, 80%);
}

.calendar div.arrow {
  position: absolute;
  display: block !important;
  width: 0px;
  height: 0px;
  border-style: solid;
  border-width: 0 8px 8px 8px;
  border-color: transparent transparent hsl(0, 0%, 80%) transparent;
  transition: all 0.7s ease;
  z-index: 16;
}

.calendar .calendar-days ol li.day.selected button .day-title span {
  font-weight: bold !important;
}

.fade-events {
  opacity: 1;
  -webkit-animation: fadeInOpacity .4s ease-out;
  -moz-animation: fadeInOpacity .4s ease-out;
  animation: fadeInOpacity .4s ease-out;
}

@keyframes fadeInOpacity {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.month-prev-in {
  -webkit-animation: moveFromBottomFadeMonth .4s ease-out;
  -moz-animation: moveFromBottomFadeMonth .4s ease-out;
  animation: moveFromBottomFadeMonth .4s ease-out;
  opacity: 1;
}

@-webkit-keyframes moveFromBottomFadeMonth {
  from {
    opacity: 0;
    -webkit-transform: translateY(-20%) scale(.95);
  }
}

@-moz-keyframes moveFromBottomFadeMonth {
  from {
    opacity: 0;
    -webkit-transform: translateY(-20%);
  }
}

@keyframes moveFromBottomFadeMonth {
  from {
    opacity: 0;
    -webkit-transform: translateY(-20%);
  }
}

.month-prev-out {
  -webkit-animation: moveToBottomFadeMonth .4s ease-in;
  -moz-animation: moveToBottomFadeMonth .4s ease-in;
  animation: moveToBottomFadeMonth .4s ease-in;
  opacity: 1;
}

@-webkit-keyframes moveToBottomFadeMonth {
  to {
    opacity: 0;
    -webkit-transform: translateY(20%) scale(.95);
  }
}

@-moz-keyframes moveToBottomFadeMonth {
  to {
    opacity: 0;
    -webkit-transform: translateY(20%);
  }
}

@keyframes moveToBottomFadeMonth {
  to {
    opacity: 0;
    -webkit-transform: translateY(20%);
  }
}

.month-next-out {
  -webkit-animation: moveToTopFadeMonth .4s ease-out;
  -moz-animation: moveToTopFadeMonth .4s ease-out;
  animation: moveToTopFadeMonth .4s ease-out;
  opacity: 1;
}

@-webkit-keyframes moveToTopFadeMonth {
  to {
    opacity: 0;
    -webkit-transform: translateY(-20%) scale(.95);
  }
}

@-moz-keyframes moveToTopFadeMonth {
  to {
    opacity: 0;
    -moz-transform: translateY(-20%);
  }
}

@keyframes moveToTopFadeMonth {
  to {
    opacity: 0;
    -moz-transform: translateY(-20%);
  }
}

.month-next-in {
  -webkit-animation: moveFromTopFadeMonth .4s ease-out;
  -moz-animation: moveFromTopFadeMonth .4s ease-out;
  animation: moveFromTopFadeMonth .4s ease-out;
  opacity: 1;
}

@-webkit-keyframes moveFromTopFadeMonth {
  from {
    opacity: 0;
    -webkit-transform: translateY(20%) scale(.95);
  }
}

@-moz-keyframes moveFromTopFadeMonth {
  from {
    opacity: 0;
    -moz-transform: translateY(20%);
  }
}

@keyframes moveFromTopFadeMonth {
  from {
    opacity: 0;
    -moz-transform: translateY(20%);
  }
}

@media screen and (min-width: 640px) {
  .calendar {
    width: 350px;
  }

  .calendar .calendar-header {
    height: 3em;
  }


  .calendar .calendar-days ol li .day-button {
    font-size: 15px;
  }

  .calendar div.events-container ul li.event-item,
  .calendar ul.calendar-weekdays,
  .calendar .calendar-days ol,
  .calendar .calendar-header {
    font-size: medium;
  }

  .calendar .calendar-days ol li abbr.weeknumber {
    font-size: small;
  }
}