/* ============================================================
   CMS Edit Mode Styles
   ============================================================ */

/* Toolbar bottom padding so page content isn't hidden behind it */
body.cms-page {
  padding-bottom: 52px;
}

/* ---- Text blocks ---- */
body.cms-edit-mode [data-cms-type="text"] {
  outline: 2px dashed rgba(99, 102, 241, 0.45);
  outline-offset: 3px;
  border-radius: 3px;
  cursor: text;
  min-width: 20px;
  min-height: 1em;
  display: inline-block;
}

body.cms-edit-mode [data-cms-type="text"]:hover {
  outline-color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
}

body.cms-edit-mode [data-cms-type="text"]:focus {
  outline-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  outline-style: solid;
}

/* ---- Image blocks ---- */
body.cms-edit-mode [data-cms-type="image"] {
  position: relative;
  cursor: pointer;
}

body.cms-edit-mode [data-cms-type="image"]::after {
  content: "\F30F  Replace image";
  font-family: "bootstrap-icons", sans-serif;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.55);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

body.cms-edit-mode [data-cms-type="image"]:hover::after {
  opacity: 1;
}

/* ---- Drag handle ---- */
.cms-drag-handle {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  align-items: center;
  gap: 5px;
  background: rgba(99, 102, 241, 0.9);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
}

.cms-drag-handle:active {
  cursor: grabbing;
}

.cms-section-name {
  text-transform: capitalize;
  margin-right: 4px;
}

.cms-move-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.7rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s;
}

.cms-move-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.cms-move-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

body.cms-edit-mode .cms-drag-handle {
  display: flex;
}

/* Section wrapper in edit mode */
body.cms-edit-mode [data-cms-section] {
  position: relative;
  outline: 1px dashed rgba(99, 102, 241, 0.2);
  outline-offset: -1px;
}

body.cms-edit-mode [data-cms-section]:hover {
  outline-color: rgba(99, 102, 241, 0.4);
}

/* Sortable ghost / chosen states */
.sortable-ghost {
  opacity: 0.4;
}

.sortable-chosen {
  outline: 2px solid #6366f1 !important;
}
