/*
 * 1aHosting – Design der Wissensdatenbank
 * Gilt nur für Elemente mit Präfix .kbx-, der Rest des Kundencenters bleibt unverändert.
 * Eingebunden in knowledgebase.tpl, knowledgebasecat.tpl und knowledgebasearticle.tpl.
 */
.kbx,
.kbx-live {
    /* Farben aus theme.css (--ah-*), Werte dahinter nur als Rückfall.
       .kbx-live zusätzlich, weil die Vorschläge auch auf der Startseite
       des Kundencenters erscheinen (ausserhalb von .kbx). */
    --kbx-brand: var(--ah-orange, #ff6c2c);
    --kbx-brand-soft: var(--ah-orange-hauch, rgba(255, 108, 44, .08));
    --kbx-text: var(--ah-tinte, #191512);
    --kbx-muted: var(--ah-matt, #6b635c);
    --kbx-line: var(--ah-linie-stark, #d8cfc2);
    --kbx-card: var(--ah-flaeche, #ffffff);
    --kbx-head: var(--ah-grund2, #f3ede4);
    color: var(--kbx-text);
}

/* Suche */
.kbx-hero {
    background: var(--kbx-card);
    border: 1px solid var(--kbx-line);
    border-radius: 6px;
    padding: 22px;
    margin-bottom: 26px;
}
.kbx-hero p.kbx-lead {
    margin: 0 0 14px;
    color: var(--kbx-muted);
    font-size: 15px;
}
.kbx-hero .kb-search {
    margin: 0;
}
.kbx-hero .kb-search .form-control {
    border-color: var(--kbx-line);
    box-shadow: none;
}
.kbx-hero .kb-search .form-control:focus {
    border-color: var(--kbx-brand);
}

/* Zwischentitel */
.kbx h2.kbx-h {
    font-size: 19px;
    margin: 0 0 14px;
}

/* Kategorie-Kacheln */
.kbx-cats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}
.kbx-cat {
    position: relative;
}
.kbx-cat > a.kbx-cat-link {
    display: flex;
    gap: 12px;
    height: 100%;
    padding: 16px;
    background: var(--kbx-card);
    border: 1px solid var(--kbx-line);
    border-radius: 6px;
    color: var(--kbx-text);
    transition: border-color .15s, box-shadow .15s;
}
.kbx-cat > a.kbx-cat-link:hover,
.kbx-cat > a.kbx-cat-link:focus {
    border-color: var(--kbx-brand);
    box-shadow: 0 2px 10px rgba(255, 108, 44, .12);
    text-decoration: none;
    color: var(--kbx-text);
}
.kbx-cat > a.kbx-cat-link:hover .kbx-cat-name,
.kbx-cat > a.kbx-cat-link:focus .kbx-cat-name {
    color: var(--kbx-brand);
}
.kbx-ic {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--kbx-brand-soft);
    color: var(--kbx-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.kbx-cat-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
}
.kbx-cat-desc {
    display: block;
    color: var(--kbx-muted);
    font-size: 13px;
    line-height: 1.45;
}
.kbx-badge {
    display: inline-block;
    min-width: 22px;
    padding: 0 7px;
    margin-left: 4px;
    border-radius: 10px;
    background: var(--kbx-head);
    color: var(--kbx-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
    vertical-align: 1px;
}
.kbx-cat .admin-inline-edit {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 12px;
}

/* Artikelliste */
.kbx-list {
    background: var(--kbx-card);
    border: 1px solid var(--kbx-line);
    border-radius: 6px;
    margin-bottom: 26px;
}
.kbx-item {
    position: relative;
    border-bottom: 1px solid var(--kbx-line);
}
.kbx-item:last-child {
    border-bottom: 0;
}
.kbx-item > a.kbx-item-link {
    display: block;
    padding: 13px 18px;
    color: var(--kbx-text);
}
.kbx-item > a.kbx-item-link:hover,
.kbx-item > a.kbx-item-link:focus {
    background: var(--kbx-brand-soft);
    text-decoration: none;
}
.kbx-item > a.kbx-item-link:hover .kbx-item-title,
.kbx-item > a.kbx-item-link:focus .kbx-item-title {
    color: var(--kbx-brand);
}
.kbx-item-title {
    display: block;
    color: var(--kbx-text);
    font-weight: 600;
    font-size: 15px;
}
.kbx-item-text {
    display: block;
    margin-top: 2px;
    color: var(--kbx-muted);
    font-size: 13px;
}
.kbx-item .admin-inline-edit {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 12px;
}
.kbx-empty {
    padding: 18px;
    color: var(--kbx-muted);
}

/* Sichtbarer Fokus für Tastatur */
.kbx a:focus-visible,
.kbx .btn:focus-visible {
    outline: 2px solid var(--kbx-brand);
    outline-offset: 2px;
}

/* Artikel */
.kbx-article {
    background: var(--kbx-card);
    border: 1px solid var(--kbx-line);
    border-radius: 6px;
    padding: 26px 30px;
    margin-bottom: 26px;
}
.kbx-article-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.kbx-article-head h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.3;
}
.kbx-article-head .btn-print {
    color: var(--kbx-muted);
    padding: 4px 6px;
}
.kbx-article-head .btn-print:hover {
    color: var(--kbx-brand);
}
.kbx-article .kb-article-content {
    font-size: 15px;
    line-height: 1.65;
    font-weight: 400; /* Six setzt hier 200 – zu dünn zum Lesen */
    color: var(--kbx-text);
}
.kbx-article .kb-article-content strong,
.kbx-article .kb-article-content b {
    font-weight: 700;
}
.kbx-article .kb-article-content h2,
.kbx-article .kb-article-content h3 {
    font-weight: 600;
}
.kbx-article .kb-article-content h2 {
    font-size: 18px;
    margin: 26px 0 8px;
}
.kbx-article .kb-article-content h3 {
    font-size: 16px;
    margin: 20px 0 6px;
}
.kbx-article .kb-article-content ol,
.kbx-article .kb-article-content ul {
    padding-left: 22px;
}
.kbx-article .kb-article-content li {
    margin: 4px 0;
}
.kbx-article .kb-article-content code {
    background: var(--kbx-head);
    color: var(--kbx-text);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 13px;
}
.kbx-article .kb-article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 18px 0 22px;
    border: 10px solid #ff6c2c;
    border-top-width: 26px;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(25, 21, 18, .12);
    background: #fff;
}
.kbx-article .kb-article-content .kbx-shot {
    margin: 18px 0 22px;
    padding: 0 10px 10px;
    background: #ff6c2c;              /* Rahmenhintergrund */
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(25, 21, 18, .12);
}
.kbx-article .kb-article-content .kbx-shot::before {
    content: "●  ●  ●     Screenshot · Cpanel";
    display: block;
    padding: 7px 2px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: pre;
}
.kbx-article .kb-article-content .kbx-shot img {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
}
.kbx-article .kb-article-content .kbx-shot .kbx-shot-text {
    margin: 0;
    padding: 8px 2px 0;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
}

/* Tabellen im Artikel */
.kbx-article .kb-article-content table {
    width: 100%;
    margin: 12px 0 18px;
    border-collapse: collapse;
}
.kbx-article .kb-article-content th,
.kbx-article .kb-article-content td {
    border: 1px solid var(--kbx-line);
    padding: 7px 10px;
    text-align: left;
    vertical-align: top;
}
.kbx-article .kb-article-content th {
    background: var(--kbx-head);
    font-weight: 600;
}

/* Tags und Bewertung unter dem Artikel */
.kbx-meta {
    list-style: none;
    padding: 14px 0 0;
    margin: 20px 0 0;
    border-top: 1px solid var(--kbx-line);
    color: var(--kbx-muted);
    font-size: 13px;
}
.kbx-meta li {
    display: inline-block;
    margin-right: 16px;
}
.kbx-meta .fas {
    color: var(--kbx-brand);
    margin-right: 4px;
}

.kbx-rate {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--kbx-head);
    border-radius: 6px;
    font-size: 15px;
}
.kbx-rate form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}
.kbx-rate .btn {
    background: var(--kbx-card);
    border: 1px solid var(--kbx-line);
    border-radius: 4px;
    padding: 5px 14px;
    color: var(--kbx-text);
    font-size: 14px;
}
.kbx-rate .btn:hover {
    border-color: var(--kbx-brand);
    color: var(--kbx-brand);
}

@media (max-width: 767px) {
    .kbx-article {
        padding: 20px 16px;
    }
    .kbx-article-head h2 {
        font-size: 20px;
    }
}

@media print {
    .kbx-article {
        border: 0;
        padding: 0;
    }
}

/* Live-Suche: Vorschläge unter dem Suchfeld (js/kb-suche.js) */
.kbx-live {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    margin-top: 6px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--kbx-card);
    border: 1px solid var(--kbx-line);
    border-radius: 6px;
    box-shadow: 0 14px 34px -12px rgba(25, 21, 18, .28);
    text-align: left;
}
.kbx-live[hidden] {
    display: none;
}
.kbx-live a.kbx-live-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--kbx-line);
    color: var(--kbx-text);
    text-decoration: none;
}
.kbx-live a.kbx-live-item:hover,
.kbx-live a.kbx-live-item.is-aktiv {
    background: var(--kbx-brand-soft);
    text-decoration: none;
}
.kbx-live a.kbx-live-item:hover .kbx-live-title,
.kbx-live a.kbx-live-item.is-aktiv .kbx-live-title {
    color: var(--kbx-brand);
}
.kbx-live-title {
    font-weight: 600;
    font-size: 15px;
}
.kbx-live-cat,
.kbx-item-cat {
    align-self: start;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--kbx-head);
    color: var(--kbx-muted);
    font-size: 12px;
    white-space: nowrap;
}
.kbx-live-text {
    grid-column: 1 / -1;
    color: var(--kbx-muted);
    font-size: 13px;
}
.kbx-live mark,
.kbx-item mark {
    padding: 0;
    background: none;
    color: inherit;
    font-weight: 700;
    box-shadow: inset 0 -.45em 0 rgba(255, 108, 44, .22);
}
.kbx-live-leer {
    padding: 14px 16px;
    color: var(--kbx-muted);
    font-size: 14px;
}
.kbx-live-leer kbd {
    background: var(--kbx-head);
    color: var(--kbx-text);
    box-shadow: none;
}
.kbx-live button.kbx-live-alle {
    display: block;
    width: 100%;
    padding: 11px 16px;
    border: 0;
    background: var(--kbx-head);
    color: var(--kbx-text);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}
.kbx-live button.kbx-live-alle:hover,
.kbx-live button.kbx-live-alle:focus {
    color: var(--kbx-brand);
}

/* Trefferseite: Kategorie neben dem Titel, weitere Treffer kleiner */
.kbx-item > a.kbx-item-link .kbx-item-cat {
    display: inline-block;
    margin: 4px 0 0;
}
.kbx h3.kbx-h-klein {
    font-size: 15px;
    color: var(--kbx-muted);
    margin: 0 0 10px;
}
.kbx-list-weitere .kbx-item-title {
    font-size: 14px;
}
/* Weitere Treffer kompakt: nur Titel und Kategorie, lange Liste eingeklappt */
.kbx-list-weitere .kbx-item-text {
    display: none;
}
.kbx-list-weitere .kbx-item > a.kbx-item-link {
    padding: 9px 18px;
}
.kbx-list-weitere.is-zu .kbx-item:nth-child(n+6) {
    display: none;
}
.kbx button.kbx-mehr {
    display: block;
    width: 100%;
    padding: 10px 18px;
    border: 0;
    border-top: 1px solid var(--kbx-line);
    background: var(--kbx-head);
    color: var(--kbx-text);
    font-weight: 600;
    text-align: left;
}
.kbx button.kbx-mehr:hover,
.kbx button.kbx-mehr:focus {
    color: var(--kbx-brand);
}
