/*
 * Techkrams Taxonomy Hubs 2.5.0
 * Konservatives responsive Layout: Flexbox statt Grid/aspect-ratio.
 * Absichtlich ohne globale html/body-Regeln, damit Jannah/Safari unberuehrt bleiben.
 */
.tkh-topic-shell,
.tkh-topic-shell *,
.tkh2-post-topics,
.tkh2-post-topics * { box-sizing: border-box; }

.tkh-topic-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 28px 16px 40px;
    overflow-x: hidden;
}

.tkh-topic-layout {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
}

.tkh-topic-main {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
}

.tkh-topic-sidebar {
    flex: 0 0 320px;
    width: auto;
    min-width: 320px;
    max-width: none;
    overflow: visible;
}

/* Jannah liefert in get_sidebar() einen eigenen Sidebar-Container mit
 * prozentualer/Float-Geometrie. Im Hub sitzt dieser bereits in einer
 * Sidebar-Spalte und muss deshalb die komplette Wrapperbreite nutzen. */
.tkh-topic-sidebar > *,
.tkh-topic-sidebar .sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.tkh-topic-sidebar img,
.tkh-topic-sidebar iframe,
.tkh-topic-sidebar table { max-width: 100% !important; }

.tkh-topic-header { margin: 0 0 24px; }
.tkh-topic-title {
    margin: 0 0 12px;
    font-size: 40px;
    line-height: 1.1;
    overflow-wrap: break-word;
    word-break: normal;
}

.tkh-parent-topics,
.tkh-child-topics { margin: 0 0 18px; }
.tkh-child-topics__title { display:block; margin:0 0 9px; font-size:14px; line-height:1.35; }
.tkh-child-topics__chips { display:flex; flex-wrap:wrap; gap:8px; }

.tkh-topic-description,
.tkh-topic-description * { max-width: 100%; overflow-wrap: break-word; }
.tkh-topic-description > :first-child { margin-top: 0; }
.tkh-topic-description > :last-child { margin-bottom: 0; }

.tkh-category-groups { display: block; width: 100%; }
.tkh-category-box {
    width: 100%;
    max-width: 100%;
    margin: 0 0 24px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.09);
    border-radius: 7px;
    overflow: hidden;
}
.tkh-category-box__header { padding: 14px 18px; border-bottom: 1px solid rgba(0,0,0,.08); }
.tkh-category-box__header h2 { margin: 0; font-size: 22px; line-height: 1.2; overflow-wrap: break-word; }
.tkh-category-box__items { width: 100%; max-width: 100%; padding: 0 18px; }

.tkh-category-card {
    width: 100%;
    max-width: 100%;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 18px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(0,0,0,.08) !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
.tkh-category-card:last-child { border-bottom: 0 !important; }

.tkh-category-card__media {
    position: relative !important;
    flex: 0 0 120px !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 5px !important;
    background: rgba(0,0,0,.05) !important;
}

.tkh-category-card__media > a {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.tax-tkh_topic .tkh-topic-shell .tkh-category-card__media img,
.tkh-topic-shell .tkh-category-card__media img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
    transform: none !important;
}

.tkh-category-card__placeholder { display:block; width:100%; height:100%; }
.tkh-category-card__badge {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 3;
    max-width: calc(100% - 16px);
    padding: 4px 7px;
    border-radius: 3px;
    background: rgba(20,20,20,.9);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tkh-category-card__body {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.tkh-category-card__meta { display:flex; flex-wrap:wrap; gap:5px 12px; margin:0 0 7px; font-size:12px; line-height:1.3; opacity:.68; }
.tkh-category-card__title { margin:0 0 8px; font-size:20px; line-height:1.25; overflow-wrap:break-word; }
.tkh-category-card__title a { color:inherit; text-decoration:none; }
.tkh-category-card__excerpt { margin:0 0 8px; overflow-wrap:break-word; }
.tkh-category-card__more { font-weight:600; }

.tkh-category-box__pager {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:12px 18px;
    border-top:1px solid rgba(0,0,0,.08);
}
.tkh-pager-button { min-width:120px; min-height:40px; cursor:pointer; padding:8px 12px; border:1px solid rgba(0,0,0,.16); border-radius:4px; background:transparent; color:inherit; font:inherit; }
.tkh-pager-button:disabled { cursor:default; opacity:.35; }
.tkh-pager-status { flex:1 1 120px; min-width:0; text-align:center; font-size:12px; opacity:.65; }
.tkh-category-box.is-loading .tkh-category-box__items { opacity:.45; pointer-events:none; }

/* Themen-Chips */
.tkh2-post-topics { width:100%; max-width:100%; margin:28px 0 8px; padding:16px 18px; border:1px solid rgba(0,0,0,.07); border-radius:7px; background:rgba(0,0,0,.028); overflow:hidden; }
.tkh2-post-topics__title { display:block; margin:0 0 14px; }
.tkh2-post-topics__title .the-subtitle { margin:0; }
.tkh2-post-topics__chips { display:flex; flex-wrap:wrap; gap:8px; }
.tkh2-topic-chip { display:inline-flex; align-items:center; max-width:100%; min-height:34px; padding:7px 13px; border:1px solid #d94723; border-radius:999px; background:#e4572e; color:#fff !important; font-size:13px; font-weight:700; line-height:1.2; text-decoration:none !important; overflow-wrap:anywhere; box-shadow:0 2px 5px rgba(0,0,0,.12); }
.tkh2-topic-chip--linked:hover,.tkh2-topic-chip--linked:focus { border-color:#bc3618; background:#c9411f; color:#fff !important; text-decoration:none !important; }

/* Tablet / schmale Laptops */
@media screen and (max-width: 1023px) {
    .tkh-topic-shell { padding: 22px 14px 34px; }
    .tkh-topic-layout { flex-direction: column; gap: 26px; }
    .tkh-topic-main { flex:0 0 auto; width:100%; }
    .tkh-topic-sidebar { flex:0 0 auto; width:100%; max-width:100%; }
    .tkh-category-card__media { flex-basis:120px !important; width:120px !important; min-width:120px !important; max-width:120px !important; height:68px !important; min-height:68px !important; max-height:68px !important; }
}

/* Smartphones: harte, Safari-feste Geometrie. */
@media screen and (max-width: 767px) {
    .tkh-topic-shell { width:100% !important; max-width:100% !important; margin:0 !important; padding:14px 10px 26px !important; overflow-x:hidden !important; }
    .tkh-topic-layout,.tkh-topic-main,.tkh-category-groups,.tkh-category-box,.tkh-category-box__items { width:100% !important; max-width:100% !important; min-width:0 !important; }
    .tkh-topic-title { font-size:28px; line-height:1.12; }
    .tkh-topic-header { margin-bottom:16px; }
    .tkh-category-box { margin-bottom:15px; border-radius:6px; }
    .tkh-category-box__header { padding:10px 11px; }
    .tkh-category-box__header h2 { font-size:18px; }
    .tkh-category-box__items { padding:0 10px !important; }

    .tkh-category-card {
        display:flex !important;
        flex-direction:row !important;
        align-items:center !important;
        gap:10px !important;
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        padding:10px 0 !important;
        overflow:hidden !important;
    }
    .tkh-category-card__media {
        position:relative !important;
        flex:0 0 120px !important;
        width:120px !important;
        min-width:120px !important;
        max-width:120px !important;
        height:68px !important;
        min-height:68px !important;
        max-height:68px !important;
    }
    body.tax-tkh_topic .tkh-topic-shell .tkh-category-card__media > a,
    body.tax-tkh_topic .tkh-topic-shell .tkh-category-card__media img,
    .tkh-topic-shell .tkh-category-card__media > a,
    .tkh-topic-shell .tkh-category-card__media img {
        position:absolute !important;
        inset:0 !important;
        width:120px !important;
        min-width:120px !important;
        max-width:120px !important;
        height:68px !important;
        min-height:68px !important;
        max-height:68px !important;
        object-fit:cover !important;
    }
    .tkh-category-card__badge { left:4px; top:4px; max-width:112px; padding:2px 4px; font-size:8px; }
    .tkh-category-card__body { flex:1 1 auto !important; width:auto !important; min-width:0 !important; max-width:calc(100% - 130px) !important; overflow:hidden !important; }
    .tkh-category-card__title { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; margin:0; overflow:hidden; font-size:14px; line-height:1.25; }
    .tkh-category-card__meta { margin:5px 0 0; font-size:10px; line-height:1.25; }
    .tkh-category-card__author,.tkh-category-card__comments,.tkh-category-card__excerpt,.tkh-category-card__more { display:none !important; }
    .tkh-topic-sidebar { display:none !important; }
    .tkh-category-box__pager { padding:9px 10px 10px; gap:7px; }
    .tkh-pager-status { order:-1; flex:1 0 100%; }
    .tkh-pager-button { flex:1 1 calc(50% - 4px); min-width:0; min-height:44px; padding:8px 6px; }
    .tkh2-post-topics { margin:22px 0 8px; padding:13px; }
    .tkh2-topic-chip { min-height:38px; padding:9px 13px; white-space:normal; }
}

@media screen and (max-width: 380px) {
    .tkh-topic-shell { padding-left:7px !important; padding-right:7px !important; }
    .tkh-category-card__media { flex-basis:120px !important; width:120px !important; min-width:120px !important; max-width:120px !important; height:68px !important; min-height:68px !important; max-height:68px !important; }
    body.tax-tkh_topic .tkh-topic-shell .tkh-category-card__media > a,
    body.tax-tkh_topic .tkh-topic-shell .tkh-category-card__media img,
    .tkh-topic-shell .tkh-category-card__media > a,
    .tkh-topic-shell .tkh-category-card__media img { width:120px !important; min-width:120px !important; max-width:120px !important; height:68px !important; min-height:68px !important; max-height:68px !important; }
    .tkh-category-card__body { max-width:calc(100% - 130px) !important; }
    .tkh-category-card__badge { max-width:112px; }
    .tkh-category-card__title { font-size:13px; }
}


/* Sidebar-Widget: kompakte, crawlbare Themen-Hubs */
.widget_tkh_topics .tkh2-widget-topics {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    width:100%;
    max-width:100%;
}
.widget_tkh_topics .tkh2-widget-topic {
    display:inline-flex;
    align-items:center;
    max-width:100%;
    min-height:32px;
    padding:7px 11px;
    border:1px solid rgba(0,0,0,.12);
    border-radius:999px;
    background:rgba(0,0,0,.035);
    color:inherit;
    font-size:13px;
    font-weight:700;
    line-height:1.2;
    text-decoration:none !important;
    overflow-wrap:anywhere;
}
.widget_tkh_topics .tkh2-widget-topic:hover,
.widget_tkh_topics .tkh2-widget-topic:focus {
    border-color:#d94723;
    color:#d94723;
    text-decoration:none !important;
}
