.day-popup {
  --editor-hardcoded-height: 20.8rem;
  --hardcoded-width: 385px;
  --hardcoded-max-width: 80rem;
  --padding: var(--op-space-medium);
  --day-popup-box-shadow: 0px 4px 10.3px rgba(0, 0, 0, 0.16), 60px 0px 200px 200px rgba(247, 244, 239, 0.6);

  width: calc((100vw - (var(--padding) * 2)) / 2);
  bottom: var(--padding);
  left: var(--padding);
  max-width: var(--hardcoded-max-width);
  position: fixed;
  height: auto;
  /*Over day numbers*/
  z-index: 2;

  padding: var(--op-space-3x-small) var(--op-space-x-small) var(--op-space-x-small) var(--op-space-x-small);
  box-shadow: var(--day-popup-box-shadow);
  background-color: var(--op-color-neutral-plus-eight);
  border-radius: var(--op-radius-2x-large);
  border: var(--op-border-width) solid var(--op-color-neutral-plus-four);

  display: flex;
  flex-direction: column;
  gap: var(--op-space-2x-small);

  .form__error {
    max-width: calc(calc(var(--hardcoded-width) / 2) - var(--op-space-x-large));
  }

  trix-toolbar {
    display: none;
  }

  trix-editor {
    --editor-inset-shadow: inset 2px 2px 12px rgba(0, 0, 0, 0.12), inset -2px -3px 8px rgba(255, 255, 255, 0.3);
    --editor-box-shadow: 0px 0px 0px 1px #E7DFCF, var(--editor-inset-shadow);
    --editor-box-active-shadow: 0px 0px 0px 1px var(--op-color-primary-plus-two), var(--editor-inset-shadow);

    anchor-name: --day-popup-editor;
    border-radius: var(--op-radius-medium);
    width: 100%;
    height: var(--editor-hardcoded-height);
    padding: var(--op-space-x-small);
    color: var(--op-color-neutral-on-max);
    line-height: var(--op-line-height-dense);
    background-color: var(--op-color-neutral-plus-max);
    overflow-y: scroll;
    padding-bottom: 6rem;
    box-shadow: var(--editor-box-shadow);
    outline: none;
    border: none;
  }

  /* --op-breakpoint-small */
  @media only screen and (max-width: 768px) {
    width: 100%;
    padding: var(--op-space-3x-small) var(--op-space-x-small) var(--op-space-x-small) var(--op-space-x-small);
    left: 0;
    border: var(--op-border-width-large) solid var(--op-color-neutral-plus-six);
    box-shadow: var(--op-shadow-large);

    trix-editor {
      background-color: unset;
      border: unset;

      &:focus-visible {
        outline: none;
        box-shadow: var(--editor-box-active-shadow);
      }
    }
  }

  /* --op-breakpoint-small */
  @media only screen and (min-width: 768px) {
    min-width: 65rem;
  }
}

.animate__animated {
  --animate-duration: 0.7s;
}

.animate__animated.animate__zoomOut {
  --animate-duration: 0.15s;
}

.day-popup__header-wrapper {
  display: flex;
  justify-content: center;
}

.day-popup__photo {
  width: 215px;
  position: relative;

  &.day-popup__photo--deletable {
    &:hover {
      cursor: pointer;

      &::after {
        visibility: visible;
      }
    }

    &::after {
      background-color: var(--op-color-alerts-danger-plus-seven);
      color: var(--op-color-alerts-danger-on-plus-seven);
      visibility: hidden;
      position: absolute;
      font-size: var(--op-font-small);
      padding: var(--op-space-3x-small);
      border-radius: 50%;
      top: -10px;
      right: -10px;
    }
  }

  .delete-image-button {
    position: absolute;
    bottom: var(--op-space-small);
    right: var(--op-space-small);
    width: 3rem;
    height: 3rem;
    border: none;
  }

  /* --op-breakpoint-small */
  @media (width < 768px) {
    display: none;
  }
}

.day-popup__mobile-photo {
  position: absolute;
  bottom: var(--op-space-medium);
  left: var(--op-space-medium);
  z-index: calc(var(--op-z-index-header) + 1);
}

.day-popup__photo-floating {
  float: left;
  padding-right: var(--op-space-small);
}

.day-popup__photo-template {
  width: 200px;
  height: 100%;
  border: 2x dashed var(--op-color-neutral-plus-eight);
  border-radius: var(--op-radius-medium);
}

.day-popup__header {
  padding-block: var(--op-space-x-small);
  padding-inline-end: var(--op-space-small);
  transition: all 300ms ease-in-out;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  width: 100%;
  align-items: center;
}

.day-popup__header > :first-child {
  justify-self: start;
}

.day-popup__header > :last-child {
  justify-self: end;
}

.day-popup__body {
  display: flex;
  gap: var(--op-space-x-small);

  /* --op-breakpoint-small */
  @media only screen and (max-width: 768px) {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;

    .full-width {
      order: 1;
      width: 100%;
    }

    #day-popup-image {
      order: 2;
    }
  }
}

.day-popup__save {

  position: absolute;
  position-anchor: --day-popup-editor;
  position-area: bottom right;
  transform: translate(-1.8rem, -4rem);
  
}

.day-popup__badge-toggle {
  order: 3;
}

.day-popup__event-buttons {
  display: flex;
  align-items: center;
  gap: var(--op-space-2x-small);
}

.day-popup__event-label {
  color: var(--op-color-neutral-on-plus-six-alt);
  font-size: var(--op-font-x-small);
}

.day-popup__autosave-status {
  display: inline-flex;
  align-items: center;
  gap: var(--op-space-2x-small);
  color: var(--op-color-neutral-on-plus-six-alt);
  font-size: var(--op-font-x-small);
  min-height: 1.25rem;
  white-space: nowrap;
}

.day-popup__autosave-message:empty {
  display: none;
}

.day-popup__autosave-spinner {
  display: inline-flex;
  animation: day-popup-autosave-spin 0.9s linear infinite;
}

.day-popup__autosave-spinner[hidden] {
  display: none;
}

@keyframes day-popup-autosave-spin {
  to { transform: rotate(360deg); }
}
