/* Documentatia CrioX PBX — stilul paginilor.
   Aceeasi directie ca aplicatia (docs/design.md): aproape monocrom, contrast
   mare, borduri de 1px, culoare folosita rar. Tokenii sunt copiati din
   `src/index.css` — site-ul nu trece prin Tailwind, deci nu-i poate importa. */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Space Grotesk Variable';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --ground: #ffffff;
  --surface: #f4f4f7;
  --surface-2: #eaeaf0;
  --canvas: #eaeaf0;
  --edge: #e2e2e9;
  --edge-strong: #cbcbd6;
  --fg: #0b0b0d;
  --fg-muted: #64646e;
  --fg-faint: #9a9aa6;
  --inverse: #0b0b0d;
  --inverse-fg: #ffffff;
  --ok: #1f7a3f;
  --warn: #9a6300;
  --warn-soft: #fff4d6;
  --bad: #b3261e;
  --bad-soft: #fde7e5;
  --mark: url('mark-black.svg');
  --mono: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --brand: 'Space Grotesk Variable', var(--sans);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1b1b1f;
    --surface: #222227;
    --surface-2: #2a2a30;
    --canvas: #121214;
    --edge: #2e2e35;
    --edge-strong: #43434c;
    --fg: #f2f2f5;
    --fg-muted: #a6a6b1;
    --fg-faint: #6c6c77;
    --inverse: #f2f2f5;
    --inverse-fg: #0b0b0d;
    --ok: #5fcf85;
    --warn: #f0b84a;
    --warn-soft: #3a2d10;
    --bad: #ff8a80;
    --bad-soft: #3d1b19;
    --mark: url('mark-white.svg');
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01';
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--edge-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; margin: 0; }
h1 { font-family: var(--brand); font-size: 2rem; font-weight: 600; }
h2 { font-size: 1.35rem; font-weight: 600; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--edge); }
h3 { font-size: 1.05rem; font-weight: 600; margin-top: 2rem; }
h2 + h3 { margin-top: 1.25rem; }
p { margin: 0.75rem 0; }
p.lead { font-size: 1.1rem; color: var(--fg-muted); margin-top: 0.5rem; }
ul, ol { padding-left: 1.35rem; }
li { margin: 0.3rem 0; }
small, .muted { color: var(--fg-muted); }
hr { border: 0; border-top: 1px solid var(--edge); margin: 2rem 0; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  white-space: nowrap;
}
pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.55;
  tab-size: 2;
}
pre code { background: none; padding: 0; font-size: inherit; white-space: pre; border-radius: 0; }
.code { position: relative; margin: 0.75rem 0 1rem; }
.code .copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--edge-strong);
  background: var(--ground);
  color: var(--fg-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms;
}
.code:hover .copy, .code .copy:focus-visible, .code .copy.done { opacity: 1; }
.code .copy.done { color: var(--ok); border-color: var(--ok); }

/* ── Asezarea: meniu la stanga, text la dreapta ───────────────────────── */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 1.25rem 1rem 2rem 1.5rem;
  background: var(--ground);
  border-right: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; margin-bottom: 1.5rem; }
.brand .mark { width: 26px; height: 26px; background: var(--mark) center / contain no-repeat; }
.brand .name { font-family: var(--brand); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.brand .name small { display: block; font-family: var(--sans); font-weight: 400; font-size: 0.72rem; color: var(--fg-muted); letter-spacing: 0; }

.menu { font-size: 0.9rem; }
.menu .group { margin-top: 1.25rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); }
.menu a { display: block; padding: 0.3rem 0.6rem; margin: 1px -0.6rem; border-radius: 7px; text-decoration: none; color: var(--fg-muted); }
.menu a:hover { background: var(--surface); color: var(--fg); }
.menu a.active { background: var(--surface-2); color: var(--fg); font-weight: 500; }
.menu a.current { color: var(--fg); font-weight: 500; }
.menu a.sub { padding-left: 1.5rem; font-size: 0.86rem; }
.menu .method { font-family: var(--mono); font-size: 0.7rem; font-weight: 600; margin-right: 0.35rem; color: var(--fg-faint); }

.main { padding: 2.5rem 3rem 5rem; max-width: 860px; }
.top { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--ground);
    border-bottom: 1px solid var(--edge);
  }
  .top button {
    font: inherit; font-size: 0.86rem;
    padding: 0.35rem 0.8rem; border-radius: 999px;
    border: 1px solid var(--edge-strong); background: var(--ground); color: var(--fg); cursor: pointer;
  }
  .side.open { display: block; position: fixed; inset: 3.4rem 0 0 0; height: auto; z-index: 3; }
  .main { padding: 1.5rem 1rem 4rem; }
  h1 { font-size: 1.6rem; }
}

/* ── Piese ────────────────────────────────────────────────────────────── */
.endpoint {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  margin: 2.5rem 0 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--ground);
  border: 1px solid var(--edge);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.95rem;
}
.endpoint .method {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem; border-radius: 6px;
  background: var(--inverse); color: var(--inverse-fg);
}
.endpoint .path { font-weight: 500; word-break: break-all; }
.endpoint .path em { font-style: normal; color: var(--fg-muted); }

table { width: 100%; border-collapse: collapse; margin: 0.75rem 0 1.25rem; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--edge); }
th { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); }
td:first-child { white-space: nowrap; }
td[colspan] { white-space: normal; }
td code { white-space: nowrap; }
tr[data-field] td:first-child code, tr[data-param] td:first-child code { font-weight: 500; }
.type { color: var(--fg-muted); font-family: var(--mono); font-size: 0.8rem; }

.note {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--edge-strong);
  border-radius: 8px;
  background: var(--ground);
}
.note.warn { border-left-color: var(--warn); }
.note.bad { border-left-color: var(--bad); }
.note p { margin: 0.25rem 0; }

.pill {
  display: inline-block; font-size: 0.72rem; font-weight: 500;
  padding: 0.1rem 0.55rem; border-radius: 999px;
  background: var(--surface-2); color: var(--fg-muted); vertical-align: middle;
}
.pill.ok { background: transparent; color: var(--fg); padding-left: 0; }
.pill.ok::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: var(--ok); margin-right: 0.4rem; vertical-align: 1px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.card { display: block; padding: 0.9rem 1rem; background: var(--ground); border: 1px solid var(--edge); border-radius: 10px; text-decoration: none; }
.card:hover { border-color: var(--edge-strong); }
.card b { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.card span { color: var(--fg-muted); font-size: 0.9rem; }

.release { margin: 1.5rem 0; padding-left: 1rem; border-left: 2px solid var(--edge-strong); }
.release time { font-size: 0.8rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.release h3 { margin-top: 0.1rem; }

.foot { margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--edge); font-size: 0.86rem; color: var(--fg-muted); }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
