/* ==========================================================================
   Service4AI — styles spécifiques à la documentation API
   S'appuie sur les tokens de style.css.
   ========================================================================== */

.docs-layout { display: grid; gap: 32px; padding-top: 24px; padding-bottom: 24px; }
@media (min-width: 1000px) {
  .docs-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 56px; }
}

/* Sommaire latéral */
.docs-toc { font-size: 14px; }
.docs-toc h2 { font-family: var(--font-sans); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); margin: 0 0 10px; }
.docs-toc ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 2px; }
.docs-toc a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--text-soft); text-decoration: none; }
.docs-toc a:hover { background: var(--surface-2); color: var(--text); }
.docs-toc a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.docs-toc .method { font-size: 10px; }
@media (min-width: 1000px) {
  .docs-toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
}
@media (max-width: 999px) {
  .docs-toc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px 14px 0; }
  .docs-toc ul { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Contenu */
.docs-content { min-width: 0; }
.docs-content section { padding-bottom: 28px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.docs-content section:last-child { border-bottom: 0; }
.docs-content h2 { font-size: clamp(24px, 3.5vw, 30px); margin-top: 0; }
.docs-content h3 { font-size: 18px; margin-top: 28px; }
.docs-content p, .docs-content li { color: var(--text-soft); }
.docs-content :not(pre) > code {
  background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: .86em; color: var(--text);
}

/* Badges de méthodes HTTP */
.method {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 6px; line-height: 1.4; min-width: 3.4em; text-align: center;
}
.method-post { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.method-get { background: var(--accent-soft); color: var(--accent); }
.method-delete { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

.endpoint {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin: 16px 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-family: var(--font-mono); font-size: 14px;
}
.endpoint .path { color: var(--text); word-break: break-all; }
.endpoint .path b { color: var(--accent); font-weight: 500; }

/* Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 16px 0; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.type { font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); }
.req { font-size: 11px; font-weight: 700; color: var(--danger); text-transform: uppercase; letter-spacing: .04em; }
.opt { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .04em; }
.status { font-family: var(--font-mono); font-weight: 600; }
.status-4 { color: var(--warn); }
.status-5 { color: var(--danger); }
.status-2 { color: var(--ok); }

/* Blocs de code avec onglets et bouton copier */
.code-block { position: relative; margin: 16px 0; border-radius: var(--radius); background: var(--code-bg); color: var(--code-text); overflow: hidden; border: 1px solid rgba(255, 255, 255, .06); }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 0 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); min-height: 44px; }
.code-tabs { display: flex; gap: 2px; overflow-x: auto; }
.code-tabs button, .code-title {
  background: none; border: 0; color: var(--code-mute); font-family: var(--font-mono); font-size: 12.5px;
  padding: 12px 12px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.code-title { cursor: default; }
.code-tabs button[aria-selected="true"] { color: #fff; border-bottom-color: #8f86ff; }
.code-tabs button:focus-visible { outline-offset: -3px; }
.copy-btn {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: var(--code-text);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: var(--font-sans); flex: none;
}
.copy-btn:hover { background: rgba(255, 255, 255, .12); }
.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.7; }
.code-block pre[hidden] { display: none; }
.code-block .k { color: var(--code-key); }
.code-block .s { color: var(--code-str); }
.code-block .n { color: var(--code-num); }
.code-block .c { color: var(--code-mute); font-style: italic; }

.two-col { display: grid; gap: 16px; }
@media (min-width: 1200px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }

.base-url { display: inline-flex; flex-wrap: wrap; max-width: 100%; overflow-wrap: anywhere; gap: 6px 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 14px; }
.version-tag { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; }

.changelog { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.changelog li { display: grid; gap: 4px; padding-left: 16px; border-left: 2px solid var(--border); }
.changelog time { font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); }
.changelog b { color: var(--text); }
