/* apelayo.com shared theme.
   Served at https://apelayo.com/assets/css/theme.css and loaded by the
   subdomain apps (Dash: external_stylesheets=[...]). Keep this file to
   tokens, base elements, and generic components; page-specific styles
   belong in each site's own stylesheet. Apps override tokens such as
   --measure in their own CSS, which loads after this file. */

:root {
    color-scheme: light;
    --bg: #fafaf9;
    --surface: #f2f1ee;
    --text: #111110;
    --muted: #6b6a66;
    --border: #e4e3de;

    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --measure: 40rem;
    --radius: 6px;
    --radius-sm: 4px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #111110;
        --surface: #1a1a18;
        --text: #ececea;
        --muted: #9a9993;
        --border: #2a2a28;
    }
}

html {
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.6;
}

body {
    margin: 0;
    padding: 3rem 1.25rem;
    background: var(--bg);
    color: var(--text);
}

nav, header, main, footer {
    max-width: var(--measure);
    margin-inline: auto;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin-bottom: 3rem;
}

nav a {
    color: var(--muted);
    text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
    color: var(--text);
}

h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

h2, h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

p {
    margin: 0 0 1rem;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s;
}

a:hover {
    text-decoration-color: currentColor;
}

img {
    max-width: 100%;
}

code, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

pre {
    padding: 0.75rem;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

table {
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.35rem 0.75rem 0.35rem 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    font-weight: 600;
}

/* Form controls inherit the page font and colors so Dash inputs,
   dropdowns and buttons match the site instead of browser defaults. */
input, select, textarea, button {
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.5rem;
}

button, .btn {
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.6rem;
}

button:hover, .btn:hover {
    border-color: var(--muted);
}

/* Generic components. */
.muted {
    color: var(--muted);
}

.card {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tags li {
    font-size: 0.8rem;
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
