.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-box-shadow: 0px 0px 0px 1px #E7DFCF, inset 2px 2px 12px rgba(0, 0, 0, 0.12), inset -2px -3px 8px rgba(255, 255, 255, 0.3);

    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;

    /* &:focus-visible {
      outline: none;
      box-shadow: var(--op-border-all) var(--op-color-neutral-plus-four);
    } */
  }

  /* --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: none;
      }
    }
  }

  /* --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) {
    gap: 0;
  }
}

.day-popup__save {
  position: absolute;
  bottom: 7rem;
  right: 2rem;

  /* --op-breakpoint-small */
  @media only screen and (max-width: 768px) {
    display: flex;
    gap: var(--op-space-x-small);
    transform: translateX(-6.5rem) translateY(-0.5rem);
    bottom: var(--op-space-x-small);
  }
}

.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); }
}
