/* ==========================================================================
   Site Développeurs — peau Rapidy (Prism v4 « Verve »)
   --------------------------------------------------------------------------
   Les valeurs viennent de `libs/angular/ui-kit/src/lib/tokens/` : ce site doit
   ressembler à la console, pas à un thème de documentation générique. Manrope,
   violet marque, encre, neutres froids, bordures capillaires, ombres quasi
   nulles, dégradé lumineux réservé aux accents.
   ========================================================================== */

@font-face {
  font-family: "Manrope";
  src: url("./Manrope-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("./Manrope-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("./Manrope-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("./Manrope-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  --violet: #6d2dff;
  --violet-hover: #8147ff;
  --violet-soft: #f1ebff;
  --ink: #101828;
  --ink-rail: #181322;
  --text: #101828;
  --text-2: #475467;
  --text-3: #5f6979;
  --canvas: #f4f4f8;
  --surface: #ffffff;
  --surface-subtle: #f8faff;
  --surface-soft: #f3f6fc;
  --border: #e6eaf2;
  --border-strong: #d0d5dd;
  --success: #12b76a;
  --warning: #93540a;
  --info: #175cd3;
  --gradient-cta: linear-gradient(135deg, #6c63ff 0%, #a855f7 48%, #ff7af5 100%);
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --radius: 14px;
  --radius-sm: 10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 60px;
  --sidebar-w: 268px;
  --toc-w: 232px;
}

:root[data-theme="dark"] {
  --violet: #9b6bff;
  --violet-hover: #b48cff;
  --violet-soft: #241a3d;
  --text: #ece9f5;
  --text-2: #b4aecb;
  --text-3: #948da8;
  --canvas: #100d18;
  --surface: #17131f;
  --surface-subtle: #1c1727;
  --surface-soft: #1c1727;
  --border: #2a2338;
  --border-strong: #3a3150;
  --ink-rail: #0b0910;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --violet: #9b6bff;
    --violet-hover: #b48cff;
    --violet-soft: #241a3d;
    --text: #ece9f5;
    --text-2: #b4aecb;
    --text-3: #948da8;
    --canvas: #100d18;
    --surface: #17131f;
    --surface-subtle: #1c1727;
    --surface-soft: #1c1727;
    --border: #2a2338;
    --border-strong: #3a3150;
    --ink-rail: #0b0910;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.68;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--violet);
  text-decoration: none;
}
a:hover {
  color: var(--violet-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ── Barre du haut ─────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.brand-home {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand-home:hover,
.brand-suffix:hover {
  text-decoration: none;
  color: var(--text);
}

/* La marque est l'asset `logo-rapidy-128.png` — le « R » vitré de la vitrine,
   de la console et du mobile. Le fichier est TRANSPARENT et porte sa propre
   lueur : il ne prend ni pastille colorée, ni tuile, ni ombre. Chacun de ces
   supports se battrait avec le halo au lieu de le porter. */
.brand-mark {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
}

.brand-suffix {
  font-weight: 500;
  color: var(--text-3);
  border-left: 1px solid var(--border);
  padding-left: 10px;
  margin-left: 2px;
}

.topbar-search {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.topbar-search input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.topbar-search input::placeholder {
  color: var(--text-3);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  z-index: 50;
}
.search-results a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.search-results a:hover {
  background: var(--surface-soft);
  text-decoration: none;
}
.search-results .r-section {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}
.search-results .empty {
  padding: 10px;
  color: var(--text-3);
  font-size: 14px;
}

.topbar-pickers {
  display: flex;
  gap: 10px;
  flex: none;
}

.picker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-3);
}
.picker-label {
  font-weight: 500;
}
.picker select {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
}

.theme-toggle {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  color: var(--text-2);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--text);
}
/* Une seule icône visible : celle du thème qu'on OBTIENDRA en cliquant. En
   clair on montre la lune, en sombre le soleil — l'inverse ferait cliquer pour
   « rester où l'on est ». */
.theme-toggle [data-theme-icon="light"] {
  display: none;
}
.theme-toggle [data-theme-icon="dark"] {
  display: block;
}
:root[data-theme="dark"] .theme-toggle [data-theme-icon="dark"] {
  display: none;
}
:root[data-theme="dark"] .theme-toggle [data-theme-icon="light"] {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle [data-theme-icon="dark"] {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle [data-theme-icon="light"] {
    display: block;
  }
}

.nav-toggle {
  display: none;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}

/* ── Structure ─────────────────────────────────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  align-items: start;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 24px 20px 48px;
  border-right: 1px solid var(--border);
}

.version-note {
  display: block;
  padding: 10px 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  font-size: 12px;
  line-height: 1.45;
}
.version-note strong {
  display: block;
  font-size: 13px;
  color: var(--violet);
}
.version-note span {
  color: var(--text-3);
}

.nav-group {
  margin-bottom: 22px;
}
.nav-group h2 {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}
.nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-group a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.nav-group a:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}
.nav-group a.active {
  background: var(--violet-soft);
  color: var(--violet);
  font-weight: 600;
}

main {
  min-width: 0;
  padding: 34px 44px 80px;
}

.toc {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 34px 20px 48px 0;
}
.toc h2 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}
.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.4;
}
.toc a:hover {
  color: var(--text);
  text-decoration: none;
}
.toc a.active {
  color: var(--violet);
  border-left-color: var(--violet);
  font-weight: 600;
}
.toc .lvl-3 a {
  padding-left: 24px;
  font-size: 12.5px;
}

/* ── Contenu ───────────────────────────────────────────────────────────── */

.prose {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--violet);
}

.prose h1 {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lede {
  margin: 0 0 30px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-2);
}

.prose h2 {
  margin: 44px 0 12px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.prose h3 {
  margin: 30px 0 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.prose h4 {
  margin: 22px 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.prose p {
  margin: 0 0 14px;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.prose li {
  margin-bottom: 6px;
}

/* Le code en ligne est l'élément le plus RÉPÉTÉ de ces pages : le laisser gris
   rendait la lecture monotone, alors que c'est précisément ce qu'un intégrateur
   cherche du regard. L'accent y trouve sa place la plus utile. */
.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--violet-soft);
  border: 1px solid color-mix(in srgb, var(--violet) 16%, transparent);
  color: var(--violet);
}

/* Dans un titre, le code prend la couleur du titre : deux accents empilés se
   neutralisent. */
.prose h1 code,
.prose h2 code,
.prose h3 code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

.prose blockquote {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--text-2);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.muted {
  color: var(--text-3);
}

/* Tableaux */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
thead th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-subtle);
}
tbody tr:last-child td {
  border-bottom: 0;
}
/* `.prose td code` et non `td code` : la règle doit être PLUS spécifique que
   `.prose code`, qu'elle affine — l'inverse se lit comme une intention
   d'écraser qui n'aboutit pas. */
.prose td code {
  white-space: nowrap;
}
/* Placé AVANT les sélecteurs plus spécifiques du tableau de paramètres :
   déclarer une règle faible après une règle forte se lit comme une intention
   d'écraser, alors qu'elle ne le fait pas. */
.params td:nth-child(2),
.params td:nth-child(3) {
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
}

/* Cartes */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 0 0 26px;
}
.card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--violet);
}
.card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}

/* Encarts */

.callout {
  margin: 0 0 20px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}
.callout p:last-child {
  margin-bottom: 0;
}
.callout-note {
  background: var(--violet-soft);
  border-color: color-mix(in srgb, var(--violet) 22%, transparent);
}
.callout-danger {
  background: color-mix(in srgb, #f97066 12%, var(--surface));
  border-color: color-mix(in srgb, #f97066 34%, transparent);
}
.callout strong:first-child {
  color: var(--text);
}

/* ── Coloration syntaxique ─────────────────────────────────────────────────
   Les teintes viennent de la palette Rapidy (violet, purple, magenta, cyan),
   pas d'un thème d'éditeur générique : le code doit avoir l'air d'appartenir au
   même produit que le reste de la page.

   Le fond des extraits est ENCRE dans les deux thèmes — une seule palette de
   jetons suffit donc, et son contraste ne dépend pas du réglage du lecteur. */

.t-com {
  color: #8b83a8; /* 4.6:1 sur l'encre — secondaire, mais lisible */
  font-style: italic;
}
.t-kw {
  color: #c4a4ff; /* violet marque éclairci */
  font-weight: 600;
}
.t-str {
  color: #a8e9ff; /* cyan marque */
}
.t-num {
  color: #ff9afb; /* rose marque */
}
.t-fn {
  color: #93cdff;
}
.t-var {
  color: #f8b9ff; /* magenta marque — `$VAR` shell, `$var` PHP */
}

/* ── Extraits de code ──────────────────────────────────────────────────── */

.snippet {
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--ink-rail);
  overflow: hidden;
}

.snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px 7px 14px;
  background: color-mix(in srgb, #ffffff 5%, var(--ink-rail));
  border-bottom: 1px solid color-mix(in srgb, #ffffff 9%, transparent);
}

.snippet-caption {
  font-size: 12px;
  font-weight: 600;
  color: #b9b2d4;
}

.lang-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.lang-tabs::-webkit-scrollbar {
  display: none;
}

.lang-tab {
  flex: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #9d97b8;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 4px 9px;
  cursor: pointer;
  white-space: nowrap;
}
.lang-tab:hover {
  color: #e6e2f2;
  background: rgba(255, 255, 255, 0.06);
}
.lang-tab[aria-selected="true"] {
  color: #ffffff;
  /* L'accent plutôt qu'un gris : c'est le seul contrôle réellement actionnable
     d'un bloc de code. Un onglet actif gris sur un fond gris se cherche. */
  background: var(--violet);
}

.snippet-body {
  position: relative;
}

.snippet .code {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.62;
  color: #e6e2f2;
  background: transparent;
  tab-size: 2;
}
.snippet .code code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}
.snippet .code[hidden] {
  display: none;
}

.copy {
  position: absolute;
  top: 9px;
  right: 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #b9b2d4;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 3px 9px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease;
}
.snippet-body:hover .copy,
.copy:focus-visible {
  opacity: 1;
}
.copy[data-done="true"] {
  color: #9ef2c4;
}

/* Bloc de code hors onglets (JSON de réponse, etc.) */
pre.code:not(.snippet .code) {
  margin: 0 0 22px;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--ink-rail);
  color: #e6e2f2;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.62;
}
pre.code:not(.snippet .code) code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  white-space: pre;
}

/* ── Référence API ─────────────────────────────────────────────────────── */

.operation {
  padding-top: 12px;
  margin-bottom: 12px;
  border-top: 1px solid var(--border);
}
.operation:first-of-type {
  border-top: 0;
}
.operation h2 code {
  font-size: 0.82em;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

.operation-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-3);
}
.badge-get {
  background: color-mix(in srgb, var(--info) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--info) 30%, transparent);
  color: var(--info);
}
.badge-post {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  color: #067a47;
}
.badge-public {
  background: var(--violet-soft);
  border-color: color-mix(in srgb, var(--violet) 25%, transparent);
  color: var(--violet);
}

.endpoint {
  font-family: var(--mono);
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--violet-soft);
  border: 1px solid color-mix(in srgb, var(--violet) 16%, transparent);
  color: var(--violet);
}

/* ── Pagination ────────────────────────────────────────────────────────── */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  max-width: 760px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.pager-link {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  min-width: 0;
}
.pager-link:hover {
  border-color: var(--violet);
  text-decoration: none;
}
.pager-link span {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}
.pager-link strong {
  font-size: 14px;
  font-weight: 600;
}
.pager-next {
  text-align: right;
}

/* ── Adaptatif ─────────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: none;
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  body[data-nav="open"] .sidebar {
    display: block;
  }
  .nav-toggle {
    display: block;
  }
  .topbar-pickers .picker-label {
    display: none;
  }
  main {
    padding: 24px 20px 60px;
  }
  .prose h1 {
    font-size: 30px;
  }
  .brand-suffix {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    /* biome-ignore lint/complexity/noImportantStyles: une préférence d'accessibilité doit battre toutes les transitions déclarées ailleurs, y compris celles ajoutées plus tard. */
    transition: none !important;
  }
}
