/* public/css/base.css */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Empêche le pull-to-refresh natif du navigateur (on fournit le nôtre)
     et le rebond de scroll qui déborde sur le document. */
  overscroll-behavior-y: contain;
}

/* Sensation native sur mobile :
   - pas de surlignage bleu au tap
   - pas de menu contextuel/callout iOS au tap long sur l'UI
   - respect de l'encoche (safe-area) via le padding du shell */
* {
  -webkit-tap-highlight-color: transparent;
}
button, .navitem, .feeditem, .folder__header, .card, .ctxmenu__item {
  -webkit-touch-callout: none;
}
/* Le contenu d'article reste sélectionnable (lecture/citation) ;
   l'interface de navigation, non, pour éviter les sélections accidentelles. */
.sidebar, .content__head, .navitem, .feeditem, .folder__header, .ctxmenu {
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  font-feature-settings: "kern", "liga";
  overscroll-behavior-y: contain;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* Conteneur racine de l'application : doit toujours remplir l'écran et
   porter le fond, sinon une zone blanche apparaît si un enfant s'effondre. */
#app {
  min-height: 100vh;
  background: var(--paper);
}

/* L'éditorial (titres, corps de lecture) : chiffres elzéviriens. */
.prose, .prose__body, .card__title, .card__summary,
.prose__title, .auth__title {
  font-feature-settings: "kern", "liga", "onum";
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.boot { display: grid; place-items: center; min-height: 100vh; }
.boot__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: 64px;
  line-height: .82;
  letter-spacing: -.04em;
  color: var(--ink);
  position: relative;
  display: inline-block;
  padding: 0 4px;
  animation: boot-pulse 1.4s ease-in-out infinite;
}
.boot__mark::after {
  content: "";
  position: absolute;
  left: 6%; right: 6%; bottom: 8%;
  height: 3px;
  background: var(--accent);
}
@keyframes boot-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.toast-region {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  max-width: 90vw;
  animation: toast-in var(--transition);
}
.toast--error { border-color: var(--accent); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Barres de défilement, aux couleurs du thème ---- */
/* Firefox : largeur fine + couleur (pouce, rail). */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

/* WebKit/Blink (Chrome, Edge, Safari) : contrôle fin. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--rule);
  border: 2px solid var(--paper);   /* marge qui amincit visuellement le pouce */
  border-radius: 0;                 /* rectangulaire, cohérent avec le brief */
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-corner { background: transparent; }
