/* PollenID: echte-schaal galerij (1 µm = 5 px). */
.pid-scale-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.6rem 0 1rem;
}

/* Material: .md-typeset figure { margin: 1em auto }. Auto L/R on flex children
   eats free space and spreads figures across the row; reset for pollen rows. */
.md-typeset .pid-scale-gallery figure.pid-scale-item {
  margin: 0;
}

.pid-scale-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  justify-content: flex-start;
}

/* Keep items content-sized; theme resets sometimes give figure { flex: 1 }. */
.pid-scale-row > .pid-scale-item {
  flex: 0 0 auto;
}

.pid-scale-row.pid-scale-row--snug {
  gap: 0;
}

.pid-scale-row.pid-scale-row--snug .pid-scale-item {
  gap: 0;
}

.pid-scale-row.pid-scale-row--snug .pid-scale-caption {
  max-width: none;
  white-space: nowrap;
}

.pid-scale-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}

.pid-scale-item img {
  display: block;
  height: auto;
  max-width: 100%;
  border-radius: 0.2rem;
  box-shadow: var(--md-shadow-z1);
}

.pid-scale-row.pid-scale-row--grayscale img {
  filter: grayscale(1);
}

.pid-scale-caption {
  font-size: 0.72rem;
  line-height: 1.15;
  color: var(--md-default-fg-color--light);
  max-width: 48ch;
}

/* Pollentabel (van der Ham) interactief */
.vdh-pollentabel {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border-radius: 0.2rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  background-color: var(--md-code-bg-color);
}

.vdh-pollentabel-step h4 {
  margin-top: 0;
}

/* Geen theme .md-button: die gaf laag contrast (blauw op grijs). */
.vdh-pollentabel-btn {
  display: inline-block;
  margin: 0.35rem 0.5rem 0.35rem 0;
  padding: 0.5em 0.85em;
  font: inherit;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  border-radius: 0.2rem;
  transition: filter 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

/* Keuzes: rustige rand (grijs), tekst helder */
.vdh-pollentabel-btn--choice {
  display: block;
  width: 100%;
  max-width: 48rem;
  box-sizing: border-box;
  background: transparent;
  color: var(--md-default-fg-color);
  border: 1.5px solid var(--md-default-fg-color--light);
  text-align: left;
}

.vdh-pollentabel-btn--choice:hover {
  background: color-mix(in srgb, var(--md-default-fg-color) 6%, transparent);
  color: var(--md-default-fg-color);
  border-color: var(--md-default-fg-color--lighter);
}

.vdh-pollentabel-btn--choice:focus-visible {
  outline: 2px solid var(--md-default-fg-color--light);
  outline-offset: 2px;
}

.vdh-pollentabel-btn--nav {
  background: transparent;
  color: var(--md-typeset-a-color, var(--md-primary-bg-color));
  border: 1.5px solid var(--md-default-fg-color--light);
  text-align: center;
}

.vdh-pollentabel-btn--nav:hover {
  background: color-mix(in srgb, var(--md-default-fg-color) 6%, transparent);
  color: var(--md-typeset-a-color, var(--md-primary-bg-color));
  border-color: var(--md-default-fg-color--lighter);
}

.vdh-pollentabel-btn--nav:focus-visible {
  outline: 2px solid var(--md-default-fg-color--light);
  outline-offset: 2px;
}

.vdh-pollentabel-nav {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.vdh-pollentabel-outcome {
  margin-top: 1rem;
}

.vdh-pollentabel-outcome h4 {
  margin-top: 0;
}

.vdh-pollentabel-outcome p em,
.vdh-pollentabel-table-grid td em,
.vdh-pollentabel-btn--choice em {
  font-style: italic;
}

.vdh-pollentabel-outcome-table {
  width: auto;
  margin: 0.25rem 0 0.5rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.vdh-pollentabel-outcome-table th,
.vdh-pollentabel-outcome-table td {
  padding: 0.25rem 0.6rem;
  vertical-align: top;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  text-align: left;
}

.vdh-pollentabel-outcome-table th {
  font-weight: 600;
  color: var(--md-default-fg-color--light);
  white-space: nowrap;
}

.pid-placeholder-image {
  opacity: 0.35;
  filter: grayscale(1);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
  background: color-mix(in srgb, var(--md-default-bg-color) 70%, transparent);
}

/* Platte pollentabel (JSON → filterbare tabel) */
.vdh-pollentabel-table {
  margin: 1rem 0 1.5rem;
}

.vdh-pollentabel-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.vdh-pollentabel-table-filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--md-default-fg-color--light);
}

.vdh-pollentabel-table-filter {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 28rem;
  padding: 0.4em 0.65em;
  font: inherit;
  border-radius: 0.15rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
}

.vdh-pollentabel-table-count {
  margin: 0;
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
}

.vdh-pollentabel-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.2rem;
  border: 1px solid var(--md-default-fg-color--lightest);
}

.vdh-pollentabel-table-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.vdh-pollentabel-table-grid th,
.vdh-pollentabel-table-grid td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.vdh-pollentabel-table-grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--md-default-bg-color);
  font-weight: 600;
  box-shadow: 0 1px 0 var(--md-default-fg-color--lightest);
}

/* Kerckvliet determinatietabel: toolbar on two lines (row 2: Grootteklasse + Zoeken). */
.kerkvliet-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.kerkvliet-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.kerkvliet-select {
  max-width: 100%;
}

.kerkvliet-search {
  flex: 1 1 16rem;
  min-width: 12rem;
  max-width: 36rem;
}

.kerkvliet-count {
  margin: 0;
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
}

/* Material for MkDocs hides top navigation tabs below ~76em.
   Force them visible so the "Home / monoflorale honing / ..." tabs stay accessible. */
@media screen and (max-width: 76.234375em) {
  .md-tabs {
    display: block !important;
  }
}

/* TOC (secondary sidebar): Material uses height:0 on .md-sidebar--secondary; without a capped
   scroll area, wheel/touch scroll targets the article and long TOCs (e.g. Kerkvliet index) clip. */
@media screen and (min-width: 60em) {
  .md-sidebar--secondary .md-sidebar__scrollwrap {
    max-height: calc(100vh - 5.5rem);
    max-height: calc(100dvh - 5.5rem);
  }

  .md-header--lifted ~ .md-container .md-sidebar--secondary .md-sidebar__scrollwrap {
    max-height: calc(100vh - 8.5rem);
    max-height: calc(100dvh - 8.5rem);
  }
}

/* Tabs forced visible below ~76em: header stack is taller; avoid clipping TOC bottom. */
@media screen and (min-width: 60em) and (max-width: 76.234375em) {
  .md-sidebar--secondary .md-sidebar__scrollwrap {
    max-height: calc(100vh - 8rem);
    max-height: calc(100dvh - 8rem);
  }
}

.vdh-pollentabel-td-step {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  width: 3rem;
}

/* Plakkende koppen voor lange artikelen (o.a. _index-overzichten).
   H1 niet sticky: anders blijft de titel het plakvlak bezet en verdwijnen H2–H6 er visueel onder (zoals ### 4. Tetradeae). */
article.md-content__inner.md-typeset h2,
article.md-content__inner.md-typeset h3 {
  position: sticky;
  top: 6rem;
  z-index: 100;
  padding: 0.625rem 0;
  background-color: var(--md-default-bg-color);
  box-shadow: 0 1px 0 var(--md-default-fg-color--lightest);
}

/* Interactieve sleutel: stap-/eindpunt-koppen niet sticky. */
article.md-content__inner.md-typeset .vdh-pollentabel h2,
article.md-content__inner.md-typeset .vdh-pollentabel h3,
article.md-content__inner.md-typeset .vdh-pollentabel h4,
article.md-content__inner.md-typeset .vdh-pollentabel h5,
article.md-content__inner.md-typeset .vdh-pollentabel h6 {
  position: static;
  z-index: auto;
  padding: revert;
  background-color: transparent;
  box-shadow: none;
}
