/*
 * Documentation styling.
 *
 * Self-contained: no fonts, scripts or images are fetched from anywhere, so the
 * documentation opens correctly from a local folder with no internet at all.
 */

:root {
    /* The accent the product itself ships with (--kora-accent in
       public/assets/css/app.css). The documentation wore the warm accent of
       the product's former name long after it was renamed. */
    --accent: #127a64;
    --accent-soft: #e8f4f0;
    --text: #1c2431;
    --text-muted: #6b7785;
    --text-faint: #99a1ae;
    --border: #e4e7eb;
    --surface: #ffffff;
    --ground: #f6f7f9;
    --radius: 10px;
    --sidebar: 268px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background: var(--ground);
}

/* -------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------- */

.doc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar);
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 1.5rem 0;
}

.doc-main {
    margin-left: var(--sidebar);
    padding: 2.5rem 3rem 5rem;
    max-width: 900px;
}

.doc-brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: 0 1.5rem 1.25rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.doc-brand-logo {
    display: block;
    width: auto;
    height: 29px;
    margin-bottom: .375rem;
}

.doc-brand-text { font-weight: 600; }
.doc-brand-version { display: block; font-size: .75rem; color: var(--text-faint); font-weight: 400; }

/* A section: Getting Started, Tenant Admin, CRM Admin, Customer Portal... */
.doc-nav-group {
    margin-top: .75rem;
    padding: 1rem 1.5rem .375rem;
    border-top: 1px solid var(--border);
    font-size: .875rem;
    font-weight: 700;
    color: var(--text);
}

.doc-brand + .doc-nav-group {
    margin-top: 0;
    border-top: 0;
}

/* A sub-heading inside a section, e.g. CRM Admin → Sales. */
.doc-nav-subgroup {
    padding: .625rem 1.5rem .125rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.doc-sidebar a {
    display: block;
    padding: .375rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
}

.doc-sidebar a:hover { color: var(--text); background: var(--ground); }
.doc-sidebar a.is-active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); font-weight: 500; }

/* -------------------------------------------------------------------------
   Typography
   ------------------------------------------------------------------------- */

h1 { font-size: 1.875rem; margin: 0 0 .5rem; letter-spacing: -.02em; }
h2 { font-size: 1.3125rem; margin: 2.5rem 0 .75rem; padding-top: .5rem; letter-spacing: -.01em; }
h3 { font-size: 1.0625rem; margin: 1.75rem 0 .5rem; }

h2:first-of-type { margin-top: 1.75rem; }

.doc-lede { font-size: 1.0625rem; color: var(--text-muted); margin: 0 0 2rem; }

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

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .875em;
    background: var(--accent-soft);
    color: #b4530a;
    padding: .1em .35em;
    border-radius: 4px;
}

pre {
    background: #1c2431;
    color: #e8eaed;
    padding: 1rem 1.125rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: .8125rem;
    line-height: 1.6;
}

pre code { background: none; color: inherit; padding: 0; }

/* -------------------------------------------------------------------------
   Blocks
   ------------------------------------------------------------------------- */

.doc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0;
}

.doc-note,
.doc-warning {
    border-radius: var(--radius);
    padding: .875rem 1.125rem;
    margin: 1.25rem 0;
    font-size: .9375rem;
}

.doc-note { background: #e8f4f0; border-left: 3px solid var(--accent); }
.doc-warning { background: #fff8e6; border-left: 3px solid #d97706; }

.doc-note strong,
.doc-warning strong { display: block; margin-bottom: .125rem; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: .9375rem;
}

th, td { padding: .625rem .875rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--ground); font-weight: 600; font-size: .8125rem; }
tr:last-child td { border-bottom: none; }

.doc-steps { counter-reset: step; list-style: none; padding: 0; }

.doc-steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 1rem;
}

.doc-steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: .0625rem;
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
}

.doc-footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: .875rem;
}

/* -------------------------------------------------------------------------
   Narrow screens
   ------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .doc-sidebar {
        position: static;
        width: auto;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .doc-main { margin-left: 0; padding: 1.5rem 1.25rem 3rem; }
}

@media print {
    .doc-sidebar { display: none; }
    .doc-main { margin: 0; max-width: none; }
    pre { border: 1px solid #ccc; background: #f6f7f9; color: #000; }
}

/* -------------------------------------------------------------------------
   Screenshots
   ------------------------------------------------------------------------- */

.doc-shot {
    display: block;
    width: 100%;
    height: auto;
    margin: 1.25rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    /* Real screenshots of a real screen; the shadow keeps them from reading as
       part of the page they sit in. */
    box-shadow: 0 1px 3px rgba(28, 36, 49, .08);
}

.doc-shot-caption {
    display: block;
    margin: -.75rem 0 1.5rem;
    font-size: .8125rem;
    color: var(--text-faint);
}
