/*
 * The public datasheet list. Hand-written and static on purpose: the deploy workflow has no
 * frontend build step (it runs `npm ci` only when the lockfile moved), so a Vite/Tailwind
 * pipeline here would be a new deploy dependency for one page.
 */

:root {
    --ink: #111827;
    --ink-soft: #6b7280;
    --line: #e5e7eb;
    --line-soft: #f3f4f6;
    --surface: #ffffff;
    --canvas: #f9fafb;
    --accent: #b45309;
    --accent-soft: #fef3c7;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--canvas);
}

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- Header -------------------------------------------------------------------------- */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
}

.brand {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}

.brand span { color: var(--accent); }

/* ---- Type ---------------------------------------------------------------------------- */

h1 {
    margin: 32px 0 4px;
    font-size: 24px;
    letter-spacing: -0.02em;
}

.lede {
    margin: 0 0 24px;
    color: var(--ink-soft);
}

.result-count {
    margin: 20px 0 10px;
    font-size: 13px;
    color: var(--ink-soft);
}

/* ---- Buttons ------------------------------------------------------------------------- */

.button {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.button:hover { background: #000; }

.button-ghost {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

.button-ghost:hover { background: var(--line-soft); }

.button-small { padding: 5px 10px; font-size: 13px; }

/* ---- Filters ------------------------------------------------------------------------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.field-grow { flex: 1 1 260px; }

.field > span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
}

.field input,
.field select {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font: inherit;
    color: var(--ink);
}

.field input:focus,
.field select:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}

.field-actions {
    flex-direction: row;
    gap: 8px;
    min-width: 0;
}

/* ---- Table --------------------------------------------------------------------------- */

.table-scroll {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

table.datasheets {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.datasheets th,
table.datasheets td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

table.datasheets thead th {
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
}

table.datasheets tbody tr + tr td { border-top: 1px solid var(--line-soft); }

table.datasheets tbody tr:hover { background: var(--canvas); }

.numeric { text-align: right; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

.empty {
    padding: 40px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    color: var(--ink-soft);
}

.empty p { margin: 4px 0; }

/* ---- Pagination ---------------------------------------------------------------------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 20px 0;
    font-size: 14px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}

.pagination a:hover { background: var(--line-soft); }

.pagination .is-current {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.pagination .is-disabled,
.pagination .is-gap {
    border-color: transparent;
    background: none;
    color: var(--ink-soft);
}

.pagination .page-of {
    margin-left: auto;
    border-color: transparent;
    background: none;
    color: var(--ink-soft);
    font-size: 13px;
}

/* ---- Footer -------------------------------------------------------------------------- */

.site-footer {
    margin: 40px auto;
    font-size: 12px;
    color: var(--ink-soft);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---- Phone width: the table becomes a stack of cards --------------------------------- */

@media (max-width: 720px) {
    .table-scroll { border: 0; background: none; }

    table.datasheets thead { display: none; }

    table.datasheets tbody tr {
        display: block;
        margin-bottom: 12px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }

    table.datasheets tbody tr + tr td { border-top: 0; }

    table.datasheets td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding: 8px 14px;
        white-space: normal;
        text-align: right;
    }

    table.datasheets td + td { border-top: 1px solid var(--line-soft); }

    table.datasheets td::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--ink-soft);
        text-align: left;
    }

    .field, .field-grow { flex: 1 1 100%; }
}
