/* Baumaschinen-Lexikon (/wiki) — single-page glossary.
   Aligned to the epsilon design system: brand blue #2E6AAD, square corners
   (no border-radius), WHITE content page (like the item page — body#item is #fff;
   custom pages default to grey body#custom, so force white for wiki), full width. */

/* The custom-page body is grey (#f5f5f5) by default; content pages (item) are
   white. Match that: body carries class `plugin-wiki` only on /wiki. */
body.plugin-wiki { background: #fff; }

#wiki-page {
  --wiki-blue: #2E6AAD;          /* brand blue (--pd-blue) */
  --wiki-ink: #0D0D0D;
  --wiki-ink2: #666666;
  --wiki-ink3: #6B7280;
  --wiki-line: #e4e8ee;
  --wiki-bg: #fff;              /* page bg is white now */
  --wiki-alt: #FAFBFC;
  --wiki-header-offset: 68px;    /* header height — toolbar's initial sticky top (JS then tracks the header live) */
  --wiki-anchor-offset: 178px;   /* deep-link clearance: header + full toolbar height, so a term isn't hidden under it */
  width: 100%;
  box-sizing: border-box;
  padding: 20px 0 64px;
  color: var(--wiki-ink);
}

/* --- hero --- */
.wiki-hero { margin-bottom: 18px; }
.wiki-h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 10px; line-height: 1.15; }
.wiki-lead { font-size: 1rem; line-height: 1.6; color: var(--wiki-ink2); max-width: 62ch; margin: 0; }

.wiki-empty {
  padding: 40px 20px; text-align: center; color: var(--wiki-ink2);
  background: #fff; border: 1px solid var(--wiki-line);
}

/* --- sticky toolbar: filter + section nav --- */
.wiki-toolbar {
  /* z-index BELOW the site header (which is z:8) but above page content: during
     the header's reveal transition the toolbar top can momentarily sit under the
     header edge; keeping it beneath the header hides that overlap (no "riding on
     top of the header"). Still above terms (z auto) so they scroll under it. */
  position: sticky; top: var(--wiki-header-offset); z-index: 7;
  background: var(--wiki-bg);          /* blend with the page, not a white bar */
  padding: 12px 0; margin: 4px 0 22px;
  border-bottom: 1px solid var(--wiki-line);
}
/* header auto-hides on scroll-down (.header-hidden); when it's gone the toolbar
   sits at the very top instead of leaving a 78px gap under a missing header. */
body:has(header.header-hidden) #wiki-page .wiki-toolbar { top: 0; }

.wiki-search { position: relative; margin-bottom: 10px; }
#wiki-filter {
  width: 100%; box-sizing: border-box;
  padding: 11px 14px; font-size: 1rem;
  border: 1px solid #ccc; border-radius: 0;
  background: #fff; transition: border-color .15s ease;
}
#wiki-filter:focus { outline: none; border-color: var(--wiki-blue); }
.wiki-noresult { display: block; margin-top: 8px; color: var(--wiki-ink2); font-size: .95rem; }
.wiki-noresult[hidden] { display: none; }

.wiki-secnav { display: flex; flex-wrap: wrap; gap: 6px; }
.wiki-secnav-item {
  font-size: .82rem; line-height: 1; text-decoration: none;
  padding: 7px 11px; border-radius: 0;
  color: var(--wiki-ink2); background: #fff;
  border: 1px solid var(--wiki-line); transition: all .15s ease; white-space: nowrap;
}
.wiki-secnav-item:hover { color: #fff; background: var(--wiki-blue); border-color: var(--wiki-blue); }

/* --- groups --- */
.wiki-group { margin-bottom: 34px; scroll-margin-top: var(--wiki-anchor-offset); }
.wiki-group-title {
  font-size: 1.25rem; margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--wiki-line);
}
.wiki-group.wiki-hidden { display: none; }

/* term grid: use the full site width in two readable columns on desktop */
.wiki-terms-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: start; }
@media (max-width: 800px) { .wiki-terms-grid { grid-template-columns: 1fr; } }

/* --- term block --- */
.wiki-term {
  scroll-margin-top: var(--wiki-anchor-offset);
  padding: 16px 18px;
  background: var(--wiki-alt); border: 1px solid var(--wiki-line);
  border-left: 3px solid var(--wiki-line);
  border-radius: 0; transition: border-color .2s ease, box-shadow .2s ease;
}
.wiki-term.wiki-hidden { display: none; }
.wiki-term-name { font-size: 1.1rem; margin: 0 0 8px; }

.wiki-term-body { line-height: 1.6; color: #333; font-size: .95rem; }
.wiki-term-body p { margin: 0 0 9px; }
.wiki-term-body p:last-child { margin-bottom: 0; }
.wiki-term-body ul { margin: 8px 0; padding-left: 20px; }

.wiki-term-tip {
  margin: 13px 0 0; padding: 11px 13px;
  background: #eef3f9; border-left: 3px solid var(--wiki-blue);
  line-height: 1.5; font-size: .9rem;
}
.wiki-tip-label {
  display: block; font-weight: 700; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .03em; color: var(--wiki-blue); margin-bottom: 4px;
}

/* CTA back into the filtered catalog */
.wiki-term-cta {
  display: inline-block; margin-top: 13px;
  font-size: .88rem; font-weight: 600; text-decoration: none;
  color: var(--wiki-blue);
}
.wiki-term-cta:hover { text-decoration: underline; }
.wiki-term-cta::after { content: " →"; }

.wiki-backtop {
  display: inline-block; margin-top: 10px; margin-left: 14px;
  font-size: .8rem; color: var(--wiki-ink3); text-decoration: none;
}
.wiki-backtop:hover { color: var(--wiki-blue); }

/* --- deep-link highlight --- */
@keyframes wiki-flash {
  0%   { border-left-color: var(--wiki-blue); box-shadow: 0 0 0 3px rgba(46,106,173,.18); }
  100% { border-left-color: var(--wiki-line); box-shadow: 0 0 0 0 rgba(46,106,173,0); }
}
.wiki-term.wiki-target {
  border-left-color: var(--wiki-blue);
  animation: wiki-flash 2.2s ease-out .1s 1;
}

@media (max-width: 600px) {
  .wiki-toolbar { top: 56px; }
  body:has(header.header-hidden) #wiki-page .wiki-toolbar { top: 0; }
}
