/* Visual edit mode — admin only */

body.cms-edit-active .cms-editable {
  outline: 2px dashed transparent;
  outline-offset: 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: outline-color 0.15s, background 0.15s;
}

body.cms-edit-active .cms-editable:hover,
body.cms-edit-active .cms-editable:focus {
  outline-color: #c9a227;
  background: rgba(201, 162, 39, 0.12);
}

.cms-edit-toolbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #121820;
  border: 1px solid #2a3544;
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: #e8edf4;
}

.cms-edit-toggle {
  padding: 8px 16px;
  background: #1a222d;
  border: 1px solid #2a3544;
  border-radius: 999px;
  color: #e8edf4;
  font-weight: 600;
  cursor: pointer;
}

.cms-edit-toggle-active {
  background: #c9a227;
  color: #0b0f14;
  border-color: #c9a227;
}

.cms-edit-toggle-preview {
  background: #2a4a6e;
  color: #e8edf4;
  border-color: #3d6a9e;
}

.cms-preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99989;
  padding: 8px 16px;
  background: #2a4a6e;
  color: #e8edf4;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
}

body.cms-preview-active {
  padding-top: 36px;
}

body.cms-edit-active .cms-editable-link {
  position: relative;
}

.cms-edit-link-badge {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.7;
}

.cms-editable-image-static,
.cms-editable-image-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.cms-editable-image-wrap {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.cms-editable-image-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.cms-editable-image-wrap img,
.cms-editable-image-static img {
  display: block;
  width: 100%;
}

body.cms-edit-active .cms-editable-image-wrap {
  outline: 2px dashed transparent;
  outline-offset: 0;
  transition: outline-color 0.15s;
}

body.cms-edit-active .cms-editable-image-wrap:hover {
  outline-color: #c9a227;
}

.cms-edit-image-badge {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 8px 14px;
  background: rgba(18, 24, 32, 0.92);
  border: 1px solid #c9a227;
  border-radius: 999px;
  color: #e8edf4;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.cms-edit-active .cms-edit-image-badge {
  opacity: 1;
}

body.cms-edit-active .cms-editable-image-wrap:hover .cms-edit-image-badge {
  background: rgba(201, 162, 39, 0.95);
  color: #0b0f14;
}

.cms-inline-editor-sublabel {
  display: block;
  font-size: 12px;
  color: #9aa8b8;
  margin-bottom: 12px;
}

.cms-inline-editor-sublabel .cms-inline-editor-input {
  margin-top: 4px;
}

.cms-inline-editor-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

.cms-inline-editor-file {
  display: none;
}

.cms-inline-editor-upload {
  width: 100%;
  padding: 8px 12px;
  background: #1a222d;
  border: 1px dashed #2a3544;
  border-radius: 8px;
  color: #e8edf4;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 10px;
}

.cms-inline-editor-upload:hover {
  border-color: #c9a227;
}

.cms-inline-editor-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cms-inline-editor-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #1a222d;
}

.cms-inline-editor-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cms-inline-editor-thumb-active {
  border-color: #c9a227;
}

.cms-editable-background {
  position: absolute;
  top: 88px;
  left: 24px;
  z-index: 60;
  padding: 6px 12px;
  background: rgba(18, 24, 32, 0.9);
  border: 1px dashed #c9a227;
  border-radius: 999px;
  color: #e8edf4;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.cms-editable-background:hover {
  background: rgba(201, 162, 39, 0.2);
  border-style: solid;
}

.cms-editable-background-inline {
  top: 24px;
}

.cms-edit-live-link {
  color: #9aa8b8;
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
}

.cms-edit-live-link:hover {
  color: #e8edf4;
}

.cms-edit-entry {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99989;
  padding: 12px 20px;
  background: #c9a227;
  color: #0b0f14;
  border: none;
  border-radius: 999px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.cms-edit-entry:hover {
  filter: brightness(1.05);
}

@media (max-width: 640px) {
  .cms-edit-entry {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 13px;
  }
}

.cms-edit-hint {
  color: #9aa8b8;
  white-space: nowrap;
}

.cms-edit-admin-link {
  color: #c9a227;
  text-decoration: none;
  font-weight: 500;
}

.cms-edit-email {
  color: #9aa8b8;
  font-size: 11px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cms-inline-editor {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 99991;
  width: min(360px, calc(100vw - 48px));
  padding: 16px;
  background: #121820;
  border: 1px solid #c9a227;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  font-family: system-ui, sans-serif;
  color: #e8edf4;
}

.cms-inline-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cms-inline-editor-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c9a227;
  font-weight: 600;
}

.cms-inline-editor-close {
  background: none;
  border: none;
  color: #9aa8b8;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.cms-inline-editor-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.cms-inline-editor-input {
  width: 100%;
  padding: 10px;
  background: #1a222d;
  border: 1px solid #2a3544;
  border-radius: 8px;
  color: #e8edf4;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.cms-inline-editor-input:focus {
  outline: none;
  border-color: #c9a227;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
}

.cms-inline-editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.cms-inline-editor-save {
  padding: 8px 16px;
  background: #c9a227;
  color: #0b0f14;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.cms-inline-editor-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cms-inline-editor-link {
  font-size: 12px;
  color: #9aa8b8;
  text-decoration: none;
}

.cms-inline-editor-link:hover {
  color: #c9a227;
}

.cms-inline-editor-hint {
  margin-top: 10px;
  font-size: 11px;
  color: #9aa8b8;
}

.cms-inline-editor-loading {
  font-size: 13px;
  color: #9aa8b8;
}

body.cms-edit-active .cms-editable-page-body {
  outline: 2px dashed transparent;
  outline-offset: 4px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 4rem;
}

body.cms-edit-active .cms-editable-page-body:hover {
  outline-color: #c9a227;
  background: rgba(201, 162, 39, 0.06);
}

.cms-document-editor {
  width: min(480px, calc(100vw - 48px));
}

.cms-document-textarea {
  min-height: 240px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.cms-document-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cms-document-tool {
  padding: 6px 12px;
  background: #1a222d;
  border: 1px solid #2a3544;
  border-radius: 6px;
  color: #e8edf4;
  font-size: 12px;
  cursor: pointer;
}

.cms-document-tool:hover {
  border-color: #c9a227;
}

@media (max-width: 640px) {
  .cms-edit-hint,
  .cms-edit-email {
    display: none;
  }
}
