/* CourtWatch guides — "the order sheet."
   Identity drawn from the artifacts of Indian court practice: order-sheet
   margins (the step rail), stamp-pad violet, manila file cards, mono-set
   case identifiers. Lives at /guides/ (renamed from /blog/ pre-launch).
   Spec: docs/superpowers/specs/2026-07-22-blog-organic-reach-design.md */

:root {
  --paper: #FBFBF8;
  --ink: #1C2B3A;
  --ink-soft: #4A5768;
  --stamp: #52489F;
  --stamp-deep: #3E3679;
  --stamp-faint: #F1EFFA;
  --file-red: #B3402E;
  --file-red-faint: #FBF1EF;
  --manila: #F5F0E3;
  --manila-edge: #DCD2B8;
  --rule: #E4E2DA;
  --serif: 'Literata', Georgia, serif;
  --sans: 'Public Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
}
a { color: var(--stamp); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--stamp-deep); }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

/* ── header ── */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: baseline; justify-content: space-between; padding-top: 1.1rem; padding-bottom: 1.1rem; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--ink); }
.site-nav { display: flex; gap: 1.4rem; align-items: baseline; }
.site-nav a { font-size: 0.9rem; text-decoration: none; color: var(--ink-soft); }
.site-nav a:hover { color: var(--stamp-deep); text-decoration: underline; }
.site-nav a.app-link {
  color: var(--stamp); border: 1.5px solid var(--stamp); border-radius: 3px;
  padding: 0.3rem 0.75rem; font-weight: 600;
}
.site-nav a.app-link:hover { background: var(--stamp-faint); text-decoration: none; }

/* ── article header ── */
.post-head { padding: 2.6rem 0 1.4rem; }
.eyebrow {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--stamp); margin: 0 0 0.9rem;
}
h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 1rem;
}
.post-meta { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); margin: 0 0 1.2rem; }
/* the hero line on a court page — one verified sentence between the heading
   and the search form */
.lede { font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 0.2rem; }

/* the verification stamp — an honest freshness claim, re-inked when the
   steps are re-walked against the live portal */
.stamp {
  display: inline-block; transform: rotate(-1.4deg);
  border: 2px solid var(--stamp); border-radius: 3px;
  box-shadow: 0 0 0 1px var(--paper), 0 0 0 2.5px var(--stamp);
  color: var(--stamp); font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.4rem 0.7rem; margin: 0.3rem 0 0;
  opacity: 0.92;
}

/* ── "in short" — the complete answer, up front ── */
.inshort {
  background: var(--manila); border: 1px solid var(--manila-edge);
  border-radius: 3px; padding: 1.05rem 1.25rem; margin: 1.6rem 0 2.2rem;
}
.inshort .label {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft); display: block; margin-bottom: 0.4rem;
}
.inshort p { margin: 0; font-size: 1rem; }

/* ── body copy ── */
article { padding-bottom: 2rem; }
article p, article ul, article ol { margin: 0 0 1.15rem; }
article ul, article ol { padding-left: 1.4rem; }
article li { margin-bottom: 0.4rem; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; line-height: 1.3; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 1.6rem 0 0.5rem; }
article img { max-width: 100%; border: 1px solid var(--rule); border-radius: 3px; }
code {
  font-family: var(--mono); font-size: 0.88em; color: var(--stamp-deep);
  background: var(--stamp-faint); border-radius: 3px; padding: 0.1em 0.35em;
  white-space: nowrap;
}

/* ── the order-sheet rail ── */
.step { display: grid; grid-template-columns: 3.4rem 1fr; column-gap: 1.1rem; margin: 1.8rem 0; }
.step-no {
  grid-row: 1 / span 20;
  font-family: var(--mono); font-weight: 500; font-size: 1rem; color: var(--stamp);
  border: 1.5px solid var(--stamp); border-radius: 3px;
  width: 2.4rem; height: 2.4rem; display: flex; align-items: center; justify-content: center;
  transform: rotate(-1deg); margin-top: 0.35rem;
}
.step h2 { margin-top: 0; font-size: 1.3rem; }
.step > *:not(.step-no) { grid-column: 2; }

/* ── asides ── */
.note {
  background: var(--manila); border-left: 3px solid var(--manila-edge);
  padding: 0.8rem 1.1rem; margin: 1.2rem 0; border-radius: 0 3px 3px 0; font-size: 0.98rem;
}
.caution {
  background: var(--file-red-faint); border-left: 3px solid var(--file-red);
  padding: 0.8rem 1.1rem; margin: 1.2rem 0; border-radius: 0 3px 3px 0; font-size: 0.98rem;
}

/* ── FAQ ── */
.faq { border-top: 1px solid var(--rule); margin-top: 2.4rem; padding-top: 0.4rem; }
.faq h3 { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; margin-top: 1.5rem; }

/* ── CTA ── */
.cta { border-top: 1px solid var(--rule); margin-top: 2.6rem; padding-top: 1.4rem; }
.cta p { margin: 0 0 0.9rem; }
a.button {
  display: inline-block; background: var(--stamp); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 0.95rem; padding: 0.55rem 1.1rem; border-radius: 3px;
}
a.button:hover { background: var(--stamp-deep); color: #fff; }
a.button.button-quiet {
  background: transparent; color: var(--stamp); border: 1.5px solid var(--stamp);
  padding: calc(0.55rem - 1.5px) calc(1.1rem - 1.5px); margin: 0 0 0.5rem 0.5rem;
}
a.button.button-quiet:hover { background: var(--stamp-faint); color: var(--stamp-deep); }

/* ── standalone pages (/for-firms/, /legal-research/) ── */
.page .trackbox { margin: 1rem 0 1.4rem; }
.page .trackbox > div { flex: 1 1 18rem; }
.page .trackbox p { margin: 0 0 0.4rem; }
.page ol li { margin-bottom: 0.55rem; }
/* compare pages: feature table, scrolls sideways on a phone */
.page .compare-table { overflow-x: auto; margin: 0.6rem 0 1.2rem; }
.page .compare-table table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: 0.93rem; }
.page .compare-table th, .page .compare-table td { text-align: left; vertical-align: top; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule); }
.page .compare-table th { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
.page .compare-table td:first-child { font-weight: 600; }
.page .compare-table td:last-child { white-space: nowrap; font-family: var(--mono); font-size: 0.8rem; }

/* ── index — "the cause list" ── */
.trackbox {
  background: var(--stamp-faint); border: 1.5px solid var(--stamp); border-radius: 3px;
  padding: 1rem 1.25rem; margin: 0 0 0.6rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.trackbox .label {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--stamp); display: block; margin-bottom: 0.3rem;
}
.trackbox p { margin: 0; font-size: 0.98rem; }
.bench-group:last-of-type { margin-bottom: 3rem; }
h2.bench {
  display: flex; align-items: center; gap: 0.9rem; margin: 2.3rem 0 0.3rem;
  font-family: var(--mono); font-weight: 500; font-size: 0.78rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft);
}
h2.bench::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.guide-rows { list-style: none; padding: 0; margin: 0; }
.guide-rows li {
  display: grid; grid-template-columns: 2.6rem 1fr auto; column-gap: 0.9rem;
  align-items: baseline; padding: 0.95rem 0; border-bottom: 1px solid var(--rule);
  margin: 0;
}
.guide-rows li:last-child { border-bottom: none; }
.itemno { font-family: var(--mono); font-size: 0.85rem; color: var(--stamp); }
.guide-rows a.g-title {
  font-family: var(--serif); font-weight: 600; font-size: 1.2rem;
  color: var(--ink); text-decoration: none; line-height: 1.35;
}
.guide-rows a.g-title:hover { color: var(--stamp-deep); text-decoration: underline; }
.g-body p { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.g-ver {
  font-family: var(--mono); font-size: 0.68rem; color: var(--ink-soft);
  letter-spacing: 0.05em; white-space: nowrap;
}
.chip {
  display: inline-block; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--stamp); border: 1px solid var(--stamp);
  border-radius: 2px; padding: 0.08rem 0.4rem; margin-left: 0.55rem;
  transform: rotate(-1deg); vertical-align: 0.15em; white-space: nowrap;
}

/* ── the search block — "find your case" ──
   A filing counter dropped into the middle of the page: stamp-violet rule,
   mono label, one line of type per question. Everything is baked HTML; the
   inline script only wires the tabs and the court typeahead. With JavaScript
   off, both panels show and the court is a plain <select> — the forms are
   ordinary GETs either way. */
.cw-search {
  border: 1.5px solid var(--stamp); border-radius: 3px;
  background: var(--stamp-faint);
  padding: 1.15rem 1.25rem 1.3rem;
  margin: 2.2rem 0 2.4rem;
}
/* Search-first pages put the form straight under the heading (Manoj
   2026-08-06: "the search bar should appear first"). Every rule here buys
   vertical space so heading, lede and the first field share a phone's opening
   screen — measured at 375x667, not guessed. */
.post-head + .cw-search { margin-top: 0.9rem; }
.post-head:has(+ .cw-search) { padding: 1.3rem 0 0.5rem; }
.post-head:has(+ .cw-search) .eyebrow { margin-bottom: 0.5rem; }
.post-head:has(+ .cw-search) h1 { margin-bottom: 0.7rem; }
.cw-search-h {
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
  margin: 0 0 0.3rem; line-height: 1.25;
}
.cw-search-sub { margin: 0 0 0.9rem; font-size: 0.95rem; color: var(--ink-soft); }

.cw-tabs { display: flex; gap: 0.5rem; margin: 0 0 0.9rem; }
.cw-tab {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-soft);
  background: transparent; border: 1px solid var(--manila-edge); border-radius: 2px;
  padding: 0.32rem 0.7rem; cursor: pointer;
}
.cw-tab[aria-selected="true"] {
  color: var(--stamp); border-color: var(--stamp); background: var(--paper);
}
.cw-search:not([data-js]) .cw-tabs { display: none; }

.cw-form { display: grid; grid-template-columns: 1fr; gap: 0.7rem 0.8rem; margin: 0; }
.cw-search[data-js] .cw-form { display: none; }
.cw-search[data-js] .cw-form[data-active] { display: grid; }
.cw-search:not([data-js]) .cw-form + .cw-form {
  border-top: 1px solid var(--manila-edge); margin-top: 1.1rem; padding-top: 1.1rem;
}

.cw-field { min-width: 0; }
.cw-field-court { position: relative; }
.cw-field-year { max-width: 9rem; }
.cw-label {
  display: block; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 0.28rem;
}
.cw-input, .cw-select {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--manila-edge); border-radius: 3px;
  padding: 0.5rem 0.6rem; line-height: 1.4;
}
.cw-input:focus, .cw-select:focus { border-color: var(--stamp); outline-offset: 1px; }
.cw-court-input { font-family: var(--sans); }
.cw-court-select { font-family: var(--sans); }
.cw-year { font-family: var(--mono); font-size: 0.95rem; }
.cw-seat { font-family: var(--sans); }
.cw-sc-go { margin: 0.4rem 0 0; }

.cw-options {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  list-style: none; margin: 0.15rem 0 0; padding: 0.2rem 0;
  background: var(--paper); border: 1px solid var(--stamp); border-radius: 3px;
  box-shadow: 0 6px 18px rgba(28, 43, 58, 0.12); max-height: 15rem; overflow-y: auto;
}
.cw-option { margin: 0; padding: 0.4rem 0.65rem; font-size: 0.97rem; cursor: pointer; }
.cw-option:hover, .cw-option[data-active] { background: var(--stamp-faint); color: var(--stamp-deep); }

.cw-scope { grid-column: 1 / -1; margin: 0 0 0.1rem; font-size: 0.95rem; color: var(--ink-soft); }
.cw-hint { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.cw-submit {
  grid-column: 1 / -1; justify-self: start;
  background: var(--stamp); color: #fff; border: none; border-radius: 3px;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  padding: 0.58rem 1.15rem; cursor: pointer; margin-top: 0.2rem;
}
.cw-submit:hover { background: var(--stamp-deep); }
.cw-fallback { margin: 0.85rem 0 0; font-size: 0.88rem; }
.cw-fallback a { color: var(--ink-soft); }

/* Hidden carriers for the chosen court. They never paint; the rules exist so
   every class the pages emit is accounted for in this stylesheet. */
.cw-h-state, .cw-h-dist, .cw-h-est, .cw-h-hc, .cw-h-bench, .cw-h-court { display: none; }

/* ── the mobile sticky search bar (funnel spec §8; Manoj approved 2026-08-06) ──
   A separate bar, NOT the hero pinned: `position: sticky` on the hero would
   glue a 300px block to the bottom of a phone screen for the whole article.
   The bar is built by the inline script and appended to <body>, so JavaScript
   off means no bar at all rather than a bar that cannot work. It is `fixed`,
   so it overlays and nothing on the page moves when it appears, and it is
   gated on the hero form AND the closing CTA being off-screen — a bar
   duplicating a form you can already see is noise, and one covering the CTA
   competes with it. Phones only: a bar pinned across a wide article reads as
   an ad. */
.cw-search--sticky { scroll-margin-bottom: 5rem; }

.cw-stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 0.5rem; align-items: stretch;
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper); border-top: 1.5px solid var(--stamp);
  box-shadow: 0 -6px 18px rgba(28, 43, 58, 0.13);
}
.cw-stickybar[hidden] { display: none; }
.cw-stickybar-in {
  flex: 1 1 auto; min-width: 0; min-height: 44px;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--manila-edge);
  border-radius: 3px; padding: 0.5rem 0.6rem;
}
.cw-stickybar-in:focus { border-color: var(--stamp); }
.cw-stickybar-go {
  flex: 0 0 auto; min-height: 44px;
  background: var(--stamp); color: #fff; border: none; border-radius: 3px;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  padding: 0.5rem 0.9rem; cursor: pointer; white-space: nowrap;
}
.cw-stickybar-go:hover { background: var(--stamp-deep); }

@media (min-width: 40rem) {
  .cw-form[data-panel="name"] { grid-template-columns: minmax(0, 1fr) 9rem; }
  .cw-form[data-panel="name"] .cw-field-court { grid-column: 1 / -1; }
  .cw-form[data-panel="name"] .cw-field-year { grid-column: 2; }
  .cw-stickybar { display: none; }
}

@media (max-width: 640px) {
  /* Phones: the name and the year share a row so the button stays in reach of
     the opening screen, and the hero heading gives back a line of its own. */
  .cw-form[data-panel="name"] { grid-template-columns: minmax(0, 1fr) 5.6rem; }
  .cw-form[data-panel="name"] .cw-field-court { grid-column: 1 / -1; }
  .cw-field-year { max-width: none; }
  .post-head:has(+ .cw-search) h1 { font-size: 1.55rem; }
  /* The sub-line explains the form; on a phone the form is right there, and on
     a pre-scoped page the scope line under it already names the court. Dropping
     it, with a tighter lede, is what puts the button inside the first screen on
     the longest-headed pages (Gautam Buddha Nagar, Karkardooma). */
  .post-head + .cw-search .cw-search-sub { display: none; }
  .post-head:has(+ .cw-search) .lede { font-size: 0.92rem; line-height: 1.42; }
  .post-head + .cw-search { padding-top: 0.95rem; }
  .post-head + .cw-search .cw-search-h { font-size: 1.15rem; }
  .cw-form { gap: 0.55rem 0.7rem; }
  .cw-submit { margin-top: 0; }
}

/* ── footer ── */
.site-foot { border-top: 1px solid var(--rule); margin-top: 2rem; }
.site-foot .wrap { padding-top: 1.2rem; padding-bottom: 2rem; }
.site-foot p { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-soft); margin: 0.2rem 0; }
.site-foot a { color: var(--ink-soft); }

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .step { display: block; }
  .step-no { display: inline-flex; margin-bottom: 0.6rem; }
  .site-head .wrap { flex-wrap: wrap; gap: 0.5rem; }
  .site-nav { gap: 0.9rem; flex-wrap: wrap; }
  .guide-rows li { grid-template-columns: 2.2rem 1fr; }
  .g-ver { grid-column: 2; margin-top: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── criminal-code section pages (/sections/) ── */
.table-scroll { overflow-x: auto; margin: 0.6rem 0 1rem; }
table.concord { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.concord th, table.concord td { text-align: left; vertical-align: top; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule); }
table.concord th { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
table.concord td strong { font-family: var(--mono); font-weight: 600; }
ul.section-list { padding-left: 1.1rem; }
ul.section-list li { margin-bottom: 0.4rem; }
