/* Hook documentation stylesheet */

:root {
    --text:        #2d333b;
    --text-light:  #57606a;
    --bg:          #ffffff;
    --bg-alt:      #f6f8fa;
    --bg-code:     #f0f3f6;
    --border:      #d0d7de;
    --border-light:#e1e4e8;
    --accent:      #0969da;
    --accent-hover:#0550ae;
    --heading:     #1f2328;
    --link:        #0969da;
    --link-hover:  #0550ae;
    --table-stripe:#f6f8fa;
    --inline-code: #eff1f3;
    --shadow:      rgba(31, 35, 40, 0.04);
}

@media (prefers-color-scheme: dark) {
    :root {
        --text:        #c9d1d9;
        --text-light:  #8b949e;
        --bg:          #0d1117;
        --bg-alt:      #161b22;
        --bg-code:     #1c2129;
        --border:      #30363d;
        --border-light:#21262d;
        --accent:      #58a6ff;
        --accent-hover:#79c0ff;
        --heading:     #e6edf3;
        --link:        #58a6ff;
        --link-hover:  #79c0ff;
        --table-stripe:#161b22;
        --inline-code: #1c2129;
        --shadow:      rgba(0, 0, 0, 0.2);
    }
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
                 Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background-color: var(--bg);
    max-width: 52em;
    margin: 0 auto;
    padding: 2em 2em 4em;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    font-weight: 600;
    line-height: 1.25;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border);
}

h2 {
    font-size: 1.5em;
    padding-bottom: 0.2em;
    border-bottom: 1px solid var(--border-light);
}

h3 { font-size: 1.25em; }
h4 { font-size: 1em; }

/* Links */
a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Paragraphs and lists */
p, ul, ol {
    margin-top: 0;
    margin-bottom: 1em;
}

li + li {
    margin-top: 0.25em;
}

/* Code */
code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.875em;
    background-color: var(--inline-code);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

pre {
    background-color: var(--bg-code);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1em;
    overflow-x: auto;
    line-height: 1.45;
    margin-bottom: 1em;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.85em;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
    overflow-x: auto;
    display: block;
}

thead th {
    background-color: var(--bg-alt);
    font-weight: 600;
}

th, td {
    border: 1px solid var(--border);
    padding: 0.5em 0.75em;
    text-align: left;
}

tbody tr:nth-child(even) {
    background-color: var(--table-stripe);
}

/* Blockquotes */
blockquote {
    margin: 0 0 1em 0;
    padding: 0.5em 1em;
    border-left: 3px solid var(--accent);
    color: var(--text-light);
    background-color: var(--bg-alt);
    border-radius: 0 4px 4px 0;
}

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

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}

/* Strong and emphasis */
strong {
    color: var(--heading);
    font-weight: 600;
}

/* Navigation bar */
nav.doc-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75em 0;
    border-top: 1px solid var(--border-light);
    margin-top: 3em;
    font-size: 0.9em;
}

nav.doc-nav a {
    color: var(--link);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
}

nav.doc-nav a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

nav.doc-nav .nav-prev::before { content: "\2190\00a0"; }
nav.doc-nav .nav-next::after  { content: "\00a0\2192"; }

nav.doc-nav .nav-index {
    color: var(--text-light);
}

/* Hide pandoc title-block on doc pages (breadcrumb + content h1 is sufficient).
   Pages without .doc-breadcrumb (index, README) keep the title visible. */
body:has(.doc-breadcrumb) > #title-block-header {
    display: none;
}

/* Top breadcrumb */
.doc-breadcrumb {
    font-size: 0.85em;
    margin-bottom: 1.5em;
    color: var(--text-light);
}

.doc-breadcrumb a {
    color: var(--text-light);
}

.doc-breadcrumb a:hover {
    color: var(--link-hover);
}

/* Print styles */
@media print {
    body {
        max-width: none;
        padding: 1cm;
        color: #000;
        background: #fff;
    }
    nav.doc-nav, .doc-breadcrumb {
        display: none;
    }
    pre {
        border-color: #ccc;
    }
    a { color: #000; }
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    nav a[href]::after { content: none; }
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 1em;
    }
    table {
        font-size: 0.85em;
    }
    h1 { font-size: 1.6em; }
    h2 { font-size: 1.3em; }
}
