/* prose-lint.css — Grammar & style checking decorations and popover */

/* ── Inline decoration underlines ── */
.prose-lint-error {
  text-decoration: underline wavy #e53e3e;
  text-decoration-skip-ink: none;
  cursor: pointer;
}

.prose-lint-warning {
  text-decoration: underline wavy #d97706;
  text-decoration-skip-ink: none;
  cursor: pointer;
}

.prose-lint-suggestion {
  text-decoration: underline dotted #3b82f6;
  text-decoration-skip-ink: none;
  cursor: pointer;
}

/* Dark/Sepia theme adjustments */
[data-theme="dark"] .prose-lint-error      { text-decoration-color: #fc8181; }
[data-theme="dark"] .prose-lint-warning    { text-decoration-color: #fbbf24; }
[data-theme="dark"] .prose-lint-suggestion { text-decoration-color: #60a5fa; }
[data-theme="sepia"] .prose-lint-error      { text-decoration-color: #c53030; }
[data-theme="sepia"] .prose-lint-warning    { text-decoration-color: #b7791f; }
[data-theme="sepia"] .prose-lint-suggestion { text-decoration-color: #2b6cb0; }

/* ── Prose lint toggle button active state ── */
#btn-prose-lint.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

/* ── Status bar issue count ── */
#status-lint-count {
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  margin-left: 0.4rem;
  border-bottom: 1px dotted var(--muted);
  white-space: nowrap;
}
#status-lint-count:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Popover ── */
#prose-lint-popover {
  display: none;
  position: absolute;
  z-index: 800;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text);
  pointer-events: auto;
}

.lint-popover-rule {
  display: inline-block;
  font-size: 0.68rem;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  margin-bottom: 0.4rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.lint-popover-msg {
  display: block;
  line-height: 1.45;
  color: var(--text);
}

.lint-popover-close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0;
  line-height: 1;
}
.lint-popover-close:hover { color: var(--text); }

/* ── Inspector "Style" tab panel ── */
.inspector-lint-panel {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
}

.lint-stats-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lint-stat {
  flex: 1;
  min-width: 80px;
  background: var(--surface-alt, var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  text-align: center;
}

.lint-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  display: block;
}

.lint-stat-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lint-issue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lint-issue-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: calc(var(--radius) / 2);
  background: var(--surface-alt, var(--bg));
  border: 1px solid var(--border);
  line-height: 1.4;
}

.lint-issue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.lint-issue-dot.error      { background: #e53e3e; }
.lint-issue-dot.warning    { background: #d97706; }
.lint-issue-dot.suggestion { background: #3b82f6; }

.lint-rule-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 0.25rem;
}

.lint-rule-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text2, var(--muted));
  cursor: pointer;
  user-select: none;
}

.lint-rule-toggle input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  cursor: pointer;
}

.lint-no-issues {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 1rem 0;
}
