/* ============================================================
   NOVIRA — help-docs.css
   Documentation components for the Katha Studio and Novira
   Translate guides. Layered on help-guide.css (uses its .hg
   tokens). Restrained: neutral surfaces, hairlines, one cream
   accent for state and emphasis. No icons standing in for words.
   ============================================================ */

/* ── At a glance: plain facts, read before anything else ──── */
.hd-glance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 48px;
  border-top: 1px solid var(--line);
}
.hg-doc-header + .hd-glance { margin-top: -48px; border-top: 0; }
.hd-glance > div {
  padding: 16px 20px 16px 0;
  border-bottom: 1px solid var(--line);
}
.hd-glance > div:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
.hd-glance dt {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 4px;
}
.hd-glance dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
  text-wrap: pretty;
}
@media (max-width: 560px) {
  .hd-glance { grid-template-columns: 1fr; }
  .hd-glance > div:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* ── Real product captures (marketing/key-visuals/capture-*.js) ── */
.hd-shot { margin: 8px 0 28px; }
.hd-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #0f0f11;
}
.hd-shot.is-narrow img { width: min(100%, 320px); }

/* ── Status flow: how a chapter moves ──────────────────────── */
.hd-flow {
  list-style: none;
  margin: 8px 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.hd-flow li {
  position: relative;
  margin: 0;
  padding: 18px 18px 20px;
  background: var(--surface);
}
.hd-flow li + li { border-left: 1px solid var(--line); }
.hd-flow li + li::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 24px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--line-2);
  border-right: 1px solid var(--line-2);
  background: var(--surface);
  transform: rotate(45deg);
}
.hd-flow-name {
  display: block;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.hd-flow-lock {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}
.hd-flow-lock.is-open { color: var(--accent); }
.hd-flow-text { display: block; font-size: 0.84rem; line-height: 1.55; color: var(--body); }
.hd-flow-loop {
  margin: 0 0 28px;
  font-size: 0.86rem;
  color: var(--muted);
}
.hd-flow-loop strong { color: var(--ink); }
@media (max-width: 760px) {
  .hd-flow { grid-template-columns: 1fr; }
  .hd-flow li + li { border-left: 0; border-top: 1px solid var(--line); }
  .hd-flow li + li::before { left: 24px; top: -6px; transform: rotate(135deg); }
}

/* ── Processing stages: a real, ordered sequence ───────────── */
.hd-stages {
  list-style: none;
  counter-reset: hdstage;
  margin: 8px 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  border-top: 1px solid var(--line);
}
.hd-stages li {
  counter-increment: hdstage;
  margin: 0;
  padding: 16px 16px 18px 0;
  border-bottom: 1px solid var(--line);
}
.hd-stages li::before {
  content: counter(hdstage);
  display: block;
  margin-bottom: 10px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--accent);
}
.hd-stages b { display: block; color: var(--ink); font-size: 0.92rem; margin-bottom: 4px; }
.hd-stages span { display: block; font-size: 0.84rem; line-height: 1.55; color: var(--body); }

/* ── Known limits: stated once, plainly ────────────────────── */
.hd-limits { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--line); }
.hd-limits li {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 8px 24px;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.hd-limits b { color: var(--ink); font-weight: 600; }
.hd-limits span { color: var(--body); }
@media (max-width: 640px) {
  .hd-limits li { grid-template-columns: 1fr; gap: 2px; }
}

/* ── Credit figure (HTML, scales with type) ───────────────── */
.hd-cost {
  margin: 0 0 12px;
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.hd-cost-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.hd-cost-row > b { color: var(--ink); font-size: 0.88rem; font-weight: 600; }
.hd-cost-row > span:last-child { color: var(--ink); font-size: 0.88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hd-units { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.hd-group { display: flex; gap: 3px; }
.hd-units i { width: 12px; height: 10px; border-radius: 2px; background: var(--accent); }
.hd-group + .hd-group i { background: rgba(232, 213, 183, 0.55); }

/* Area equivalence */
.hd-area {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin: 0 0 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.hd-area-shape { display: grid; gap: 6px; justify-items: start; }
.hd-area-shape small { font-size: 0.74rem; color: var(--muted); }
.hd-strip, .hd-pages { display: grid; gap: 3px; }
.hd-strip i { display: block; width: 40px; height: 116px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); }
.hd-pages i { display: block; width: 40px; height: 26.75px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); }
.hd-area-eq { color: var(--muted); font-size: 1.1rem; }
.hd-area-copy { color: var(--body); font-size: 0.9rem; line-height: 1.55; }
.hd-area-copy b { display: block; color: var(--ink); margin-bottom: 2px; }
.hd-area-wrap { display: flex; align-items: center; gap: 20px; }
@media (max-width: 560px) {
  .hd-area { grid-template-columns: 1fr; }
}

/* Base prose list styles (.hg-main ol/ul/li) outrank single classes. */
.hg-main .hd-flow,
.hg-main .hd-stages,
.hg-main .hd-limits { padding-left: 0; }
.hg-main .hd-flow li,
.hg-main .hd-stages li,
.hg-main .hd-limits li { margin-bottom: 0; }

.hg-main code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.86em;
  white-space: nowrap;
}


/* ============================================================
   Help centre index (/help)
   One column, 1080px. Search covers guides and questions. The
   products image sits directly above the three guide cards so
   its three panels line up with them.
   ============================================================ */
.hc-shell { max-width: 1080px; margin: 0 auto; padding: 120px clamp(20px, 5vw, 40px) 96px; }
.hc-head { max-width: 46rem; margin: 0 0 32px; }
.hc-head h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: balance;
}
.hc-head h1 em { font-style: italic; color: var(--accent); }
.hc-head p { margin: 0; font-size: 1.1rem; color: var(--muted); line-height: 1.6; text-wrap: pretty; }

.hc-search { position: relative; max-width: 40rem; margin: 0 0 56px; }
.hc-search svg { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); pointer-events: none; }
.hc-search input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px 12px 46px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.hc-search input::placeholder { color: #8a8a93; }
.hc-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.hc-empty { display: none; margin: -32px 0 48px; color: var(--muted); }
.hc-empty.is-on { display: block; }

.hc-section { margin: 0 0 64px; }
.hc-section > h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 18px;
}

.hc-visual { margin: 0 0 16px; }
.hc-visual img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: #060607; }

.hc-guides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hc-guide {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 18px 20px 20px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--body);
  text-decoration: none;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.hc-guide:hover { border-color: var(--accent); background: var(--surface); }
.hc-guide:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hc-guide b { color: var(--ink); font-size: 1.02rem; font-weight: 600; }
.hc-guide span { font-size: 0.92rem; line-height: 1.5; }
.hc-guide i { font-style: normal; margin-top: 6px; color: var(--accent); font-size: 0.86rem; font-weight: 600; }
@media (max-width: 760px) {
  .hc-guides { grid-template-columns: 1fr; }
  /* Its three panels only map to the guides when the cards sit in a row. */
  .hc-visual { display: none; }
}

.hc-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 8px 40px; }
.hc-topic h3 { margin: 0 0 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.hc-q { border-bottom: 1px solid var(--line); }
.hc-q summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 12px 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  list-style: none;
}
.hc-q summary::-webkit-details-marker { display: none; }
.hc-q summary::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms var(--ease);
}
.hc-q[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.hc-q summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hc-q p { margin: 0 0 16px; color: var(--body); font-size: 0.95rem; line-height: 1.65; text-wrap: pretty; }
.hc-q a { color: var(--accent); text-underline-offset: 3px; }

.hc-contact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.hc-contact a {
  display: grid;
  gap: 4px;
  padding: 20px 20px 20px 0;
  color: var(--body);
  text-decoration: none;
}
.hc-contact a + a { padding-left: 20px; border-left: 1px solid var(--line); }
.hc-contact b { color: var(--ink); font-weight: 600; }
.hc-contact span { font-size: 0.9rem; }
.hc-contact a:hover b { color: var(--accent); }
@media (max-width: 760px) {
  .hc-contact { grid-template-columns: 1fr; }
  .hc-contact a + a { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .hc-guide, .hc-q summary::after { transition: none; }
}
