/* Styles for editing container */
body.path-frontend-editing {
  --gin-toolbar-x-offset: 0;
  --gin-toolbar-y-offset: 0;
}

.editing-container {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  overflow: auto;
  width: 30%;
  min-width: 300px;
  height: 100%;
  transition: width 0.5s;
  background-color: white;
  box-shadow: -0.2rem 0 1rem rgb(116, 116, 116, 0.4);
}
.editing-container--wide {
  width: 80%;
}
.editing-container--loading {
  animation-name: placeholder-shimmer;
  animation-duration: 1.8s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  background: linear-gradient(to right, #f5f7fb 8%, #e7e7e7 38%, #f5f7fb 54%);
  background-size: 1000px 640px;
  animation-fill-mode: forwards;
}
@keyframes placeholder-shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

/* Styles for action buttons */
.editing-container__actions {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  width: 100%;
  height: 0;
  padding: 0 1rem;
}

.editing-container__actions button {
  position: relative;
  top: 40px;
}

/* Styles for close button */
button.editing-container__close {
  width: 24px;
  height: 24px;
  cursor: pointer;
  border: none;
  background: url('data:image/svg+xml,%3Csvg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M17 1L9 9l8 8M1 1l8 8-8 8" stroke="%23222330" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E') center no-repeat;
}

/* Styles for width button */
button.editing-container__toggle {
  width: 24px;
  height: 24px;
  cursor: pointer;
  border: none;
  background: url('data:image/svg+xml,%3Csvg width="10" height="18" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M9 1L1 9l8 8" stroke="%23222330" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E') center no-repeat;
}

.editing-container--wide .editing-container__toggle {
  background: url('data:image/svg+xml,%3Csvg width="10" height="18" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M9 1L1 9l8 8" stroke="%23222330" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" transform="rotate(180 5 9)"/%3E%3C/svg%3E') center no-repeat;
}

/* Styles for iframe */
#editing-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.frontend-editing-preview-content,
.frontend-editing-update-content {
  visibility: hidden;
  overflow: hidden;
  order: 100;
  width: 32px;
  height: 32px;
  position: absolute;
  text-indent: -9999rem;
}

/* Style container of editable elements */
.frontend-editing {
  position: relative;
}

.frontend-editing:has(.frontend-editing:hover) > .frontend-editing-actions .add-paragraphs {
  display: none;
}

.frontend-editing:hover .frontend-editing:not(:hover) .add-paragraphs {
  display: none;
}

body:not(.frontend-editing--hidden) .frontend-editing:has(.add-paragraphs.hover-highlight) {
  transition: padding ease-in-out 0.4s;
}

body:not(.frontend-editing--hidden) .frontend-editing:has(.add-paragraphs.hover-highlight):hover {
  padding: 25px 0;
}

body:not(.frontend-editing--hidden) .frontend-editing:hover {
  z-index: 10;
  outline: 3px solid rgba(var(--fe-editing-primary-color), 0.8);
}

body:not(.frontend-editing--hidden) .frontend-editing:has(.frontend-editing:hover) {
  outline: 3px solid rgba(var(--fe-editing-primary-color), 0.2);
}

.frontend-editing:has(.frontend-editing:hover) > .frontend-editing-actions {
  display: none;
}

.frontend-editing:hover .frontend-editing:not(:hover) .frontend-editing-actions {
  display: none;
}

/* Styled for editing action */
.common-actions-container {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 0;
  display: flex;
  width: auto;
}

.title-edit-container,
.icons-container {
  margin-right: 0.5rem;
  margin-left: 0.5rem;
}

.action-title {
  display: block;
  align-self: center;
  width: 100%;
  padding-top: 5px;
  padding-bottom: 5px;
  padding-left: 15px;
  white-space: nowrap;
  letter-spacing: 0.2em;
  pointer-events: none;
  opacity: 0;
  color: #222330;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: normal;
}

.frontend-editing:hover .frontend-editing__action,
.frontend-editing:hover .action-title {
  opacity: 1;
}

.frontend-editing:hover .title-edit-container,
.frontend-editing:hover .icons-container {
  display: flex;
  overflow: hidden;
  border: 1px solid #d3d3d3;
  border-radius: 8px;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.frontend-editing-actions .ajax-progress {
  display: inline-flex;
  justify-content: center;
  /* Ensure AJAX throbber is always last item */
  order: 6;
  width: 32px;
  height: 32px;
  padding: 0;
  opacity: 1;
  border-left: 1px solid #dddcdc;
  background: #e8e8e8;
}

.frontend-editing-actions .ajax-progress .throbber {
  display: block;
  width: 100%;
  padding: 0;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 24 24'%3E%3Cstyle%3E@keyframes spinner%7Bto%7Btransform:rotate(360deg)%7D%7D%3C/style%3E%3Cpath d='M12 4a8 8 0 0 1 7.89 6.7 1.53 1.53 0 0 0 1.49 1.3 1.5 1.5 0 0 0 1.48-1.75 11 11 0 0 0-21.72 0A1.5 1.5 0 0 0 2.62 12a1.53 1.53 0 0 0 1.49-1.3A8 8 0 0 1 12 4Z' style='transform-origin:center;animation:spinner .75s infinite linear'/%3E%3C/svg%3E");
  background-position: center;
  background-size: 18px;
}

.frontend-editing--outline:hover .frontend-editing-actions::before {
  opacity: 1;
}

/* Style editing icon */
.frontend-editing__action {
  z-index: 1;
  display: inline-block;
  overflow: hidden;
  width: 37px;
  height: 32px;
  transition-duration: 0s;
  text-indent: -9999rem;
  opacity: 0;
  color: transparent;
  border-right: 1px solid #dddcdc;
  background-position: center;
  font-size: 0;
}

.frontend-editing__action--edit {
  width: 49px;
}

.frontend-editing__action--edit {
  border-left: 1px solid #dddcdc;
}

.frontend-editing-actions .frontend-editing__action:hover {
  opacity: 1;
}

.frontend-editing-actions {
  height: 0;
}

:is(.frontend-editing__action--delete, .frontend-editing__action--edit, .frontend-editing__action--down, .frontend-editing__action--up):hover {
  background-color: rgb(var(--fe-editing-primary-color), 0.25);
}

.frontend-editing__action:last-child {
  border-right-width: 0;
}

.frontend-editing__action:hover::before {
  opacity: 1;
}

.add-paragraphs {
  width: 0;
  height: 0;
}

.add-paragraphs a {
  position: absolute;
  z-index: 1;
  right: 0;
  left: 0;
  display: flex;
  overflow: visible;
  width: fit-content;
  height: 25px;
  margin: auto;
  border: 0;
}

.add-paragraphs.hover-highlight a {
  width: 100%;
  background-color: rgba(var(--fe-editing-primary-color), 0.25);
}

.add-paragraphs a:hover {
  opacity: 0.5;
}

.frontend-editing:hover .add-paragraphs.icons-container {
  border-width: 0;
}

.frontend-editing .move-paragraphs.icons-container:not(:has(*)) {
  display: none;
}

.frontend-editing__action--before {
  top: 0;
}

.frontend-editing__action--after {
  bottom: 0;
}

.frontend-editing:hover + .frontend-editing {
  pointer-events: none;
}

.frontend-editing__action:not(.frontend-editing__action--before, .frontend-editing__action--after)::before {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
}

.frontend-editing__action--before svg,
.frontend-editing__action--after svg {
  border-radius: 100%;
  box-shadow: 0 0 5px 0 #00000040;
}

.frontend-editing__action--before::before,
.frontend-editing__action--after::before {
  position: absolute;
  z-index: 10;
  right: 0;
  left: 0;
  display: block;
  width: 32px;
  height: 32px;
  content: " ";
}

.frontend-editing__action--before::before {
  margin: -1rem auto 0 auto;
}

.frontend-editing__action--before svg {
  z-index: 10;
  width: 32px;
  height: 32px;
  margin: -1rem auto 0 auto;
  pointer-events: none;
  color: rgb(var(--fe-editing-primary-color));
}

.frontend-editing__action--after::before {
  bottom: 0;
  margin: auto;
  margin-bottom: -1rem;
}

.frontend-editing__action--after svg {
  z-index: 10;
  width: 32px;
  height: 32px;
  margin: auto;
  margin-bottom: -1rem;
  pointer-events: none;
  color: rgb(var(--fe-editing-primary-color));
}

.frontend-editing__action--up::before {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzIzMjIyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIgNGExIDEgMCAwIDEgLjcwNy4yOTNsNyA3YTEgMSAwIDAgMS0xLjQxNCAxLjQxNEwxMyA3LjQxNFYxOWExIDEgMCAxIDEtMiAwVjcuNDE0bC01LjI5MyA1LjI5M2ExIDEgMCAwIDEtMS40MTQtMS40MTRsNy03QTEgMSAwIDAgMSAxMiA0WiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+");
  background-size: 20px;
}

.frontend-editing__action--down::before {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzIzMjIyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTMgNWExIDEgMCAxIDAtMiAwdjExLjU4NmwtNS4yOTMtNS4yOTNhMSAxIDAgMSAwLTEuNDE0IDEuNDE0bDYuOTk1IDYuOTk1QS45OTMuOTkzIDAgMCAwIDEyIDIwYS45OTcuOTk3IDAgMCAwIC43MTItLjI5OGw2Ljk5NS02Ljk5NWExIDEgMCAwIDAtMS40MTQtMS40MTRMMTMgMTYuNTg2VjVaIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=");
  background-size: 20px;
}

.frontend-editing__action--edit::before {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzIzMjIyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkgMy4xNzFhMS44MjkgMS44MjkgMCAwIDAtMS4yOTMuNTM2TDQuMzk1IDE3LjAxOWwtLjk3IDMuNTU2IDMuNTU2LS45N0wyMC4yOTMgNi4yOTNBMS44MjkgMS44MjkgMCAwIDAgMTkgMy4xN1ptLTEuNDY1LTEuNzA4YTMuODI5IDMuODI5IDAgMCAxIDQuMTcyIDYuMjQ0bC0xMy41IDEzLjVhMSAxIDAgMCAxLS40NDQuMjU4bC01LjUgMS41YTEgMSAwIDAgMS0xLjIyOC0xLjIyOGwxLjUtNS41YTEgMSAwIDAgMSAuMjU4LS40NDRsMTMuNS0xMy41YTMuODI5IDMuODI5IDAgMCAxIDEuMjQyLS44M1oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==");
}

.frontend-editing__action--delete::before {
  /* Applies red color to icon, but still allows for CSS overwrites to change in case needed. */
  filter: invert(46%) sepia(89%) saturate(7478%) hue-rotate(352deg) brightness(99%) contrast(104%);
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxOCIgZmlsbD0ibm9uZSI+PHBhdGggc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIxLjUiIGQ9Ik0uNzUgMi44ODNoMTMuODY3bS05LjYgMFYxLjc5QTEuMDQgMS4wNCAwIDAgMSA2LjA1Ny43NUg5LjMxYTEuMDQgMS4wNCAwIDAgMSAxLjA0IDEuMDR2MS4wOTNtMi44IDAtLjc3MyAxMi41NmExLjMzNCAxLjMzNCAwIDAgMS0xLjMwNyAxLjMwN0g0LjI5N2ExLjMzMyAxLjMzMyAwIDAgMS0xLjMwNy0xLjMwN2wtLjc3My0xMi41Nk03LjY4MyA1LjAxN3Y5LjZtLTIuNjY2LTkuNi41MzMgOS42bTQuOC05LjYtLjUzMyA5LjYiLz48L3N2Zz4=");
}

/* Layout for small screens */
@media (max-width: 450px) {
  .editing-container,
  .editing-container--wide {
    width: 100%;
  }
  .editing-container__toggle {
    display: none;
  }
}

/* Hidden */

.frontend-editing--hidden .frontend-editing:hover {
  outline: none;
}

.frontend-editing--hidden .frontend-editing .frontend-editing-actions {
  display: none;
}

.fe-confirm-dialog {
  padding: 15px;
}

.fe-confirm-dialog-question {
  margin-bottom: 20px;
  text-align: center;
}

.fe-confirm-dialog-button-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

button.fe-confirm-dialog-button {
  margin: 0 5px;
  padding: 5px 15px;
  color: #fff;
  border-color: rgb(var(--fe-editing-primary-color));
  background-color: rgb(var(--fe-editing-primary-color));
}

button.fe-confirm-dialog-button--false {
  border-color: rgb(var(--fe-editing-primary-color), 0.6);
  background-color: rgb(var(--fe-editing-primary-color), 0.6);
}
