/* ============================================================
   IP-Docketing.com — Design system
   Light, legal-tech palette: deep navy, warm gold, soft teal.
   ============================================================ */

:root {
  /* Palette */
  --ink: #1f3a68;          /* primary deep navy */
  --ink-soft: #2d4d80;
  --gold: #c9962b;         /* warm accent */
  --gold-soft: #e0b54a;
  --teal: #2e6f7a;         /* secondary tech */
  --teal-soft: #4a93a0;
  --plum: #6a3a72;         /* tertiary accent for icons */
  --paper: #fbfaf6;        /* surface */
  --paper-2: #f3eedf;      /* card surface */
  --line: #e3dccb;         /* dividers */
  --text: #1c2230;
  --text-soft: #4b5468;
  --muted: #6f7689;
  --code-bg: #f6f1e4;
  --code-inline-bg: #efe9d6;
  --link: #1f3a68;
  --link-hover: #c9962b;
  --shadow-1: 0 1px 2px rgba(20, 25, 40, 0.04), 0 2px 8px rgba(20, 25, 40, 0.05);
  --shadow-2: 0 4px 14px rgba(20, 25, 40, 0.08), 0 10px 30px rgba(20, 25, 40, 0.05);

  /* Layout */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 18px;
  --maxw-narrow: 72ch;
  --maxw: 1280px;
  --maxw-wide: 1680px;
  --maxw-article: 1280px;
  --header-h: 68px;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-serif: "Iowan Old Style", "Apple Garamond", Baskerville, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Headings/anchors clear the sticky header */
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 2.2em 0 0.6em;
}
h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  margin-top: 0.2em;
  background: linear-gradient(90deg, var(--ink) 0%, var(--teal) 60%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 {
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: clamp(1.2rem, 1.5vw, 1.35rem); color: var(--ink-soft); }
h4 { font-size: 1.07rem; color: var(--teal); }

a {
  color: var(--link);
  text-decoration: none;
  background-image: linear-gradient(var(--gold-soft), var(--gold-soft));
  background-repeat: no-repeat;
  background-size: 0 2px;
  background-position: 0 100%;
  transition: background-size 180ms ease, color 180ms ease;
}
a:hover, a:focus-visible {
  color: var(--link-hover);
  background-size: 100% 2px;
}

p { margin: 0 0 1.1em; }

main p, main ul, main ol { color: var(--text); }

ul, ol { padding-left: 1.5em; }
li { margin: 0.3em 0; }

/* ---------- List styling inside articles ----------
   Scoped to `.prose` so chrome lists (breadcrumbs, related, footer)
   are unaffected. The article body is wrapped in `.prose` via the
   layout, so anything _outside_ that wrapper keeps default styling. */
.prose ul,
.prose ol {
  margin: 1em 0 1.3em;
  padding-left: 0;
  list-style: none;
}
.prose ul > li,
.prose ol > li {
  position: relative;
  padding: 4px 0 4px 1.85em;
  margin: 0.18em 0;
  line-height: 1.6;
}

/* Unordered: gold diamond bullet */
.prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.4em;
  top: 0.8em;
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  border-radius: 1px;
  box-shadow: 0 0 0 2px rgba(201, 150, 43, 0.18);
}

/* Ordered: navy circle with number */
.prose ol { counter-reset: ol-counter; }
.prose ol > li {
  padding-left: 2.4em;
  counter-increment: ol-counter;
}
.prose ol > li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 1.7em;
  height: 1.7em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ink), var(--teal));
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 999px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(20, 25, 40, 0.18);
}

/* Nested lists */
.prose li ul,
.prose li ol { margin: 0.45em 0 0.6em; }
.prose li ul > li::before {
  background: var(--teal);
  box-shadow: 0 0 0 2px rgba(46, 111, 122, 0.18);
  width: 6px;
  height: 6px;
  top: 0.85em;
}
.prose li ol > li::before {
  background: linear-gradient(135deg, var(--teal), var(--plum));
}

/* Bold leading term ("**Operational Action:** …") */
.prose li > strong:first-child { color: var(--ink); }

/* Task-list items keep their checkbox UI */
.prose ul.contains-task-list > li,
.prose ul > li.task-list-item { padding-left: 0; }
.prose ul.contains-task-list > li::before,
.prose ul > li.task-list-item::before { display: none; }

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.4em 0;
}

blockquote {
  margin: 1.5em 0;
  padding: 0.6em 1.1em;
  border-left: 4px solid var(--gold);
  background: var(--paper-2);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
}

/* Heading anchor links (markdown-it-anchor headerLink) */
h2 a.heading-anchor,
h3 a.heading-anchor,
h4 a.heading-anchor {
  color: inherit;
  background: none;
}
h2 a.heading-anchor:hover,
h3 a.heading-anchor:hover,
h4 a.heading-anchor:hover { color: var(--gold); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
  flex-wrap: nowrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  background: none;
  flex: 0 0 auto;
  min-width: 0;
}
.brand:hover { color: var(--gold); }
.brand svg { width: 34px; height: 34px; display: block; flex: 0 0 auto; }
.brand__text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1;
  white-space: nowrap;
}
.brand__text small {
  display: block;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
}
/* On medium widths the tagline takes room from the nav — drop it first */
@media (max-width: 1180px) {
  .brand__text small { display: none; }
}

.site-nav {
  margin-left: auto;
  min-width: 0;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text-soft);
  background: transparent;
  transition: background 180ms ease, color 180ms ease;
  white-space: nowrap;
}
.site-nav a svg { width: 18px; height: 18px; flex: 0 0 auto; }
/* Below 1100px, visually hide the nav labels but keep the icons so the bar stays one line. Labels remain available to assistive tech. */
@media (max-width: 1099px) and (min-width: 761px) {
  .site-nav a { padding: 8px 10px; gap: 0; }
  .site-nav a span:not([class]) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
  background: var(--paper-2);
}
.site-nav a.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--ink), var(--teal));
  box-shadow: var(--shadow-1);
}
.site-nav a.is-active:hover { color: #fff; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--paper-2); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
  .site-nav { display: none; width: 100%; }
  .site-nav.is-open { display: block; margin-top: 8px; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav a { justify-content: flex-start; }
}

/* ---------- Containers ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.container--wide { max-width: var(--maxw-wide); }
.container--narrow { max-width: 960px; }

/* ---------- Hero (home) ---------- */
.hero {
  padding: 56px 0 36px;
  text-align: center;
  position: relative;
}
.hero__logo {
  display: block;
  margin: 0 auto 18px;
  width: clamp(120px, 18vw, 168px);
  height: auto;
  filter: drop-shadow(0 14px 28px rgba(31, 58, 104, 0.18));
  transition: transform 400ms cubic-bezier(.2,.7,.2,1);
}
.hero__logo:hover { transform: translateY(-4px) rotate(-1deg); }

.hero__title {
  margin: 0.4em auto 0.6em;
  max-width: 22ch;
}
.hero__lede {
  max-width: 64ch;
  margin: 0 auto 1.2em;
  color: var(--text-soft);
  font-size: 1.08rem;
}

.cta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 28px auto 0;
  max-width: 920px;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  box-shadow: var(--shadow-1);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.cta:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: var(--gold-soft);
  color: var(--ink);
  background-size: 0 2px;
}
.cta__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
}
.cta__icon svg { width: 22px; height: 22px; }
.cta__icon--ink   { background: linear-gradient(135deg, #1f3a68, #2e6f7a); }
.cta__icon--gold  { background: linear-gradient(135deg, #c9962b, #e0b54a); }
.cta__icon--teal  { background: linear-gradient(135deg, #2e6f7a, #4a93a0); }
.cta__icon--plum  { background: linear-gradient(135deg, #6a3a72, #9a5aa6); }
.cta__label { display: block; line-height: 1.25; }
.cta__sub {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* ---------- Home: intro + section grid ---------- */
.home-intro {
  max-width: 78ch;
  margin: 32px auto 0;
  color: var(--text-soft);
}
.home-intro p { font-size: 1.04rem; }

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.section-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  color: var(--text);
  background-image: none;
  display: block;
}
.section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: var(--gold-soft);
  color: var(--text);
}
.section-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1.08rem;
}
.section-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* ---------- Content layout (wide) ---------- */
.content-wrap {
  padding: 28px 24px 64px;
  max-width: var(--maxw-wide);
  margin: 0 auto;
}

.article {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3.5vw, 56px);
  box-shadow: var(--shadow-1);
}
.article > :first-child { margin-top: 0; }
.article p,
.article li { font-size: 1.03rem; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 0.88rem;
  margin: 0 0 18px;
  color: var(--muted);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.breadcrumbs li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--muted);
}
.breadcrumbs a {
  color: var(--text-soft);
  background: none;
}
.breadcrumbs a:hover { color: var(--gold); }

/* ---------- Related pages ---------- */
.related {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.related h2 {
  border: none;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.related-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.related-list a {
  display: block;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  background-image: none;
}
.related-list a:hover {
  transform: translateY(-2px);
  border-color: var(--gold-soft);
  box-shadow: var(--shadow-1);
  color: var(--ink);
}

/* ---------- Inline code ---------- */
:not(pre) > code {
  background: var(--code-inline-bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0.08em 0.42em;
  border-radius: 4px;
  border: none;
}

/* ---------- Code blocks ---------- */
.code-block {
  position: relative;
  margin: 1.4em 0;
}
.code-block pre {
  background: var(--code-bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 #fff;
}
.code-block pre code {
  background: transparent !important;
  padding: 0;
  border: none;
  font-family: inherit;
  font-size: inherit;
}
.code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  font: 600 0.75rem/1 var(--font-sans);
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
  z-index: 2;
}
.code-block:hover .code-copy,
.code-copy:focus-visible { opacity: 1; transform: none; }
.code-copy:hover { background: var(--gold-soft); color: var(--ink); }
.code-copy.is-copied { background: var(--teal); color: #fff; }
@media (max-width: 720px) {
  .code-copy { opacity: 1; transform: none; }
}

/* Prism token overrides for the light palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #7b8194; font-style: italic; }
.token.punctuation { color: #5a637a; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: var(--plum); }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: var(--teal); }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: var(--ink-soft); background: transparent; }
.token.atrule, .token.attr-value, .token.keyword { color: var(--ink); font-weight: 600; }
.token.function, .token.class-name { color: var(--gold); }
.token.regex, .token.important, .token.variable { color: var(--plum); }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

/* Highlight line numbers (if any) from the syntax plugin */
.line-numbers-rows { border-right-color: var(--line) !important; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 1.4em 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  border-collapse: collapse;
  width: 100%;
  min-width: 540px;
  font-size: 0.96rem;
}
.table-wrap th, .table-wrap td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.table-wrap th {
  background: var(--paper-2);
  color: var(--ink);
  font-weight: 700;
  border-bottom: 2px solid var(--line);
}
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:nth-child(even) td { background: #fdfbf3; }

/* ---------- Task lists ---------- */
.task-list-item {
  list-style: none;
  padding-left: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.task-list-item::marker { content: ""; }
.task-list-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 5px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
}
.task-list-item.is-checked { color: var(--muted); }
.task-list-item.is-checked > * { text-decoration: line-through; }
.task-list-item.is-checked input[type="checkbox"] { text-decoration: none; }
ul.contains-task-list { padding-left: 0; list-style: none; }
ul.contains-task-list ul.contains-task-list { padding-left: 1.4em; }

/* ---------- FAQ / details ---------- */
details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin: 0.8em 0;
  background: #fff;
  overflow: hidden;
}
details + details { margin-top: 8px; }
details > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--gold);
  transition: transform 200ms ease;
}
details[open] > summary::after { content: "−"; }
details[open] > summary { border-bottom: 1px solid var(--line); }
details > .details-body { padding: 14px 18px; }

/* ---------- Mermaid ---------- */
pre.mermaid {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 1.4em 0;
  text-align: center;
  overflow: auto;
}

/* ---------- KaTeX ---------- */
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; }

/* ---------- Footer ---------- */
.site-footer {
  flex: 0 0 auto;
  margin-top: 48px;
  background: linear-gradient(180deg, transparent, var(--paper-2));
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.95rem;
}
.site-footer__inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .site-footer__inner {
    grid-template-columns: 1.4fr 2fr;
    align-items: start;
  }
}
.site-footer h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: none;
  margin: 0 0 10px;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.site-footer a {
  color: var(--ink);
  background: none;
}
.site-footer a:hover { color: var(--gold); }
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-footer__brand svg { width: 38px; height: 38px; }
.site-footer__legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Misc ---------- */
::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
img { max-width: 100%; height: auto; }
