/* AmigaFAQ - Workbench 3.1 inspired style.
   The HTML also carries bgcolor attributes and a table layout, so old Amiga
   browsers get the grey two-column look without this file. */

/* Topaz (Workbench 3.x / A1200 version), see fonts/README.md for license */
@font-face {
  font-family: "Topaz WB";
  src: url("fonts/topaz-a1200.woff") format("woff"), url("fonts/topaz-a1200.ttf") format("truetype");
  font-display: block;
}

:root {
  --screen: #b2b2b2;   /* screen and window contents */
  --chrome: #cccccc;   /* window frames, gadgets, buttons, text boxes */
  --black: #000000;
  --white: #ffffff;
  --blue: #6688bb;     /* title bars, highlights */
  --link: #0055aa;
  --topaz: "Topaz WB", "Courier New", Courier, monospace;
  --text-font: Verdana, Geneva, "DejaVu Sans", Helvetica, Arial, sans-serif;
  --bar-h: 26px;
}

* { box-sizing: border-box; }
html { background: var(--screen); }
body {
  margin: 0;
  background: var(--screen);
  color: var(--black);
  font-family: var(--text-font);
  font-size: 15px;
  line-height: 23px; /* whole pixels keep pixel-art gadgets on the grid */
}

/* Pixel font: no smoothing, no fake bold */
.screenbar, td.titlebar, ul.tree a, .qa h3, a.btn, .reqtext, .mitems a {
  font-family: var(--topaz);
  font-size: 16px;
  -webkit-font-smoothing: none;
  font-smooth: never;
}
.screenbar b, td.titlebar b, .qa h3 { font-weight: normal; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Bevels ---------- */
/* raised: light top-left, dark bottom-right; recessed: the reverse */
.raised, table.win, a.btn {
  border-style: solid;
  border-width: 2px;
  border-color: var(--white) var(--black) var(--black) var(--white);
}
.recessed, .qa, .reqtext {
  border-style: solid;
  border-width: 2px;
  border-color: var(--black) var(--white) var(--white) var(--black);
}

/* ---------- Screen title bar ---------- */
.screenbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  height: var(--bar-h);
  line-height: calc(var(--bar-h) - 2px);
  background: var(--white);
  color: var(--black);
  border-bottom: 2px solid var(--black);
  white-space: nowrap;
}
.tagline {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  /* menu is 96px, depth gadget 30px: pad so the text centers on the page */
  padding: 0 74px 0 8px;
}
sup.tm { font-family: var(--topaz); font-size: 8px; line-height: 0; vertical-align: 6px; margin-left: 1px; }

/* Screen menu (CSS only). Hidden with :not() so browsers too old to open
   it never hide it: they just show the About link inline. */
.menu { position: relative; display: block; outline: none; width: 96px; flex: none; }
.mtitle { display: block; padding: 0 10px; }
.menu:hover .mtitle, .menu:focus-within .mtitle { background: var(--black); color: var(--white); }
.menu:not(.never) .mitems {
  display: none;
  position: absolute;
  left: 0; top: 100%;
  min-width: 190px;
  background: var(--white);
  border-style: solid;
  border-color: var(--black);
  border-width: 1px 2px 2px 1px;
  padding: 2px 0;
  line-height: 1.6;
}
.menu:hover .mitems, .menu:focus-within .mitems { display: block; }
.mitems a { display: block; padding: 1px 12px; color: var(--black); text-decoration: none; }
.mitems a:hover, .mitems a:focus { background: var(--blue); color: var(--white); outline: none; text-decoration: none; }

/* Screen depth gadget at the right end of the bar (back to top) */
.screenbar a.scrdepth {
  position: relative;
  flex: none;
  width: 30px;
  background: var(--chrome);
  border-left: 2px solid var(--black);
}

/* ---------- Layout ---------- */
table.layout { border-collapse: separate; border-spacing: 12px; table-layout: fixed; }
td.side { width: 280px; }

/* ---------- Windows ---------- */
table.win {
  border-collapse: separate;
  border-spacing: 0;
  background: var(--chrome);
}
table.win > tbody > tr > td, table.win > tr > td { border: 0; padding: 0; }

td.titlebar {
  height: var(--bar-h);
  background: var(--blue);
  border-bottom: 2px solid var(--black) !important;
  color: var(--black);
}
.tb { display: flex; align-items: stretch; height: calc(var(--bar-h) - 2px); }
.wtitle {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  line-height: calc(var(--bar-h) - 2px);
  border-left: 1px solid var(--white);
  border-right: 1px solid var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Gadgets: drawn with borders, each in its own box with divider lines */
.gad {
  position: relative;
  display: block;
  flex: none;
  width: 28px;
  background: var(--blue);
}
.gad.close { border-right: 1px solid var(--black); }
.gad.close i {
  position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 12px;
  margin: -6px 0 0 -4px;
  background: var(--white);
  border: 2px solid var(--black);
}
.gad.depth { border-left: 1px solid var(--white); border-right: 1px solid var(--black); }
.gad.zoom { border-left: 1px solid var(--white); }
.gad i, .gad b { position: absolute; border: 2px solid var(--black); box-sizing: border-box; }
.gad.depth i { left: 5px; top: 4px; width: 14px; height: 11px; background: var(--chrome); }
.gad.depth b { left: 10px; top: 9px; width: 13px; height: 11px; background: var(--white); }
.gad.zoom i { left: 5px; top: 4px; width: 17px; height: 15px; background: var(--chrome); }
.gad.zoom b { left: 5px; top: 4px; width: 9px; height: 8px; background: var(--white); }
.screenbar .gad.depth i { top: 4px; }
.screenbar .gad.depth b { top: 9px; }
a.gad:active { background: var(--black); }

/* Window frame: a blue border, then an inset edge, then the contents */
td.winbody { padding: 0 !important; }
.frame { border: 2px solid var(--blue); border-top: 0; }
.pane {
  border-style: solid;
  border-width: 0 2px 2px 2px;
  border-color: var(--black) var(--white) var(--white) var(--black);
  background: var(--screen);
  padding: 14px 18px;
}

/* ---------- Sidebar tree ---------- */
ul.tree, ul.tree ul { list-style: none; margin: 0; padding: 0; }
ul.tree ul { padding-left: 16px; }
ul.tree li { margin: 3px 0; }
ul.tree a {
  display: block;
  color: var(--black);
  text-decoration: none;
  padding: 2px 6px;
  line-height: 22px;
}
ul.tree li.drawer > a::before,
ul.tree li.file > a::before {
  content: "";
  display: inline-block;
  width: 16px; height: 14px;
  margin-right: 7px;
  vertical-align: -2px;
  background: url("icons/drawer.svg") no-repeat left center;
  image-rendering: pixelated;
}
ul.tree li.drawer.open > a::before { background-image: url("icons/drawer-open.svg"); }
ul.tree li.file > a::before { background-image: url("icons/project.svg"); background-position: 2px center; }
ul.tree li.file { margin-top: 10px; }
ul.tree ul.qs { padding-left: 22px; border-left: 1px dotted var(--black); margin-left: 12px; }
ul.tree ul.qs a { font-family: var(--text-font); font-size: 13px; line-height: 18px; -webkit-font-smoothing: auto; }
ul.tree a:hover, ul.tree a:focus { background: var(--blue); color: var(--white); text-decoration: none; }
ul.tree a.sel { background: var(--black); color: var(--white); }
ul.tree a.sel::before { background-color: var(--chrome); box-shadow: 0 0 0 2px var(--chrome); }

/* ---------- Content ---------- */
p.intro { font-size: 16px; line-height: 25px; margin-top: 0; }
.qa {
  background: var(--chrome);
  padding: 4px 16px 10px;
  margin: 16px 0;
}
.qa h3 { margin: 10px 0 6px; line-height: 20px; }
.qa h3 a { color: var(--black); text-decoration: none; }
.qa ul { list-style: none; padding-left: 0; margin-left: 0.5em; }
.qa li { padding-left: 1.2em; text-indent: -1.2em; margin-bottom: 0.3em; }
.qa li::before { content: "* "; font-family: var(--topaz); }
p.up { text-align: right; margin: 6px 0 0; }
p.note { font-size: 13px; font-style: italic; }

/* Buttons: raised, and they press in when clicked */
a.btn {
  display: inline-block;
  background: var(--chrome);
  color: var(--black);
  padding: 2px 14px;
  text-decoration: none;
}
a.btn:hover { text-decoration: none; }
a.btn:active {
  border-color: var(--black) var(--white) var(--white) var(--black);
  transform: translate(2px, 1px);
}

/* ---------- Footer ---------- */
.foot { padding: 4px 20px 20px; font-size: 13px; }
.foot p.tmnote { font-size: 12px; margin-top: 6px; }

/* ---------- About requester (CSS only, opened with :target) ---------- */
.requester { margin: 16px 20px 24px; max-width: 460px; }
.requester:not(:target) { display: none; }
.requester:target {
  position: fixed;
  inset: 0;
  z-index: 50;
  margin: 0;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
}
.req-backdrop { display: none; }
.requester:target .req-backdrop { display: block; position: absolute; inset: 0; }
table.reqwin { position: relative; max-width: 420px; }
table.reqwin .pane {
  padding: 8px;
  /* the fine dither pattern of a Workbench requester */
  background-color: var(--white);
  background-image:
    linear-gradient(45deg, var(--chrome) 25%, transparent 25%, transparent 75%, var(--chrome) 75%),
    linear-gradient(45deg, var(--chrome) 25%, transparent 25%, transparent 75%, var(--chrome) 75%);
  background-size: 2px 2px;
  background-position: 0 0, 1px 1px;
}
.reqtext {
  background: var(--chrome);
  padding: 4px 14px;
  margin: 6px 6px 14px;
  text-align: center;
}
.reqtext p { margin: 8px 0; }
.reqbtns td { padding: 0 6px 6px; }
.reqbtns a.btn { min-width: 84px; text-align: center; padding: 4px 18px; }

/* ---------- Phones: stack the sidebar above the content ---------- */
@media (max-width: 720px) {
  table.layout, table.layout > tbody, table.layout > tbody > tr, table.layout td.side, table.layout td.content {
    display: block;
    width: 100% !important;
  }
  table.layout { border-spacing: 0; padding: 8px; }
  td.side { margin-bottom: 12px; }
  .pane { padding: 12px; }
  .tagline { text-align: left; padding: 0 8px; }
  .foot { padding: 4px 16px 16px; }
}

/* ---------- Mouse pointer ----------
   From dkb-amiga.com, used with permission of Stefan Reinauer.
   PNG first (widest support), then the original .cur. Hotspot is (4,5).
   Used everywhere, including over links. */
html, body, *, a, a * { cursor: url("icons/amim.png?v=2") 4 5, url("icons/amim.cur"), default; }

/* ---------- Model list: click a model to show its specs ---------- */
.models { margin: 10px 0 4px; }
details.model { margin: 0 0 4px; }
details.model > summary {
  list-style: none;
  padding: 3px 6px 3px 26px;
  position: relative;
  line-height: 22px;
}
details.model > summary::-webkit-details-marker { display: none; }
/* small raised gadget with a +/- sign */
details.model > summary::before {
  content: "";
  position: absolute;
  left: 2px;
  /* centred on the first line: top padding + half the line height - half the box */
  top: 6px; /* 3px padding + half of the 22px line - half of the 16px box */
  width: 16px; height: 16px;
  box-sizing: border-box;
  border-style: solid;
  border-width: 2px;
  border-color: var(--white) var(--black) var(--black) var(--white);
  /* plus sign drawn with two bars, exactly centred in the 12px interior */
  background:
    linear-gradient(var(--black), var(--black)) center / 8px 2px no-repeat,
    linear-gradient(var(--black), var(--black)) center / 2px 8px no-repeat,
    var(--chrome);
}
details.model[open] > summary::before {
  border-color: var(--black) var(--white) var(--white) var(--black);
  background:
    linear-gradient(var(--black), var(--black)) center / 8px 2px no-repeat,
    var(--chrome);
}
details.model > summary:hover { background: var(--blue); color: var(--white); }
table.specs {
  margin: 4px 0 10px 26px;
  border-collapse: collapse;
  background: var(--screen);
  border-style: solid;
  border-width: 2px;
  border-color: var(--black) var(--white) var(--white) var(--black);
  font-size: 14px;
}
table.specs th {
  font-family: var(--topaz);
  font-size: 16px;
  font-weight: normal;
  -webkit-font-smoothing: none;
  white-space: nowrap;
  padding: 4px 14px 4px 10px;
}
table.specs td { padding: 4px 10px 4px 0; }
@media (max-width: 720px) {
  table.specs { margin-left: 0; }
  table.specs th { white-space: normal; }
}

/* ---------- Glossary ---------- */
dl.gloss { margin: 6px 0 4px; }
dl.gloss dt {
  font-family: var(--topaz);
  font-size: 16px;
  -webkit-font-smoothing: none;
  margin-top: 10px;
}
dl.gloss dd { margin: 2px 0 0 24px; }
/* Big letter headings on the glossary page */
.qa:has(> dl.gloss) > h3 { font-size: 32px; line-height: 1.1; margin: 10px 0 0; }
/* Sidebar letters laid out as a compact grid */
ul.tree ul.qs.letters { padding-left: 14px; }
ul.tree ul.qs.letters li { display: inline-block; margin: 2px 1px; }
ul.tree ul.qs.letters a {
  font-family: var(--topaz);
  font-size: 16px;
  -webkit-font-smoothing: none;
  width: 24px;
  text-align: center;
  padding: 1px 0;
}

/* Sub-topic drawers inside a topic drawer */
ul.tree ul.subs { padding-left: 16px; }
