/* ==========================================================================
   LEXIKON (Übersicht und Artenseiten) – ergänzt css/shop.css
   Die Filter, Karten und Schaltflächen nutzen die Klassen des Shops (sh-...).
   Gehört zu tools/build.mjs und js/lexikon-filter.js
   ========================================================================== */

body.lx-page .lx-main { padding: 24px 16px 40px; }

.lx-wrap {
    --lx-measure: 72ch;
}

/* ---------- Brotkrumen ---------- */
.lx-crumbs {
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: var(--sh-muted);
}

.lx-crumbs a { color: var(--sh-green); text-decoration: underline; }

/* ---------- Übersicht ---------- */
.sh-card-title a {
    color: inherit;
    text-decoration: none;
}

.sh-card-title a:hover { color: var(--sh-green); text-decoration: underline; }
.lx-card .sh-card-title { font-size: 1.05rem; margin: 0; }
.lx-card .sh-card-body { padding-bottom: 14px; }
.lx-card[hidden] { display: none; }

.lx-teaser { display: none; margin: 10px 0 0; font-size: 0.9rem; color: var(--sh-muted); }

.lx-grid.is-list .lx-teaser { display: block; }
.lx-grid.is-list .lx-card { grid-template-columns: 200px minmax(0, 1fr); }

.lx-sub { margin-left: 22px; font-size: 0.85rem; }

/* ---------- Seite einer Art ---------- */
.lx-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 32px;
    align-items: start;
}

.lx-article { min-width: 0; max-width: var(--lx-measure); }

.lx-article h1 {
    margin: 0 0 12px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    text-wrap: balance;
}

.lx-lead { font-size: 1.1rem; line-height: 1.65; margin: 0 0 18px; }

.lx-section { margin-top: 28px; }

.lx-section h2 {
    margin: 0 0 8px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    text-wrap: balance;
}

.lx-section p { margin: 0 0 12px; line-height: 1.7; }

.lx-figure { margin: 16px 0; }

.lx-figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.lx-figure figcaption { margin-top: 6px; font-size: 0.85rem; font-style: italic; color: var(--sh-muted); }

.lx-sources { font-size: 0.85rem; color: var(--sh-muted); }
.lx-sources h2 { font-size: 1.05rem; }
.lx-sources p { line-height: 1.6; }

.ref-box {
    display: inline-block;
    min-width: 1.4em;
    padding: 0 4px;
    font-size: 0.8em;
    text-align: center;
    border: 1px solid var(--sh-line);
    border-radius: 4px;
}

/* ---------- Steckbrief ---------- */
.lx-side {
    position: sticky;
    top: 96px;
    padding: 18px;
    background: var(--sh-soft);
    border-radius: var(--sh-radius);
}

.lx-side h2 { margin: 0 0 10px; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.04em; }
.lx-side dl { margin: 0 0 14px; }
.lx-side dt { margin-top: 10px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sh-muted); }
.lx-side dd { margin: 2px 0 0; font-size: 0.95rem; }
.lx-side p { margin: 0 0 10px; }
.lx-back { font-size: 0.9rem; color: var(--sh-green); }

.lx-shopbtn {
    display: block;
    text-align: center;
    text-decoration: none;
}

/* ---------- Vorherige / nächste Pflanze ---------- */
.lx-prevnext {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--sh-line);
}

.lx-prevnext a {
    display: block;
    max-width: 48%;
    padding: 10px 14px;
    color: var(--sh-ink);
    text-decoration: none;
    border: 1px solid var(--sh-line);
    border-radius: 8px;
}

.lx-prevnext a:hover { border-color: var(--sh-green); color: var(--sh-green); }
.lx-prevnext small { display: block; font-size: 0.75rem; color: var(--sh-muted); }
.lx-next { text-align: right; margin-left: auto; }

@media (max-width: 900px) {
    body.lx-page .lx-main { padding: 12px 8px 32px; }
    .lx-article-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .lx-side { position: static; }
    .lx-article h1 { font-size: 1.6rem; }
    .lx-grid.is-list .lx-card { grid-template-columns: 110px minmax(0, 1fr); }
}

/* ==========================================================================
   BIOGEOGRAPHIE (Regionen) – gehört zu tools/build.mjs und js/biogeo-filter.js
   ========================================================================== */

.bg-card { overflow: hidden; }
.bg-card[hidden] { display: none; }

.bg-card-head {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    min-height: 96px;
    padding: 12px 14px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--bg-a), var(--bg-b));
}

.bg-card-reich { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.02em; }
.bg-card-typ { font-size: 0.8rem; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.06em; }

.bg-r-holarktis    { --bg-a: #2d6a4f; --bg-b: #5b8f6f; }
.bg-r-palaeotropis { --bg-a: #9a4f12; --bg-b: #c0792f; }
.bg-r-neotropis    { --bg-a: #1f6b66; --bg-b: #3e9690; }
.bg-r-capensis     { --bg-a: #7a3f6e; --bg-b: #a56a97; }
.bg-r-australis    { --bg-a: #85650f; --bg-b: #b08f2e; }
.bg-r-antarktis    { --bg-a: #2f5f8f; --bg-b: #5a8cbb; }

.bg-teaser { display: block; }
.bg-grid.is-grid .bg-teaser { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.bg-card-foot {
    margin-top: auto;
    padding: 9px 14px;
    font-size: 0.85rem;
    color: var(--sh-muted);
    border-top: 1px solid var(--sh-line);
}

.bg-grid.is-list .bg-card { grid-template-columns: 170px minmax(0, 1fr); }
.bg-grid.is-list .bg-card-head { min-height: 100%; }
.bg-grid.is-list .bg-card-foot { grid-column: 2; }

.bg-hint { margin: 0 0 6px; font-size: 0.8rem; color: var(--sh-muted); }

.bg-notes { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--sh-line); }
.bg-notes h3 { margin: 18px 0 6px; font-size: 1rem; }
.bg-quellen { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; line-height: 1.55; color: var(--sh-muted); }
.bg-quellen a { color: var(--sh-green); }

.bg-table { width: 100%; max-width: 560px; margin: 12px 0 6px; border-collapse: collapse; font-size: 0.95rem; }
.bg-table th, .bg-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--sh-line); }
.bg-table th { width: 42%; font-weight: 600; background: var(--sh-soft); }
.bg-note { margin: 4px 0 0; font-size: 0.82rem; font-style: italic; color: var(--sh-muted); }

.bg-plants { margin: 6px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.bg-plants a { display: block; padding: 8px 12px; color: var(--sh-ink); text-decoration: none; border: 1px solid var(--sh-line); border-radius: 8px; }
.bg-plants a:hover { border-color: var(--sh-green); color: var(--sh-green); }
.bg-plants i { display: block; font-size: 0.85rem; color: var(--sh-muted); }

.lx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lx-side dd a { color: var(--sh-green); }

@media (max-width: 900px) {
    .bg-grid.is-list .bg-card { grid-template-columns: 110px minmax(0, 1fr); }
}

.bg-head p { max-width: none; }
.autor { font-variant: small-caps; letter-spacing: 0.02em; }

/* ---------- Glossar ---------- */
.gl-tools { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; margin-bottom: 8px; }
.gl-search { margin: 0; flex: 0 1 320px; min-width: 220px; }
.gl-letters { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 420px; }
.gl-letters a, .gl-letters .gl-off { min-width: 34px; padding: 6px 8px; text-align: center; border-radius: 6px; font-size: 0.9rem; line-height: 1.2; text-decoration: none; }
.gl-letters a { color: var(--sh-green); border: 1px solid var(--sh-line, #d6d6d0); background: #fff; }
.gl-letters a:hover, .gl-letters a:focus-visible { border-color: var(--sh-green); }
.gl-letters a.is-active { background: var(--sh-green); border-color: var(--sh-green); color: #fff; }
.gl-letters a.is-dim { opacity: 0.35; }
.gl-letters .gl-off { color: var(--sh-muted); opacity: 0.4; border: 1px solid transparent; }
.gl-letters .gl-all { padding-left: 12px; padding-right: 12px; }
#gl-list { margin-top: 8px; }
.gl-group { margin: 0 0 28px; scroll-margin-top: 90px; }
.gl-group h2 { margin: 0 0 8px; padding-bottom: 4px; font-size: 1.6rem; color: var(--sh-green); border-bottom: 1px solid var(--sh-line, #d6d6d0); }
.gl-group dl { margin: 0; }
.gl-entry { padding: 10px 0; scroll-margin-top: 90px; }
.gl-entry[hidden], .gl-group[hidden] { display: none; }
.gl-entry dt { font-weight: 600; font-size: 1.05rem; }
.gl-entry dd { margin: 2px 0 0; }
.gl-entry dd p { margin: 0 0 4px; max-width: 75ch; line-height: 1.55; }
.gl-auch { font-weight: 400; font-size: 0.85rem; color: var(--sh-muted); margin-left: 6px; }
.gl-siehe { font-size: 0.85rem; color: var(--sh-muted); }
.gl-siehe a { color: var(--sh-green); }
.gl-entry.is-target { background: #f3f7ee; outline: 2px solid var(--sh-green); outline-offset: 4px; border-radius: 4px; }
.gl-search input[type="search"] { width: 100%; min-width: 0; padding: 8px 10px; font: inherit; font-size: 0.95rem; border: 1px solid var(--sh-line); border-radius: 6px; background: #fff; color: var(--sh-ink); }
.gl-search input[type="search"]:focus-visible { outline: 2px solid var(--sh-green); outline-offset: 1px; }
.gl-letters a:focus-visible { outline: 2px solid var(--sh-green); outline-offset: 1px; }

/* Glossar-Verweise im Text: dezent gepunktet unterstrichen */
a.gl-link { color: inherit; text-decoration: underline dotted; text-decoration-color: var(--sh-green, #2d6a4f); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.gl-link:hover, a.gl-link:focus-visible { color: var(--sh-green, #2d6a4f); text-decoration-style: solid; }
