/* Guide de l'API : page autonome, memes couleurs que l'interface. */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --border: rgba(60, 60, 67, .14);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-dim: rgba(0, 113, 227, .1);
  --code-bg: #f2f2f7;
  --get: #28a745;
  --post: #0071e3;
  --put: #d98e04;
  --patch: #8e44d6;
  --delete: #e5342a;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --border: rgba(84, 84, 88, .55);
    --text: #f5f5f7; --muted: #98989d; --accent: #2997ff; --accent-dim: rgba(41, 151, 255, .14);
    --code-bg: #2c2c2e; --get: #30d158; --post: #2997ff; --put: #ffb340; --patch: #bf5af2;
    --delete: #ff453a;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --border: rgba(84, 84, 88, .55);
  --text: #f5f5f7; --muted: #98989d; --accent: #2997ff; --accent-dim: rgba(41, 151, 255, .14);
  --code-bg: #2c2c2e; --get: #30d158; --post: #2997ff; --put: #ffb340; --patch: #bf5af2;
  --delete: #ff453a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.toc {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1.4rem 1rem 2rem;
  border-right: 1px solid var(--border);
}
.toc a { display: block; padding: .28rem .6rem; border-radius: 8px; color: var(--text); font-size: .92rem; }
.toc a:hover { background: var(--accent-dim); text-decoration: none; }
.toc a.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.toc .brand { font-weight: 700; font-size: 1.15rem; margin-bottom: .6rem; }
.toc-title {
  margin: 1.1rem .6rem .3rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}

main { padding: 1.6rem 2.4rem 5rem; min-width: 0; }
.hero h1 { font-size: 2.1rem; margin: .2rem 0 .4rem; letter-spacing: -.02em; }
.hero p { color: var(--muted); max-width: 60ch; margin: .3rem 0; }
.hero .base { margin-top: .8rem; }

section { padding-top: 1.2rem; scroll-margin-top: 1rem; }
h2 { font-size: 1.45rem; margin: 1.6rem 0 .6rem; letter-spacing: -.01em; padding-top: 1rem; border-top: 1px solid var(--border); }
h3 { font-size: 1.08rem; margin: 1.3rem 0 .4rem; }
p, li { max-width: 78ch; }
ul, ol { padding-left: 1.3rem; }
li { margin: .25rem 0; }
.muted { color: var(--muted); }

code { font-family: var(--mono); font-size: .86em; background: var(--code-bg); padding: .08em .35em; border-radius: 5px; }
pre {
  position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 2rem 1rem .9rem; overflow-x: auto; margin: .6rem 0 1rem; line-height: 1.5;
  max-width: 100%;
}
pre code { background: none; padding: 0; font-size: .82rem; white-space: pre; }
.copy {
  position: absolute; top: .45rem; right: .45rem; font: 600 .72rem var(--font); color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .2rem .5rem; cursor: pointer;
}
.copy:hover { color: var(--accent); }

table { width: 100%; border-collapse: collapse; margin: .6rem 0 1rem; background: var(--surface); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); font-size: .9rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--surface-2); font-weight: 600; font-size: .82rem; }
tr:last-child td { border-bottom: 0; }
table.eps td:first-child { width: 4.5rem; }
table.eps td:nth-child(2) { white-space: nowrap; }

.m {
  display: inline-block; min-width: 3.6rem; text-align: center; font: 700 .7rem var(--mono);
  padding: .15rem .4rem; border-radius: 5px; color: #fff; margin-right: .3rem;
}
.m.get { background: var(--get); } .m.post { background: var(--post); }
.m.put { background: var(--put); } .m.patch { background: var(--patch); }
.m.delete { background: var(--delete); }
.ep { margin: 1.1rem 0 .3rem; font-size: 1rem; }
.ep code { font-size: .95rem; overflow-wrap: anywhere; }
li, p { overflow-wrap: anywhere; }

.note {
  background: var(--accent-dim); border-left: 3px solid var(--accent); border-radius: 8px;
  padding: .75rem 1rem; margin: 1rem 0; max-width: 78ch;
}
.steps li { margin-bottom: .6rem; }

#ref-search {
  width: 100%; max-width: 420px; font: inherit; padding: .5rem .75rem; margin: .4rem 0 1rem;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text);
}
.ref-group h3 { text-transform: capitalize; }
details.op { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; margin: .35rem 0; }
details.op summary { cursor: pointer; padding: .5rem .75rem; list-style: none; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
details.op summary::-webkit-details-marker { display: none; }
details.op summary code { background: none; padding: 0; overflow-wrap: anywhere; }
details.op summary .sum { color: var(--muted); font-size: .88rem; }
details.op[open] summary { border-bottom: 1px solid var(--border); }
details.op .body { padding: .5rem .9rem .8rem; font-size: .9rem; }
details.op .body p { margin: .3rem 0 .6rem; white-space: pre-line; }
.tag { font-size: .72rem; padding: .05rem .4rem; border-radius: 5px; background: var(--surface-2); color: var(--muted); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  main { padding: 1rem 16px 4rem; }
  table.eps td:nth-child(2) { white-space: normal; }
}
