/* Forum index page — thread list, forum header, toolbar */
/* Matches legacy PostList-Responsive.ascx CSS Grid layout */

/* Forum view wrapper */
.sd-forum-view {
    padding: 0;
}

.sd-forum-header {
    background: var(--accent-color);
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.sd-forum-title {
    color: var(--accent-color-text);
    font-size: 1.5rem;
    font-weight: normal;
    margin: 0;
}

.sd-forum-description {
    color: var(--accent-color-text);
    font-size: .85rem;
    margin: .25rem 0 0;
    opacity: .85;
}

/* Subcategory grid */
.sd-subcategory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border-color);
    border-bottom: none;
    margin-bottom: 1rem;
}

.sd-subcategory-grid__item {
    display: block;
    padding: 8px 12px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--link-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-decoration: none;
    background: var(--card-background);
}

.sd-subcategory-grid__item:nth-child(4n) {
    border-right: none;
}

.sd-subcategory-grid__item:hover {
    background: var(--alternate-background);
    text-decoration: underline;
}

@media(max-width:767px) {
    .sd-subcategory-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sd-subcategory-grid__item:nth-child(4n) {
        border-right: 1px solid var(--border-color);
    }

    .sd-subcategory-grid__item:nth-child(2n) {
        border-right: none;
    }
}

/* Thread list */
.sd-thread-list {
    border-bottom: 1px solid var(--border-color);
}

.sd-thread-list-header {
    display: none;
    font-size: .7rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--secondary-text-color);
    padding: 16px .75rem 16px 3rem;
    border-bottom: 1px solid var(--border-color);
    background-color: transparent;
}

/* Thread item — CSS Grid matching legacy postlist responsive layout */
.sd-thread-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 .5rem;
    padding: .5rem .75rem;
    align-items: center;
    font-size: .8125rem;
    line-height: 1.5;
}

    .sd-thread-item:nth-child(even) {
        background: var(--alternate-background);
    }

    .sd-thread-item:hover {
        background: var(--section-header-background-2);
    }

.sd-thread-item--locked {
    opacity: .8;
}

/* Icon column */
.sd-thread-item__icon {
    grid-row: 1 / 3;
    display: flex;
    align-items: flex-start;
    padding-top: .2rem;
}

/* Info section: title + meta */
.sd-thread-item__info {
    min-width: 0;
}

.sd-thread-item__title-row {
    overflow: visible;
}

.sd-thread-item__title {
    color: var(--link-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    white-space: normal;
}

    .sd-thread-item__title:hover {
        text-decoration: underline;
    }

.sd-thread-item--read .sd-thread-item__title {
    font-weight: 400;
}

.sd-thread-item__subtitle {
    color: var(--secondary-text-color);
    font-size: .75rem;
    line-height: 1.15rem;
    min-height: 1.15rem;
    margin-top: .1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sd-thread-item__meta {
    display: flex;
    gap: .5rem;
    align-items: center;
    color: var(--secondary-text-color);
    font-size: .75rem;
    margin-top: .15rem;
}

.sd-thread-item__author a {
    color: var(--link-color);
    text-decoration: none;
}

    .sd-thread-item__author a:hover {
        text-decoration: underline;
    }

.sd-thread-item__date {
    color: var(--secondary-text-color);
}

/* Author column — hidden on mobile, shown on tablet+ */
.sd-thread-item__sd-reply {
    display: none;
}

.sd-thread-item__author-col {
    display: none;
    font-size: .8rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sd-thread-item__author-col a {
    color: var(--link-color);
    text-decoration: none;
}

.sd-thread-item__author-col a:hover {
    text-decoration: underline;
}

/* Stats and last reply — hidden on mobile, shown on tablet+ */
.sd-thread-item__stats {
    display: none;
}

.sd-thread-item__last-reply {
    display: none;
}

.sd-thread-item__stat-label {
    display: none;
}

.sd-thread-item__stat-value {
    font-weight: 500;
    color: var(--table-text-color);
}

.sd-thread-item__last-reply-user {
    font-size: .75rem;
}

.sd-thread-item__last-reply-date {
    font-size: .75rem;
    color: var(--secondary-text-color);
}

.sd-thread-item__no-replies {
    font-size: .75rem;
    color: var(--secondary-text-color);
    font-style: italic;
}

/* Tablet+ (768px): grid layout with stats columns */
@media(min-width:768px) {
    .sd-thread-list-header {
        display: grid;
        grid-template-columns: 28px 1fr 24px 110px 80px 134px;
        gap: 0 .5rem;
        align-items: center;
    }

    .sd-thread-list-header__title {
        grid-column: 1 / 3;
    }

    .sd-thread-list-header__author {
        padding-left: .75rem;
    }

    .sd-thread-list-header__stats {
        text-align: center;
    }

    .sd-thread-list-header__last-reply {
        text-align: right;
    }

    .sd-thread-item {
        grid-template-columns: 28px 1fr 24px 110px 80px 134px;
        grid-template-rows: 1fr;
        align-items: center;
        min-height: 3.25rem;
    }

    .sd-thread-item__sd-reply {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sd-thread-item--advanced {
        align-items: start;
    }

    .sd-thread-item__icon {
        grid-row: auto;
    }

    .sd-thread-item__info {
        overflow: hidden;
    }

    .sd-thread-item__meta {
        display: none;
    }

    .sd-thread-item__author {
        display: none;
    }

    .sd-thread-item__author-col {
        display: block;
        padding-left: .75rem;
    }

    .sd-thread-item__stats {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        text-align: right;
        gap: .15rem;
    }

    .sd-thread-item__replies, .sd-thread-item__views {
        display: flex;
        flex-direction: row;
        align-items: baseline;
        gap: .25rem;
        justify-content: flex-end;
    }

    .sd-thread-item__stat-label {
        display: block;
        font-size: .65rem;
        text-transform: uppercase;
        color: var(--secondary-text-color);
    }

    .sd-thread-item__last-reply {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        text-align: right;
    }
}

/* Desktop+ (1025px): wider stats */
@media(min-width:1025px) {
    .sd-thread-list-header {
        grid-template-columns: 28px 1fr 24px 130px 90px 160px;
    }

    .sd-thread-item {
        grid-template-columns: 28px 1fr 24px 130px 90px 160px;
    }
}

/* Inline sliding search */
.sd-sliding-search {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.sd-sliding-search__btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-text-color);
    font-size: .9rem;
    padding: .25rem;
}

    .sd-sliding-search__btn:hover {
        color: var(--text-color);
    }

.sd-sliding-search__input {
    width: 0;
    transition: width .3s ease;
    border: 1px solid var(--border-color);
    padding: .25rem .5rem;
    font-size: .8rem;
}

.sd-sliding-search--open .sd-sliding-search__input {
    width: 200px;
}

/* Thread title tray with pagination */
.sd-thread-tray {
    font-size: .8rem;
    color: var(--secondary-text-color);
    margin-top: 2px;
    display: flex;
    gap: .5rem;
    align-items: center;
}

.sd-thread-tray__pages {
    display: flex;
    gap: 2px;
}

.sd-thread-tray__page-link {
    padding: 1px 4px;
    border: 1px solid var(--border-color);
    font-size: .75rem;
    border-radius: 2px;
    color: var(--link-color);
    text-decoration: none;
}

    .sd-thread-tray__page-link:hover {
        background: var(--accent-color);
        color: var(--accent-color-text);
        text-decoration: none;
    }
/* Group labels for sticky/pinned sections */
.sd-thread-group-label {
    background: var(--accent-color);
    padding: 1.25rem 2rem;
    color: var(--accent-color-text);
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    display: flex;
    align-items: center;
}

.sd-thread-group-label__text {
    font-size: 1.5rem;
    font-weight: normal;
    margin: 0;
    color: inherit;
}
.sd-thread-group-label .sd-rss-link {
    margin-left:auto;
    font-size:.8rem;
    color:var(--color-rss);
    text-decoration:none;
}
.sd-thread-group-label .sd-rss-link:hover {
    text-decoration:underline;
}

.sd-thread-group__toggle {
    cursor: pointer;
    background: rgba(0,0,0,.15);
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-color-text);
    width: 26px;
    height: 26px;
    line-height: 24px;
    text-align: center;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.sd-thread-group__toggle:hover {
    background: rgba(0,0,0,.25);
}

.sd-thread-group--collapsed .sd-thread-group__body {
    display: none;
}
/* Moderators list */
.sd-moderators {
    padding: .5rem .75rem;
    font-size: .8rem;
    color: var(--secondary-text-color);
    border-top: 1px solid var(--border-color);
}

.sd-moderators__label {
    font-weight: 600;
    margin-right: .5rem;
}

.sd-moderators a {
    color: var(--link-color);
    text-decoration: none;
}

    .sd-moderators a:hover {
        text-decoration: underline;
    }
/* Thread status icons (SVG-based) */
.sd-thread-icon {
    display: inline-block;
    width: 25px;
    height: 25px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.sd-thread-icon--read {
    background-image: url(/images/icons/thread-read.svg);
}

.sd-thread-icon--unread {
    background-image: url(/images/icons/thread-unread.svg);
}

.sd-thread-icon--new-reply {
    background-image: url(/images/message_new.svg);
}

.sd-thread-icon--new-reply-sub {
    background-image: url(/images/message_new_sub.svg);
}

.sd-thread-icon--pinned {
    background-image: url(/images/icons/thread-pinned.svg);
}

.sd-thread-icon--locked {
    background-image: url(/images/icons/thread-locked.svg);
}

.sd-thread-icon--deleted {
    background-image: url(/images/icons/thread-deleted.svg);
}

.sd-thread-icon--hidden {
    background-image: url(/images/icons/thread-hidden.svg);
}

/* Stardock reply indicator */
.sd-stardock-reply {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-left: .25rem;
}
/* Icon legend */
.sd-icon-legend {
    margin: .5rem 0 0;
    border: 1px solid var(--border-color);
}

.sd-icon-legend__toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: .5rem .75rem;
    background: var(--section-header-background-2);
    border: none;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text-color);
}

.sd-icon-legend__toggle:hover {
    background: var(--border-color);
}

.sd-icon-legend__body {
    padding: .5rem .75rem;
}

.sd-icon-legend__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
}

.sd-icon-legend__list li {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: var(--text-color);
}

.sd-icon-legend__list .sd-thread-icon {
    width: 20px;
    height: 20px;
}
/* Forum footer links */
.sd-forum-footer-links {
    margin: .5rem 0;
}

.sd-forum-footer-links .sd-home-footer__menu {
    list-style: disc;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 2rem;
    padding: .75rem .75rem .75rem 2rem;
    margin: 0;
    font-size: .85rem;
}

.sd-forum-footer-links .sd-home-footer__menu a {
    color: var(--link-color);
    text-decoration: none;
}

.sd-forum-footer-links .sd-home-footer__menu a:hover {
    text-decoration: underline;
}
.sd-mark-all-read-form{display:inline;margin:0;padding:0;}
.sd-mark-all-read-form button{background:none;border:none;padding:0;margin:0;font:inherit;color:var(--link-color);cursor:pointer;text-decoration:none;}
.sd-mark-all-read-form button:hover{text-decoration:underline;}

/* Mobile thread list — must appear after base rules to override display:none */
@media(max-width:767px) {
    .sd-thread-item {
        display: grid;
        grid-template-columns: 28px auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 0 .5rem;
    }

    .sd-thread-item__icon {
        grid-column: 1;
        grid-row: 1 / 3;
        min-width: 28px;
        min-height: 24px;
        padding-top: .2rem;
    }

    .sd-thread-item__info {
        grid-column: 2 / 5;
        grid-row: 1;
        min-width: 0;
    }

    .sd-thread-item__author-col {
        display: block;
        font-size: .75rem;
        grid-column: 2;
        grid-row: 2;
    }

    .sd-thread-item__author-col::before {
        content: "by ";
        color: var(--secondary-text-color);
    }

    .sd-thread-item__last-reply {
        display: block;
        font-size: .75rem;
        grid-column: 3;
        grid-row: 2;
        text-align: right;
    }

    .sd-thread-item__last-reply-user {
        display: none;
    }

    .sd-thread-item__stats {
        display: block;
        font-size: .75rem;
        grid-column: 4;
        grid-row: 2;
        text-align: right;
    }

    .sd-thread-item__stat-label {
        display: inline;
    }

    .sd-thread-item__views {
        display: none;
    }

    .sd-thread-item__sd-reply {
        display: none;
    }

    .sd-thread-item__subtitle {
        min-height: 0;
    }

    .sd-thread-item__subtitle--empty {
        display: none;
    }

    .sd-thread-item--advanced .sd-thread-item__meta {
        display: none;
    }
}
