/* Editor-only chrome for edit/preview mode. Loaded by the public layout only
   when editor_mode? / preview_mode? is true, so public visitors never get it. */
.public-site--editing {
  padding-top: 3.25rem;
}

.cms-editor-bar {
  --editor-bg: #f8faf9;
  --editor-border: #d8e1de;
  --editor-text: #17211e;
  --editor-muted: #5f6f69;
  --editor-soft: #eef3f1;
  --editor-soft-hover: #e2ebe8;
  --editor-accent: #0d766d;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.25rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--editor-border);
  background: var(--editor-bg);
  color: var(--editor-text);
  font: 0.9rem/1 ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 1px 12px rgba(15, 35, 31, 0.08);
}

.cms-editor-bar__group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cms-editor-bar__title {
  font-weight: 700;
}

.cms-editor-bar__back {
  color: var(--editor-text);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  background: var(--editor-soft);
  font-weight: 700;
}

.cms-editor-bar__back:hover {
  background: var(--editor-soft-hover);
}

.cms-editor-bar__mode {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--editor-soft);
  color: var(--editor-muted);
  font-size: 0.78rem;
}

.cms-editor-bar__publish {
  padding: 0.4rem 0.9rem;
  border: 0;
  border-radius: 6px;
  background: var(--editor-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* Editable affordances: a subtle outline on hover so editors see what's editable. */
.public-site--editing .editable {
  outline: 1px dashed transparent;
  outline-offset: 3px;
  transition: outline-color 0.12s ease;
}

.public-site--editing .editable:hover,
.public-site--editing .editable:focus-within {
  outline-color: #0d766d;
}

.public-site--editing .editable .ProseMirror {
  caret-color: #0d766d;
  min-width: 1ch;
}

.public-site--editing .editable .ProseMirror:focus {
  outline: 2px solid #0d766d;
  outline-offset: 2px;
}

.public-site--editing .editable--plain_text .ProseMirror {
  padding-inline: 0.16em;
}

.public-site--editing .editable--rich_text .ProseMirror {
  min-height: 2.5rem;
  padding: 0.25rem 0.4rem;
}

/* Inline rich-text formatting toolbar. Hidden until the editor is focused so
   it doesn't clutter the live page; revealed (in flow, above the text) while
   editing. Styling for .tiptap-toolbar-button / .tiptap-palette / .tiptap-swatch
   comes from Blitz's tiptap.css. */
.public-site--editing .editable--rich_text .tiptap-toolbar {
  display: none;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #d6e2de;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 40, 35, 0.12);
  color: #1f2d29;
}

.public-site--editing .editable--rich_text:focus-within .tiptap-toolbar {
  display: flex;
}

/* Language switcher with per-locale status dots. */
.cms-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  color: var(--editor-muted);
  text-decoration: none;
}

.cms-lang.is-current {
  color: var(--editor-text);
  background: var(--editor-soft);
}

.cms-lang__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.cms-lang--published .cms-lang__dot { background: #2f8b57; }
.cms-lang--draft .cms-lang__dot { background: #b57910; }
.cms-lang--missing .cms-lang__dot { background: #b84b43; }

.cms-editor-bar__locales {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.cms-editor-bar__language-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  gap: 0.25rem;
  min-width: 0;
}

.cms-editor-bar__copy-slot {
  flex: 0 0 11rem;
  display: flex;
  justify-content: flex-start;
}

.cms-editor-bar__copy,
.cms-editor-bar__publish {
  padding: 0.4rem 0.9rem;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.cms-editor-bar__copy {
  background: var(--editor-soft);
  color: var(--editor-text);
}

.cms-editor-bar__publish {
  background: var(--editor-accent);
  color: #fff;
}

.cms-editor-bar__switch {
  color: var(--editor-accent);
  text-decoration: none;
  padding: 0.38rem 0.65rem;
  border-radius: 6px;
  font-weight: 800;
}

.cms-editor-bar__switch:hover {
  background: var(--editor-soft);
}
