/* style.css — shared theme for the datalog-dafsa documentation site. */

/* ─── Reset ─────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #1f2328;
    background: #ffffff;
    font-size: 16px;
}

/* ─── Layout ────────────────────────────────────────────────────────── */

.wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ─── Sticky top navigation ─────────────────────────────────────────── */

.site {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #0d1117;
    color: #e6edf3;
    border-bottom: 1px solid #30363d;
}

.site .wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.site .brand {
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    font-size: 17px;
    margin-right: 8px;
}

.site nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.site nav a {
    color: #c9d1d9;
    text-decoration: none;
    font-size: 14px;
}

.site nav a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Prominent "Playground" nav item (call to action). */
.site nav a.nav-cta {
    color: #ffffff;
    background: #238636;
    border-radius: 14px;
    padding: 2px 12px;
    font-weight: 600;
}
.site nav a.nav-cta:hover {
    background: #2ea043;
    text-decoration: none;
}

/* ─── Front-and-center CTA banner ────────────────────────────────────── */

.cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #0d1117, #161b22);
    color: #e6edf3;
    border: 1px solid #30363d;
    border-left: 4px solid #238636;
    border-radius: 8px;
    padding: 18px 20px;
    margin: 1.2em 0;
    font-size: 1.02em;
}
.cta-banner strong { color: #7ee787; }
.cta-btn {
    display: inline-block;
    background: #238636;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}
.cta-btn:hover { background: #2ea043; color: #ffffff; }

/* ─── Typography ────────────────────────────────────────────────────── */

h1 { font-size: 1.9em; margin: 0.5em 0 0.4em; }
h2 { font-size: 1.45em; margin: 1.6em 0 0.5em; border-bottom: 1px solid #e2e4e8; padding-bottom: 0.2em; }
h3 { font-size: 1.15em; margin: 1.3em 0 0.4em; }
p  { margin: 0.6em 0; }

a { color: #0969da; }
a:visited { color: #8250df; }

code, .code {
    font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas,
                 "Liberation Mono", monospace;
    font-size: 0.9em;
}

p code, li code, td code, h2 code, h3 code {
    background: #f0f1f3;
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

/* ─── Code blocks ───────────────────────────────────────────────────── */

pre.code {
    background: #f6f8fa;
    border: 1px solid #e2e4e8;
    border-radius: 6px;
    padding: 12px 14px;
    overflow-x: auto;
    margin: 0.8em 0;
    line-height: 1.45;
    white-space: pre;
}

pre.code code {
    background: none;
    padding: 0;
    font-size: 0.9em;
}

/* ─── Feature / API tables ──────────────────────────────────────────── */

table.features {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}

table.features th,
table.features td {
    border: 1px solid #d0d7de;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

table.features th {
    background: #f6f8fa;
    font-weight: 600;
}

table.features tr:nth-child(even) td {
    background: #fafbfc;
}

table.api {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8em 0;
    font-size: 0.92em;
}

table.api th, table.api td {
    border: 1px solid #d0d7de;
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}

table.api th { background: #f6f8fa; font-weight: 600; }
table.api td:first-child { white-space: nowrap; }

/* ─── Headline feature cards ────────────────────────────────────────── */

.headline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 1em 0;
}

.headline-card {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-left: 4px solid #0969da;
    border-radius: 8px;
    padding: 14px 16px;
}

.headline-card h3 {
    margin-top: 0;
    font-size: 1.05em;
}

.headline-card p { font-size: 0.95em; }
.headline-card p:last-child { margin-bottom: 0; }

/* ─── Notes / callouts ──────────────────────────────────────────────── */

.note {
    background: #fff8c5;
    border-left: 4px solid #d4a72c;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 1em 0;
}

.warn {
    background: #ffebe9;
    border-left: 4px solid #cf222e;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 1em 0;
}

/* ─── Playground ─────────────────────────────────────────────────────── */

#program {
    width: 100%;
    font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas,
                 "Liberation Mono", monospace;
    font-size: 0.9em;
    line-height: 1.45;
    background: #f6f8fa;
    border: 1px solid #e2e4e8;
    border-radius: 6px;
    padding: 12px 14px;
    color: #1f2328;
    margin: 0.5em 0;
    resize: vertical;
    tab-size: 4;
}

.playground-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0.6em 0 1.2em;
}

.playground-controls label {
    font-weight: 600;
    font-size: 0.95em;
}

.playground-controls input[type="text"] {
    font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas,
                 "Liberation Mono", monospace;
    font-size: 0.95em;
    padding: 6px 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2328;
}

.playground-controls button {
    font-size: 0.95em;
    font-weight: 600;
    padding: 7px 18px;
    border: none;
    border-radius: 6px;
    background: #0969da;
    color: #ffffff;
    cursor: pointer;
}

.playground-controls button:hover {
    background: #0550ae;
}

#output {
    min-height: 4em;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ─── Footer ────────────────────────────────────────────────────────── */

footer.site-foot {
    margin-top: 3em;
    padding: 1.4em 0 2em;
    border-top: 1px solid #e2e4e8;
    color: #57606a;
    font-size: 0.85em;
}

/* ─── Dark mode ─────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    body {
        background: #0d1117;
        color: #e6edf3;
    }
    h2 { border-bottom-color: #30363d; }
    a { color: #58a6ff; }
    a:visited { color: #bc8cff; }
    p code, li code, td code, h2 code, h3 code {
        background: #2d333b;
    }
    pre.code {
        background: #161b22;
        border-color: #30363d;
    }
    #program {
        background: #161b22;
        border-color: #30363d;
        color: #e6edf3;
    }
    .playground-controls input[type="text"] {
        background: #0d1117;
        border-color: #30363d;
        color: #e6edf3;
    }
    table.features th,
    table.features td {
        border-color: #30363d;
    }
    table.features th { background: #161b22; }
    table.features tr:nth-child(even) td { background: #0d1117; }
    table.api th, table.api td { border-color: #30363d; }
    table.api th { background: #161b22; }
    .headline-card {
        background: #161b22;
        border-color: #30363d;
        border-left-color: #58a6ff;
    }
    .note {
        background: #3a2e00;
        border-left-color: #d4a72c;
        color: #f0e6c0;
    }
    .warn {
        background: #3d1a1e;
        border-left-color: #ff7b72;
        color: #ffd7d5;
    }
    footer.site-foot {
        border-top-color: #30363d;
        color: #8b949e;
    }
}
