/* ==========================================================================
   RedFamosa - product manual stylesheet
   Self-contained: no CDN, no web fonts, no external assets.
   Opens straight from disk (file://) with a double click.

   Layout ...... fixed sidebar + single scrolling column
   Accent ...... #6d3bf5 (RF_BRAND_PRIMARY), used sparingly
   Rules ....... no decorative shadows; separation by space, hairline and
                 colour; light type weights for headings; every table and
                 code block scrolls inside its own box so the page itself
                 never scrolls sideways.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --brand:        #6d3bf5;
  --brand-ink:    #5326d4;   /* link / heading accent, AA on white */
  --brand-soft:   #f2eeff;   /* tinted surfaces */
  --brand-line:   #ddd2ff;

  --ink:          #14161d;   /* body headings */
  --ink-2:        #363b49;   /* body text */
  --muted:        #666d7d;   /* captions, meta */

  --line:         #e4e6ee;   /* hairlines */
  --line-strong:  #d3d6e2;

  --bg:           #ffffff;
  --bg-soft:      #f7f8fb;
  --bg-code:      #f6f5fc;
  --bg-sidebar:   #fbfbfe;

  --ok:           #0e7c46;
  --ok-bg:        #ecfaf1;
  --ok-line:      #bfe8cf;
  --warn:         #97600a;
  --warn-bg:      #fff8ec;
  --warn-line:    #f0dcb4;
  --danger:       #b3261e;
  --danger-bg:    #fdefee;
  --danger-line:  #f3ccc8;
  --info:         #1d4ed8;
  --info-bg:      #eef3ff;
  --info-line:    #cfdcff;

  --radius:       10px;
  --sidebar-w:    296px;

  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   2. Layout
   -------------------------------------------------------------------------- */
.layout { display: flex; align-items: flex-start; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  padding-bottom: 48px;
}

.content {
  flex: 1 1 auto;
  min-width: 0;                 /* lets children shrink instead of pushing */
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 52px 120px;
}

/* Mobile top bar - hidden on desktop */
.topbar { display: none; }

/* --------------------------------------------------------------------------
   3. Sidebar brand + navigation
   -------------------------------------------------------------------------- */
.brand {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 22px 16px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--line);
}
.brand .mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand .name { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.brand .ver  { font-size: 12px; color: var(--muted); margin-top: 1px; }

.nav { padding: 12px 12px 0; }
.nav .group {
  margin: 18px 12px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav .group:first-child { margin-top: 6px; }

.nav a {
  display: block;
  padding: 5px 12px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}
.nav a:hover { background: var(--brand-soft); color: var(--ink); text-decoration: none; }
.nav a.sub   { padding-left: 26px; font-size: 13px; color: var(--muted); }
.nav a.sub:hover { color: var(--ink); }

.nav a.active {
  background: var(--brand-soft);
  border-left-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}
.nav a.sub.active { font-weight: 600; }

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 { color: var(--ink); }

h1 {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.015em;
  margin: 40px 0 10px;
}
h2 {
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -.012em;
  margin: 58px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
h3 { font-size: 17.5px; font-weight: 600; margin: 32px 0 8px; letter-spacing: -.005em; }
h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 6px;
}

p { margin: 11px 0; }
.lead { font-size: 17.5px; line-height: 1.6; color: var(--ink-2); }
.subtitle { color: var(--muted); font-size: 14px; margin-top: -4px; }

ul, ol { margin: 11px 0; padding-left: 22px; }
li { margin: 5px 0; }
strong { color: var(--ink); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* Anchor offset so a jumped-to heading is not glued to the viewport edge */
[id] { scroll-margin-top: 20px; }

/* --------------------------------------------------------------------------
   5. Code
   -------------------------------------------------------------------------- */
code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--bg-code);
  border: 1px solid var(--brand-line);
  border-radius: 5px;
  padding: 1px 5px;
  color: #45259f;
  overflow-wrap: anywhere;      /* never let a long token widen the page */
}
pre {
  margin: 15px 0;
  padding: 15px 17px;
  background: var(--bg-code);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  overflow-x: auto;             /* the block scrolls, not the page */
  line-height: 1.62;
}
pre code {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
  color: #2c3040;
  white-space: pre;
  overflow-wrap: normal;
}
kbd {
  font-family: var(--mono);
  font-size: .82em;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   6. Tables - always inside .tbl (its own horizontal scroller)
   -------------------------------------------------------------------------- */
.tbl {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* Key / value definition grid */
.kv {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 8px 20px;
  margin: 14px 0;
  font-size: 14.5px;
}
.kv dt { font-weight: 600; color: var(--ink); }
.kv dd { margin: 0; }

/* --------------------------------------------------------------------------
   7. Callouts - flat, no shadow, 3px accent edge
   -------------------------------------------------------------------------- */
.callout {
  margin: 18px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-soft);
  font-size: 14.5px;
}
.callout .h { display: block; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child  { margin-bottom: 0; }
.callout pre { margin: 10px 0 2px; background: #fff; }

.callout.note   { background: var(--info-bg);   border-color: var(--info-line);   border-left-color: var(--info); }
.callout.tip    { background: var(--ok-bg);     border-color: var(--ok-line);     border-left-color: var(--ok); }
.callout.warn   { background: var(--warn-bg);   border-color: var(--warn-line);   border-left-color: var(--warn); }
.callout.danger { background: var(--danger-bg); border-color: var(--danger-line); border-left-color: var(--danger); }
.callout.note .h   { color: #17358f; }
.callout.tip .h    { color: var(--ok); }
.callout.warn .h   { color: var(--warn); }
.callout.danger .h { color: var(--danger); }

/* --------------------------------------------------------------------------
   8. Pills, numbered steps, cards
   -------------------------------------------------------------------------- */
.pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 20px;
  border: 1px solid var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.pill.no { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.pill.wa { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }

.steps { counter-reset: s; list-style: none; padding-left: 0; }
.steps > li { position: relative; padding-left: 40px; margin: 13px 0; }
.steps > li::before {
  counter-increment: s;
  content: counter(s);
  position: absolute;
  left: 0;
  top: 1px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Feature list on the intro page */
.panel {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel > strong { display: block; margin-bottom: 4px; }
.panel ul { columns: 2; column-gap: 34px; margin: 8px 0 2px; }
.panel li { break-inside: avoid; }

/* --------------------------------------------------------------------------
   9. Figures (installer screenshots)
   -------------------------------------------------------------------------- */
figure { margin: 20px 0 26px; }
figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
figcaption {
  margin-top: 9px;
  padding-left: 12px;
  border-left: 2px solid var(--brand-line);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
figcaption b { color: var(--ink-2); font-weight: 600; }

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */
.footer {
  margin-top: 72px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   11. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .content { padding: 8px 32px 100px; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    width: 284px;
    flex-basis: 284px;
    transform: translateX(-100%);
    transition: transform .18s ease-out;
    border-right: 1px solid var(--line-strong);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .topbar button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
  }
  .topbar .t { font-weight: 600; font-size: 14.5px; color: var(--ink); }

  .scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(18, 18, 34, .38);
  }
  body.nav-open .scrim { display: block; }

  .content { max-width: 100%; padding: 4px 20px 90px; }
  .panel ul { columns: 1; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 10px; }
  h1 { font-size: 27px; }
  h2 { font-size: 21px; margin-top: 46px; }
}

@media (max-width: 420px) {
  body { font-size: 15px; }
  .content { padding: 4px 15px 80px; }
  h1 { font-size: 24px; }
  h2 { font-size: 19.5px; }
  h3 { font-size: 16.5px; }
}

/* --------------------------------------------------------------------------
   12. Print
   -------------------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .scrim { display: none !important; }
  .content { max-width: 100%; padding: 0; }
  body { font-size: 11pt; color: #000; }
  a { color: inherit; text-decoration: none; }
  h1, h2, h3 { page-break-after: avoid; }
  pre, .tbl, .callout, figure { page-break-inside: avoid; }
}
