/* Colours and fonts follow the original ICF Browser (browser.css). */
:root {
    --header-bg: #cf0000;
    --header-border: #f16600;
    --header-fg: #ffffff;
    --text: #000000;
    --tree-text: #303030;
    --hover-bg: #e0e0e0;
    --selected-bg: #e8e8e8;
    --link: #3030ff;
    --result-text: #505050;
    --panel-bg: #f8f8f8;
    --highlight-fg: #ff0000;
    --highlight-bg: #dfdfb0;
    --page-bg: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--page-bg);
    color: var(--text);
    font-family: Verdana, Helvetica, Arial, sans-serif;
    font-size: 0.8em;
}

/* header */
.masthead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 40px;
    padding: 4px 8px 5px;
    margin-bottom: 10px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    color: var(--header-fg);
}

.apptitle {
    min-width: 260px;
    color: inherit;
    text-decoration: none;
    font-family: "Times New Roman", Times, serif;
    font-size: 1.7em;
    font-weight: bold;
    letter-spacing: .005em;
}

.langform {
    font-family: "Times New Roman", Times, serif;
    font-size: 1.2em;
    font-weight: bold;
}

.langform select { width: 295px; max-width: 100%; margin-left: 4px; }

/* two panes that scroll independently */
.layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 33% 1fr;
    gap: 0 12px;
}

.treepane, .pane {
    min-height: 0;
    overflow: auto;
    padding: 0 5px 5px 2px;
}

/* tree */
.tree, .tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* toggle and icon sit in a 34px gutter so that long titles wrap under the title, not under the icons;
   child lists move back 24px so each level is indented by 10px */
.tree ul { margin-left: -24px; }

.tree li {
    position: relative;
    padding-left: 34px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    line-height: 1.5;
}

.tree .toggle {
    position: absolute;
    left: 0;
    top: 0;
    width: 13px;
    text-align: center;
    color: var(--tree-text);
    text-decoration: none;
    font-family: "Courier New", monospace;
    font-weight: bold;
}

.tree .icon { position: absolute; left: 15px; top: 3px; }

.tree .label { color: var(--tree-text); text-decoration: none; padding: 0 2px; }
.tree a.label:hover { text-decoration: underline; background: var(--hover-bg); }
.tree li.selected > .label { background: var(--selected-bg); }

/* details */
.titleclass { display: block; margin: 0 0 12px; font-size: 1em; font-weight: bold; }
.descriptionclass { margin: 0 0 12px; }
.incexcclass { margin: 0 0 12px; font-style: italic; }
.incexcclass a, .descriptionclass a { color: var(--link); font-weight: bold; text-decoration: none; }

.highlight { color: var(--highlight-fg); background: var(--highlight-bg); }

/* search form */
.searchfields {
    margin: 40px 0 16px;
    padding: 10px;
    background: var(--panel-bg);
    font-size: 90%;
}

.searchresults ~ .searchfields, .pane-content > .searchfields:first-child { margin-top: 0; }

.searchfields input[type=search] { width: 406px; max-width: 100%; margin: 2px 12px 6px 0; }

.searchfields fieldset { border: 0; margin: 0; padding: 0; }
.searchfields legend { padding: 0; margin-bottom: 2px; }
.searchfields fieldset label { margin-right: 10px; white-space: nowrap; }

.linkbutton {
    border: 0;
    padding: 0;
    background: none;
    color: var(--link);
    font: inherit;
    cursor: pointer;
}
.linkbutton:hover { text-decoration: underline; }

/* search results */
.resultstitle { margin: 0 0 8px; }
.searchresults { border-collapse: collapse; }
.searchresults td { padding: 1px 0; vertical-align: top; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; }
.searchrescode a { color: var(--link); text-decoration: none; margin-right: 10px; white-space: nowrap; }
.searchres a { color: var(--result-text); text-decoration: none; }
.searchresults a:hover { text-decoration: underline; }

/* phones: one column, the page scrolls as a whole */
@media (max-width: 700px) {
    body { height: auto; }
    .apptitle { min-width: 0; }
    .layout { display: block; padding: 0 16px; }
    .treepane { max-height: 45vh; margin-bottom: 12px; border-bottom: 1px solid var(--selected-bg); }
    .pane { overflow: visible; }
}
