/* Markaz POS website: the Help page (user guide). Uses the tokens from styles.css. */

.nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.mnav nav a[aria-current="page"] { color: var(--primary); }

.help { padding: 28px 0 72px; }
.help-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 960px) {
  .help { padding: 40px 0 96px; }
  .help-grid { grid-template-columns: 280px minmax(0, 1fr); gap: 48px; }
  .help-side { position: sticky; top: 88px; max-height: calc(100vh - 108px); display: flex; flex-direction: column; }
}

/* Sidebar */
.help-side { min-width: 0; }
.help-side-head { display: grid; gap: 14px; margin-bottom: 14px; }
.help-side .kicker svg { width: 16px; height: 16px; }
html[lang="ar"] .help-side .kicker { letter-spacing: 0; text-transform: none; font-size: 14px; }
.help-search {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--muted);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.help-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.help-search svg { width: 18px; height: 18px; }
.help-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.help-search input::placeholder { color: var(--muted); opacity: .8; }

.help-toc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 0; display: flex; flex-direction: column; }
.help-toc summary { cursor: pointer; padding: 12px 16px; font-weight: 650; font-size: 15px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.help-toc summary::-webkit-details-marker { display: none; }
.help-toc summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-top: -4px; transition: transform .2s var(--ease); }
.help-toc[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.help-toc nav { display: grid; gap: 2px; padding: 0 8px 10px; overflow: auto; }
.help-toc nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14.5px; line-height: 1.4; transition: background-color .15s var(--ease), color .15s var(--ease); }
.help-toc nav a:hover { background: var(--surface-2); color: var(--text); }
.help-toc nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
@media (min-width: 960px) {
  .help-toc { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; border: 0; background: transparent; overscroll-behavior: contain; scrollbar-width: thin; }
  .help-toc summary { display: none; }
  .help-toc nav { padding: 0 0 8px; margin-inline-start: -10px; overflow: visible; }
}

/* Main column */
.help-main { min-width: 0; max-width: 820px; }
.help-note { margin-bottom: 18px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 14.5px; }
.help-loading, .help-empty { color: var(--muted); }

.help-results { display: grid; gap: 12px; }
.help-results h1 { font-size: clamp(24px, 3vw, 30px); margin-bottom: 6px; }
.hit { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s var(--ease); }
.hit:hover { border-color: var(--primary); }
.hit-title { color: var(--primary); font-weight: 650; }
.hit-snippet { color: var(--muted); font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }

.help-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.pg { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); transition: border-color .15s var(--ease); min-width: 0; }
.pg:hover { border-color: var(--primary); }
.pg-next { text-align: end; grid-column: 2; }
.pg-label { font-size: 13px; color: var(--muted); }
.pg-title { font-weight: 600; overflow-wrap: anywhere; }

/* Rendered guide */
.md { font-size: 16.5px; line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.md > * + * { margin-top: 16px; }
.md h1, .md h2, .md h3, .md h4 { scroll-margin-top: 96px; }
.md h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 8px; }
.md h2 { font-size: clamp(21px, 2.6vw, 26px); margin-top: 44px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 19px; margin-top: 32px; }
.md h4, .md h5, .md h6 { font-size: 16.5px; margin-top: 24px; }
.md[dir="rtl"] h1, .md[dir="rtl"] h2, .md[dir="rtl"] h3 { letter-spacing: 0; line-height: 1.45; }
.md a { color: var(--primary); text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--primary) 45%, transparent); }
.md a:hover { text-decoration-color: var(--primary); }
.md strong { font-weight: 650; }
.md ul, .md ol { padding-inline-start: 1.5em; margin-bottom: 0; }
.md li + li { margin-top: 6px; }
.md li > * + * { margin-top: 8px; }
.md li > p { margin: 0; }
.md li::marker { color: var(--muted); }
.md code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; direction: ltr; unicode-bidi: isolate; }
.md pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; direction: ltr; text-align: left; }
.md pre code { background: none; border: 0; padding: 0; font-size: 14px; }
.md blockquote { margin-inline: 0; padding: 12px 16px; border-inline-start: 4px solid var(--primary); background: var(--primary-soft); border-start-end-radius: 12px; border-end-end-radius: 12px; }
.md blockquote > * + * { margin-top: 8px; }
.md img { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin: 8px 0; }
.md .md-missing-img { color: var(--muted); font-style: italic; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.md-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.md table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.md th, .md td { padding: 10px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.md th { background: var(--surface-2); font-weight: 650; white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
