/* ==========================================================================
   Haru Live - Channel Show
   ========================================================================== */

.channel-show-page {
    --ch-bg: #f5f6f8;
    --ch-card: #ffffff;
    --ch-text: #111827;
    --ch-soft: #475569;
    --ch-muted: #94a3b8;
    --ch-border: #e5e7eb;
    --ch-border-soft: #eef2f7;
    --ch-blue: #2563eb;
    --ch-green: #16a34a;
    --ch-red: #dc2626;
    --ch-shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 3px 10px rgba(15, 23, 42, .025);
    width: 100%;
}

.channel-show-page *,
.channel-show-page *::before,
.channel-show-page *::after {
    box-sizing: border-box;
}

/* Header */
.channel-page-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.channel-page-header__text {
    min-width: 0;
}

.channel-page-header__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.035em;
    color: #111827;
}

.channel-page-header__slug {
    margin-top: 3px;
    font-size: 12px;
    color: #94a3b8;
}

.channel-page-header__actions {
    flex: 0 0 auto;
}

.channel-page-header__write,
.channel-page-header__login {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.channel-page-header__write {
    border: 1px solid #111827;
    background: #111827;
    color: #fff;
}

.channel-page-header__write:hover {
    background: #1f2937;
}

.channel-page-header__login {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #475569;
}

.channel-page-header__login:hover {
    background: #f8fafc;
}

.channel-page-header__write-disabled {
    font-size: 12px;
    color: #94a3b8;
}

/* Layout */
.community-board-layout {
    width: 100%;
    max-width: 1600px;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 220px;
    gap: 18px;
    margin: 0 auto;
    padding: 8px 0px 40px;
}

.community-board-main,
.community-board-content,
.community-side {
    min-width: 0;
}

.community-side__sticky {
    position: sticky;
    top: 90px;
}

.community-side--right .community-side__sticky > * + * {
    margin-top: 12px;
}

/* Channel Info */
.channel-info-card {
    margin-bottom: 6px;
    padding: 15px;
    border: 1px solid var(--ch-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--ch-shadow);
}

.channel-info-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.channel-owner {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-owner__avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111827;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.channel-owner__content {
    min-width: 0;
}

.channel-owner__meta {
    display: flex;
    align-items: center;
    gap: 5px;
}

.channel-owner__label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
}

.channel-owner__id {
    padding: 2px 6px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 10px;
    color: #64748b;
}

.channel-owner__name {
    margin-top: 2px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    color: #111827;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-info-card__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.channel-subscribe-group {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.channel-subscribe-group form {
    margin: 0;
    display: flex;
}

.channel-subscriber-count,
.channel-manage-button,
.channel-action--compact {
    min-height: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

.channel-subscriber-count {
    background: #eff6ff;
    color: #2563eb;
}

.channel-manage-button {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #475569;
    text-decoration: none;
}

.channel-manage-button:hover {
    background: #f8fafc;
}

/* Actions */
.channel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.channel-actions--secondary {
    margin-top: 10px;
}

.channel-action {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.channel-action--compact {
    min-height: 29px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
}

.channel-action--subscribe {
    border: 1px solid #16a34a;
    background: #16a34a;
    color: #fff;
}

.channel-action--subscribed {
    border: 1px solid #d1d5db;
    background: #f1f5f9;
    color: #475569;
}

.channel-action--guide {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #fff;
}

/* Guide */
.channel-guide {
    margin-top: 12px;
    padding: 12px;
    border-radius: 9px;
    background: #f8fafc;
}

.channel-guide__title {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 800;
    color: #111827;
}

.channel-guide__content {
    font-size: 12px;
    line-height: 1.7;
    color: #475569;
    word-break: keep-all;
}

.channel-guide__content p {
    margin: 0 0 6px;
}

.channel-guide__content p:last-child {
    margin-bottom: 0;
}

/* Category */
.channel-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.channel-category-tab {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #fff;
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
}

.channel-category-tab:hover {
    background: #f8fafc;
}

.channel-category-tab.is-active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.channel-sort-wrap {
    margin-bottom: 10px;
}

/* Post List */
.channel-post-list {
    border: 1px solid var(--ch-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--ch-shadow);
    overflow: visible;
}

.channel-post-header,
.channel-post-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 120px 125px 65px 55px 55px;
    align-items: center;
    gap: 8px;
}

.channel-post-header {
    min-height: 38px;
    padding: 7px 10px;
    border-bottom: 1px solid #d1d5db;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
}

.channel-post-header__center,
.channel-post-header__number {
    text-align: center;
}

.channel-post-item {
    border-bottom: 1px solid #eef2f7;
}

.channel-post-item:last-child {
    border-bottom: 0;
}

.channel-post-item:hover {
    background: #fafafa;
}

.channel-post-row {
    min-height: 44px;
    padding: 7px 10px;
}

.channel-post-number {
    position: relative;
    text-align: center;
    font-size: 10px;
    color: #64748b;
}

.channel-post-content--with-thumbnail {
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-post-content--with-thumbnail > .channel-post-title-row {
    flex: 1;
    min-width: 0;
}

.channel-post-thumbnail-inline {
    position: relative;
    flex: 0 0 64px;
    width: 64px;
    height: 52px;
    display: block;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}

.channel-post-thumbnail-inline img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-post-thumbnail-inline img.is-blurred {
    filter: blur(5px);
}

.channel-post-thumbnail-inline__spoiler {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .38);
    font-size: 10px;
    font-weight: 800;
    color: #fff;
}

.channel-post-content,
.channel-post-title-row {
    min-width: 0;
}

.channel-post-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 3px;
}

.channel-post-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 5px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.channel-post-badge--category.is-notice,
.channel-post-badge--notice {
    background: #fef3c7;
    color: #92400e;
}

.channel-post-badge--category.is-spoiler,
.channel-post-badge--status.is-hidden {
    background: #fee2e2;
    color: #b91c1c;
}

.channel-post-badge--category.is-normal,
.channel-post-badge--category.is-empty {
    background: #f1f5f9;
    color: #64748b;
}

.channel-post-badge--category.is-category {
    background: #eff6ff;
    color: #2563eb;
}

.channel-post-badge--pinned {
    background: #dbeafe;
    color: #1d4ed8;
}

.channel-post-badge--special,
.channel-post-badge--series,
.channel-post-badge--status.is-pending {
    background: #f3e8ff;
    color: #7e22ce;
}

.channel-post-badge--status.is-draft {
    background: #ffedd5;
    color: #c2410c;
}

.channel-post-badge--status.is-published {
    background: #dcfce7;
    color: #15803d;
}

.channel-post-title-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.channel-post-title {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-post-title:hover {
    color: #2563eb;
    text-decoration: underline;
}

.channel-post-comments {
    flex: 0 0 auto;
    font-size: 8px;
    color: #2563eb;
}

.channel-post-author,
.channel-post-date,
.channel-post-stat {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    color: #64748b;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-post-mobile-meta {
    display: none;
}

.channel-post-empty {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

/* Popular */
.channel-popular {
    border: 1px solid var(--ch-border);
    background: #fff;
    box-shadow: var(--ch-shadow);
}

.channel-popular__header {
    padding: 9px 10px;
    border-bottom: 1px solid var(--ch-border-soft);
    background: #f8fafc;
    font-size: 12px;
    font-weight: 800;
    color: #334155;
}

.channel-popular__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.channel-popular__list li + li {
    border-top: 1px solid #f1f5f9;
}

.channel-popular__list a {
    display: block;
    overflow: hidden;
    padding: 7px 9px;
    font-size: 10px;
    color: #475569;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-popular__list a:hover {
    background: #f8fafc;
    color: #2563eb;
}

/* Tablet */
@media screen and (max-width: 1100px) {
    .community-board-layout {
        grid-template-columns: minmax(0, 1fr) 210px;
    }

    .community-side--left {
        display: none;
    }

    .channel-post-header,
    .channel-post-row {
        grid-template-columns: 55px minmax(0, 1fr) 100px 110px 55px 50px 50px;
        gap: 5px;
    }
}

/* Mobile */
@media screen and (max-width: 640px) {
    .channel-page-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 8px;
    }

    .channel-page-header__title {
        font-size: 19px;
    }

    .channel-page-header__slug {
        margin-top: 2px;
        font-size: 10px;
    }

    .channel-page-header__write,
    .channel-page-header__login {
        min-height: 31px;
        padding: 5px 8px;
        border-radius: 7px;
        font-size: 10px;
    }

    .channel-page-header__write-disabled {
        max-width: 120px;
        font-size: 6px;
        line-height: 1.35;
        text-align: right;
    }

    .channel-show-page {
        width: 100%;
        background: var(--ch-bg);
        overflow-x: hidden;
    }

    .community-board-layout {
        display: block;
        width: 100%;
        max-width: 100%;
        padding: 6px 6px 28px;
    }

    .community-side {
        display: none !important;
    }

    .community-board-main,
    .community-board-content {
        width: 100%;
        min-width: 0;
    }

    .channel-info-card {
        margin-bottom: 8px;
        padding: 9px;
        border-radius: 9px;
    }

    .channel-info-card__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .channel-owner {
        min-width: 0;
        flex: 1 1 auto;
        gap: 7px;
    }

    .channel-owner__avatar {
        width: 34px;
        height: 34px;
        font-size: 10px;
    }

    .channel-owner__label {
        font-size: 6px;
    }

    .channel-owner__id {
        padding: 2px 4px;
        font-size: 5.5px;
    }

    .channel-owner__name {
        margin-top: 1px;
        font-size: 8.5px;
    }

    .channel-info-card__actions {
        flex: 0 0 auto;
        gap: 4px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .channel-subscribe-group {
        gap: 3px;
        flex-wrap: nowrap;
    }

    .channel-subscriber-count,
    .channel-manage-button,
    .channel-action--compact {
        min-height: 25px;
        padding: 4px 6px;
        font-size: 6px;
    }

    .channel-action--compact {
        border-radius: 999px;
    }

    .channel-actions--secondary {
        margin-top: 7px;
    }

    .channel-action {
        min-height: 28px;
        padding: 5px 8px;
        border-radius: 6px;
        font-size: 10px;
    }

    .channel-guide {
        margin-top: 8px;
        padding: 8px;
        border-radius: 7px;
    }

    .channel-guide__title {
        margin-bottom: 3px;
        font-size: 8px;
    }

    .channel-guide__content {
        font-size: 10px;
        line-height: 1.55;
    }

    .channel-category-tabs {
        flex-wrap: nowrap;
        gap: 5px;
        margin-bottom: 8px;
        padding-bottom: 2px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .channel-category-tabs::-webkit-scrollbar {
        display: none;
    }

    .channel-category-tab {
        flex: 0 0 auto;
        min-height: 28px;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 6.5px;
    }

    .channel-sort-wrap {
        margin-bottom: 7px;
    }

    .channel-post-list {
        border-radius: 9px;
        overflow: hidden;
    }

    .channel-post-header {
        display: none;
    }

    .channel-post-item {
        border-bottom: 1px solid #eef2f7;
    }

    .channel-post-item:hover {
        background: #fff;
    }

    .channel-post-row {
        display: block;
        min-height: 0;
        padding: 8px;
    }

    .channel-post-number,
    .channel-post-author,
    .channel-post-date,
    .channel-post-stat {
        display: none;
    }

    .channel-post-thumbnail-inline {
        flex-basis: 56px;
        width: 56px;
        height: 48px;
    }

    .channel-post-content {
        width: 100%;
    }

    .channel-post-badges {
        gap: 3px;
        margin-bottom: 4px;
    }

    .channel-post-badge {
        min-height: 18px;
        padding: 3px 5px;
        border-radius: 4px;
        font-size: 5.5px;
    }

    .channel-post-title-wrap {
        align-items: flex-start;
    }

    .channel-post-title {
        font-size: 10px;
        line-height: 1.45;
        white-space: normal;
        word-break: keep-all;
    }

    .channel-post-comments {
        margin-top: 1px;
        font-size: 6px;
    }

    .channel-post-mobile-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 2px 4px;
        margin-top: 4px;
        font-size: 6px;
        line-height: 1.35;
        color: #94a3b8;
    }

    .channel-post-empty {
        min-height: 110px;
        padding: 16px 10px;
        font-size: 7.5px;
    }
}

/* <= 390px */
@media screen and (max-width: 390px) {
    .community-board-layout {
        padding-left: 5px;
        padding-right: 5px;
    }

    .channel-info-card__top {
        align-items: center;
        gap: 5px;
    }

    .channel-owner__avatar {
        width: 31px;
        height: 31px;
    }

    .channel-owner {
        gap: 5px;
    }

    .channel-info-card__actions {
        max-width: 62%;
        gap: 3px;
    }

    .channel-subscribe-group {
        margin-left: auto;
    }

    .channel-subscriber-count,
    .channel-action--compact,
    .channel-manage-button {
        min-height: 23px;
        padding: 3px 5px;
        font-size: 5.5px;
    }

    .channel-manage-button {
        margin-left: auto;
    }
}

/* <= 350px */
@media screen and (max-width: 350px) {
    .channel-page-header {
        grid-template-columns: minmax(0, 1fr);
    }

    .channel-page-header__actions {
        width: 100%;
    }

    .channel-page-header__write,
    .channel-page-header__login {
        width: 100%;
    }

    .channel-info-card__top {
        align-items: flex-start;
    }

    .channel-owner__avatar {
        width: 29px;
        height: 29px;
        font-size: 10px;
    }

    .channel-owner__name {
        max-width: 75px;
    }

    .channel-info-card__actions {
        max-width: 68%;
    }

    .channel-subscribe-group {
        gap: 2px;
    }

    .channel-subscriber-count,
    .channel-action--compact,
    .channel-manage-button {
        min-height: 22px;
        padding: 3px 4px;
        font-size: 5px;
    }

    .channel-actions--secondary .channel-action {
        width: 100%;
    }

    .channel-post-mobile-meta {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 1px;
    }

    .channel-post-mobile-meta > span:nth-child(even) {
        display: none;
    }
}