/* ==========================================================================
   azul-docs.css - shared shell + content styles for ALL docs pages
   (api / guide / releases / donate / blog). Layers on top of azlin.css
   (tokens, .navbar, .container, .btn) - same recipe as the marketing
   frontpage and /ui landing: floating glass navbar, 1200px canvas,
   narrow reading measure, oversized serif openers, hairlines not boxes.

   Rearchitecture note (2026-07-04): this file REPLACES main.css and every
   per-page inline <style> block (API_CSS, donation_css, release styles).
   Page-family specifics live in docs-*.css next to this file; nothing is
   allowed to inline ad-hoc CSS in Rust strings anymore.
   ========================================================================== */

body.docs {
    background: var(--color-bg);
    color: var(--color-text);
}

/* ---- Page opener ("airy" subpage treatment: no hero, big heading in
        whitespace; the fixed navbar needs ~170px clearance) ---- */
.docs-hero {
    padding: 170px 0 16px;
}
.docs-hero .docs-eyebrow {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 12px;
}
.docs-hero h1 {
    font-family: var(--font-serif);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: var(--color-text);
}
.docs-hero .docs-lede {
    font-family: var(--font-sans);
    font-size: 19px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--color-text-light);
    max-width: 720px;
    text-wrap: balance;
    margin: 0 0 8px;
}

/* ---- Body / measure ---- */
.docs-body {
    padding: 32px 0 96px;
}
.docs-content {
    max-width: 820px;
}
.docs-content.docs-wide {
    max-width: none;
}

/* ---- Prose ---- */
.docs-content p,
.docs-content li {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.8;
    color: var(--color-text);
}
.docs-content p { margin: 0 0 20px; }
.docs-content ul,
.docs-content ol { margin: 0 0 20px; padding-left: 28px; }
.docs-content li { margin-bottom: 8px; }
.docs-content h2 {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 56px 0 20px;
}
.docs-content h3 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 16px;
}
.docs-content h4 {
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 700;
    margin: 32px 0 12px;
}
.docs-content h2:first-child,
.docs-content h3:first-child { margin-top: 0; }

/* Links: accent + underline - NEVER default browser blue. :visited is
   pinned too (the old pages' unreadable-blue CTA bug came from unstyled
   visited links). */
.docs-content a,
.docs-content a:visited {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}
.docs-content a:hover {
    color: var(--color-accent-hover);
    border-bottom-color: currentColor;
}

.docs-content blockquote {
    margin: 0 0 20px;
    padding: 12px 20px;
    border-left: 3px solid var(--color-accent);
    background: white;
    border-radius: 0 8px 8px 0;
    color: var(--color-text-light);
}
.docs-content blockquote p:last-child { margin-bottom: 0; }
.docs-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 48px 0;
}
.docs-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 32px rgba(0, 4, 40, 0.10);
    margin: 8px 0 24px;
}

/* ---- Code ---- */
.docs-content code,
.docs-content kbd {
    font-family: "Red Hat Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
    background: #eceae7;
    border-radius: 4px;
    padding: 2px 6px;
}
.docs-content pre {
    position: relative;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 18px 20px;
    overflow-x: auto;
    margin: 0 0 24px;
    box-shadow: 0 4px 16px rgba(0, 4, 40, 0.05);
}
.docs-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: white;
    color: var(--color-text-light);
    cursor: pointer;
    opacity: 0.8;
    box-shadow: 0 1px 4px rgba(0, 4, 40, 0.08);
}
.docs-copy-btn:hover { opacity: 1; color: var(--color-text); }
.docs-content pre code {
    background: transparent;
    padding: 0;
    font-size: 13.5px;
    line-height: 1.55;
}
/* Neutralize Prism default-theme backgrounds (beige pre + translucent
   boxes behind operator tokens) - our white pre card is the background. */
.docs-content pre[class*="language-"] {
    background: white;
    margin: 0 0 24px;
    padding: 18px 20px;
}
.docs-content code[class*="language-"] { background: transparent; }
.docs-content .token.operator,
.docs-content .token.entity,
.docs-content .token.url {
    background: none;
}

/* ---- Tables ---- */
.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 24px;
    font-size: 15px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}
.docs-content th {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    color: var(--color-text-light);
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}
.docs-content td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}
.docs-content tr:last-child td { border-bottom: none; }

/* ---- Index/list pages: hairline lists (erp-style, no cards) ---- */
.docs-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 900px;
}
.docs-list-item {
    padding-bottom: 40px;
    border-bottom: 1px solid var(--color-border);
}
.docs-list-item:last-child { border-bottom: none; }
.docs-list-item h3 {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px;
}
.docs-list-item h3 a,
.docs-list-item h3 a:visited {
    color: var(--color-text);
    text-decoration: none;
}
.docs-list-item h3 a:hover { color: var(--color-accent); }
.docs-list-item .docs-meta {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 12px;
}
.docs-list-item p {
    font-size: 17px;
    line-height: 1.7;
    color: var(--color-text-light);
    text-wrap: balance;
    margin: 0 0 12px;
}
.docs-read-more,
.docs-read-more:visited {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
}
.docs-read-more:hover { text-decoration: underline; }

/* ---- Card grid (download/link tiles where a list is too sparse) ---- */
.docs-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 0 0 24px;
}
.docs-card {
    display: block;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px 22px;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.docs-card:visited { color: var(--color-text); }
a.docs-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 4, 40, 0.10);
}
.docs-card h4 {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
}
.docs-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-light);
    margin: 0;
}

/* ---- Footer (same voice as the /ui landing footer) ---- */
.docs-footer {
    border-top: 1px solid var(--color-border);
    background: white;
    padding: 44px 0;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--color-text-light);
}
.docs-footer p { margin: 0; }
.docs-footer a,
.docs-footer a:visited { color: var(--color-accent); text-decoration: none; }
.docs-footer a:hover { text-decoration: underline; }

/* ---- Inline search mount on docs pages ---- */
.docs-hero #azul-search-mount { max-width: 520px; margin-top: 20px; }

/* ---- Sticky search rail (api / release / blog-post pages) ----
   Content keeps its reading measure; the API search box lives in the
   right gutter and stays on screen while scrolling, so results expand
   NEXT TO the content instead of pushing it around. */
.docs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 48px;
    align-items: start;
}
.docs-search-rail {
    position: sticky;
    top: 96px;
    min-width: 0;
}
@media (max-width: 1024px) {
    .docs-layout { grid-template-columns: 1fr; }
    /* On mobile the search bar goes ABOVE the content (after the page
       heading - never before it). */
    .docs-search-rail { position: static; order: -1; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .docs-hero { padding: 130px 0 8px; }
    .docs-hero h1 { font-size: 40px; }
    .docs-hero .docs-lede { font-size: 17px; }
    .docs-content h2 { font-size: 27px; margin-top: 44px; }
    .docs-content h3 { font-size: 21px; }
    .docs-list-item h3 { font-size: 24px; }
}
@media (max-width: 480px) {
    .docs-hero h1 { font-size: 33px; }
}
