/* ── Typography — Gold on Midnight ── */
/* Scope: base text elements for app chrome and long-form document reading.
   Layout (sidebar, grid) → main.css | Widget skins (cards, timeline, callouts) → components.css */

/* ── Base ── */

body {
    font-family: var(--serif);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Display headings — Fraunces ── */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--disp);
    color: var(--ink);
    line-height: 1.15;
}

h1 {
    font-weight: 600;
    font-size: clamp(28px, 4.2vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.012em;
}

h2 {
    font-weight: 500;
    font-size: 24px;
    letter-spacing: -0.01em;
}

h3 {
    font-weight: 500;
    font-size: 19px;
    letter-spacing: -0.006em;
}

h4 {
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0;
}

/* ── Global links ── */

a {
    color: var(--gold-bright);
    text-decoration: none;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--gold-dim);
}

/* ── Label / kicker / mono utility classes ── */

.kick {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.kick::after {
    content: "";
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, var(--gold-dim), transparent);
}

.label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
}

.mono {
    font-family: var(--mono);
}

/* ── Small / metadata text ── */

small,
.text-sm {
    font-size: 0.8125rem;
    color: var(--muted);
}

.text-muted { color: var(--muted); }
.text-faint  { color: var(--faint); }

/* ── Horizontal rule ── */

hr {
    border: none;
    border-top: 1px solid var(--hair);
    margin: 2.5rem 0;
}

/* ══════════════════════════════════════════════════
   DOCUMENT READING — article.document-body
   Markdown-rendered content inside /doc/<slug>
   ══════════════════════════════════════════════════ */

.document-body {
    font-family: var(--serif);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ink);
}

/* -- Document headings -- */

.document-body h1 {
    font-family: var(--disp);
    font-weight: 600;
    font-size: clamp(26px, 3.8vw, 40px);
    line-height: 1.1;
    letter-spacing: -0.012em;
    margin: 2.5rem 0 1rem;
    color: var(--ink);
}

.document-body h2 {
    font-family: var(--disp);
    font-weight: 500;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--hair);
    color: var(--ink);
}

.document-body h3 {
    font-family: var(--disp);
    font-weight: 500;
    font-size: 19px;
    line-height: 1.25;
    letter-spacing: -0.006em;
    margin: 2rem 0 0.75rem;
    color: var(--ink);
}

.document-body h4 {
    font-family: var(--disp);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.35;
    margin: 1.5rem 0 0.5rem;
    color: var(--muted);
}

/* Anchor links on headings (generated by markdown toc extension) */
.document-body h2 .headerlink,
.document-body h3 .headerlink,
.document-body h4 .headerlink {
    color: var(--faint);
    font-size: 0.75em;
    margin-left: 0.5em;
    text-decoration: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.document-body h2:hover .headerlink,
.document-body h3:hover .headerlink,
.document-body h4:hover .headerlink {
    opacity: 1;
}

/* -- Paragraphs -- */

.document-body p {
    font-family: var(--serif);
    line-height: 1.75;
    margin-bottom: 1.1rem;
    max-width: 68ch;
    color: var(--ink);
}

/* -- Strong / Em -- */

.document-body strong {
    font-weight: 600;
    color: var(--ink);
}

.document-body em {
    font-style: italic;
    color: var(--muted);
}

/* -- Links inside document -- */

.document-body a {
    color: var(--gold-bright);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--gold-dim);
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.document-body a:hover {
    color: var(--ink);
    text-decoration-color: var(--gold);
}

/* content.py-generated link classes */
.internal-link {
    color: var(--gold-bright);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--gold-dim);
}

.internal-link:hover {
    color: var(--ink);
    text-decoration-color: var(--gold);
}

.external-ref {
    color: var(--faint);
    font-style: italic;
}

/* -- Lists -- */

.document-body ul,
.document-body ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
    max-width: 68ch;
}

.document-body li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
}

.document-body li::marker {
    color: var(--gold);
}

/* -- Blockquote -- */

.document-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--gold);
    background: rgba(216, 179, 106, 0.05);
    border-radius: 0 var(--r) var(--r) 0;
    font-family: var(--serif);
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--muted);
}

.document-body blockquote p {
    margin-bottom: 0.5rem;
    max-width: none; /* inside blockquote, don't cap width again */
}

.document-body blockquote p:last-child {
    margin-bottom: 0;
}

.document-body blockquote strong {
    color: var(--ink);
    font-weight: 600;
}

/* quote-* skins (whatsapp, testimony, legal, alert) live in components.css */

/* -- Code / Pre -- */

.document-body code {
    font-family: var(--mono);
    font-size: 0.875em;
    padding: 0.15em 0.4em;
    background: var(--hair);
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--gold-bright);
}

.document-body pre {
    margin: 1.25rem 0;
    padding: 1.25rem;
    background: var(--panel-2);
    border: 1px solid var(--hair);
    border-radius: var(--r);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 100%;
}

.document-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--ink);
    font-size: inherit;
}

/* -- HR inside document -- */

.document-body hr {
    margin: 2.5rem 0;
    border: none;
    border-top: 1px solid var(--hair);
}

/* -- Images -- */

.document-body img {
    max-width: 100%;
    border-radius: var(--r);
    margin: 1rem 0;
    display: block;
}

/* -- Checkboxes (Obsidian task lists) -- */

.document-body input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--line);
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 0.5rem;
    position: relative;
    cursor: default;
    transition: all var(--transition-fast);
    background: transparent;
}

.document-body input[type="checkbox"]:checked {
    background: var(--gold);
    border-color: var(--gold);
}

.document-body input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
