/* Honeybee Database — one stylesheet for every page. */

:root {
  --ink: #1f2a24;        /* deep pine, for text */
  --muted: #56635b;      /* sources, notes */
  --paper: #ffffff;
  --leaf: #2f5d46;       /* links */
  --line: #d6ddd4;
  --honey: #e8a317;      /* "keep bees" cells */
  --wax: #f5d27a;        /* "learn about bees" cells */
  --cell-ink: #1f2a24;
  --focus: #1a6fd0;
  --measure: 68ch;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --slab: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7ece7;
    --muted: #a9b5ad;
    --paper: #141a16;
    --leaf: #9fd0b3;
    --line: #2c3730;
    --focus: #7fb6ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.6 var(--body);
}
a { color: var(--leaf); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2 { font-family: var(--slab); font-weight: 700; line-height: 1.15; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); margin: 0 0 .5rem; }
h2 { font-size: 1.6rem; margin: 2.75rem 0 .75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 5; }

/* Masthead and footer */
.masthead, main, .foot { width: min(100% - 2rem, 1080px); margin-inline: auto; }
.masthead {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center;
  padding: 1.25rem 0; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font: 700 1.3rem/1 var(--slab); }
.brand-mark { width: 1.35rem; height: 1.55rem; fill: var(--honey); }
.masthead-link { font-size: 1rem; }
.foot { border-top: 1px solid var(--line); margin-top: 5rem; padding: 1.5rem 0 3rem; color: var(--muted); font-size: .95rem; }
.foot p { max-width: var(--measure); margin: .4rem 0; }

/* Home */
.lede { font-size: 1.2rem; max-width: var(--measure); }
.hero { padding: 2.5rem 0 .5rem; }
.hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); max-width: 22ch; }
.hero .lede { max-width: 56ch; margin-bottom: 0; }

.comb-wrap { margin: 2rem 0 1rem; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 0; column-gap: 0; color: var(--muted); font-size: .95rem; margin: 0 0 1rem; }
.key { display: inline-block; width: 1rem; height: .87rem; margin-right: .4rem; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); vertical-align: -1px; }
.key.learn { background: var(--wax); }
.key.keep { background: var(--honey); margin-left: 1.4rem; }

/* The honeycomb: flat-topped hexagons, every other column dropped half a cell. */
.comb {
  --cols: 5;
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  /* the outer hexagons overhang their grid cells by 1/6 of a cell */
  padding-inline: calc(100% / var(--cols) / 6);
  padding-bottom: calc((100% / var(--cols)) * 4 / 3 * .433);
}
.cell { margin-inline: -16.667%; }
.cell:nth-child(5n + 2), .cell:nth-child(5n + 4) { transform: translateY(50%); }
.cell a {
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  aspect-ratio: 1 / .866;
  padding: 0 19%;
  clip-path: polygon(25.5% 1%, 74.5% 1%, 99% 50%, 74.5% 99%, 25.5% 99%, 1% 50%);
  color: var(--cell-ink); text-decoration: none;
  transition: background-color .15s ease;
}
.cell.learn a { background: var(--wax); }
.cell.keep a { background: var(--honey); }
.cell a:hover { background: var(--ink); color: var(--paper); }
@media (prefers-color-scheme: dark) { .cell a:hover { background: #fff6dc; color: #1f2a24; } }
.cell a:focus-visible { outline: none; background: var(--focus); color: #fff; }
.cell-title { font: 700 clamp(1rem, .7rem + .8vw, 1.3rem)/1.12 var(--slab); }
.cell-sum { font-size: .86rem; line-height: 1.3; margin-top: .4rem; }
.cell-count { font-size: .8rem; margin-top: .35rem; opacity: .8; }

@media (max-width: 860px) {
  .comb { --cols: 3; }
  .cell:nth-child(n) { transform: none; }
  .cell:nth-child(3n + 2) { transform: translateY(50%); }
}
@media (max-width: 600px) {
  .comb { --cols: 2; }
  .cell:nth-child(n) { transform: none; }
  .cell:nth-child(2n) { transform: translateY(50%); }
  .cell-sum, .cell-count { display: none; }
  .cell a { padding: 0 16%; }
  .cell-title { font-size: 1.08rem; }
}
@media (prefers-reduced-motion: reduce) { .cell a { transition: none; } }

/* Search */
.search { max-width: var(--measure); margin-top: 2.5rem; }
.search input {
  width: 100%; font: inherit; padding: .75rem 1rem; border: 2px solid var(--line); border-radius: 6px;
  background: var(--paper); color: var(--ink);
}
.search input:focus { border-color: var(--leaf); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.status { color: var(--muted); font-size: .95rem; min-height: 1.5em; margin: .6rem 0 0; }
.in-section { font-size: .9rem; }

/* Topic pages */
.topic { max-width: var(--measure); padding-top: 2rem; }
.crumb { font-size: .95rem; color: var(--muted); margin: 0 0 1rem; }
.jump { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: .75rem 0; border-block: 1px solid var(--line); margin-top: 1.5rem; }
.count { font-family: var(--body); font-weight: 400; font-size: 1rem; color: var(--muted); }

.links { list-style: none; padding: 0; margin: 0; }
.link { padding: .9rem 0 .95rem; border-bottom: 1px solid var(--line); }
.link > a { font-weight: 700; font-size: 1.15rem; }
.source { margin: .15rem 0 0; color: var(--muted); font-size: .95rem; }
.host { white-space: nowrap; }
.host::before { content: "("; } .host::after { content: ")"; }
.note { margin: .25rem 0 0; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; }
.pager a { display: block; padding: 1rem 0; text-decoration: none; font: 700 1.15rem/1.25 var(--slab); }
.pager a span { display: block; font: 400 .9rem var(--body); color: var(--muted); margin-bottom: .2rem; }
.pager .next { text-align: right; }
.pager a:hover { text-decoration: underline; }

.prose p { max-width: var(--measure); }
.sources { columns: 2 16rem; padding-left: 1.2rem; }
.updated { color: var(--muted); font-size: .95rem; margin-top: 2rem; }
