/* DEV-5209 — public developer guide.
 * Visual language copied from the ECPA API docs (encompass core repo:
 * server/src/main/webapp/docs/css/style.css), without the Pixxett theme's
 * Bootstrap / Angular / Font Awesome dependencies. No JavaScript.
 *
 * Key tokens taken from the core theme: 60px #364760 topbar with a 250px
 * darker logo block, 250px #364760 sidebar with translucent-white links,
 * #e8ebf1 content background with white cards.
 */

:root {
    --navy: #364760;
    --page-bg: #e8ebf1;
    --ink: #37363e;
    --body-text: #58666e;
    --accent: #399bff;
    --code-bg: #41444e;
    --code-red: #c7254e;
    --border: #e4e4e4;
    --panel-bg: #f6f8fa;
    --sidebar-width: 250px;
    --topbar-height: 60px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--body-text);
    font-family:
        'Open Sans',
        -apple-system,
        'Segoe UI',
        Roboto,
        Arial,
        sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

/* --- Top bar --- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--brand-header-bg, var(--navy));
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 900;
}

/* Logo block occupies the sidebar column, slightly darker than the bar —
 * mirrors the core theme's .applogo. */
.applogo {
    width: var(--sidebar-width);
    height: var(--topbar-height);
    background: var(--brand-applogo-bg, rgba(0, 0, 0, 0.14));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.applogo img {
    height: 32px;
    display: block;
}

.topbar-title {
    color: var(--brand-header-ink, #fff);
    font-family: Montserrat, 'Open Sans', sans-serif;
    font-size: 15px;
    letter-spacing: 0.5px;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    overflow-y: auto;
    background: var(--brand-sidebar-bg, var(--navy));
    font-family: Montserrat, 'Open Sans', sans-serif;
    padding: 15px 0;
    z-index: 500;
}

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

.toc li a {
    display: block;
    padding: 6px 15px 6px 30px;
    color: var(--brand-sidebar-ink, rgba(255, 255, 255, 0.6));
    text-decoration: none;
    font-size: 12px;
}

/* Child combinator: the group's own link only — nested .toc-h3 links must
 * keep the smaller indented base style. */
.toc li.toc-h2 > a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    padding: 8px 15px;
    margin-top: 4px;
}

.toc li.toc-h3 a {
    background: rgba(0, 0, 0, 0.1);
}

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

/* Collapsible groups — docs.js adds body.js, opens the in-view section and
 * marks its link .current. Without JS everything stays expanded. */
body.js .toc li.has-children > .toc-sub {
    display: none;
}

body.js .toc li.has-children.open > .toc-sub {
    display: block;
}

.toc li a.current {
    color: rgba(255, 255, 255, 1);
}

.toc li a:hover,
.toc li a:focus {
    color: rgba(255, 255, 255, 1);
}

.toc li a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* --- Content --- */
.content {
    margin-left: var(--sidebar-width);
    padding: calc(var(--topbar-height) + 20px) 24px 48px;
}

.card {
    background: #fff;
    border-radius: 4px;
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 40px;
    box-shadow: 0 1px 3px rgba(54, 71, 96, 0.12);
}

h1,
h2,
h3,
h4 {
    font-family: Montserrat, 'Open Sans', sans-serif;
    color: var(--ink);
    line-height: 1.3;
}

h1 {
    font-size: 26px;
    margin-top: 0;
}

h2 {
    font-size: 21px;
    margin-top: 48px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-size: 16px;
    margin-top: 32px;
}

h4 {
    font-size: 14px;
    margin-top: 24px;
}

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

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

/* Anchor targets land below the fixed top bar */
h2[id],
h3[id] {
    scroll-margin-top: calc(var(--topbar-height) + 16px);
}

/* Section numbers prepended to headings (content) and TOC entries (sidebar)
 * by build-docs.mts. Muted so the title stays the focal point; tabular digits
 * keep multi-section lists visually aligned. */
.sec-num {
    font-variant-numeric: tabular-nums;
    color: var(--body-text);
    font-weight: 600;
}

.toc .sec-num {
    color: inherit;
    opacity: 0.55;
    margin-right: 3px;
}

/* --- Code --- */
code {
    font-family: 'Source Code Pro', ui-monospace, Menlo, Consolas, monospace;
    font-size: 12.5px;
    background: var(--panel-bg);
    color: var(--code-red);
    padding: 1px 5px;
    border-radius: 3px;
}

pre {
    background: var(--code-bg);
    color: #fff;
    border-radius: 4px;
    padding: 14px 16px;
    overflow-x: auto;
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
}

/* --- Tables --- */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
    font-size: 13px;
}

th,
td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--panel-bg);
    font-family: Montserrat, 'Open Sans', sans-serif;
    color: var(--ink);
}

/* --- Blockquotes (the guide uses these for "When to use" callouts) --- */
blockquote {
    margin: 16px 0;
    padding: 8px 16px;
    border-left: 4px solid var(--accent);
    background: var(--panel-bg);
}

blockquote p {
    margin: 6px 0;
}

/* --- Responsive: hide sidebar on narrow viewports --- */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .applogo {
        width: auto;
        padding: 0 16px;
        background: none;
    }

    .content {
        margin-left: 0;
        padding: calc(var(--topbar-height) + 16px) 12px 32px;
    }

    .card {
        padding: 24px 20px;
    }
}
