/* Styles for the /help/ documentation pages (erp/templates/erp/docs/).
   Loaded only on those pages — see _article_base.html's extra_head. */

/* ---- domain index (index.html) ---- */
.docs-area { margin-bottom: var(--space-7); }
.docs-area__title {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-subtle); margin: 0 0 var(--space-3);
}
.docs-area__title span { text-transform: none; letter-spacing: 0; font-weight: 400; margin-inline-start: var(--space-2); }
.docs-domain-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4);
}
a.docs-domain-card { display: block; color: inherit; text-decoration: none; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.docs-domain-card:hover { border-color: var(--brand); box-shadow: var(--elev-2); }
.docs-domain-card__head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.docs-domain-card__icon {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--radius-sm); background: var(--brand-tint); color: var(--brand);
}
.docs-domain-card__head h3 { font-size: var(--text-base); margin: 0; flex: 1; }
.docs-domain-card__count { font-size: var(--text-2xs); color: var(--text-subtle); white-space: nowrap; }
.docs-domain-card__desc { color: var(--text-muted); font-size: var(--text-sm); margin: 0 0 var(--space-3); }
.docs-domain-card__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.docs-domain-card__list li { font-size: var(--text-sm); color: var(--text); }
.docs-domain-card__list li::before { content: "›"; color: var(--brand); margin-inline-end: var(--space-2); }
li.docs-domain-card__more { color: var(--text-subtle); }
li.docs-domain-card__more::before { content: ""; margin: 0; }
.docs-domain-card__empty { color: var(--text-subtle); font-size: var(--text-sm); margin: 0; }

/* ---- domain article list (domain.html) ---- */
.docs-article-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--space-3); }
.docs-article-card {
  display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4);
  color: inherit; text-decoration: none; height: 100%;
}
.docs-article-card:hover { border-color: var(--brand); box-shadow: var(--elev-2); }
.docs-article-card strong { display: block; font-size: var(--text-base); }
.docs-article-card:hover strong { color: var(--brand); }
.docs-article-card__num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-sunken);
  color: var(--text-muted); font-size: var(--text-xs); font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.docs-article-card__summary { display: block; margin-top: 2px; color: var(--text-muted); font-size: var(--text-sm); }

/* ---- article body (_article_base.html + per-article templates) ---- */
.docs-article { max-width: var(--content-max); }
.docs-article__lede { font-size: var(--text-base); color: var(--text-muted); max-width: var(--measure); }
.docs-article__steps { list-style: none; margin: var(--space-6) 0; padding: 0; counter-reset: docs-step; }
.docs-article__steps > li {
  counter-increment: docs-step; position: relative; padding-block: 0 var(--space-6); padding-inline: var(--space-9) 0;
  border-inline-start: 2px solid var(--line); margin-inline-start: 15px;
}
.docs-article__steps > li:last-child { border-inline-start-color: transparent; padding-bottom: 0; }
.docs-article__steps > li::before {
  content: counter(docs-step); position: absolute; inset-inline-start: -16px; top: 0;
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--on-brand, #fff);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--text-sm);
}
.docs-article__steps h3 { margin: 0 0 var(--space-2); font-size: var(--text-base); }
.docs-article__steps p { margin: 0 0 var(--space-2); color: var(--text-muted); }
.docs-article__steps p:last-child { margin-bottom: 0; }
.docs-article__steps code { background: var(--surface-sunken); padding: 1px 6px; border-radius: var(--radius-xs); font-family: var(--font-mono); font-size: 0.92em; }

.docs-figure { margin: var(--space-4) 0; }
.docs-figure img {
  display: block; max-width: 100%; height: auto; border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--elev-1); cursor: zoom-in;
}
.docs-figure--narrow img { max-width: min(100%, 640px); }
.docs-figure--half img { max-width: min(100%, 860px); }
.docs-figure figcaption { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-subtle); text-align: center; }

.docs-callout {
  display: flex; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md);
  background: var(--surface-sunken); border: 1px solid var(--line); margin: var(--space-4) 0; font-size: var(--text-sm);
}
.docs-callout strong { display: block; margin-bottom: 2px; }
.docs-callout--tip { border-inline-start: 3px solid var(--brand); }
.docs-callout--warn { border-inline-start: 3px solid var(--warning, #b8860b); }
.docs-callout--example { border-inline-start: 3px solid var(--info); background: var(--surface); }
.docs-callout--example strong::before { content: "▸ "; color: var(--info); }

/* "Before you start" / "Where" quick facts above the steps */
.docs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); margin: var(--space-4) 0; }
.docs-facts > div { padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); font-size: var(--text-sm); }
.docs-facts dt { font-size: var(--text-2xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-subtle); margin-bottom: 2px; }
.docs-facts dd { margin: 0; color: var(--text); }
.docs-article__steps ul { margin: var(--space-1) 0 var(--space-2); padding-inline-start: var(--space-5); color: var(--text-muted); }
.docs-article__steps li li { margin-bottom: 2px; }
.docs-ui { font-weight: 600; color: var(--text); }
.docs-status { display: inline-block; font-size: .85em; font-weight: 600; padding: 0 7px; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--text); white-space: nowrap; }

/* zoomed screenshot overlay */
.docs-zoom { position: fixed; inset: 0; z-index: var(--z-modal, 1000); background: rgba(13,33,29,.82); display: flex; align-items: center; justify-content: center; padding: var(--space-6); cursor: zoom-out; }
.docs-zoom img { max-width: 100%; max-height: 100%; border-radius: var(--radius-md); box-shadow: var(--elev-3); background: var(--surface); }

.docs-article h2 { font-size: var(--text-xl); margin: var(--space-7) 0 var(--space-3); }
.docs-article table { width: 100%; border-collapse: collapse; margin: var(--space-4) 0; font-size: var(--text-sm); }
.docs-article th, .docs-article td { text-align: start; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
.docs-article th { color: var(--text-subtle); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .03em; }

.docs-article__pager {
  display: flex; justify-content: space-between; gap: var(--space-4);
  margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--line);
}
.docs-article__pager-link {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text);
  max-width: 45%;
}
.docs-article__pager-link span { font-size: var(--text-xs); color: var(--text-subtle); }
.docs-article__pager-link strong { color: var(--brand); }
.docs-article__pager-link--next { text-align: end; margin-inline-start: auto; }
.docs-domain-grid > .panel, .docs-article-cards .panel { margin: 0; }
