/* Public site styles. Admin pages use app.css. */

:root {
    --paper: #f7f6f2;
    --surface: #ffffff;
    --ink: #1b1f23;
    --ink-2: #3d454d;
    --muted: #68717a;
    --rule: #e4e1d8;
    --rule-strong: #cdc9bd;
    --link: #1a4fb4;
    --link-hover: #0f3480;
    --accent: #c2410c;
    --header: #1b1f23;
    --code-bg: #f1efe8;
    --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, Menlo, monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --wrap: 1120px;
    --gutter: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 17px/1.6 var(--sans);
}

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.35rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.1rem; }

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

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

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

/* Header */

.site-header {
    background: var(--header);
    color: #fff;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 60px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    white-space: nowrap;
}

.logo:hover { color: #fff; }

.logo .led {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}

.logo small { color: #a7adb3; font-weight: 500; font-size: inherit; }

.site-nav {
    display: flex;
    gap: 1.25rem;
}

.site-nav a {
    color: #e6e8ea;
    text-decoration: none;
    font-size: 0.95rem;
}

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

.header-search {
    margin-left: auto;
    display: flex;
}

.header-search input {
    width: 240px;
    border: 1px solid #3c444c;
    border-right: 0;
    border-radius: 4px 0 0 4px;
    padding: 0.45rem 0.7rem;
    color: #fff;
    background: #2a3036;
    font: inherit;
    font-size: 0.92rem;
}

.header-search input::placeholder { color: #9aa1a8; }

.header-search button {
    border: 1px solid #3c444c;
    border-radius: 0 4px 4px 0;
    padding: 0 0.8rem;
    color: #fff;
    background: #343b42;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Page scaffolding */

main { padding-bottom: 3rem; }

.page-head {
    padding: 1.75rem 0 1.25rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 1.75rem;
}

.page-head .lede {
    max-width: 46rem;
    margin: 0;
    color: var(--ink-2);
    font-size: 1.05rem;
}

.page-head .meta {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { color: var(--rule-strong); }

.block { margin: 2.5rem 0; }

.block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 0.4rem;
    margin-bottom: 1rem;
}

.block-head h2 { margin: 0; font-size: 1.2rem; }
.block-head a { font-size: 0.92rem; }

.muted { color: var(--muted); }

.empty {
    color: var(--muted);
    padding: 1rem 0;
}

/* Home */

.home-hero {
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--rule);
}

.home-hero h1 {
    max-width: 40rem;
    font-size: clamp(1.9rem, 4vw, 2.75rem);
}

.home-hero .lede {
    max-width: 38rem;
    margin: 0 0 1.25rem;
    color: var(--ink-2);
    font-size: 1.1rem;
}

.search-large {
    display: flex;
    max-width: 38rem;
}

.search-large input {
    flex: 1;
    min-width: 0;
    border: 2px solid var(--ink);
    border-right: 0;
    border-radius: 6px 0 0 6px;
    padding: 0.75rem 0.9rem;
    font: inherit;
    background: var(--surface);
}

.search-large button {
    border: 2px solid var(--ink);
    border-radius: 0 6px 6px 0;
    padding: 0 1.25rem;
    color: #fff;
    background: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.search-large button:hover { background: #000; }

.quick-links {
    margin: 0.9rem 0 0;
    color: var(--muted);
    font-size: 0.93rem;
}

.quick-links a { margin-right: 0.6rem; white-space: nowrap; }

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.brand-grid a {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    font-weight: 650;
}

.brand-grid a:hover {
    border-color: var(--ink);
}

.brand-grid span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.note {
    border-left: 3px solid var(--accent);
    background: var(--surface);
    padding: 1rem 1.15rem;
}

.note h2, .note h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.note p, .note ul { margin: 0.4rem 0 0; font-size: 0.95rem; color: var(--ink-2); }
.note ul { padding-left: 1.1rem; }
.note li + li { margin-top: 0.3rem; }

.type-list {
    columns: 3 220px;
    column-gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.type-list li {
    break-inside: avoid;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--rule);
}

.type-list span { color: var(--muted); font-size: 0.9rem; }

/* Product lists */

.product-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.product-list li {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--rule);
}

.product-list .name { font-weight: 600; }
.product-list .sub { display: block; margin-top: 0.1rem; color: var(--muted); font-size: 0.88rem; }


.group-title {
    margin: 2rem 0 0.5rem;
    font-size: 1.1rem;
}

.group-title span { color: var(--muted); font-weight: 400; font-size: 0.95rem; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin: 0 0 1.5rem;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
}

.filter-bar a { color: var(--ink-2); text-decoration: none; }
.filter-bar a:hover { color: var(--ink); text-decoration: underline; }
.filter-bar a span { color: var(--muted); }

.filter-bar a.active {
    color: var(--ink);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
}

.directory-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.directory-list li {
    display: grid;
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto;
    gap: 0.25rem 1.5rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
}

.directory-list a { font-weight: 650; }
.directory-list p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.directory-list .count { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* Product page */

.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 3rem;
    align-items: start;
}

.article { max-width: 46rem; }

.article > section {
    padding-top: 0.5rem;
    margin-bottom: 2.5rem;
    scroll-margin-top: 1rem;
}

.article > section > h2 {
    padding-top: 0.75rem;
    border-top: 2px solid var(--ink);
}

.article > section:first-of-type > h2 {
    padding-top: 0;
    border-top: 0;
}

.mobile-toc { display: none; }

.toc {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 1.75rem;
}

.toc h2 {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.toc ol,
.toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 2px solid var(--rule);
}

.toc li a {
    display: block;
    padding: 0.25rem 0 0.25rem 0.85rem;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.93rem;
}

.toc li a:hover {
    border-left-color: var(--accent);
    color: var(--ink);
}

.callout {
    margin: 0 0 2rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--rule-strong);
    border-radius: 6px;
    background: var(--surface);
}

.callout h2 { font-size: 1.05rem; margin: 0 0 0.4rem; border: 0; padding: 0; }
.callout p { margin: 0.4rem 0 0; color: var(--ink-2); }

.button {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 5px;
    color: #fff;
    background: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.button:hover { color: #fff; background: #000; }

/* Rich product body (imported HTML) */

.product-body > :first-child { margin-top: 0; }
.product-body p, .product-body ul, .product-body ol { margin: 0 0 1rem; }
.product-body h3 { margin: 1.75rem 0 0.6rem; }
.product-body h4 { margin: 1.25rem 0 0.5rem; font-size: 1rem; }
.product-body ul, .product-body ol { padding-left: 1.3rem; }
.product-body li + li { margin-top: 0.35rem; }

.product-body code {
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: var(--code-bg);
}

.table-wrap {
    overflow-x: auto;
    margin: 0 0 1.25rem;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

th, td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--rule);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f1efe8;
    color: var(--ink-2);
    font-weight: 600;
}

tbody tr:last-child td { border-bottom: 0; }

.codes td:first-child {
    font-family: var(--mono);
    font-weight: 600;
    white-space: nowrap;
}

.faq-list { border-top: 1px solid var(--rule); }

.faq-list details {
    border-bottom: 1px solid var(--rule);
    padding: 0.8rem 0;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 600;
}

.faq-list details[open] summary { margin-bottom: 0.5rem; }
.faq-list details .product-body p:last-child { margin-bottom: 0; }

/* Prose pages */

.prose { max-width: 44rem; }
.prose h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose li + li { margin-top: 0.4rem; }

/* Ads */

.ad-unit { margin: 2rem 0; min-height: 100px; }

.ad-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    margin: 2rem 0;
    border: 1px dashed var(--rule-strong);
    color: var(--muted);
    font-size: 0.85rem;
}

/* Footer */

.site-footer {
    background: var(--header);
    color: #c4c9ce;
    font-size: 0.92rem;
}

.site-footer .wrap {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
    gap: 2rem;
    padding-top: 2.25rem;
    padding-bottom: 2.25rem;
}

.site-footer h2 {
    margin: 0 0 0.6rem;
    color: #fff;
    font-size: 0.95rem;
}

.site-footer p { margin: 0 0 0.6rem; max-width: 30rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li + li { margin-top: 0.35rem; }
.site-footer a { color: #e6e8ea; }
.site-footer a:hover { color: #fff; }

/* Responsive */

@media (max-width: 900px) {
    .product-layout,
    .home-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    .toc .toc-sections { display: none; }
    .toc { position: static; }

    .mobile-toc {
        display: block;
        margin: 0 0 1.75rem;
        border: 1px solid var(--rule-strong);
        border-radius: 6px;
        background: var(--surface);
        padding: 0.6rem 0.9rem;
    }

    .mobile-toc summary { cursor: pointer; font-weight: 600; }
    .mobile-toc ol { margin: 0.5rem 0 0.25rem; padding-left: 1.2rem; }
    .mobile-toc li + li { margin-top: 0.25rem; }
}

@media (max-width: 760px) {
    body { font-size: 16px; }

    .site-header .wrap {
        flex-wrap: wrap;
        gap: 0.5rem 1.25rem;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .header-search {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .header-search input { flex: 1; width: auto; min-width: 0; }

    .directory-list li { grid-template-columns: minmax(0, 1fr) auto; }
    .directory-list p { grid-column: 1 / -1; }

    .site-footer .wrap { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}
