/* editor.css | updated: 2026-04-25 */
.editor-page {
  display: flex;
  flex-direction: column;
  width: 1140px;
  height: 100%;
  margin: 40px auto;
}

.rpg-editor {
  flex: 1;
}

.rpg-editor * {
  outline: none;
}

.rpg-editor .ce-toolbar__actions {
  padding-right: 1rem;
}

.rpg-editor .ce-toolbar__plus,
.rpg-editor .ce-toolbar__settings-btn {
  color: #fff;
}
@media (hover: hover) {
  .rpg-editor .ce-toolbar__plus:hover,
  .rpg-editor .ce-toolbar__settings-btn:hover {
    background-color: #418af4;
  }
}
.rpg-editor .codex-editor__redactor {
  display: flex;
  flex-direction: column;
  gap: 1.23rem;
  outline: none;
}

.rpg-editor .ce-paragraph {
  font-size: 1.125rem;
  font-family: "Brutal", sans-serif;
  font-weight: 325;
}

.rpg-editor .ce-rampaga-header {
  font-family: "Brutal", sans-serif;
  color: #ccc;
  outline: none;
}

.rpg-editor .ce-rampaga-header--h1 {
  font-size: 2.125rem;
}

.rpg-editor .ce-rampaga-header--h2 {
  font-size: 1.525rem;
}

.rpg-editor .ce-rampaga-header--h3 {
  font-size: 1.225rem;
}

.rpg-editor .ce-ucoz-image {
  display: flex;
  flex-direction: column;
}

.rpg-editor .ce-ucoz-image__img {
  max-width: 100%;
  display: block;
  border-radius: 10px;
}

/* пустой блок — большая кликабельная зона */
.rpg-editor .ce-ucoz-image {
  position: relative;
}

/* label — по умолчанию большой */
.rpg-editor .ce-ucoz-image__pick {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: #232e38;
  box-shadow: 0 0 0 1px #29343e;
  border-radius: 0.5rem;
  color: #418af4;
}

/* пустое состояние: label занимает место превью */
.rpg-editor .ce-ucoz-image:not(.ce-ucoz-image--loaded) .ce-ucoz-image__pick {
  width: 100%;
  min-height: 96px;
}

.rpg-editor .ce-ucoz-image__caption {
  margin-top: 1rem;
  outline: none;
  font-style: italic;
}

/* загружено: label становится маленькой кнопкой в углу */
.rpg-editor .ce-ucoz-image.ce-ucoz-image--loaded .ce-ucoz-image__pick {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  color: #fff;
  background-color: #418af4;
  box-shadow: 0 0 0 1px #418af4;
  opacity: 0.7;
}

.rpg-editor .ce-ucoz-image.ce-ucoz-image--loaded .ce-ucoz-image__pick:hover {
  opacity: 1;
}

.rpg-editor .ce-ucoz-image.ce-ucoz-image--loaded .ce-ucoz-image__pick svg {
  width: 80%;
}

/* caption placeholder */
.rpg-editor .ce-ucoz-image__caption:empty::before {
  content: attr(data-placeholder);
  opacity: 0.6;
  pointer-events: none;
}

.rpg-editor .ce-ucoz-image:not(.ce-ucoz-image--loaded) .ce-ucoz-image__caption,
.ce-ucoz-image__slot {
  display: none;
}

.ce-ucoz-gallery {
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
}

.ce-ucoz-gallery.ce-ucoz-gallery--dragover {
  outline: 2px dashed var(--color-accent, #c5a574);
  outline-offset: 6px;
}

.ce-ucoz-gallery__grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ce-ucoz-gallery__thumb {
  width: 93px;
  height: 93px;
  border-radius: 0.5rem;
  position: relative;
}

.ce-ucoz-gallery__thumb img {
  width: 100%;
  object-fit: cover;
  height: 100%;
  border-radius: 0.5rem;
}

.ce-ucoz-gallery__thumb--add {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  color: #418af4;
  transition: background-color 0.3s linear;
}

.ce-ucoz-gallery__thumb--add:hover {
  background-color: #418af4;
  box-shadow: #418af4;
  color: #fff;
}

.ce-ucoz-gallery__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 10;
  color: #fff;
  padding: 0;
  background-color: #a52a2a;
  height: 24px;
  width: 24px;
  border-radius: 100%;
  opacity: 0.7;
  transition: opacity 0.3s linear;
}

.ce-ucoz-gallery__remove:hover {
  opacity: 1;
}

.ce-ucoz-gallery__remove svg {
  fill: currentColor;
  stroke: currentColor;
  width: 12px;
  height: 12px;
}

.ce-ucoz-gallery__caption {
  outline: none;
  margin-top: 1rem;
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 0 0 4px #4189f400;
  transition: box-shadow 0.1s linear;
}

.ce-ucoz-gallery__caption:focus-visible {
  box-shadow: 0 0 0 4px #4189f4;
}

/* GalleryTool — single image hero mode */
.ce-ucoz-gallery.ce-ucoz-gallery--single .ce-ucoz-gallery__grid {
  display: block;
  width: 100%;
}

.ce-ucoz-gallery.ce-ucoz-gallery--single .ce-ucoz-gallery__hero {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;

  /* 16:9 */
  padding-top: 56.25%;

  background: rgba(255, 255, 255, 0.04);
}

.ce-ucoz-gallery.ce-ucoz-gallery--single .ce-ucoz-gallery__hero img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ce-ucoz-gallery.ce-ucoz-gallery--single .ce-ucoz-gallery__hero .ce-ucoz-gallery__remove {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
}

.ce-ucoz-gallery.ce-ucoz-gallery--single .ce-ucoz-gallery__hero-add {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;

  width: 34px;
  height: 34px;
  line-height: 34px;

  text-align: center;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;

  font-weight: 700;
  font-size: 18px;

  background: rgba(59, 130, 246, 0.95);
  color: #fff;
}

.rpg-editor .ce-header {
}

.rpg-editor .ce-popover-item__icon--tool {
  color: #d0d0d0;
}
.rpg-editor .ce-popover-item__icon--tool svg,
.rpg-editor .ce-popover-item__icon--tool svg [fill],
.rpg-editor .ce-popover-item__icon--tool svg [stroke] {
  fill: currentColor;
  stroke: currentColor;
}

.rpg-editor .ce-popover__container {
  background-color: rgb(23, 26, 32);
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}
.rpg-editor .ce-popover-item__title {
  font-weight: 400;
  font-size: 1rem;
}
.rpg-editor .ce-popover-item {
  color: #d0d0d0;
}

.rpg-editor .ce-popover-item:hover:not(.ce-popover-item--no-hover) {
  background-color: #2b3139;
}

.rpg-editor .cdx-search-field {
  background-color: #2b3139;
}

.rpg-editor .video {
  display: block;
}
.rpg-editor .video__input {
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 0 0 4px #4189f400;
  transition: box-shadow 0.1s linear;
  margin-bottom: 1rem;
}
.rpg-editor .video__input:focus-visible {
  box-shadow: 0 0 0 4px #418af4;
}
/* именно плеер держит пропорции и обрезку */
.rpg-editor .video__player {
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.1);
  aspect-ratio: 16 / 9;
}

.rpg-editor .video__caption {
  outline: none;
  margin-top: 1rem;
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 0 0 4px #4189f400;
  transition: box-shadow 0.1s linear;
}

rpg-editor .video__caption:focus-visible {
  box-shadow: 0 0 0 4px #4189f4;
}

.rpg-editor .video__caption:empty:before {
  content: attr(data-placeholder);
  opacity: 0.45;
}

.rpg-editor .video__player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}

.rpg-editor .linkcard__topbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.rpg-editor .linkcard.linkcard--loaded .linkcard__controls,
.rpg-editor .linkcard .linkcard__hint,
.rpg-editor .linkcard.linkcard__btn {
  display: none;
}

.rpg-editor .linkcard__controls {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-bottom: 1rem;
}

.rpg-editor .linkcard__input {
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 0 0 4px #4189f400;
  transition: box-shadow 0.1s linear;
}

.rpg-editor .linkcard__input:focus-visible {
  box-shadow: 0 0 0 4px #418af4;
}

.rpg-editor .linkcard__btn {
  padding: 0.5rem 1rem;
  background: #418af4;
  border-radius: 0.5rem;
  color: #fff;
  font-weight: 500;
}

.rpg-editor .linkcard__card .linkcard__a {
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.rpg-editor .linkcard__img {
  width: 160px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
}
.rpg-editor .linkcard__title {
  font-weight: 500;
}
.rpg-editor .linkcard__brief {
  font-weight: 300;
  opacity: 0.45;
}
.rpg-editor .linkcard__cat {
  font-size: 12px;
  opacity: 0.8;
}

.rpg-editor .quote {
  display: grid;
  grid-template-columns: 4px auto;
  row-gap: 0.25rem;
  column-gap: 0.5rem;
  position: relative;
}

.rpg-editor .quote::before {
  content: "";
  grid-row: span 2;
  margin: 4px 0;
  border-radius: 2px;
  border-left: 4px solid #418af4;
}

.rpg-editor .quote__text {
  font-size: 20px;
  line-height: 28px;
  outline: none;
}

.quote__caption {
  font-size: 15px;
  line-height: 22px;
  outline: none;
}

.rpg-editor .quote__text:empty::before,
.rpg-editor .quote__caption:empty::before {
  content: attr(data-placeholder);
  opacity: 0.6;
}

.rpg-editor .ce-ucoz-image__caption:empty::before {
  content: attr(data-placeholder);
  opacity: 0.6;
}

.rpg-editor .ce-paragraph:empty::before {
  content: "Пустой параграф…";
  opacity: 0.55;
  pointer-events: none;
}

#tags-box {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 22px;
}

.tags-input-container {
  display: flex;
  flex-direction: column;

  width: 100%;
  max-width: 650px;
  position: relative;
  gap: 0.5rem;

  .selected-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;

    .tag {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding-block: 0.5rem;
      padding-inline: 1rem;
      min-width: 80px;
      gap: 0.45rem;
      font-size: 0.8125rem;
      line-height: 1;
      background-color: rgb(23, 26, 32);
      border-radius: var(--radius);
      position: relative;
      transition: 0.3s linear;

      &.tag--vmain {
        background: linear-gradient(135deg, rgba(65, 138, 244, 0.22), rgba(65, 138, 244, 0.12));

        .tag__text,
        .tag__link {
        }
      }

      &.tag--dragging {
        opacity: 0.6;
        cursor: grabbing;
      }
      &.tag--over-before {
        box-shadow: inset 0 3px 0 var(--accent, #6aa9ff);
      }
      &.tag--over-after {
        box-shadow: inset 0 -3px 0 var(--accent, #6aa9ff);
      }
      &.prepare-delete {
        outline: 2px solid #d14;
        opacity: 0.7;
      }

      .tag__handle {
        cursor: grab;
        background: transparent;
        border: 0;
        padding: 0 0.2rem 0 0;
        -webkit-user-drag: element;
      }

      .tag__btns {
        display: inline-flex;
        margin-left: 0.25rem;

        .tag__btn {
          background: transparent;
          border: 0;
          padding: 0 0.15rem;
          font-size: 0.85em;
          color: #9aa3ad;
          cursor: pointer;

          &:hover {
            color: #cfd3d7;
          }
        }
      }

      .tag-img {
        width: 20px;
        height: 20px;
        object-fit: cover;
        border-radius: var(--radius-max);
      }

      a {
        color: var(--color-white);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        font-size: 0.8125rem;
        line-height: 1;
      }

      .remove {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: absolute;
        top: calc(24px * -0.4);
        right: calc(24px * -0.4);
        z-index: 1;
        color: var(--color-danger);
        width: 24px;
        height: 24px;
        padding: 0.25rem;
        background-color: rgb(23, 26, 32);
        border-radius: var(--radius-max);
        opacity: 0.7;
        transition: all 0.1s linear;

        &:hover {
          color: var(--color-dark);
          background-color: var(--color-danger);
          opacity: 1;
        }

        svg {
          width: 16px;
          height: 16px;
        }
      }
    }
  }

  /* Р±Р»РѕРєРёСЂСѓРµРј РЅРµРЅСѓР¶РЅС‹Р№ drag Сѓ РІРЅСѓС‚СЂРµРЅРЅРёС… СЌР»РµРјРµРЅС‚РѕРІ */
  .selected-tags {
    .tag {
      a,
      img,
      .remove,
      .tag__btn,
      .tag__btns,
      .tag__text {
        -webkit-user-drag: none;
        pointer-events: auto;
      }
    }
  }

  .tags-input-field {
    height: 44px;
    font-size: 0.9rem;
    padding-inline: 1rem;
    background-color: rgb(23, 26, 32);
    border-radius: var(--radius);
    border: 0 none;
    transition: 0.3s ease;

    &:focus-visible {
      border-color: var(--color-accent);
    }
  }

  .suggestions {
    display: none;
    width: 100%;
    position: absolute;
    z-index: 100;
    top: calc(100% + 0.2rem);
    background-color: rgb(23, 26, 32);
    border-radius: var(--radius);
    padding: 0.7rem;
    backdrop-filter: blur(0.25rem);

    &.is-visible {
      display: block;
    }

    li {
      cursor: pointer;
      font-size: 1rem;
      overflow: hidden;
      padding: 0.5rem 0.8rem;
      text-transform: capitalize;
      border-radius: var(--radius);
      transition: 0.1s ease;

      &:hover {
        background-color: var(--color-darker);
      }
    }

    .highlight {
      background-color: var(--color-darker);
    }
  }
}

.rpg-editor .ce-rpg-list__list,
.rpg-editor .ce-rpg-list__nested {
  margin: 0;
  padding-left: 1.25rem;
}

.rpg-editor .ce-rpg-list ul {
  list-style-type: disc;
}

.rpg-editor .ce-rpg-list ol {
  list-style-type: decimal;
}

.rpg-editor .ce-rpg-list__li {
  margin: 0.25rem 0;
}

.rpg-editor .ce-rpg-list__item {
  outline: none;
  min-height: 1.2em;
}

.rpg-editor .ce-rpg-list__item:empty::before {
  content: attr(data-placeholder);
  opacity: 0.5;
}

.rpg-editor .ce-rpg-list__settings {
  display: flex;
  gap: 8px;
}

.rpg-editor .ce-rpg-list__btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  cursor: pointer;
}

.rpg-editor .ce-rpg-list__btn--active {
  border-color: rgba(59, 130, 246, 0.9);
}

.editor-tools {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 501;
  background: #1a1e24;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-tools__wrapper {
  display: flex;
  align-items: center;
  gap: 10px;

  max-width: 650px;
  margin: 0 auto;
  padding: 10px 12px;
}

.editor-tools__spacer {
  flex: 1 1 auto;
}

/* большая кнопка */
.editor-tools__publish {
  appearance: none;
  border: 0;
  background: #4189f4;
  color: #fff;
  font-weight: 600;

  height: 38px;
  padding: 0 14px;
  border-radius: 999px;

  cursor: pointer;
}

.editor-tools__publish:hover {
  filter: brightness(1.05);
}

.editor-tools__publish:active {
  transform: translateY(1px);
}

.editor-tools__menu {
  position: relative;
}

/* круглые иконки справа */
.editor-tools__iconbtn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);

  width: 38px;
  height: 38px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

.editor-tools__iconbtn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.editor-tools__iconbtn:active {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(1px);
}

.editor-tools__icon {
  width: 20px;
  height: 20px;
}

/* поповер-меню */
.editor-tools__popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);

  min-width: 280px;
  padding: 8px;

  background: #11151b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);

  overflow: hidden;

  z-index: 500;
}

.editor-tools__popover-title {
  padding: 8px 10px 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.editor-tools__item {
  width: 100%;
  text-align: left;

  appearance: none;
  border: 0;
  background: transparent;

  padding: 10px 10px;
  border-radius: 10px;

  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.2;

  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.editor-tools__item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.editor-tools__hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.editor-tools__item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.editor-tools__item.is-disabled:hover {
  background: transparent;
}

/* аккуратный фокус */
.editor-tools__publish:focus,
.editor-tools__iconbtn:focus,
.editor-tools__item:focus {
  outline: 2px solid rgba(65, 137, 244, 0.65);
  outline-offset: 2px;
}
/* ---- status dot on right buttons ---- */
.editor-tools__iconbtn {
  position: relative;
}

/* базовая точка */
.editor-tools__iconbtn::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 2px rgba(17, 21, 27, 1); /* "ободок" под фон поповера */
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

/* показываем точку, когда есть состояние */
.editor-tools__iconbtn.has-indicator::after {
  opacity: 1;
  transform: scale(1);
}

/* зелёная/синяя — “ок” */
.editor-tools__iconbtn.is-ok::after {
  background: rgba(65, 137, 244, 0.95); /* в тон publish */
}

/* красная — “выкл/запрещено” */
.editor-tools__iconbtn.is-bad::after {
  background: rgba(255, 90, 90, 0.95);
}

/* лёгкое приглушение, если “внешняя публикация” выключена */
.editor-tools__iconbtn.is-muted {
  opacity: 0.78;
}

/* подсветка блока с ошибкой */
.rpg-err-focus {
  outline: 2px solid #ff4d4f;
  outline-offset: 4px;
  border-radius: 10px;
  animation: rpgErrPulse 900ms ease-out 1;
}

@keyframes rpgErrPulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

/* Drafts button near publish */
.editor-tools__drafts-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
}
.editor-tools__drafts-btn.is-dirty {
  border-color: rgba(255, 200, 80, 0.35);
}
.editor-tools__dot {
  margin-left: 6px;
  opacity: 0.9;
}

.editor-tools__popover--drafts {
  width: 420px;
  max-width: min(420px, 92vw);
}

.editor-tools__drafts-status {
  margin: 8px 0 10px;
  font-size: 13px;
  opacity: 0.9;
}
.editor-tools__drafts-status.is-ok {
  opacity: 0.95;
}
.editor-tools__drafts-status.is-warn {
  opacity: 0.95;
}
.editor-tools__drafts-status.is-bad {
  opacity: 0.95;
}

.editor-tools__drafts-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.editor-tools__draft {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.editor-tools__draft:first-child {
  border-top: 0;
}

.editor-tools__draft-title {
  font-size: 14px;
  line-height: 1.25;
}
.editor-tools__draft-meta {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.75;
}

.editor-tools__draft-actions {
  display: flex;
  gap: 8px;
}
.editor-tools__draft-btn {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 12px;
}
.editor-tools__draft-btn.is-danger {
  border-color: rgba(255, 120, 120, 0.28);
}

.editor-tools__drafts-empty {
  padding: 10px 0;
  opacity: 0.75;
}
