/* BKBoK - Beekeeping Book of Knowledge - site stylesheet.
   Made from the Rosetta manuals' rosetta-docs.css (Rosetta repo and
   RosettaSupportManual repo), recoloured honey: a honey-gold header with
   dark honey-brown text, amber-brown links on a cream page (option B,
   chosen by Rich 22 November 2026). Plain CSS, no external files.

   Contrast (WCAG): header text on header 9.0:1, body text 15.1:1,
   headings 8.4:1, links 6.5:1, text in a note box 13:1.

   Version
     1.0 - 22 November 2026
     1.1 - 23 November 2026 - on a phone, layout tables holding columns
           (class "stack") go one under the other; only tables of data
           (class "lined") scroll sideways; captioned pictures fit the
           screen */

:root {
  --navy: #6b4200;       /* headings (the name is kept from the Rosetta stylesheet) */
  --ink: #1d2330;
  --muted: #6b5a3a;
  --page: #fffaf0;       /* cream */
  --backdrop: #fffaf0;
  --rule: #e2c98a;
  --panel: #fff4d6;
  --link: #8a4b00;       /* amber-brown */
  --link-hover: #5c3200;
  --header: #ffc30b;     /* honey gold */
  --header-ink: #3b2500; /* dark honey brown - white on honey gold is only 1.6:1 */
  --accent: #d99a00;
  --note: #fff1c4;
}

* { box-sizing: border-box; }

html { background: var(--backdrop); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--backdrop);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "DejaVu Sans", Arial, sans-serif;
}

/* Hyphenation, as in the Sharpening Handbook: on for running text
   (needs lang="en" on <html>), off for headings, navigation and code. */
body { -webkit-hyphens: auto; hyphens: auto; }
h1, h2, h3, h4, .site-header, .crumbs, .toc, .footer-links, code, pre, kbd, a {
  -webkit-hyphens: manual; hyphens: manual;
}

a { color: var(--link); }
a { text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;     /* stays at the top while scrolling */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 10px 24px;
  background: var(--header);
  color: var(--header-ink);
  border-bottom: 1px solid #d99a00;
}
.brand { display: flex; align-items: center; min-width: 0; }
.brand img { display: block; height: 60px; width: auto; max-width: 100%; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: var(--header-ink); text-decoration: none; padding: 6px 12px; border-radius: 6px;
  border: 1px solid rgba(59,37,0,.4); font-size: 15px;
}
.site-nav a:hover { background: rgba(255,255,255,.35); color: var(--header-ink); }

/* jumping to a heading leaves it below the sticky header, not under it */
[id] { scroll-margin-top: 92px; }

/* ---------- search (rosetta-docs.js) ---------- */
.site-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.site-search input {
  width: 100%; padding: 7px 12px; font: inherit; font-size: 15px;
  border: 1px solid rgba(59,37,0,.45); border-radius: 6px;
  background: rgba(255,255,255,.4); color: var(--header-ink);
}
.site-search input::placeholder { color: #5c4210; }
.site-search input:focus { outline: none; background: #fff; color: var(--ink); }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 70vh; overflow-y: auto; min-width: 320px;
  background: #fff; color: var(--ink); border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); -webkit-hyphens: manual; hyphens: manual;
}
.search-results a {
  display: block; padding: 8px 12px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid #eceef2;
}
.search-results a:hover, .search-results a.active { background: #fff4d6; color: var(--ink); }
.search-title { display: block; font-weight: 600; color: var(--navy); }
.search-head { font-weight: 400; }
.search-where { display: block; font-size: 12px; color: var(--muted); }
.search-snip { display: block; font-size: 13.5px; color: #3b4352; margin-top: 2px; }
.search-results mark { background: #ffe58a; color: inherit; padding: 0 1px; }
.search-none { margin: 0; padding: 10px 12px; color: var(--muted); }

/* ---------- picture zoom (rosetta-docs.js) ---------- */
img.zoomable { cursor: zoom-in; }
.zoom-overlay {
  position: fixed; inset: 0; z-index: 100; cursor: zoom-out;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 30, .82); padding: 2vh 2vw;
}
.zoom-overlay img { max-width: 96vw; max-height: 94vh; background: #fff; box-shadow: 0 4px 30px rgba(0,0,0,.5); }

/* ---------- page ---------- */
.page {
  margin: 0;
  padding: 20px 32px 32px;
  background: var(--page);
  overflow-wrap: break-word;
}
.crumbs { margin: 0 0 4px; font-size: 14px; color: var(--muted); min-height: 1em; }
.crumbs a { color: var(--muted); }
h1 { color: var(--navy); font-size: 32px; line-height: 1.2; margin: 0 0 16px; }
h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 1.6em 0 .4em; clear: none; }
.content h1 { font-size: 27px; margin: 1.6em 0 .4em; padding-bottom: 4px; border-bottom: 2px solid var(--rule); }
h2 { font-size: 23px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
p { margin: .6em 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.4em 0; clear: both; }
img { max-width: 100%; height: auto; }
code, pre, kbd { font-family: "DejaVu Sans Mono", Menlo, Consolas, monospace; font-size: .92em; }
pre { background: var(--panel); padding: 12px 14px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; }

/* "On this page" */
.toc {
  display: inline-block; min-width: 280px; max-width: 100%;
  margin: 0 0 20px; padding: 10px 16px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; font-size: 14.5px;
}
.toc p { margin: 0 0 4px; font-weight: 600; color: var(--navy); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 3px 0; }
.toc .toc-l1 { padding-left: 14px; } .toc .toc-l2 { padding-left: 28px; font-size: 13.5px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* links to another web site (the old site typed "↗" after them by hand) */
a.online::after { content: " ↗"; font-size: .85em; }

/* ---------- PmWiki-era content classes ---------- */
.content table { border-collapse: collapse; max-width: 100%; }
.content td, .content th { padding: 4px 8px; vertical-align: top; }
.content table[border="1"] td, .content table[border="1"] th { border: 1px solid var(--rule); }
.vspace { margin-top: 1em; }
.indent { margin-left: 2em; }
.clearboth { clear: both; }
.left { text-align: left; } .center { text-align: center; } .right { text-align: right; }
.rfloat { float: right; margin: 4px 0 12px 20px; }
.lfloat { float: left; margin: 4px 20px 12px 0; }
.img { margin: 0; }
.content div[style*="width"] { max-width: 100%; }   /* captioned pictures set a width */
.frame { display: inline-block; padding: 6px; background: #fff; max-width: 100%; border: 1px solid var(--rule); border-radius: 4px; }
.frame.rfloat, .frame.lfloat { display: block; }
.caption { display: block; text-align: center; font-size: 14.5px; color: var(--muted); padding-top: 4px; }
.pmL1 { font-size: 1.2em; } .pmL2 { font-size: 1.44em; } .pmL3 { font-size: 1.73em; } .pmL4 { font-size: 2.07em; }
.pmS1 { font-size: .83em; } .pmS2 { font-size: .69em; }
math { font-size: 1.1em; }

/* ---------- Previous / Next (tools/build_site.py) ---------- */
.pager {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px;
  margin-top: 32px; -webkit-hyphens: manual; hyphens: manual;
}
.pager a {
  display: block; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--panel); text-decoration: none; color: var(--navy); font-weight: 600;
}
.pager a:hover { border-color: var(--accent); }
.pager a span { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.pager-prev { grid-column: 1; }
.pager-prev span::before { content: "\2190  "; }
.pager-contents { grid-column: 2; text-align: center; }
.pager-next { grid-column: 3; text-align: right; }
.pager-next span::after { content: "  \2192"; }

/* ---------- Note boxes ---------- */
.note {
  margin: 1em 0; padding: 10px 14px; border-left: 5px solid var(--accent);
  background: var(--note);
}
.note > :first-child { margin-top: 0; } .note > :last-child { margin-bottom: 0; }


/* ---------- download button ---------- */
a.download {
  display: inline-block; margin: 4px 0; padding: 7px 14px; border-radius: 6px;
  background: var(--navy); color: #fff; text-decoration: none; font-weight: 600;
}
a.download:hover { background: #4a2c00; color: #fff; }

/* ---------- footer ---------- */
.site-footer {
  margin: 0; padding: 12px 32px 24px; border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 14px;
}
.site-footer p { margin: .4em 0; }
.footer-links {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 24px;
  margin: 10px 0; padding: 8px 12px; background: var(--panel); border: 1px solid var(--rule); color: var(--ink);
}
.footer-contact { text-align: right; }
.copyright { font-size: 13px; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header { padding: 10px 16px; }
  .page { padding: 16px; }
  .site-footer { padding: 12px 16px 20px; }
  .footer-links { grid-template-columns: 1fr; }
  .site-search { order: 3; flex-basis: 100%; max-width: none; }
  .search-results { min-width: 0; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager-next { grid-column: 2; }
  .pager-contents { grid-column: 1 / -1; grid-row: 2; }
  .brand img { height: auto; }
  .site-header { position: static; }    /* on a phone it would take too much of the screen */
  [id] { scroll-margin-top: 8px; }
  .footer-contact { text-align: left; }
  .rfloat, .lfloat, .content table[style*="float"] { float: none !important; width: auto !important; margin: 12px 0 !important; }
  /* layout tables holding columns (the Index, the Calendar's months) go
     one under the other; tables of data scroll sideways if they must */
  .content table.stack, .content table.stack > tbody, .content table.stack > tr,
  .content table.stack > tbody > tr, .content table.stack > tr > td,
  .content table.stack > tbody > tr > td { display: block; width: auto !important; }
  .content table.layout { max-width: 100%; }
  .content table.layout[width], .content table.layout[style*="width"] { width: auto !important; }
  .content table.lined:not(.stack) { display: block; overflow-x: auto; }
  .content table[align="right"], .content table[align="left"] {
    float: none; margin: 12px auto; width: auto !important; max-width: 100%;
  }
  .indent { margin-left: 1em; }
  h1 { font-size: 26px; }
}

@media print {
  html, body { background: #fff; }
  .site-header, .site-nav, .toc, .site-footer, .pager, .site-search { display: none; }
  .page { box-shadow: none; margin: 0; max-width: none; padding: 0; }
  a.online::after { content: none; }
}
