/* Screen stylesheet of the web edition of the Karyagrah Client Guide (karyagrah.com/guide). Copied by build.mjs to client/public/guide/guide.css. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin.woff2) format("woff2"); }

:root {
  --brand: #2d4d58; --brand-dark: #1d3640; --brand-soft: #e7eff1; --tint: #f3f7f8;
  --teal: #0e7c72; --teal-soft: #e8f6f3; --amber: #b45309; --amber-soft: #fff7e8; --red: #b42318; --red-soft: #fdf1ef;
  --ink: #1f2a30; --muted: #5d6b73; --line: #d5dfe3; --bg: #ffffff;
  --bar: 58px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Inter", "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.65; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
img, svg { max-width: 100%; }
strong, b { font-weight: 650; color: #131c21; }
code { font-family: Menlo, Consolas, monospace; font-size: 0.88em; background: var(--tint); padding: 0.1em 0.35em; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js-only { display: none; }
.js .js-only { display: block; }
a.ix { position: relative; top: -70px; display: inline-block; width: 0; height: 0; }

/* ---- top bar */
.bar { position: sticky; top: 0; z-index: 30; height: var(--bar); display: flex; align-items: center; gap: 14px; padding: 0 20px; background: rgba(255,255,255,0.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; }
.brand img { height: 34px; width: auto; display: block; }
.bar-title { font-family: "Plus Jakarta Sans", Arial, sans-serif; font-weight: 700; color: var(--teal); font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; padding-left: 14px; border-left: 1px solid var(--line); }
.bar-links { margin-left: auto; display: flex; gap: 8px; }
.bar-links a { font-size: 14px; font-weight: 600; text-decoration: none; padding: 7px 13px; border-radius: 8px; color: var(--brand); border: 1px solid var(--line); }
.bar-links a:hover { background: var(--tint); }

/* ---- layout */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; }
.side { position: sticky; top: var(--bar); align-self: start; height: calc(100vh - var(--bar)); overflow-y: auto; padding: 18px 14px 40px 20px; border-right: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
main { padding: 8px 40px 60px; min-width: 0; max-width: 860px; }

/* ---- contents list */
ul.toc { list-style: none; margin: 0; padding: 0; }
ul.toc li { margin: 0; }
ul.toc a { display: block; text-decoration: none; color: #33424a; padding: 5px 8px; border-radius: 6px; }
ul.toc a:hover { background: var(--tint); color: var(--brand-dark); }
ul.toc li.ch { margin-top: 10px; }
ul.toc li.ch a { font-family: "Plus Jakarta Sans", Arial, sans-serif; font-weight: 700; color: var(--brand-dark); font-size: 14.5px; }
ul.toc li.sec a { padding-left: 24px; font-size: 13.5px; }
ul.toc .n { display: inline-block; min-width: 2.1em; color: var(--teal); font-weight: 650; }
ul.toc li.sec .n { color: var(--muted); font-weight: 500; }
ul.toc a.on { background: var(--teal-soft); color: var(--teal); }

.search { margin-bottom: 8px; position: relative; }
.search input { width: 100%; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.search input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.results { margin-top: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; max-height: 50vh; overflow-y: auto; }
.results a { display: block; padding: 8px 12px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 14px; }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a:focus { background: var(--tint); }
.results small { display: block; color: var(--muted); font-size: 12px; }
.results p { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 14px; }

details.mobile-toc { display: none; }

/* ---- hero */
.hero { padding: 36px 0 12px; }
.kicker { font-family: "Plus Jakarta Sans", Arial, sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--teal); }
h1 { font-family: "Plus Jakarta Sans", Arial, sans-serif; font-weight: 800; font-size: 40px; line-height: 1.15; color: var(--brand-dark); margin: 10px 0 16px; letter-spacing: -0.015em; }
.lead { font-size: 18px; line-height: 1.6; color: #36454d; margin: 0 0 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; font-weight: 650; text-decoration: none; padding: 11px 20px; border-radius: 10px; background: var(--brand); color: #fff; border: 1px solid var(--brand); }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.ghost:hover { background: var(--tint); color: var(--brand-dark); }
.hero-note { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips a { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--brand); border: 1px solid var(--brand); border-radius: 999px; padding: 5px 14px; }
.chips a:hover { background: var(--brand); color: #fff; }

/* ---- chapters */
.chapter { padding-top: 36px; }
.chapter-head { margin: 0 0 22px; padding-bottom: 14px; border-bottom: 3px solid var(--brand); }
.chapter-kicker { font-family: "Plus Jakarta Sans", Arial, sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal); margin-bottom: 4px; }
.chapter-head h1 { font-size: 34px; margin: 0; }
.chapter-head + p.lead, p.lead { }
h2 { font-family: "Plus Jakarta Sans", Arial, sans-serif; font-weight: 750; font-size: 25px; line-height: 1.25; color: var(--brand-dark); margin: 40px 0 12px; }
h2 .num { color: var(--teal); margin-right: 8px; }
h3 { font-family: "Plus Jakarta Sans", Arial, sans-serif; font-weight: 700; font-size: 19px; line-height: 1.3; color: var(--brand); margin: 30px 0 8px; }
h3 .num { color: var(--teal); font-weight: 650; margin-right: 8px; }
p { margin: 0 0 14px; }
a.xref { font-weight: 600; }

ul { margin: 0 0 16px; padding-left: 22px; }
ul li { margin: 0 0 6px; }
ul li::marker { color: var(--teal); }
ol { list-style: none; counter-reset: step; margin: 6px 0 18px; padding-left: 40px; }
ol > li { counter-increment: step; position: relative; margin: 0 0 10px; }
ol > li::before { content: counter(step); position: absolute; left: -40px; top: 1px; width: 27px; height: 27px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; line-height: 27px; text-align: center; }
li > ul, li > ol { margin-top: 6px; margin-bottom: 4px; }
li > p { margin-bottom: 6px; }

/* ---- boxes */
.box { border-radius: 10px; padding: 14px 18px 4px; margin: 18px 0 22px; border: 1px solid var(--line); background: var(--tint); }
.box-title { font-family: "Plus Jakarta Sans", Arial, sans-serif; font-weight: 750; font-size: 15.5px; margin: 0 0 8px; color: var(--brand-dark); }
.box ul { margin-bottom: 10px; }
.box p { font-size: 15.5px; }
.box-keep { background: #fff; border: 1.5px solid var(--brand); padding: 0 0 6px; overflow: hidden; }
.box-keep .box-title { background: var(--brand); color: #fff; padding: 10px 18px; margin: 0 0 12px; }
.box-keep > p, .box-keep > .table-wrap { margin-left: 18px; margin-right: 18px; }
.box-keep > ul { list-style: none; padding: 0 18px; }
.box-keep > ul > li { position: relative; padding-left: 28px; margin-bottom: 8px; }
.box-keep > ul > li::before { content: ""; position: absolute; left: 0; top: 5px; width: 15px; height: 15px; border: 1.5px solid var(--brand); border-radius: 3px; background: #fff; }
.box-meta { border: 0; border-left: 5px solid var(--amber); background: var(--amber-soft); }
.box-meta .box-title { color: var(--amber); }
.box-tip { border: 0; border-left: 5px solid var(--teal); background: var(--teal-soft); }
.box-tip .box-title { color: var(--teal); }
.box-note { border: 0; border-left: 5px solid var(--brand); }
.box-warn { border: 0; border-left: 5px solid var(--red); background: var(--red-soft); }
.box-warn .box-title { color: var(--red); }

/* ---- tables */
.table-wrap { margin: 12px 0 22px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.5; }
th, td { border: 1px solid var(--line); padding: 8px 12px; vertical-align: top; text-align: left; }
th { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
tbody tr:nth-child(even) td { background: #fafcfc; }
.box table { background: #fff; }
.box .table-wrap { margin-bottom: 14px; }

/* ---- module entries */
.chapter.mods h3 { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 21px; }
.chapter.mods h2 + h3, .chapter.mods h2 + .h3-block h3 { border-top: 0; padding-top: 0; margin-top: 14px; }
p.m { margin: 0 0 8px; }
p.m strong:first-child { color: var(--brand); font-weight: 700; }
p.m-works-with { background: var(--teal-soft); border-radius: 8px; padding: 9px 14px; margin-top: 10px; font-size: 15.5px; }
p.m-works-with strong:first-child { color: var(--teal); }
p.m-needs { color: var(--muted); font-size: 15px; }
.soon { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--amber); background: var(--amber-soft); border: 1px solid #f0c98a; border-radius: 999px; padding: 1px 10px; margin-right: 8px; vertical-align: 1px; }

/* ---- diagrams */
figure.diagram { margin: 22px 0 26px; text-align: center; }
figure.diagram svg { width: 100%; height: auto; display: block; font-family: "Inter", Arial, sans-serif; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
figcaption b { color: var(--brand); }

/* ---- index */
.ix-cols { column-count: 3; column-gap: 28px; font-size: 15px; line-height: 1.45; }
.ix-letter { font-family: "Plus Jakarta Sans", Arial, sans-serif; font-weight: 800; font-size: 17px; color: var(--teal); margin: 16px 0 4px; break-after: avoid; }
.ix-letter:first-child { margin-top: 0; }
.ix-row { margin-bottom: 3px; break-inside: avoid; }
.ix-row a { text-decoration: none; color: var(--ink); }
.ix-row a:hover { color: var(--teal); text-decoration: underline; }
.ix-row a.ix-more { margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--teal); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }

/* ---- page footer */
.foot { margin-top: 56px; padding-top: 22px; border-top: 3px solid var(--brand); font-size: 15px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: baseline; }
.to-top { font-weight: 600; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 14px 0; }
.foot-links a { color: var(--brand); text-decoration: none; font-weight: 500; }
.foot-links a:hover { text-decoration: underline; }
.foot-small { color: var(--muted); font-size: 13px; }

/* ---- narrower screens */
@media (max-width: 980px) {
  .layout { display: block; }
  .side { display: none; }
  main { padding: 4px 18px 48px; max-width: none; }
  details.mobile-toc { display: block; margin: 12px 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--tint); }
  details.mobile-toc summary { cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--brand-dark); }
  details.mobile-toc ul.toc { padding: 0 8px 12px; max-height: 60vh; overflow-y: auto; }
  .ix-cols { column-count: 2; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .bar { padding: 0 14px; gap: 10px; }
  .bar-title { display: none; }
  h1 { font-size: 30px; }
  .chapter-head h1 { font-size: 27px; }
  h2 { font-size: 22px; }
  .lead { font-size: 17px; }
  .ix-cols { column-count: 1; }
  /* a diagram keeps a readable size and scrolls sideways on a phone */
  figure.diagram { overflow-x: auto; }
  figure.diagram svg { min-width: 560px; }
  ol { padding-left: 38px; }
  .box { padding: 12px 14px 2px; }
  .box-keep .box-title { padding: 10px 14px; }
  .box-keep > ul { padding: 0 14px; }

  /* a table of 3+ columns becomes a list of small cards: each row is a card, each cell says which column it is */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; overflow: hidden; }
  table.stack td { border: 0; border-bottom: 1px solid var(--line); background: #fff !important; padding: 8px 12px; }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--teal); margin-bottom: 2px; }
  table.stack td:first-child { background: var(--brand-soft) !important; font-weight: 600; }
  table.stack td:first-child::before { color: var(--brand); }
}

@media print {
  .bar, .side, details.mobile-toc, .search, .hero-actions, .chips, .to-top { display: none !important; }
  .layout { display: block; }
  main { padding: 0; max-width: none; }
  .box, figure.diagram, tr, .h3-block { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
