/* The homepage: a Clearlooks window (frame and paint from viewer/static/window.css and clearlooks.css) laid out
   like GNOME 2's help browser: the Contents sidebar on the left, the README on the right in the window's own
   scroll box. Colours are the window's variables, so the Dark Background toggle covers everything. */
.client { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); min-height: 0;
          column-gap: 6px; }   /* between the two panes: Clearlooks' GtkPaned handle-size */

/* The toolbar, across the window: the find bar (its matches painted through the Custom Highlight API, in
   Tango's Butter and Orange) and, on a narrow window only, the Contents combo box (the end of this file). */
.toolbar { grid-column: 1 / -1; position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.toolbar button { display: inline-flex; align-items: center; gap: 4px; }
.toolbar .entry { flex: 1 1 160px; max-width: 320px; }
#find-count { color: var(--muted); white-space: nowrap; }
.find-menu { left: 6px; }   /* under the box: the pages with matches */
.toolbar .menu-item { color: inherit; text-decoration: none; }   /* the toolbar's menus are links: a page each */
.toolbar .menu-item.current { font-weight: 600; }
.toolbar .menu-item.sub { padding-left: 26px; }   /* a row under a document's own, as in the sidebar */
::highlight(find) { background: #fce94f; color: #000; }
::highlight(find-current) { background: #f57900; color: #fff; }
.toolbar .combo { display: none; }   /* (.toolbar button would show it) */

/* Sidebar: a GTK tree view with one selected row */
/* The two panes as GTK2 scrolled windows (shadow IN): a 1 px frame around the list and around the text, the bar beside
   each outside its frame, 3 px of the window above and below, the paned handle's 6 px between them (.client). */
#toc-box, #content-box { padding: 3px 0; }
.sidebar { overflow-y: auto; background: var(--cl-base, var(--ctl-bg)); border: 1px solid var(--cl-frame-in, var(--line)); }
.sidebar-title { position: sticky; top: 0; padding: 4px 8px; font-weight: 600; background: var(--bg); border-bottom: 1px solid var(--line); }
.sidebar ul { list-style: none; margin: 0; padding: 2px 0; }
.sidebar a { display: flex; align-items: center; gap: 8px; padding: 3px 10px; color: var(--fg); text-decoration: none; user-select: none; }
.sidebar img { flex: none; }
.sidebar a span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* a long title ends in ... */
.sidebar a:hover { background: var(--hover); }
.sidebar a.current, .sidebar a.current:hover { background: var(--cl-sel-grad, var(--sel)); color: var(--cl-sel-fg, var(--fg)); }
.sidebar li li a { padding-left: 30px; }   /* a document's sections under its own row (the LSP server's) */

/* The README, in a column of at most 60rem, centred when the pane is wider */
#content { overflow-y: auto; border: 1px solid var(--cl-frame-in, var(--line)); padding: 16px max(32px, calc((100% - 60rem) / 2)) 48px; background: var(--cl-base, var(--ctl-bg));
           font-size: 14px; line-height: 1.55; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { #content { scroll-behavior: auto; } }
.readme > :first-child { margin-top: 0; }
.readme :is(h1, h2, h3, h4) { scroll-margin-top: 8px; }
.readme a { color: var(--link, #204a87); }
body.dark .readme a { color: #8fb3e6; }
.readme img { max-width: 100%; height: auto; }
.readme h1 { display: flex; align-items: center; gap: 14px; font-size: 1.9rem; margin-top: 1.4em; padding-bottom: .2em; border-bottom: 1px solid var(--line); }
.readme h1 img { flex: none; }
.readme h2 { font-size: 1.45rem; margin-top: 1.4em; padding-bottom: .2em; border-bottom: 1px solid var(--line); }
.readme h3 { font-size: 1.2rem; }
.readme code { font-size: .9em; background: var(--cl-row-alt, var(--hover)); padding: .1em .3em; border-radius: 3px; }
.readme pre { background: var(--cl-row-alt, var(--hover)); border: 1px solid var(--line); padding: 12px 14px; overflow-x: auto; border-radius: 3px; line-height: 1.45; }
.readme pre code { padding: 0; background: none; font-size: .85em; }
/* Pygments wraps a coloured block in div.highlight, which highlight.css paints; the pre inside goes bare. */
.readme .highlight { margin: 1em 0; border: 1px solid var(--line); border-radius: 3px; overflow-x: auto; }
.readme .highlight pre { margin: 0; border: 0; background: transparent; }
.readme blockquote { margin: 1em 0; padding: 2px 16px; border-left: 4px solid var(--line); color: var(--muted); }
.readme table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.readme th, .readme td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.readme th { background: var(--bg); }
.readme hr { border: 0; border-top: 1px solid var(--line); }
.readme del { color: var(--muted); }
/* GitHub's `> [!NOTE]` alerts, drawn like GNOME 2's documentation notes: the kind's dialog icon by the title
   (ALERT_ICONS in the generator), and the title and left border in the icon's own colour from the Tango palette:
   Sky Blue for the note, Chameleon for the tip's check, Scarlet Red for the important mark, Orange for the
   warning triangle, a deeper Scarlet Red plus a tint for the caution sign. */
.readme blockquote.alert { color: inherit; }
.readme .alert-title { display: flex; align-items: center; gap: 7px; font-weight: 700; margin: .5em 0; }
.readme .alert-title img { flex: none; }
.readme .alert.note { border-color: #3465a4; } .readme .note .alert-title { color: #3465a4; }
.readme .alert.tip { border-color: #4e9a06; } .readme .tip .alert-title { color: #4e9a06; }
.readme .alert.important { border-color: #cc0000; } .readme .important .alert-title { color: #cc0000; }
.readme .alert.warning { border-color: #f57900; } .readme .warning .alert-title { color: #ce5c00; }
.readme .alert.caution { border-color: #a40000; background: rgba(204, 0, 0, 0.06); } .readme .caution .alert-title { color: #a40000; }
body.dark .readme .note .alert-title { color: #729fcf; }
body.dark .readme .tip .alert-title { color: #8ae234; }
body.dark .readme .important .alert-title, body.dark .readme .caution .alert-title { color: #ef2929; }
body.dark .readme .warning .alert-title { color: #fcaf3e; }

/* Previous / Next, at the end of each page */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--line); }
.pager a { display: inline-flex; align-items: center; gap: 6px; }

/* Narrow window (a phone): no sidebar; a toolbar with a combo box (a GtkComboBox: the section's icon and
   name, an etched separator, an arrow) stands in for it, its menu listing the sections. */
@media (max-width: 700px) {
  .client { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #toc-box { display: none; }
  .toolbar .combo { order: 1; flex: 1 1 100%; display: flex; align-items: center; gap: 6px; padding: 4px 6px; text-align: left; }   /* its own row, under the find bar, its menu right below it */
  .toolbar .entry { max-width: none; }
  #find-previous span, #find-next span { display: none; }   /* icons only */
  .combo img { flex: none; }
  .combo-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .combo-arrow { flex: none; align-self: stretch; display: flex; align-items: center; margin: -4px 0; padding-left: 8px;
                 border-left: 1px solid var(--ctl-border); box-shadow: inset 1px 0 0 var(--cl-shine, #fff); }
  .contents-menu, .find-menu { left: 6px; right: 6px; }
  #content { padding: 12px 16px 32px; }
}

/* included_icons.txt examples: the tokens of lib/included_icons_tokens.py (the LSP server's), in Tango's colours.
   Theme names in Sky Blue (built-in bold, a declared one in Plum), contexts in Chocolate, icon names in Chameleon,
   input sizes in Sky Blue, output sizes in Orange, operators in Aluminium, `scalable` and paths in Plum,
   the directive keyword in Pygments' decorator violet, comments in Aluminium. */
.ii-theme { color: #5c3566; font-weight: 600; }
.ii-theme.ii-builtin { color: #204a87; }
.ii-context { color: #8f5902; }
.ii-icon { color: #4e9a06; }
.ii-input_size { color: #3465a4; }
.ii-output_size { color: #ce5c00; }
.ii-operator { color: #555753; font-weight: 700; }
.ii-keyword { color: #75507b; font-weight: 600; }
.ii-directive { color: #5c35cc; font-weight: 600; }
.ii-string { color: #75507b; }
.ii-comment { color: #888a85; font-style: italic; }
body.dark .ii-theme { color: #ad7fa8; }
body.dark .ii-theme.ii-builtin { color: #729fcf; }
body.dark .ii-context { color: #e9b96e; }
body.dark .ii-icon { color: #8ae234; }
body.dark .ii-input_size { color: #729fcf; }
body.dark .ii-output_size { color: #fcaf3e; }
body.dark .ii-operator { color: #babdb6; }
body.dark .ii-keyword, body.dark .ii-string { color: #ad7fa8; }
body.dark .ii-directive { color: #b39ddb; }
body.dark .ii-comment { color: #888a85; }
