/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:root {
    --font-family: system-ui, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    --font-size: 14px;
    --code-font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --black-color: #333333;
    --gray-color: #CCCCCC;
    --red-color: #BE2043;
    --purple-color: #832778;
    --blue-color: #0033cc;
}

body {
    margin: 0;
    padding: 0;
    border: 0;
    background-color: white;
}

/* Main content holder. */
div.book {
    max-width: 1320px;
    min-width: 320px;
    margin: 0 auto;
    font-family: var(--font-family);
    padding: 1rem;
}

div.cover {
    text-align: center;
    page-break-after: always;
    padding: 0;
    margin: 0;
}

div.cover img {
    height: 100%;
    max-width: 100%;
    padding: 10px;
    margin: 0;
}

div.toc > dl, div.list-of-tables > dl {
    border: 2px solid var(--gray-color);
    padding: 1rem;
}

a {
    color: var(--blue-color);
    text-decoration: none;
}

/* font plan- serif text, sans headers */
h1, h2, h3, h4, h5, h6, div.toc {
    color: var(--red-color);
    hyphens: none !important;
    -moz-hyphens: none !important;
    -webkit-hyphens: none !important;
    adobe-hyphenate: none !important;
    page-break-after: avoid;
    page-break-inside: avoid;
    text-indent: 0;
    text-align: left;
}

h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p {
    text-indent: 0;
}

p {
    font-family: var(--font-family);
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    hyphens: auto;
    hyphenate-after: 3;
    hyphenate-before: 3;
    hyphenate-lines: 2;
    -webkit-hyphenate-after: 3;
    -webkit-hyphenate-before: 3;
    -webkit-hyphenate-lines: 2;
    line-height: 1.5em;
    margin: 0;
    text-align: justify;
    orphans: 2;
    widows: 2;
}
p.first-para, p.first-para-chapter, p.note-p-first {
    text-indent: 0;
}
p.first-para-chapter::first-line {
    /* handle run-in */
    font-variant: small-caps;
}
p.no-indent {
    text-indent: 0;
}

div.legalnotice {
    max-width: 660px;
}

pre {
    overflow: scroll;
}

pre i {
    font-style: normal;
}

pre.programlisting, pre.screen, pre.literallayout {
    border: 1px solid #BBBBBB;
    background-color: #EEE;
    font-family: var(--code-font-family);
    white-space: pre;
    padding-top: 1rem;
    padding-left: 1rem;
    padding-bottom: 0;
}

/*
 * Java syntax highlighting with eclipse default colors
 * and default font-style
 */
pre.programlisting .hl-keyword {
    color: var(--purple-color);
    font-weight: bold;
}

/* Seems to be broken, override red inline style of hl-string */
pre.programlisting .hl-string, pre.programlisting b.hl-string i[style] {
    color: #2A00FF !important;
}

pre.programlisting .hl-tag {
    color: #3F7F7F;
}

pre.programlisting .hl-comment {
    color: #3F5F5F;
    /* font-style: italic; */
}

pre.programlisting .hl-multiline-comment {
    color: #3F5FBF;
    /* font-style: italic; */
}

pre.programlisting .hl-value {
    color: #2A00FF;
}

pre.programlisting .hl-attribute {
    color: var(--purple-color);
}

table {
    width: 100%;
    border: 1px solid #A0A0A0;
    border-spacing: 0;
    caption-side: bottom;
    border-collapse: collapse;
}

table thead {
    border-color: inherit;
    border-style: solid;
    border-width: 0;
}

table tr {
    border-color: inherit;
    border-style: solid;
    border-width: 0;
}

table th {
    border-color: #A0A0A0;
    border-style: solid;
    border-width: 0;
    border-left-width: 1px;
    border-bottom-width: 1px;
    text-align: inherit;
    background-color: #ededee;
    padding: 0.1rem 0.5rem;
    font-weight: bold;
}

table tbody {
    border-color: inherit;
    border-style: solid;
    border-width: 0;
}

table td {
    border-color: #A0A0A0;
    border-style: dotted;
    border-width: 0;
    border-left-width: 1px;
    border-bottom-width: 1px;
    vertical-align: top;
    padding: 0.3em;
}

div.mediaobject img {
    width: 100%;
    height: 100%;
}

h2.subtitle img {
    width: min(650px, 100%);
}
