/* ============================================================
   Ritter Reha – Admin-Editor-Styles
   Wird nur aktiviert, wenn editor.js geladen ist.
   Kein Einfluss auf das normale Seitendesign.
   ============================================================ */

/* ── Admin-Leiste (oben, fixed) ─────────────────────────── */
#rr-editbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  height: 44px;
  background: #1a56db;
  color: #fff;
  display: none;         /* wird per JS auf flex gesetzt */
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  font-size: 12.5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
  flex-wrap: nowrap;
  overflow-x: auto;
}

/* Sticky-Header 44 px nach unten schieben wenn Leiste sichtbar */
body.rr-bar-open .site-header {
  top: 44px;
}
body.rr-bar-open {
  padding-top: 44px;
}

.rr-bar-label {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Toggleschalter */
.rr-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.rr-toggle input { display: none; }
.rr-slider {
  width: 34px;
  height: 18px;
  background: rgba(255,255,255,.3);
  border-radius: 9px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.rr-slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.rr-toggle input:checked ~ .rr-slider            { background: #22c55e; }
.rr-toggle input:checked ~ .rr-slider::after     { transform: translateX(16px); }
.rr-toggle-text { font-size: 12.5px; white-space: nowrap; }

/* Status-Info */
#rr-save-info {
  font-size: 11.5px;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons in der Leiste */
.rr-bar-btn {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, opacity .15s;
}
.rr-bar-btn:hover               { background: rgba(255,255,255,.28); }
.rr-bar-btn:disabled            { opacity: .45; cursor: default; }
.rr-bar-btn:disabled:hover      { background: rgba(255,255,255,.15); }
.rr-danger                      { background: rgba(220,38,38,.25); border-color: rgba(220,38,38,.5); }
.rr-danger:hover                { background: rgba(220,38,38,.45); }
/* Speichern-Button – hebt sich hervor wenn Änderungen vorhanden */
.rr-save-primary                { background: rgba(34,197,94,.25); border-color: rgba(34,197,94,.5); }
.rr-save-primary:not(:disabled):hover { background: rgba(34,197,94,.45); }

/* ── Footer-Login-Button ─────────────────────────────────── */
.rr-login-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.28);
  font-size: .78rem;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
  transition: color .2s;
  line-height: 1;
}
.rr-login-btn:hover { color: rgba(255,255,255,.65); }

/* ── Login-Modal ─────────────────────────────────────────── */
#rr-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(16,18,28,.72);
  backdrop-filter: blur(4px);
  display: none;           /* flex wenn offen */
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.rr-mbox {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
}
.rr-mbox h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #10121c;
  margin: 0 0 10px;
  letter-spacing: -.02em;
}
.rr-mhint {
  font-size: .9rem;
  color: #5f646b;
  margin: 0 0 18px;
  line-height: 1.55;
}
.rr-mhint small {
  display: block;
  margin-top: 6px;
  color: #b45309;
  font-size: .82rem;
}
.rr-mbox input[type="password"] {
  display: block;
  width: 100%;
  padding: 11px 14px;
  font-size: 1rem;
  border: 1.5px solid #dde6ee;
  border-radius: 10px;
  font-family: inherit;
  margin-bottom: 8px;
  transition: border-color .18s, box-shadow .18s;
  color: #1a1d26;
}
.rr-mbox input[type="password"]:focus {
  outline: none;
  border-color: #1679b4;
  box-shadow: 0 0 0 4px rgba(22,121,180,.12);
}
.rr-merr {
  color: #dc2626;
  font-size: .87rem;
  margin-bottom: 10px;
  min-height: 1.2em;
}
.rr-mbtns {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.rr-mprimary {
  flex: 1;
  background: #1679b4;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: .98rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .18s;
}
.rr-mprimary:hover { background: #0f5c8c; }
.rr-mghost {
  background: none;
  color: #5f646b;
  border: 1.5px solid #dde6ee;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: .98rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .18s, color .18s;
}
.rr-mghost:hover { border-color: #1679b4; color: #1679b4; }

/* ── Bearbeitungsmodus: Text-Elemente ────────────────────── */
body.rr-editing [data-rr-ce="1"] {
  outline: 2px dashed rgba(22,121,180,.55) !important;
  outline-offset: 3px;
  border-radius: 4px;
  cursor: text !important;
  transition: outline-color .15s, background .15s;
}
body.rr-editing [data-rr-ce="1"]:hover {
  outline-color: #1679b4 !important;
  background: rgba(22,121,180,.04);
}
body.rr-editing [data-rr-ce="1"]:focus {
  outline: 2px solid #1679b4 !important;
  background: rgba(255,255,255,.96);
  box-shadow: 0 0 0 5px rgba(22,121,180,.1);
}

/* ── Bearbeitungsmodus: Bilder ───────────────────────────── */
body.rr-editing [data-rr-img="1"] {
  outline: 3px dashed rgba(22,121,180,.6) !important;
  outline-offset: 3px;
  cursor: pointer !important;
  transition: outline-color .15s;
}
body.rr-editing [data-rr-img="1"]:hover {
  outline-color: #1679b4 !important;
  opacity: .88;
}
