/*
 * Zollcon Lexikon – Front-end styles
 * CI: Türkis #00CED1 · near-black Headings · klare, edle B2B-Optik
 * Version: 3.0.0
 * Alle Selektoren sind unter Plugin-Wrappern gescoped, um Theme-Styles nicht zu beeinflussen.
 * Die Design-Tokens liegen prefixsicher (--zlex-*) auf :root, damit auch die
 * automatischen Begriffs-Links inkl. Tooltip auf beliebigen Seiten korrekt gestylt sind.
 */

:root {
    --zlex-accent:       #00CED1;
    --zlex-accent-dark:  #00A6A9;
    --zlex-accent-deep:  #007F82;
    --zlex-accent-soft:  #E8FBFB;
    --zlex-ink:          #0E1116;
    --zlex-text:         #39434B;
    --zlex-muted:        #6B7780;
    --zlex-line:         #E6EBEF;
    --zlex-line-strong:  #D3DBE1;
    --zlex-bg:           #F5F8F9;
    --zlex-card:         #FFFFFF;
    --zlex-radius:       4px;
    --zlex-radius-lg:    6px;
    --zlex-shadow-sm:    0 1px 3px rgba(14,17,22,0.06), 0 1px 2px rgba(14,17,22,0.04);
    --zlex-shadow-md:    0 8px 30px rgba(14,17,22,0.08);
    --zlex-shadow-cta:   0 18px 50px rgba(0,166,169,0.18);
    --zlex-ease:         180ms cubic-bezier(.2,.6,.2,1);
    --zlex-font:         inherit;
}

/* =====================================================
   ARCHIVE
   ===================================================== */
.zollcon-lexikon-archive {
    max-width: 1160px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    width: 100%;
    box-sizing: border-box;
    color: var(--zlex-text);
    font-family: var(--zlex-font);
}
.zollcon-lexikon-archive *,
.zlex-entry * { box-sizing: border-box; }

/* ---- Hero ---- */
.zlex-hero {
    margin-bottom: 2.25rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--zlex-line);
}
.zlex-eyebrow {
    display: inline-block;
    margin: 0 0 .85rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--zlex-accent-deep);
    position: relative;
    padding-left: 2.4rem;
}
.zlex-eyebrow::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1.9rem;
    height: 2px;
    background: var(--zlex-accent);
    transform: translateY(-50%);
}
.zlex-hero h1.zlex-title {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -.015em;
    color: var(--zlex-ink);
}
.zlex-hero h1.zlex-title .zlex-title-accent {
    display: block;
    font-weight: 500;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    letter-spacing: 0;
    color: var(--zlex-muted);
    margin-top: .65rem;
}
.zlex-hero-meta {
    margin: 1.1rem 0 0;
    font-size: .92rem;
    color: var(--zlex-muted);
}
.zlex-hero-meta strong { color: var(--zlex-ink); font-weight: 700; }

/* ---- Toolbar (search + filter) ---- */
.zlex-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.zlex-search { flex: 1 1 280px; }
.zlex-search form { margin: 0; }
.zlex-search-wrap { position: relative; display: flex; align-items: center; }
.zlex-search-icon {
    position: absolute;
    left: .95rem;
    width: 1.1rem; height: 1.1rem;
    fill: var(--zlex-muted);
    pointer-events: none;
}
.zlex-search input[type="search"] {
    width: 100%;
    padding: .85rem 1rem .85rem 2.85rem;
    border: 1.5px solid var(--zlex-line-strong);
    border-radius: var(--zlex-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--zlex-card);
    color: var(--zlex-ink);
    outline: none;
    transition: border-color var(--zlex-ease), box-shadow var(--zlex-ease);
}
.zlex-search input[type="search"]::placeholder { color: var(--zlex-muted); }
.zlex-search input[type="search"]:focus {
    border-color: var(--zlex-accent);
    box-shadow: 0 0 0 4px rgba(0,206,209,.16);
}

/* ---- Category filter ---- */
.zlex-cat-filter { display: flex; flex-wrap: wrap; gap: .5rem; }
.zlex-cat-btn {
    display: inline-block;
    padding: .55rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--zlex-text);
    background: var(--zlex-card);
    border: 1.5px solid var(--zlex-line-strong);
    border-radius: 100px;
    text-decoration: none;
    transition: all var(--zlex-ease);
    line-height: 1.2;
}
.zlex-cat-btn:hover { border-color: var(--zlex-accent); color: var(--zlex-accent-deep); }
.zlex-cat-btn.active {
    background: var(--zlex-ink);
    border-color: var(--zlex-ink);
    color: #fff;
}
.zlex-cat-btn.reset { border-style: dashed; color: var(--zlex-muted); }

/* ---- Stats: popular / recent ---- */
.zlex-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2.25rem;
}
.zlex-stat-card {
    background: var(--zlex-bg);
    border: 1px solid var(--zlex-line);
    border-radius: var(--zlex-radius-lg);
    padding: 1.35rem 1.5rem;
}
.zlex-stat-card h3 {
    margin: 0 0 .85rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--zlex-accent-deep);
}
.zlex-stat-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.zlex-stat-card li a {
    display: inline-block;
    padding: .35rem .8rem;
    font-size: .86rem;
    color: var(--zlex-ink);
    background: var(--zlex-card);
    border: 1px solid var(--zlex-line);
    border-radius: 100px;
    text-decoration: none;
    transition: all var(--zlex-ease);
}
.zlex-stat-card li a:hover { border-color: var(--zlex-accent); color: var(--zlex-accent-deep); }

/* ---- Letter nav ---- */
.zlex-letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    padding: 1rem 1.1rem;
    margin-bottom: 2.5rem;
    background: var(--zlex-card);
    border: 1px solid var(--zlex-line);
    border-radius: var(--zlex-radius-lg);
    box-shadow: var(--zlex-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 5;
}
.zlex-letter-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem; height: 2.15rem;
    font-size: .9rem;
    font-weight: 700;
    color: var(--zlex-text);
    text-decoration: none;
    border-radius: var(--zlex-radius);
    transition: all var(--zlex-ease);
}
.zlex-letter-link:hover { background: var(--zlex-accent-soft); color: var(--zlex-accent-deep); }
.zlex-letter-link.active { background: var(--zlex-accent); color: #fff; }

/* ---- A–Z entries ---- */
.zlex-letter-heading {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--zlex-accent);
    margin: 2.5rem 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--zlex-line);
    scroll-margin-top: 5rem;
    letter-spacing: -.01em;
}
.zlex-letter-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.zlex-card-entry {
    display: block;
    background: var(--zlex-card);
    border: 1px solid var(--zlex-line);
    border-left: 3px solid transparent;
    border-radius: var(--zlex-radius-lg);
    padding: 1.3rem 1.4rem;
    text-decoration: none;
    transition: transform var(--zlex-ease), box-shadow var(--zlex-ease), border-color var(--zlex-ease);
}
.zlex-card-entry:hover {
    transform: translateY(-2px);
    box-shadow: var(--zlex-shadow-md);
    border-left-color: var(--zlex-accent);
}
.zlex-card-entry .zlex-card-title {
    margin: 0 0 .45rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--zlex-ink);
    line-height: 1.25;
}
.zlex-card-entry:hover .zlex-card-title { color: var(--zlex-accent-deep); }
.zlex-card-entry .zlex-card-excerpt {
    margin: 0;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--zlex-muted);
}
.zlex-card-more {
    display: inline-block;
    margin-top: .7rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--zlex-accent-deep);
}
.zlex-no-results { padding: 2rem; text-align: center; color: var(--zlex-muted); }

/* =====================================================
   SINGLE ENTRY
   ===================================================== */
.zlex-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2.75rem;
    align-items: start;
    font-family: var(--zlex-font);
    color: var(--zlex-text);
}
.zlex-main { min-width: 0; }

/* aliases */
.zlex-alias {
    margin: 0 0 .4rem;
    font-size: .9rem;
    color: var(--zlex-muted);
}
.zlex-alias-label {
    font-weight: 700;
    color: var(--zlex-ink);
    margin-right: .35rem;
}

/* body typography */
.zlex-body { margin-top: .5rem; }
.zlex-body .zlex-lead {
    font-size: 1.18rem;
    line-height: 1.65;
    color: var(--zlex-ink);
    font-weight: 400;
    padding-left: 1.1rem;
    border-left: 3px solid var(--zlex-accent);
    margin: 0 0 1.75rem;
}
.zlex-body h2 {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--zlex-accent-deep);
    margin: 1.9rem 0 .6rem;
    padding-bottom: .45rem;
    border-bottom: 1px solid var(--zlex-line);
}
.zlex-body p {
    font-size: 1.02rem;
    line-height: 1.72;
    margin: 0 0 1rem;
    color: var(--zlex-text);
}
.zlex-body a { color: var(--zlex-accent-deep); text-underline-offset: 2px; }

/* related chips */
.zlex-related { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--zlex-line); }
.zlex-related-title {
    font-size: .8rem !important;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--zlex-muted);
    margin: 0 0 .9rem;
}
.zlex-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.zlex-chip {
    display: inline-flex;
    align-items: center;
    padding: .45rem .95rem;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--zlex-ink);
    background: var(--zlex-card);
    border: 1.5px solid var(--zlex-line-strong);
    border-radius: 100px;
    transition: all var(--zlex-ease);
}
.zlex-chip:hover {
    border-color: var(--zlex-accent);
    color: var(--zlex-accent-deep);
    background: var(--zlex-accent-soft);
}
.zlex-chip-plain { color: var(--zlex-muted); border-style: dashed; cursor: default; }

/* =====================================================
   CTA ROUTER (signature element)
   ===================================================== */
.zlex-side { position: sticky; top: 2rem; }
.zlex-cta {
    background: var(--zlex-card);
    border: 1px solid var(--zlex-line);
    border-radius: var(--zlex-radius-lg);
    overflow: hidden;
    box-shadow: var(--zlex-shadow-sm);
}
.zlex-cta-head {
    padding: 1.5rem 1.5rem 1.25rem;
    background: linear-gradient(180deg, var(--zlex-accent-soft) 0%, #fff 100%);
    border-bottom: 1px solid var(--zlex-line);
}
.zlex-cta-eyebrow {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--zlex-accent-deep);
    margin-bottom: .6rem;
}
.zlex-cta-lead {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--zlex-ink);
}

/* primary featured CTA */
.zlex-cta-primary {
    display: flex;
    align-items: center;
    gap: .95rem;
    margin: 1.25rem 1.25rem 0;
    padding: 1.15rem 1.2rem;
    text-decoration: none;
    background: var(--zlex-ink);
    border-radius: var(--zlex-radius);
    transition: transform var(--zlex-ease), box-shadow var(--zlex-ease), background var(--zlex-ease);
    position: relative;
    overflow: hidden;
}
.zlex-cta-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 40%, rgba(0,206,209,.18) 100%);
    opacity: 0;
    transition: opacity var(--zlex-ease);
}
.zlex-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--zlex-shadow-cta);
    background: #000;
}
.zlex-cta-primary:hover::after { opacity: 1; }
.zlex-cta-primary-icon {
    flex: 0 0 auto;
    width: 2.6rem; height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--zlex-radius);
    background: rgba(0,206,209,.16);
    color: var(--zlex-accent);
    position: relative; z-index: 1;
}
.zlex-cta-primary-icon svg { width: 1.4rem; height: 1.4rem; }
.zlex-cta-primary-body { flex: 1 1 auto; min-width: 0; position: relative; z-index: 1; }
.zlex-cta-primary-label {
    display: block;
    font-size: .98rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}
.zlex-cta-primary-desc {
    display: block;
    margin-top: .3rem;
    font-size: .82rem;
    line-height: 1.4;
    color: rgba(255,255,255,.72);
}
.zlex-cta-primary-arrow {
    flex: 0 0 auto;
    color: var(--zlex-accent);
    display: inline-flex;
    position: relative; z-index: 1;
    transition: transform var(--zlex-ease);
}
.zlex-cta-primary-arrow svg { width: 1.25rem; height: 1.25rem; }
.zlex-cta-primary:hover .zlex-cta-primary-arrow { transform: translateX(4px); }

/* secondary CTAs */
.zlex-cta-secondary { list-style: none; margin: .75rem 1.25rem 1.4rem; padding: 0; }
.zlex-cta-secondary li + li { margin-top: .4rem; }
.zlex-cta-secondary a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem .9rem;
    text-decoration: none;
    border: 1px solid var(--zlex-line);
    border-radius: var(--zlex-radius);
    background: #fff;
    transition: all var(--zlex-ease);
}
.zlex-cta-secondary a:hover {
    border-color: var(--zlex-accent);
    background: var(--zlex-accent-soft);
}
.zlex-cta-sec-icon {
    flex: 0 0 auto;
    width: 1.9rem; height: 1.9rem;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--zlex-accent-deep);
}
.zlex-cta-sec-icon svg { width: 1.15rem; height: 1.15rem; }
.zlex-cta-sec-text {
    flex: 1 1 auto;
    font-size: .92rem;
    font-weight: 600;
    color: var(--zlex-ink);
}
.zlex-cta-sec-arrow {
    flex: 0 0 auto;
    color: var(--zlex-muted);
    display: inline-flex;
    transition: transform var(--zlex-ease), color var(--zlex-ease);
}
.zlex-cta-sec-arrow svg { width: 1rem; height: 1rem; }
.zlex-cta-secondary a:hover .zlex-cta-sec-arrow { transform: translateX(3px); color: var(--zlex-accent-deep); }

/* back link */
.zlex-back { margin-top: 2.5rem; }
.zlex-back a {
    display: inline-flex;
    align-items: center;
    font-size: .92rem;
    font-weight: 600;
    color: var(--zlex-muted);
    text-decoration: none;
    transition: color var(--zlex-ease);
}
.zlex-back a:hover { color: var(--zlex-accent-deep); }

/* =====================================================
   INTERNAL LINK + TOOLTIP
   ===================================================== */
.zlex-term-link {
    position: relative;
    color: var(--zlex-accent-deep);
    text-decoration: none;
    border-bottom: 1px dotted var(--zlex-accent);
    cursor: help;
}
.zlex-term-link:hover { border-bottom-style: solid; }
.zlex-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    width: min(320px, 78vw);
    padding: .85rem 1rem;
    background: var(--zlex-ink);
    color: #fff;
    font-size: .84rem;
    line-height: 1.5;
    font-weight: 400;
    border-radius: var(--zlex-radius);
    box-shadow: var(--zlex-shadow-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--zlex-ease), transform var(--zlex-ease), visibility var(--zlex-ease);
    z-index: 50;
}
.zlex-tooltip strong { display: block; color: var(--zlex-accent); margin-bottom: .25rem; font-weight: 700; }
.zlex-tooltip::after {
    content: "";
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--zlex-ink);
}
.zlex-tooltip-more { display: inline-block; margin-top: .4rem; color: var(--zlex-accent); font-weight: 600; }
.zlex-term-link:hover .zlex-tooltip,
.zlex-term-link:focus .zlex-tooltip {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); pointer-events: auto;
}

/* =====================================================
   SHORTCODE GLOSSARY (compact A–Z)
   ===================================================== */
.zlex-glossary { color: var(--zlex-text); font-family: var(--zlex-font); }
.zlex-glossary-nav {
    display: flex; flex-wrap: wrap; gap: .3rem;
    padding-bottom: 1rem; margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--zlex-line);
}
.zlex-glossary-nav a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem;
    font-weight: 700; font-size: .85rem;
    color: var(--zlex-text); text-decoration: none;
    border-radius: var(--zlex-radius);
    transition: all var(--zlex-ease);
}
.zlex-glossary-nav a:hover { background: var(--zlex-accent-soft); color: var(--zlex-accent-deep); }
.zlex-glossary-letter {
    font-size: 1.35rem; font-weight: 800; color: var(--zlex-accent);
    margin: 1.75rem 0 .75rem; scroll-margin-top: 5rem;
}
.zlex-glossary-list {
    list-style: none; margin: 0 0 1rem; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35rem;
}
.zlex-glossary-list a {
    display: block; padding: .5rem .75rem;
    color: var(--zlex-ink); text-decoration: none;
    border-radius: var(--zlex-radius);
    transition: background var(--zlex-ease), color var(--zlex-ease);
}
.zlex-glossary-list a:hover { background: var(--zlex-accent-soft); color: var(--zlex-accent-deep); }

/* autocomplete suggestions */
.zlex-suggestions {
    position: absolute;
    z-index: 9999;
    list-style: none;
    margin: .35rem 0 0;
    padding: .35rem;
    background: #fff;
    border: 1px solid var(--zlex-line-strong);
    border-radius: var(--zlex-radius);
    box-shadow: var(--zlex-shadow-md);
    max-height: 280px;
    overflow-y: auto;
}
.zlex-suggestions li {
    padding: .55rem .75rem;
    cursor: pointer;
    font-size: .92rem;
    color: var(--zlex-ink);
    border-radius: var(--zlex-radius);
}
.zlex-suggestions li:hover,
.zlex-suggestions li.active { background: var(--zlex-accent-soft); color: var(--zlex-accent-deep); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 920px) {
    .zlex-entry { grid-template-columns: 1fr; gap: 2rem; }
    .zlex-side { position: static; }
    .zlex-stats { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .zollcon-lexikon-archive { padding: 2rem 1.1rem 3rem; }
    .zlex-letter-group { grid-template-columns: 1fr; }
    .zlex-letter-nav { position: static; }
    .zlex-cta-primary { flex-wrap: wrap; }
    .zlex-cta-primary-arrow { display: none; }
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
.zlex-card-entry:focus-visible,
.zlex-cta-primary:focus-visible,
.zlex-cta-secondary a:focus-visible,
.zlex-chip:focus-visible,
.zlex-letter-link:focus-visible,
.zlex-cat-btn:focus-visible,
.zlex-term-link:focus-visible {
    outline: 3px solid var(--zlex-accent);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .zollcon-lexikon-archive *,
    .zlex-entry * {
        transition: none !important;
        animation: none !important;
    }
}
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
