/* ============================================================
   Wikow — styles personnalisés (complète Tailwind CDN)
   Palette : tons proches du noir et du blanc.
   ============================================================ */

:root {
  --ink: #0a0a0a;
  --line: #e6e6e6;
  --paper: #fafafa;
}

* {
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

/* Barres de défilement discrètes */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 999px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover {
  background: #bcbcbc;
}

/* Sélection de texte */
::selection {
  background: var(--ink);
  color: #fff;
}

/* Transitions de vue */
.view-enter {
  animation: viewIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------- Rendu d'un wikow (contenu utilisateur) ----------- */
.wikow-content {
  line-height: 1.7;
  color: #1c1c1e;
  word-wrap: break-word;
}
.wikow-content h1,
.wikow-content h2,
.wikow-content h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  margin: 1.4em 0 0.5em;
  color: var(--ink);
}
.wikow-content h1 {
  font-size: 2rem;
}
.wikow-content h2 {
  font-size: 1.5rem;
}
.wikow-content h3 {
  font-size: 1.2rem;
}
.wikow-content p {
  margin: 0.75em 0;
}
.wikow-content a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wikow-content ul,
.wikow-content ol {
  margin: 0.75em 0;
  padding-left: 1.4em;
}
.wikow-content ul {
  list-style: disc;
}
.wikow-content ol {
  list-style: decimal;
}
.wikow-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.wikow-content blockquote {
  border-left: 3px solid var(--ink);
  padding-left: 1rem;
  margin: 1em 0;
  color: #3a3a3c;
  font-style: italic;
}
.wikow-content code {
  background: #f2f2f2;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}
.wikow-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}
.wikow-content th,
.wikow-content td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.wikow-content th {
  background: #f2f2f2;
}

/* ----------- Éditeur visuel ----------- */
.canvas-grid {
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.canvas-el {
  position: absolute;
  cursor: grab;
  user-select: none;
  outline: 2px solid transparent;
  transition: outline-color 0.12s;
}
.canvas-el:hover {
  outline-color: #c7c7cc;
}
.canvas-el.selected {
  outline: 2px solid var(--ink);
  cursor: grabbing;
}
.canvas-el[contenteditable="true"] {
  cursor: text;
}

/* Poignée de redimensionnement */
.resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--ink);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: nwse-resize;
  display: none;
}
.canvas-el.selected .resize-handle {
  display: block;
}

/* Notifications */
.toast {
  pointer-events: auto;
  animation: toastIn 0.25s ease;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
