
.forum-shell{
    width:min(1180px,calc(100% - 32px));
    margin:0 auto;
    padding:22px 0 70px;
    color:var(--tg-text);
}

.forum-topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:18px 0;
}

.forum-brand-row{
    display:flex;
    align-items:center;
    gap:16px;
    flex-wrap:wrap;
}

.forum-brand,
.forum-nav{
    color:var(--tg-text)!important;
    text-decoration:none;
    font-weight:900;
}

.forum-nav{
    font-size:14px;
    padding:7px 9px;
    border-radius:8px;
}

.forum-nav:hover{
    background:var(--tg-surface-muted)!important;
    color:var(--tg-text)!important;
}

.forum-hero{
    padding:34px 0 26px;
    border-bottom:1px solid var(--tg-border);
}

.forum-hero h1{
    margin:0 0 10px;
    font-size:clamp(32px,5vw,52px);
    letter-spacing:-.04em;
    color:var(--tg-text);
}

.forum-hero p{
    margin:0;
    color:var(--tg-text-muted)!important;
    font-size:17px;
    line-height:1.6;
}

.forum-toolbar{
    display:flex;
    gap:12px;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    padding:24px 0;
}

.forum-search{
    display:flex;
    gap:8px;
    flex:1;
    min-width:min(100%,380px);
}

.forum-search input,
.forum-compose textarea,
.forum-compose input,
.forum-compose select{
    width:100%;
    padding:11px 12px;
    border:1px solid var(--tg-border-input)!important;
    border-radius:9px;
    background:var(--tg-surface)!important;
    color:var(--tg-text)!important;
    font:inherit;
}

.forum-search input{
    flex:1;
}

.forum-search input::placeholder,
.forum-compose textarea::placeholder,
.forum-compose input::placeholder{
    color:var(--tg-text-muted)!important;
}

/* IMPORTANT: covers both <button> and <a class="forum-button"> */
.forum-button,
a.forum-button,
button.forum-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid #171717!important;
    border-radius:9px;
    padding:10px 14px;
    background:#171717!important;
    color:#ffffff!important;
    text-decoration:none!important;
    font:inherit;
    font-weight:800;
    cursor:pointer;
}

.forum-button:hover,
a.forum-button:hover,
button.forum-button:hover{
    background:#2a2a2a!important;
    color:#ffffff!important;
}

.forum-button.secondary,
a.forum-button.secondary,
button.forum-button.secondary{
    background:var(--tg-surface-muted)!important;
    color:var(--tg-text)!important;
    border-color:var(--tg-border)!important;
}

.forum-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 280px;
    gap:24px;
}

.forum-panel,
.forum-compose,
.forum-profile,
.forum-post{
    border:1px solid var(--tg-border)!important;
    border-radius:14px;
    background:var(--tg-surface)!important;
    color:var(--tg-text)!important;
}

.forum-panel{
    overflow:hidden;
}

.forum-topic-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:14px;
    padding:18px 20px;
    border-bottom:1px solid var(--tg-border)!important;
    background:var(--tg-surface)!important;
}

.forum-topic-row:last-child{
    border-bottom:0;
}

.forum-topic-row:hover{
    background:var(--tg-surface-muted)!important;
}

.forum-topic-title{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.forum-topic-title a,
.forum-user-name a,
.forum-topic-meta a{
    color:var(--tg-text)!important;
    text-decoration:none;
}

.forum-topic-title a{
    font-size:18px;
    font-weight:900;
}

.forum-topic-excerpt{
    margin-top:6px;
    color:var(--tg-text-muted)!important;
    line-height:1.45;
}

.forum-topic-meta{
    margin-top:9px;
    color:var(--tg-text-muted)!important;
    font-size:12px;
}

.forum-topic-stats{
    display:flex;
    align-items:center;
    gap:14px;
    color:var(--tg-text-muted)!important;
    font-size:13px;
    white-space:nowrap;
}

.forum-badge{
    display:inline-flex;
    align-items:center;
    padding:4px 7px;
    border-radius:999px;
    background:var(--tg-surface-muted)!important;
    color:var(--tg-text-soft)!important;
    font-size:11px;
    font-weight:900;
}

.forum-badge.admin{
    background:#171717!important;
    color:#ffffff!important;
}

.forum-sidebar{
    padding:18px;
    background:var(--tg-surface)!important;
}

.forum-sidebar h3{
    margin:0 0 12px;
    color:var(--tg-text)!important;
}

.forum-category-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.forum-category-list a{
    color:var(--tg-text)!important;
    text-decoration:none;
    padding:9px 10px;
    border-radius:8px;
    background:var(--tg-surface-muted)!important;
    border:1px solid transparent;
    font-weight:700;
}

.forum-category-list a:hover{
    background:var(--tg-border)!important;
    color:var(--tg-text)!important;
}

.forum-post{
    display:grid;
    grid-template-columns:180px minmax(0,1fr);
    overflow:hidden;
    margin-bottom:18px;
}

.forum-post-user{
    padding:18px;
    background:var(--tg-surface-muted)!important;
    border-right:1px solid var(--tg-border)!important;
}

.forum-post-body{
    padding:20px;
    background:var(--tg-surface)!important;
}

.forum-avatar{
    width:54px;
    height:54px;
    border-radius:50%;
    object-fit:cover;
    display:block;
    margin-bottom:10px;
}

.forum-avatar-fallback{
    display:flex;
    align-items:center;
    justify-content:center;
    background:#171717!important;
    color:#ffffff!important;
    font-weight:900;
    font-size:20px;
}

.forum-user-name{
    font-weight:900;
}

.forum-user-bio{
    margin-top:8px;
    color:var(--tg-text-muted)!important;
    font-size:12px;
    line-height:1.45;
}

.forum-post-date{
    color:var(--tg-text-muted)!important;
    font-size:12px;
    margin-bottom:14px;
}

.forum-post-text{
    font-size:16px;
    line-height:1.7;
    color:var(--tg-text)!important;
}

.forum-post-text p{
    margin:0 0 16px;
    color:var(--tg-text)!important;
}

.forum-post-text a{
    color:var(--tg-text)!important;
    text-decoration:underline;
}

.forum-reactions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:18px;
    padding-top:14px;
    border-top:1px solid var(--tg-border)!important;
}

.forum-reaction{
    border:1px solid var(--tg-border)!important;
    background:var(--tg-surface-muted)!important;
    color:var(--tg-text)!important;
    border-radius:999px;
    padding:7px 10px;
    cursor:pointer;
}

.forum-reaction.active{
    background:#171717!important;
    color:#ffffff!important;
}

.forum-compose{
    padding:20px;
}

.forum-compose textarea{
    min-height:180px;
    resize:vertical;
}

.forum-field{
    margin-bottom:14px;
}

.forum-field label{
    display:block;
    margin-bottom:6px;
    font-weight:800;
    color:var(--tg-text)!important;
}

.forum-profile{
    display:grid;
    grid-template-columns:120px 1fr;
    gap:22px;
    padding:22px;
}

.forum-profile .forum-avatar{
    width:100px;
    height:100px;
}

.forum-empty{
    padding:30px;
    text-align:center;
    color:var(--tg-text-muted)!important;
    background:var(--tg-surface)!important;
}

.forum-admin-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin:0 0 18px;
}

.forum-notice{
    padding:12px 14px;
    border-radius:9px;
    background:var(--tg-surface-muted)!important;
    color:var(--tg-text)!important;
    margin-bottom:16px;
}

.forum-form-help{
    color:var(--tg-text-muted)!important;
    font-size:13px;
    line-height:1.5;
    margin-top:6px;
}

/* Darkmode: graue Flächen statt blankem Weiß */
html[data-theme="dark"] .forum-panel,
html[data-theme="dark"] .forum-compose,
html[data-theme="dark"] .forum-profile,
html[data-theme="dark"] .forum-post,
html[data-theme="dark"] .forum-sidebar,
html[data-theme="dark"] .forum-topic-row,
html[data-theme="dark"] .forum-post-body,
html[data-theme="dark"] .forum-empty{
    background:#191c1f!important;
    border-color:#30353b!important;
    color:#f2f4f7!important;
}

html[data-theme="dark"] .forum-topic-row:hover{
    background:#20252a!important;
}

html[data-theme="dark"] .forum-post-user,
html[data-theme="dark"] .forum-category-list a,
html[data-theme="dark"] .forum-reaction,
html[data-theme="dark"] .forum-badge{
    background:#25292e!important;
    border-color:#30353b!important;
    color:#e7eaee!important;
}

html[data-theme="dark"] .forum-category-list a:hover,
html[data-theme="dark"] .forum-reaction:hover{
    background:#30363d!important;
}

html[data-theme="dark"] .forum-button,
html[data-theme="dark"] a.forum-button,
html[data-theme="dark"] button.forum-button{
    background:#343a40!important;
    color:#f3f4f6!important;
    border-color:#454c54!important;
}

html[data-theme="dark"] .forum-button:hover,
html[data-theme="dark"] a.forum-button:hover,
html[data-theme="dark"] button.forum-button:hover{
    background:#414850!important;
    color:#ffffff!important;
}

html[data-theme="dark"] .forum-button.secondary{
    background:#25292e!important;
    color:#e7eaee!important;
    border-color:#3a4047!important;
}

html[data-theme="dark"] .forum-badge.admin{
    background:#454c54!important;
    color:#ffffff!important;
}

@media(max-width:850px){
    .forum-layout{grid-template-columns:1fr}
    .forum-post{grid-template-columns:1fr}
    .forum-post-user{
        border-right:0!important;
        border-bottom:1px solid var(--tg-border)!important;
    }
}

@media(max-width:620px){
    .forum-topic-row{grid-template-columns:1fr}
    .forum-topic-stats{justify-content:flex-start}
    .forum-profile{grid-template-columns:1fr}
}


/* =========================================================
   Navigation – gleiche Hover-Farben wie index.php
   ========================================================= */
.forum-nav{
    transition:background .15s ease,color .15s ease;
}

html[data-theme="light"] .forum-nav:hover,
html:not([data-theme="dark"]) .forum-nav:hover{
    background:#f0f2f4!important;
    color:#171717!important;
}

html[data-theme="dark"] .forum-nav{
    color:#b5bcc4!important;
}

html[data-theme="dark"] .forum-nav:hover{
    background:#262b31!important;
    color:#ffffff!important;
}
