/* ================================================================
   EDITOR.CSS – Ritter GmbH In-Page-Editor
   Wird in allen HTML-Seiten eingebunden.
   ================================================================ */

/* ── Admin-Bar (fixed oben) ────────────────────────────────────── */
#editor-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99999;
  height: 44px;
  background: #1565c0;
  color: #fff;
  align-items: center;
  padding: 0 14px;
  gap: 6px;
  font-family: system-ui, -apple-system, Arial, sans-serif;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
#editor-bar.visible { display: flex; }

#editor-bar .eb-logo {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  opacity: .7;
  margin-right: 6px;
  white-space: nowrap;
}
#editor-bar .eb-sep { flex: 1; }

#editor-bar button {
  background: rgba(255,255,255,.13);
  color: #fff;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 4px;
  padding: 4px 11px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s;
}
#editor-bar button:hover  { background: rgba(255,255,255,.25); }
#editor-bar button:active { background: rgba(255,255,255,.35); }

#eb-toggle.active {
  background: #fff;
  color: #1565c0;
  font-weight: 700;
  border-color: #fff;
}

#eb-save { transition: background .2s, border-color .2s; }
#eb-save.has-changes {
  background: #2e7d32;
  border-color: #1b5e20;
}
#eb-save.has-changes:hover { background: #388e3c; }

/* ── Body-Versatz wenn Bar sichtbar ────────────────────────────── */
body.editor-bar-visible {
  padding-top: 44px !important;
}
/* Sticky-Header rückt mit runter */
body.editor-bar-visible .site-header {
  top: 44px !important;
}

/* ── Admin-Button im Footer ────────────────────────────────────── */
#editor-admin-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.15);
  font-size: 9px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 6px;
  line-height: 1;
  vertical-align: middle;
  transition: color .2s;
}
#editor-admin-btn:hover { color: rgba(255,255,255,.55); }

/* ── Login-Modal ───────────────────────────────────────────────── */
#editor-login-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,.52);
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, Arial, sans-serif;
}
#editor-login-modal.visible { display: flex; }

#editor-login-inner {
  background: #fff;
  border-radius: 8px;
  padding: 30px 26px 24px;
  width: 310px;
  max-width: 94vw;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
#editor-login-inner h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: #1a1a1a;
  font-family: inherit;
}
#editor-login-inner p.subtitle {
  margin: 0 0 18px;
  font-size: 12px;
  color: #888;
}
#editor-login-inner input[type="password"] {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid #d0d0d0;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  margin-bottom: 14px;
  outline: none;
  transition: border-color .15s;
}
#editor-login-inner input[type="password"]:focus {
  border-color: #1565c0;
}
#editor-login-error {
  display: none;
  color: #c62828;
  font-size: 12px;
  margin-bottom: 10px;
  padding: 6px 10px;
  background: #ffebee;
  border-radius: 3px;
}
.editor-btn-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.editor-btn-row button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
#editor-login-submit {
  background: #1565c0;
  color: #fff;
  font-weight: 600;
}
#editor-login-submit:hover { background: #1976d2; }
#editor-login-cancel { background: #ececec; }
#editor-login-cancel:hover { background: #e0e0e0; }

/* ── Editierbare Text-Elemente ─────────────────────────────────── */
.editor-editable {
  outline: 2px dashed rgba(21,101,192,.38);
  outline-offset: 3px;
  border-radius: 2px;
  cursor: text;
  min-height: 1em;
}
.editor-editable:hover {
  outline-color: #1565c0;
  background: rgba(21,101,192,.04);
}
.editor-editable:focus {
  outline: 2px solid #1565c0;
  background: rgba(21,101,192,.05);
}

/* ── Bild-Bearbeitung ──────────────────────────────────────────── */
.editor-img-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.editor-img-wrap.block {
  display: block;
}
.editor-img-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0,0,0,.48);
  color: #fff;
  font-size: 13px;
  font-family: system-ui, -apple-system, Arial, sans-serif;
  font-weight: 500;
  opacity: 0;
  transition: opacity .18s;
  border-radius: inherit;
}
.editor-img-wrap:hover .editor-img-btn { opacity: 1; }

/* ── Hintergrundbild-Button ────────────────────────────────────── */
.editor-has-bg-edit { position: relative; }

.editor-bg-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 11px;
  font-size: 12px;
  font-family: system-ui, -apple-system, Arial, sans-serif;
  cursor: pointer;
  z-index: 5;
  transition: background .15s;
  white-space: nowrap;
}
.editor-bg-btn:hover { background: rgba(0,0,0,.82); }
