/*
 * Chenile Javadoc theme.
 *
 * Added on top of the JDK's own stylesheet (maven-javadoc-plugin <addStylesheets>), so the JDK keeps the page
 * layout and this file only sets the chenile.org look: colours, fonts and the brand bar. Keep it to variables and
 * light touches; do not copy layout rules from the JDK stylesheet, because they change between JDK releases.
 */
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;600;700&family=Sora:wght@600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    /* chenile.org palette */
    --chenile-ink: #0d0d0d;
    --chenile-ink-2: #1a1a1a;
    --chenile-orange: #f89038;
    --chenile-ember: #e0801e;
    --chenile-link: #b55f12;
    --chenile-soft: #faf7f2;
    --chenile-soft-2: #fdefe0;
    --chenile-line: #ece6dd;
    --chenile-slate: #514c44;

    /* fonts */
    --body-font-family: "Josefin Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --block-font-family: var(--body-font-family);
    --code-font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --body-font-size: 15px;
    --block-font-size: 15.5px;
    --code-font-size: 13.4px;
    --nav-font-size: 14px;

    /* text and surfaces */
    --body-text-color: #1f1b16;
    --block-text-color: #1f1b16;
    --body-background-color: #ffffff;
    --detail-background-color: #ffffff;
    --code-background-color: var(--chenile-soft);
    --mark-background-color: var(--chenile-soft);
    --detail-block-color: var(--chenile-soft);

    /* navigation */
    --navbar-background-color: var(--chenile-ink-2);
    --navbar-text-color: #ffffff;
    --subnav-background-color: var(--chenile-soft);
    --subnav-link-color: var(--chenile-slate);
    --member-heading-background-color: var(--chenile-soft-2);
    --selected-background-color: var(--chenile-orange);
    --selected-text-color: var(--chenile-ink);
    --selected-link-color: var(--chenile-ink);

    /* tables */
    --table-header-color: var(--chenile-soft-2);
    --even-row-color: #ffffff;
    --odd-row-color: var(--chenile-soft);

    /* titles and links */
    --title-color: var(--chenile-ink);
    --link-color: var(--chenile-link);
    --link-color-active: var(--chenile-ember);

    /* table of contents sidebar */
    --toc-background-color: var(--chenile-soft);
    --toc-highlight-color: var(--chenile-soft-2);
    --toc-hover-color: #fff3e4;

    /* snippets and pre blocks, dark as on chenile.org */
    --snippet-background-color: #17130d;
    --snippet-text-color: #f3e9dc;
    --snippet-highlight-color: #5a3a14;
    --pre-background-color: var(--snippet-background-color);
    --pre-text-color: var(--snippet-text-color);

    /* borders, search, buttons */
    --border-color: var(--chenile-line);
    --tab-border-radius: 6px 6px 0 0;
    --search-tag-highlight-color: #ffd9a8;
    --button-border-color: var(--chenile-line);

    /* the brand bar sits above the JDK's navigation; the sticky header and scroll offsets must include it */
    --brand-height: 46px;
    --nav-height: calc(var(--brand-height) + var(--top-nav-height) + var(--sub-nav-height));
}

/* ---------- brand bar (the -top text from pom.xml) ---------- */
.chenile-brand {
    background: var(--chenile-ink);
    height: var(--brand-height);
    border-bottom: 2px solid var(--chenile-orange);
    box-sizing: border-box;
}
.chenile-brand .chenile-brand-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 100%;
    max-width: var(--max-content-width);
    margin: var(--content-margin);
    padding: 0 12px;
    box-sizing: border-box;
}
.chenile-brand a.chenile-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-family: "Sora", var(--body-font-family);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .04em;
}
.chenile-brand a.chenile-home img { width: 26px; height: 26px; }
.chenile-brand .chenile-tag {
    font-family: var(--code-font-family);
    font-size: 12px;
    color: #cabfb0;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.chenile-brand .chenile-links { margin-left: auto; display: flex; gap: 18px; }
.chenile-brand .chenile-links a { color: #e8e2d9; font-size: 14px; }
.chenile-brand a:hover { color: var(--chenile-orange); }

/* ---------- navigation ---------- */
.top-nav .nav-list li { border-radius: 4px; }
.top-nav .nav-list li.nav-bar-cell1-rev { font-weight: 700; }
.top-nav .nav-list a:hover { color: var(--chenile-orange); }
div.sub-nav { border-bottom: 1px solid var(--border-color); }
#search-input, #page-search-input {
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
#search-input:focus, #page-search-input:focus {
    outline: 2px solid var(--chenile-orange);
    outline-offset: 0;
}
#reset-search, #page-search-reset {
    border-radius: 8px;
}

/* ---------- headings ---------- */
h1, h2, h3, h4, .title, .sub-title {
    font-family: "Sora", var(--body-font-family);
    letter-spacing: -.01em;
}
h1.title { font-weight: 700; }
/* chenile.org headings are upright; Sora has no italic, so the JDK's italic section headings would be faked */
body.class-declaration-page .summary h2,
body.class-declaration-page .details h2,
body.class-use-page h2,
body.module-declaration-page .block-list h2 { font-style: normal; }
.header .sub-title, .sub-title { color: var(--chenile-slate); }

/* ---------- code ---------- */
.block code, .block-list code, dd code {
    background: var(--chenile-soft-2);
    color: var(--chenile-link);
    padding: 1px 5px;
    border-radius: 5px;
}
.block pre, .block pre code, pre.snippet, pre.snippet code {
    background: var(--pre-background-color);
    color: var(--pre-text-color);
    padding: 0;
}
.block pre, pre.snippet { padding: 14px 16px; border-radius: 10px; }
.block a code, dd a code { color: inherit; background: none; padding: 0; }
.member-signature { font-family: var(--code-font-family); }

/* ---------- tables and tabs ---------- */
.summary-table, .details-table { border-color: var(--border-color); }
.caption span, .table-tabs button { font-family: "Sora", var(--body-font-family); font-weight: 600; }
.table-tabs button { border-radius: var(--tab-border-radius); }
/* Chenile groups its packages into many tabs: wrap them instead of scrolling sideways */
div.table-tabs { white-space: normal; display: flex; flex-wrap: wrap; gap: 6px 0; }
div.table-tabs > button.table-tab { background: var(--chenile-soft-2); color: var(--chenile-slate); }
div.table-tabs > button.table-tab:hover { background: #fbd9b4; }
div.table-tabs > .active-table-tab { background: var(--selected-background-color); color: var(--selected-text-color); }

/* ---------- footer (the -bottom text from pom.xml) ---------- */
.legal-copy, footer .legal-copy {
    color: var(--chenile-slate);
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

/* ---------- small screens: the JDK hides parts of the navigation; keep the brand bar compact ---------- */
@media screen and (max-width: 920px) {
    .chenile-brand .chenile-tag, .chenile-brand .chenile-links { display: none; }
}
