/* Page Editor - Edit Mode */
body.edit-mode [data-editable] {
  outline: 2px dashed rgba(192, 104, 75, 0.35);
  outline-offset: 4px;
  cursor: pointer;
  position: relative;
}
body.edit-mode [data-editable]:hover {
  outline-color: rgba(192, 104, 75, 0.8);
  background: rgba(192, 104, 75, 0.04);
}
body.edit-mode [data-editable]::after {
  content: '✎';
  position: absolute;
  top: -18px;
  right: -8px;
  background: var(--terracotta);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 10;
}
body.edit-mode [data-editable]:hover::after {
  opacity: 1;
}

/* Edit toolbar */
.edit-toolbar {
  position: fixed;
  top: 16px;
  right: 16px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-md);
  z-index: 9999;
  display: none;
  gap: 10px;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
}
body.edit-mode .edit-toolbar {
  display: flex;
}
.edit-toolbar .badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
  background: var(--sand-soft);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.edit-toolbar .sep {
  width: 1px;
  height: 20px;
  background: var(--line);
}

/* Edit modal */
.edit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 48, 46, 0.45);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.edit-modal-overlay.open {
  display: flex;
}
.edit-modal {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-luxury);
  padding: 24px;
}
.edit-modal h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 0 0 14px;
}
.edit-modal textarea,
.edit-modal input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sand-soft);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 12px;
  outline: none;
}
.edit-modal textarea:focus,
.edit-modal input[type="text"]:focus {
  border-color: var(--terracotta);
  background: #FFFFFF;
}
.edit-modal .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

/* Card editor */
.card-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.card-editor-item {
  background: var(--sand-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.card-editor-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}
.card-editor-meta {
  flex: 1;
  font-size: 0.8rem;
  color: var(--muted);
}
.card-editor-meta strong {
  color: var(--ink);
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

/* Admin page modal */
.admin-page-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 48, 46, 0.45);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.admin-page-modal-overlay.open {
  display: flex;
}
.admin-page-modal {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-luxury);
  padding: 24px;
}
.admin-page-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.admin-page-modal-head h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 0;
}
.admin-page-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
}
.admin-page-blocks {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.admin-page-block-item {
  background: var(--sand-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.admin-page-block-item img {
  max-height: 120px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* Site preview modal */
.preview-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 48, 46, 0.6);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.preview-modal-overlay.open {
  display: flex;
}
.preview-modal {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  height: 90vh;
  max-height: 900px;
  overflow: hidden;
  box-shadow: var(--shadow-luxury);
  display: flex;
  flex-direction: column;
}
.preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.preview-modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0;
}
.preview-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
}
.preview-modal-body {
  flex: 1;
  overflow: hidden;
  background: #fff;
}
.preview-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
