/* Advoke CV — Editor Form Entry (Repeatable Items) */

.editor-entry {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  background-color: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  position: relative;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

@media (min-width: 768px) {
  .editor-entry {
    padding: var(--space-4);
    gap: var(--space-4);
  }
}

.editor-entry:hover {
  border-color: var(--color-border-strong);
}

.editor-entry.is-focused {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-tint);
}

.editor-entry__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
  min-height: 32px;
}

.editor-entry__header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 auto;
  min-width: 0;
}

.editor-entry__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 var(--space-1-5);
  font-size: var(--text-2xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-active);
  background-color: var(--color-accent-soft);
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.editor-entry__label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

.editor-entry__label-empty {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-regular);
  font-style: italic;
}

.editor-entry__header-right {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.editor-entry__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.editor-entry__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .editor-entry__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.editor-entry__grid--full {
  grid-template-columns: 1fr;
}

.editor-entry__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1-5);
  min-width: 0;
}

.editor-entry__field--full {
  grid-column: 1 / -1;
}

.editor-entry__divider {
  height: 1px;
  background-color: var(--color-border-subtle);
  border: none;
  margin: 0;
}

.editor-entry__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
}

.editor-entry__footer-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.editor-entry--collapsed .editor-entry__body {
  display: none;
}

.editor-entry--collapsed .editor-entry__footer {
  display: none;
}

.editor-entry--collapsed .editor-entry__header {
  border-bottom: none;
  padding-bottom: 0;
}

.editor-entry__collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-colors);
  padding: 0;
}

.editor-entry__collapse-btn:hover {
  background-color: var(--ink-100);
  color: var(--color-text);
}

.editor-entry__collapse-btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--duration-base) var(--ease-out);
}

.editor-entry--collapsed .editor-entry__collapse-btn svg {
  transform: rotate(-90deg);
}

.editor-entry__drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--color-text-subtle);
  cursor: grab;
  transition: var(--transition-colors);
  padding: 0;
  flex-shrink: 0;
}

.editor-entry__drag-handle:hover {
  color: var(--color-text);
  background-color: var(--ink-100);
}

.editor-entry__drag-handle:active {
  cursor: grabbing;
}

.editor-entry__drag-handle svg {
  width: 12px;
  height: 12px;
}

.editor-entry.is-dragging {
  opacity: 0.5;
  box-shadow: var(--shadow-lg);
}

.editor-entry.is-drop-before {
  border-top: 2px solid var(--color-accent);
}

.editor-entry.is-drop-after {
  border-bottom: 2px solid var(--color-accent);
}

.editor-entry__preview {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.editor-entry__preview-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.editor-entry__preview-item svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.editor-entry__preview-separator {
  color: var(--color-text-subtle);
}

@media (max-width: 640px) {
  .editor-entry__header {
    padding-bottom: var(--space-2);
  }
  .editor-entry__label {
    font-size: var(--text-xs);
  }
  .editor-entry__index {
    min-width: 20px;
    height: 20px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editor-entry,
  .editor-entry__collapse-btn,
  .editor-entry__collapse-btn svg,
  .editor-entry__drag-handle {
    transition: none;
  }
}