@charset "UTF-8";

/* ==========================================================================
   ShortsBuilder Community Board Stylesheet (/css/board.css)
   ========================================================================== */
.sb-board-wrap {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 20px 80px;
    box-sizing: border-box;
    color: #e2e8f0;
}

/* 상세 상단 목록 복귀 버튼 */
.btn-sb-list {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 13px;
    border-radius: 20px;
    background: #131b2e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.btn-sb-list:hover {
    background: #1e293b;
    border-color: rgba(99, 102, 241, 0.5);
    color: #ffffff;
}

/* 상단 커뮤니티 타이틀 & 게시판 탭 네비게이션 */
.sb-board-top-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sb-board-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sb-board-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sb-board-tab {
    padding: 7px 15px;
    border-radius: 20px;
    background: #131b2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}
.sb-board-tab:hover {
    color: #ffffff;
    border-color: rgba(99, 102, 241, 0.5);
}
.sb-board-tab.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border-color: transparent;
}

/* 상단 관리자 지정 HTML 안내 박스 */
/* 상단 관리자 지정 HTML 안내 박스 */
.sb-board-notice-box {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid #6366f1;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.55;
}
.sb-board-notice-box p:last-child,
.sb-board-notice-box ul:last-child {
    margin-bottom: 0;
}

/* 모바일 아코디언(접기/펼치기) 전용 레이아웃 */
@media (max-width: 767.98px) {
    .sb-board-notice-box.has-toggle {
        padding: 0;
        overflow: hidden;
    }
    .sb-board-notice-box.has-toggle .sb-notice-inner {
        padding: 12px 14px 10px;
    }
    .sb-board-notice-box.is-clamped .sb-notice-inner {
        position: relative;
        max-height: 68px; /* 2줄 제목까지 잘림 없이 노출 */
        overflow: hidden;
    }
    .sb-board-notice-box.is-clamped .sb-notice-inner::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 22px;
        background: linear-gradient(to bottom, rgba(14, 21, 38, 0), #0e1526 92%);
        pointer-events: none;
    }
    .sb-notice-toggle-btn {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px;
        padding: 7px 0;
        background: rgba(255, 255, 255, 0.025);
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        color: #94a3b8;
        font-size: 0.76rem;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.15s, color 0.15s;
    }
    .sb-notice-toggle-btn:active {
        background: rgba(255, 255, 255, 0.06);
        color: #e2e8f0;
    }
}

/* PC에서는 항상 전체 펼침 유지 */
@media (min-width: 768px) {
    .sb-board-notice-box.has-toggle .sb-notice-inner {
        max-height: none !important;
    }
    .sb-notice-toggle-btn {
        display: none !important;
    }
}

/* 1. 커뮤니티 허브(/board/main) 3열 카드 그리드 */
.sb-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 992px) {
    .sb-hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .sb-hub-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
}
.sb-hub-card {
    background: #131b2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
@media (max-width: 640px) {
    .sb-hub-card {
        padding: 16px 14px;
    }
}
.sb-hub-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.sb-hub-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sb-hub-card-more {
    font-size: 0.8rem;
    color: #94a3b8;
    text-decoration: none;
    flex-shrink: 0;
}
.sb-hub-card-more:hover {
    color: #818cf8;
}
.sb-hub-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sb-hub-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    min-width: 0;
}
.sb-hub-post-link {
    color: #cbd5e1;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.sb-hub-post-link:hover {
    color: #ffffff;
}
.sb-hub-post-meta {
    font-size: 0.78rem;
    color: #64748b;
    flex-shrink: 0;
}

/* 2. 게시판 목록 테이블 (/board/{boardCode}) */
.sb-board-card {
    background: #162038;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}
.sb-post-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.sb-post-table thead th {
    background: #0b1120;
    color: #94a3b8;
    font-weight: 600;
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}
.sb-post-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    vertical-align: middle;
}
.sb-post-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}
.sb-post-row-pin2 {
    background: rgba(239, 68, 68, 0.06);
}
.sb-post-row-pin1 {
    background: rgba(99, 102, 241, 0.06);
}
.sb-post-title-link {
    color: #f1f5f9;
    text-decoration: none;
    font-weight: 500;
}
.sb-post-title-link:hover {
    color: #818cf8;
}
.sb-badge-pin2,
.sb-badge-pin1 {
    display: inline-block;
    white-space: nowrap;
    line-height: 1.2;
    color: #ffffff;
    font-size: 0.72rem;
    padding: 3px 7px;
    border-radius: 4px;
    font-weight: 700;
    margin-right: 6px;
}
.sb-badge-pin2 {
    background: #ef4444;
}
.sb-badge-pin1 {
    background: #6366f1;
}

@media (min-width: 768px) {
    .sb-post-table {
        min-width: 700px;
    }
    .sb-post-table tbody td:not(:nth-child(2)) {
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    .sb-post-table tbody td {
        padding: 13px 14px;
    }
    .sb-post-title-link {
        font-size: 0.94rem;
        line-height: 1.4;
    }
}

/* 3. 게시글 상세 (/board/post/{postId}) */
.sb-detail-box {
    background: #131b2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 24px;
    min-width: 0;
    overflow: hidden;
}
.sb-detail-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 18px;
    margin-bottom: 24px;
}
.sb-detail-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    margin: 10px 0 12px;
    line-height: 1.4;
    word-break: break-word;
}

/* PC: 좌측 작성자 / 우측 날짜·조회·댓글 고정 */
.sb-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 0.84rem;
    color: #94a3b8;
}
.sb-detail-author {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sb-detail-meta-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* 모바일: 1줄 작성자(전체 폭) / 2줄 날짜(좌)·조회/댓글(우) */
@media (max-width: 767.98px) {
    .sb-detail-header {
        padding-bottom: 14px;
        margin-bottom: 18px;
    }
    .sb-detail-title {
        font-size: 1.2rem;
        margin: 10px 0;
    }
    .sb-detail-meta {
        flex-wrap: wrap;
        row-gap: 4px;
        font-size: 0.78rem;
    }
    .sb-detail-author {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .sb-detail-meta-right {
        flex: 0 0 100%;
        gap: 10px;
        font-size: 0.76rem;
    }
    .sb-meta-date {
        margin-right: auto;
    }
    .sb-meta-sep {
        display: none;
    }
}

.sb-detail-media {
    margin-bottom: 24px;
    background: #0b1120;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.sb-detail-media iframe,
.sb-detail-media video,
.sb-detail-media img {
    max-width: 100%;
    max-height: 540px;
    border-radius: 8px;
}

/* 본문 영역 및 내부 미디어/표 반응형 보호 (에디터 정렬 유지) */
.sb-post-content,
.sb-detail-content,
.board-content-area {
    display: flow-root;
    font-size: 0.98rem;
    line-height: 1.8;
    color: #e2e8f0;
    min-height: 180px;
    max-width: 100%;
    overflow-x: hidden;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}
.sb-detail-content img,
.sb-detail-content video,
.sb-post-content img,
.sb-post-content video,
.board-content-area img,
.board-content-area video {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
}
.sb-detail-content iframe,
.sb-post-content iframe,
.board-content-area iframe {
    display: inline-block;
    vertical-align: top;
    width: 100% !important;
    max-width: 720px !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    border-radius: 10px;
    margin: 14px 0;
}
.sb-detail-content table,
.sb-post-content table,
.board-content-area table {
    display: block;
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sb-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sb-tag-badge {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.82rem;
    text-decoration: none;
    font-weight: 600;
}
.sb-tag-badge:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
}

/* 좋아요 & 액션 버튼바 (좋아요 정중앙 + 신고 우측 끝) */
.sb-detail-actions {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 36px;
    margin: 26px 0 6px;
}
.btn-sb-like {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    padding: 7px 18px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.86rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-sb-like:hover {
    border-color: rgba(244, 63, 94, 0.5);
    color: #ffffff;
}
.btn-sb-like.liked {
    background: rgba(244, 63, 94, 0.15);
    border-color: #f43f5e;
    color: #fb7185;
}
.btn-sb-report {
    position: absolute;
    right: 0;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.78rem;
    padding: 4px 6px;
    cursor: pointer;
    transition: color 0.15s;
}
.btn-sb-report:hover {
    color: #94a3b8;
}

/* 4. 댓글 영역 (2-Depth) */
.sb-comment-box {
    background: #131b2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px 22px;
    margin-top: 16px;
    min-width: 0;
    overflow: hidden;
}
.sb-comment-composer {
    background: #0b1120;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 10px 12px;
    transition: border-color 0.2s;
}
.sb-comment-composer:focus-within {
    border-color: #6366f1;
}
.sb-comment-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sb-comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sb-comment-body img {
    max-width: 100% !important;
    max-height: 260px;
    height: auto !important;
    border-radius: 8px;
    margin-top: 6px;
}
.sb-comment-reply {
    margin-left: 24px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid #6366f1;
    border-radius: 0 8px 8px 0;
    margin-top: 8px;
}

/* 모바일(768px 이하) 여백 압축 - 입력 영역 최대 확보 */
@media (max-width: 768px) {
    .sb-board-wrap {
        padding: 16px 10px 60px;
    }
    .sb-detail-box {
        padding: 16px 14px;
        border-radius: 12px;
    }
    .sb-comment-box {
        padding: 14px 12px;
        border-radius: 12px;
    }
    .sb-comment-composer {
        padding: 9px 10px;
    }
    .sb-comment-reply {
        margin-left: 12px;
        padding: 9px 10px;
    }
}

/* 글쓰기/검색 폼 다크 보정 */
.sb-form-dark {
    background-color: #0b1120 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
    border-radius: 8px;
}
.sb-form-dark::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

/* 이미지 확대 뷰어 닫기 버튼 */
.sb-zoom-close-btn {
    width: 38px;
    height: 38px;
    z-index: 10;
    background-color: rgba(11, 17, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #f8fafc;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.sb-zoom-close-btn:hover {
    background-color: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
    transform: scale(1.05);
}