/* ═══════════════════════════════════════════════════════════════════
   TrustDID concept-B docs layer — long-form content styles.
   Include AFTER /site.css on documentation-style pages:
     <link rel="stylesheet" href="/site.css">
     <link rel="stylesheet" href="/docs.css">
   Provides typography and building blocks so converted pages need
   little or no page-specific CSS.
   ═══════════════════════════════════════════════════════════════════ */

.doc { padding: 40px 0 60px; }

.doc-head { text-align: center; padding: 20px 0 34px; animation: rise 0.9s ease both; }
.doc-head h1 {
    font-family: var(--font-head); font-weight: 700;
    font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12;
    letter-spacing: -0.03em; margin-bottom: 16px;
}
.doc-head .doc-sub { font-size: 1.08rem; color: var(--muted); max-width: 640px; margin: 0 auto; }
.doc-head .doc-sub strong { color: var(--text); }

/* ── Body typography ── */
.doc h2 {
    font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em;
    font-size: clamp(1.4rem, 3.5vw, 1.8rem); margin: 46px 0 14px;
}
.doc h3 {
    font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em;
    font-size: 1.15rem; margin: 30px 0 10px;
}
.doc p, .doc li { color: var(--muted); font-size: 1.02rem; }
.doc p { margin-bottom: 18px; }
.doc p strong, .doc li strong { color: var(--text); }
.doc a { color: var(--cyan); text-decoration: none; }
.doc a:hover { text-decoration: underline; }
/* Buttons are links too: .doc a (0,1,1) would otherwise beat the button
   classes (0,1,0) and paint their labels cyan. Restate at equal weight. */
.doc a.btn-primary { color: #05070f; }
.doc a.btn-ghost { color: var(--text); }
.doc a.btn-sm { color: #05070f; }
.doc a.btn-sm--ghost { color: var(--text); }
/* Download-page tier buttons, same trap: cyan-on-cyan rendered the .tar.gz
   label at 1:1 contrast — invisible. Dark on the cyan gradient is 11:1. */
.doc a.btn-tier-dl { color: #05070f; }
.doc a.btn-tier-vrfy, .doc a.btn-vrfy { color: var(--green); }
.doc a.btn-tier-enroll { color: var(--amber); }
.doc a.btn-tier-contact { color: var(--violet); }
.doc a.btn-primary:hover, .doc a.btn-ghost:hover,
.doc a.btn-sm:hover, .doc a.btn-sm--ghost:hover,
.doc a.btn-tier-dl:hover, .doc a.btn-tier-vrfy:hover, .doc a.btn-vrfy:hover,
.doc a.btn-tier-enroll:hover, .doc a.btn-tier-contact:hover { text-decoration: none; }
.doc ul, .doc ol { margin: 0 0 18px 22px; }
.doc li { margin-bottom: 8px; }

.doc code, .doc pre {
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
.doc code {
    font-size: 0.85em; color: var(--amber);
    background: rgba(0,0,0,0.35); padding: 1px 7px; border-radius: 5px;
    /* A long command or path has no natural break point, so on a phone it ran
       past the column and scrolled the whole user guide sideways. "anywhere"
       breaks only a token that would otherwise overflow; anything that fits
       is left exactly as it was. */
    overflow-wrap: anywhere;
}
.doc pre {
    background: rgba(0,0,0,0.35); border: 1px solid var(--line);
    border-radius: 12px; padding: 16px 20px; margin: 0 0 20px;
    overflow-x: auto; font-size: 0.85rem; line-height: 1.55; color: var(--text);
}
/* Inside <pre> the block scrolls (overflow-x:auto above) rather than wrapping;
   white-space:pre permits no soft wrap anyway, so this is belt and braces. */
.doc pre code { background: none; padding: 0; color: inherit; overflow-wrap: normal; }

/* ── Tables ── */
.doc .tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 22px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.doc th {
    font-family: var(--font-head); font-weight: 600; font-size: 0.72rem;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
    text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line-2);
    background: var(--bg-2); white-space: nowrap;
}
.doc td { padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.doc tr:last-child td { border-bottom: none; }

/* ── Building blocks ── */
.doc .callout {
    background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--cyan);
    border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 0 0 20px;
    font-size: 0.95rem; color: var(--muted);
}
.doc .callout--warn { border-left-color: var(--amber); }
.doc .callout--danger { border-left-color: var(--red); }
.doc .callout strong { color: var(--text); }

.doc .card {
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    padding: 24px 26px; margin-bottom: 16px;
    transition: border-color 0.25s ease;
}
.doc .card:hover { border-color: var(--line-2); }
.doc .card h3 { margin-top: 0; }
/* minmax(0,1fr), not 1fr. Bare 1fr is minmax(auto,1fr): a card holding a
   <pre> with one long command line contributes that line's width as its
   min-content, and the track grows past its share -- on /signing/ two
   columns resolved to 1210px inside an 804px grid and the page scrolled
   sideways. The pre's own overflow-x:auto cannot help, because the grid
   item is the card, whose min-width:auto inherits the pre's intrinsic
   width. A 0 floor lets the track shrink and the pre scroll as intended. */
.doc .card-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 720px) { .doc .card-grid { grid-template-columns: minmax(0, 1fr); } }

.doc details.fold {
    border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 10px;
}
.doc details.fold summary {
    cursor: pointer; padding: 15px 20px; font-weight: 500; font-size: 0.98rem; color: var(--text);
    font-family: var(--font-body);
}
.doc details.fold summary:hover { color: var(--cyan); }
.doc details.fold .fold-body { padding: 0 20px 16px; }

.doc .step-list { counter-reset: step; list-style: none; margin-left: 0; }
.doc .step-list > li {
    counter-increment: step; position: relative; padding: 0 0 18px 52px; margin: 0;
}
.doc .step-list > li::before {
    content: counter(step);
    position: absolute; left: 0; top: -2px;
    font-family: var(--font-head); font-weight: 700; font-size: 0.9rem;
    color: #05070f; background: linear-gradient(135deg, var(--cyan), #0891b2);
    border-radius: 9px; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
}

.doc .btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 22px; }
.doc .btn-sm {
    font-family: var(--font-head); font-weight: 600; font-size: 0.88rem;
    color: #05070f; text-decoration: none; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--cyan), #0891b2);
    padding: 11px 20px; border-radius: 9px;
}
.doc .btn-sm--ghost {
    color: var(--text); background: none; border: 1px solid var(--line-2);
}
.doc .btn-sm--ghost:hover { border-color: var(--cyan); }

.doc .pill-tag {
    display: inline-block; font-family: var(--font-head); font-weight: 600;
    font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
    border-radius: 999px; padding: 3px 10px; white-space: nowrap;
    color: var(--dim); border: 1px solid var(--line-2);
}
.doc .pill-tag--green { color: var(--green); border-color: rgba(16,185,129,0.4); }
.doc .pill-tag--amber { color: var(--amber); border-color: rgba(245,158,11,0.45); }
