/* Advoke CV — Editor Style Panel (Font, Accent, Spacing, Size) */

.editor-style {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
}

.editor-style__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.editor-style__group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.editor-style__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}

.editor-style__label-value {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  text-transform: none;
  letter-spacing: 0;
}

.editor-style__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.editor-style__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: 52px;
  padding: var(--space-2);
  background-color: var(--white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-colors);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.editor-style__option:hover {
  border-color: var(--color-accent);
  background-color: var(--color-accent-tint);
}

.editor-style__option:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
}

.editor-style__option[aria-pressed="true"],
.editor-style__option.is-active {
  border-color: var(--color-accent);
  background-color: var(--color-accent-soft);
  box-shadow: 0 0 0 2px var(--color-accent-tint);
}

.editor-style__option[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: var(--font-weight-black);
  color: var(--color-accent-active);
}

.editor-style__option-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.editor-style__option-preview--serif {
  font-family: var(--font-serif);
}

.editor-style__option-preview--sans {
  font-family: var(--font-sans);
}

.editor-style__option-preview--mono {
  font-family: var(--font-mono);
}

.editor-style__option-label {
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.editor-style__color-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: var(--space-2);
}

.editor-style__swatch {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-width: 32px;
  max-width: 44px;
  border-radius: var(--radius-full);
  border: 2px solid var(--white);
  cursor: pointer;
  transition: var(--transition-colors);
  box-shadow: 0 0 0 1px var(--color-border);
  padding: 0;
  overflow: hidden;
}

.editor-style__swatch:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.editor-style__swatch:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 3px;
}

.editor-style__swatch[aria-pressed="true"] {
  box-shadow:
    0 0 0 2px var(--white),
    0 0 0 4px var(--color-text);
}

.editor-style__swatch[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: var(--font-weight-black);
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.editor-style__swatch--yellow { background-color: #F5B800; }
.editor-style__swatch--ink { background-color: #0F172A; }
.editor-style__swatch--ocean { background-color: #0369A1; }
.editor-style__swatch--forest { background-color: #166534; }
.editor-style__swatch--slate { background-color: #475569; }
.editor-style__swatch--burgundy { background-color: #7F1D1D; }
.editor-style__swatch--teal { background-color: #0F766E; }
.editor-style__swatch--plum { background-color: #6D28D9; }
.editor-style__swatch--rose { background-color: #BE185D; }
.editor-style__swatch--amber { background-color: #B45309; }

.editor-style__slider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.editor-style__slider-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--ink-100);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.editor-style__slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background-color: var(--white);
  border: 2px solid var(--color-accent);
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-out);
}

.editor-style__slider-input::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.editor-style__slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background-color: var(--white);
  border: 2px solid var(--color-accent);
  cursor: grab;
  box-shadow: var(--shadow-sm);
}

.editor-style__slider-input::-moz-range-track {
  height: 6px;
  background: var(--ink-100);
  border-radius: var(--radius-full);
}

.editor-style__slider-input:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 4px;
}

.editor-style__slider-value {
  flex-shrink: 0;
  min-width: 56px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.editor-style__segmented {
  display: inline-flex;
  width: 100%;
  padding: 2px;
  background-color: var(--ink-100);
  border-radius: var(--radius-md);
  gap: 0;
}

.editor-style__segment {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  padding: 0 var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-colors);
  white-space: nowrap;
}

.editor-style__segment:hover {
  color: var(--color-text);
}

.editor-style__segment[aria-pressed="true"],
.editor-style__segment.is-active {
  background-color: var(--white);
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-xs);
}

.editor-style__preview {
  padding: var(--space-3);
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.4;
  border: 1px solid var(--color-border-subtle);
}

.editor-style__reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 100%;
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-colors);
  margin-top: var(--space-1);
}

.editor-style__reset:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background-color: var(--color-danger-bg);
}

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

@media (prefers-reduced-motion: reduce) {
  .editor-style__option,
  .editor-style__swatch,
  .editor-style__segment,
  .editor-style__slider-input::-webkit-slider-thumb,
  .editor-style__reset {
    transition: none;
  }
  .editor-style__swatch:hover {
    transform: none;
  }
}