/* SandraCMS — the public site: homepage and documentation.
 *
 * Its OWN stylesheet. The console and the Studio each have another, and
 * design/TOKENS.md is the shared spec rather than a shared file — a "just the
 * layout" package is how two products quietly become one (D23).
 *
 * This one is a reading surface, so it is typographic where the others are
 * dense: a wide measure would make the theme guide unreadable, and the guide is
 * the reason this exists.
 */

:root {
  --brand: #246974; --brand-d: #1C535C;
  --lime: #C6F24E; --lime-on: #16240F;
  --ink: #1F2A2C; --muted: #6E7679;
  --paper: #f3f3f3; --surface: #ffffff; --surface-2: #F7F8F8;
  --line: #E4E5E6; --line-strong: #D4D6D7;
  --ok: #3B6D11; --ok-bg: #EAF3DE;
  --warn: #854F0B; --warn-bg: #FAEEDA;
  --measure: 46rem;
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.6 Puritan, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
a:hover { color: var(--brand-d); }

/* ---------- chrome ---------- */

.top {
  background: var(--brand); color: #fff;
  padding: .85rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.top__brand {
  display: flex; align-items: center; gap: .6rem;
  color: #fff; text-decoration: none; font-weight: 700; letter-spacing: -.01em;
}
.top__mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--lime);
  display: grid; place-items: center; color: var(--lime-on); font-size: 13px; font-weight: 700;
}
.top__nav { display: flex; gap: 1.25rem; margin-left: auto; flex-wrap: wrap; }
.top__nav a { color: #B7D2D6; text-decoration: none; font-size: .9rem; }
.top__nav a:hover, .top__nav a[aria-current] { color: #fff; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.wrap--wide { max-width: 62rem; }

.foot {
  border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem;
  color: var(--muted); font-size: .85rem; text-align: center;
}

/* ---------- homepage ---------- */

.hero { padding: 3.5rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.1; margin: 0 0 .75rem; letter-spacing: -.02em; }
.hero p { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.5rem; max-width: 34rem; }

.btn {
  display: inline-block; padding: .6rem 1.1rem; border-radius: 8px;
  background: var(--brand); color: #fff; text-decoration: none; font-weight: 700; font-size: .95rem;
}
.btn:hover { background: var(--brand-d); color: #fff; }
.btn--accent { background: var(--lime); color: var(--lime-on); }
.btn--accent:hover { background: #B8E63C; color: var(--lime-on); }
.btn--quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn--quiet:hover { background: var(--surface-2); color: var(--ink); }
.btns { display: flex; gap: .6rem; flex-wrap: wrap; }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 2rem 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.1rem 1.2rem;
}
.card h3 { margin: 0 0 .35rem; font-size: 1rem; }
.card h3 a { text-decoration: none; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }

.note {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 8px; padding: 1rem 1.2rem; margin: 2rem 0;
}
.note p { margin: 0 0 .5rem; }
.note p:last-child { margin: 0; }

/* ---------- rendered documentation ---------- */

.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2rem 2.25rem 2.5rem; }
.doc > *:first-child { margin-top: 0; }

.doc h1 { font-size: 1.9rem; letter-spacing: -.02em; margin: 0 0 1rem; }
.doc h2 {
  font-size: 1.3rem; margin: 2.4rem 0 .7rem; padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.doc h3 { font-size: 1.05rem; margin: 1.8rem 0 .5rem; }
.doc p, .doc ul { margin: 0 0 1rem; }
.doc li { margin: 0 0 .35rem; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .875em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px;
  padding: .1em .35em;
}
.doc pre {
  background: #17282B; color: #E8EEEF; border-radius: 8px;
  padding: 1rem 1.1rem; overflow-x: auto; margin: 0 0 1.2rem;
  font-size: .85rem; line-height: 1.55;
}
.doc pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 1em; }

/* Wide content scrolls inside its own box; the page never scrolls sideways. */
.table-wrap { overflow-x: auto; margin: 0 0 1.2rem; }
.doc table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.doc th, .doc td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }

.doc__meta {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline;
  margin: 0 0 1.5rem; color: var(--muted); font-size: .85rem;
}
.doc__meta a { font-weight: 700; }

@media (max-width: 40rem) {
  .doc { padding: 1.4rem 1.2rem 2rem; border-radius: 0; margin: 0 -1.5rem; border-left: 0; border-right: 0; }
}

.doc blockquote {
  margin: 0 0 1.2rem; padding: .9rem 1.1rem;
  background: var(--surface-2); border-left: 3px solid var(--line-strong); border-radius: 0 6px 6px 0;
  color: var(--muted);
}
.doc blockquote > *:last-child { margin-bottom: 0; }
