/* sartar help — tokens, type and logo from sartar-brand.md. */

@font-face {
    font-family: "Comfortaa";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/assets/comfortaa-latin-700-normal.woff2") format("woff2");
}

:root {
    --color-paper: #f5f0e8;
    --color-paper-2: #fbf8f2;
    --color-hairline: #ddd3c3;
    --color-ink: #1a1a1a;
    --color-ink-soft: #55504a;
    --color-rust: #a8512e;
    --color-rust-deep: #7e3a1f;
    --color-sage: #7e8a6a;
    --color-gold: #c49a3d;
    --color-mark: var(--color-rust);
    --color-link: var(--color-rust);
    --color-link-hover: var(--color-rust-deep);

    --font-wordmark: "Comfortaa", sans-serif;
    --font-body: Georgia, "Times New Roman", serif;
    --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-paper: #1e1b17;
        --color-paper-2: #262119;
        --color-hairline: #3a332a;
        --color-ink: #f5f0e8;
        --color-ink-soft: #b9b0a2;
        /* On a dark ground the mark goes gold, and rust is too dim for links. */
        --color-mark: var(--color-gold);
        --color-link: #d98a66;
        --color-link-hover: #eaa685;
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 1rem;
}

body {
    margin: 0;
    background: var(--color-paper);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
}

a {
    color: var(--color-link);
}

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

/* --- header ---------------------------------------------------------------- */

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 2rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-hairline);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    text-decoration: none;
    font-size: 2rem; /* drives the whole lockup; keeps the mark above 26px */
    line-height: 1;
}

.logo-mark {
    height: 0.86em;
    color: var(--color-mark);
    flex: none;
}

.logo-word {
    font-family: var(--font-wordmark);
    font-weight: 700;
    color: var(--color-ink);
    letter-spacing: -0.01em;
}

.logo-section {
    font-family: var(--font-body);
    font-size: 0.6em;
    font-style: italic;
    color: var(--color-ink-soft);
    align-self: flex-end;
    padding-bottom: 0.1em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
}

.site-nav a {
    color: var(--color-ink);
    text-decoration: none;
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    border-bottom-color: var(--color-rust);
}

/* --- layout ---------------------------------------------------------------- */

.layout {
    max-width: 50rem;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
}

.layout.with-toc {
    max-width: 68rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 3rem;
}

main {
    min-width: 0;
}

/* On a phone the list of sections would push the page itself below the fold,
   so it only exists from the 768px breakpoint up (doc/mobile.md). */
.toc {
    display: none;
    font-size: 0.9375rem;
}

.toc p {
    margin: 0 0 0.4rem;
    font-weight: bold;
}

.toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc li {
    margin: 0.3rem 0;
}

.toc a {
    text-decoration: none;
}

@media (min-width: 768px) {
    .layout.with-toc {
        grid-template-columns: minmax(0, 1fr) 14rem;
    }

    .layout.with-toc main {
        grid-column: 1;
        grid-row: 1;
    }

    .toc {
        display: block;
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        position: sticky;
        top: 1.5rem;
        max-height: calc(100dvh - 3rem);
        overflow-y: auto;
        border-left: 1px solid var(--color-hairline);
        padding: 0.25rem 0 0.25rem 1.25rem;
        margin-top: 2rem;
    }
}

/* --- content --------------------------------------------------------------- */

h1,
h2,
h3 {
    line-height: 1.25;
}

h1 {
    font-size: 2rem;
    margin: 1.5rem 0 1rem;
}

h2 {
    font-size: 1.45rem;
    margin: 2.5rem 0 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-hairline);
}

h3 {
    font-size: 1.15rem;
    margin: 1.75rem 0 0.5rem;
}

.anchor {
    color: inherit;
    text-decoration: none;
}

.anchor:hover::after {
    content: " #";
    color: var(--color-rust);
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-paper-2);
    border: 1px solid var(--color-hairline);
    border-radius: 3px;
    padding: 0.05em 0.3em;
    overflow-wrap: anywhere;
}

.code {
    position: relative;
    margin: 1rem 0;
}

.code pre {
    margin: 0;
    padding: 0.9rem 3rem 0.9rem 1rem;
    background: var(--color-paper-2);
    border: 1px solid var(--color-hairline);
    border-radius: 4px;
    overflow-x: auto;
    line-height: 1.45;
}

.code pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    overflow-wrap: normal;
}

/* Plain-text blocks (address templates, sample output) wrap instead of
   scrolling: their long lines would otherwise run under the copy button.
   Commands and code keep their line breaks, where a wrap changes the meaning. */
.code pre code.language-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.copy {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-paper-2);
    color: var(--color-ink-soft);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}

.copy:hover,
.copy:focus-visible {
    border-color: var(--color-hairline);
    color: var(--color-ink);
}

.copy svg {
    width: 1.15rem;
    height: 1.15rem;
}

.copy.copied {
    color: #3f8f4f;
}

.table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
}

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

th,
td {
    text-align: left;
    vertical-align: top;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--color-hairline);
}

th {
    border-bottom-width: 2px;
}

blockquote {
    margin: 1.25rem 0;
    padding: 0.1rem 1rem;
    border-left: 3px solid var(--color-sage);
    background: var(--color-paper-2);
}

.cards {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

/* --- footer ---------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--color-hairline);
    padding: 1.25rem 1.5rem;
    font-size: 0.9375rem;
    text-align: center;
}
