/*
 * Amplify — Hybrid inline CMS editor styles ("pencil icon" editing)
 * Paired with cms-inline-edit.js. Desktop-only pilot; no responsive rules
 * needed yet since this only renders for logged-in admins.
 */

/* ── Edit Mode toggle (floating, bottom-right) ── */
.cms-edit-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: #1f2430;
  color: #f5f6f8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.cms-edit-toggle:hover {
  transform: translateY(-1px);
}

.cms-edit-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a8f9b;
  transition: background-color 0.15s ease;
}

.cms-edit-toggle.is-on {
  background: #4056f4;
}

.cms-edit-toggle.is-on .cms-edit-toggle-dot {
  background: #37c978;
}

/* ── Pencil button (sits right after an editable node) ── */
.cms-pencil-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #4056f4;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.cms-pencil-btn:hover {
  background: #2f42d6;
  transform: scale(1.08);
}

/* Elements that were hidden (empty value) but are shown while editing. */
.cms-empty-placeholder {
  outline: 1px dashed rgba(64, 86, 244, 0.6);
  outline-offset: 4px;
  min-width: 40px;
  min-height: 1em;
  opacity: 0.7;
}

/* ── Popup editor ── */
.cms-edit-popup {
  position: absolute;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 16px);
  padding: 14px;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2430;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  font-family: inherit;
}

.cms-edit-popup-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.cms-edit-popup-field {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d7dae0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  color: #1f2430;
  resize: vertical;
}

.cms-edit-popup-field:focus {
  outline: none;
  border-color: #4056f4;
  box-shadow: 0 0 0 3px rgba(64, 86, 244, 0.15);
}

textarea.cms-edit-popup-field {
  min-height: 80px;
}

.cms-edit-popup-error {
  margin-top: 8px;
  font-size: 12px;
  color: #d64545;
  min-height: 14px;
}

.cms-edit-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.cms-edit-popup-cancel,
.cms-edit-popup-save {
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cms-edit-popup-cancel {
  background: #eef0f4;
  color: #1f2430;
}

.cms-edit-popup-cancel:hover {
  background: #e2e5eb;
}

.cms-edit-popup-save {
  background: #4056f4;
  color: #fff;
}

.cms-edit-popup-save:hover {
  background: #2f42d6;
}

.cms-edit-popup-save:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── Toast ── */
.cms-edit-toast {
  position: fixed;
  right: 20px;
  bottom: 72px;
  z-index: 9999;
  padding: 8px 16px;
  border-radius: 999px;
  background: #1f2430;
  color: #f5f6f8;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cms-edit-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
