/* 
 * 게시판 스타일
 * 모바일 최적화 및 콘텐츠 표시 개선을 위한 CSS
 */

/* ===== 게시판 목록 스타일 ===== */
.boards-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
}

.boards-container section {
    padding: 0;
    margin: 0;
}

@media (max-width: 768px) {
    .boards-container {
        max-width: 100%;
        margin: 10px;
        padding: 0 10px;
    }
}

/* 카테고리 메뉴 */
.category-menu {
    margin-bottom: 1.5rem;
}

.category-item {
    border-radius: 20px;
    background-color: #f8f9fa;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.category-item:hover {
    background-color: #e9ecef;
    color: #212529;
}

.category-item-pill {
    border-radius: 20px;
    background-color: #0d6efd;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #0d6efd;
}

.category-item-pill:hover {
    background-color: #0b5ed7;
    color: #fff;
}

/* 카테고리 정보 */
.category-info {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.category-info-title {
    font-size: 1rem;
}

.category-highlight {
    color: #0d6efd;
    font-weight: 600;
}

/* 검색 폼 */
.btn-search {
    background-color: #0d6efd;
    color: #fff;
}

.btn-search:hover {
    background-color: #0b5ed7;
    color: #fff;
}

/* 게시글 테이블 스타일 */
.board-table {    
    margin-bottom: 2rem;
}

.board-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
}

.board-table .title-cell {
    width: 60%;
    text-align: left;
}

.board-table .author-cell {
    width: 15%;
    text-align: center;
}

.board-table .date-cell {
    width: 15%;
    text-align: center;
}

.board-table .views-cell {
    width: 10%;
    text-align: center;
}

.board-table tbody tr {
    transition: background-color 0.2s;
}

.board-table tbody tr:hover {
    background-color: #f8f9fa;
}

.title-link {
    color: #212529;
    text-decoration: none;
    display: block;
    padding: 0.5rem 0;
    font-weight: 500;
}

.title-link:hover {
    color: #0d6efd;
}

.title-text {
    margin-right: 0.5rem;
}

/* 새 글 표시 배지 */
.badge-new {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    background-color: #ff3366;
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* 좋아요 카운트 */
.likes-count {
    display: inline-flex;
    align-items: center;
    color: #ff3366;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.likes-count i {
    margin-right: 0.1rem;
}

/* 모바일 반응형 */
@media (max-width: 767.98px) {
    .mobile-hide {
        display: none;
    }
    
    .board-table .title-cell {
        width: 75%;
    }
    
    .board-table .views-cell {
        width: 25%;
    }
}

/* 빈 상태 */
.empty-state {
    min-height: 200px;
}

.icon-lg {
    font-size: 3rem;
    color: #adb5bd;
}

/* 페이지네이션 */
.pagination-container {
    display: flex;
    justify-content: center;
    padding-top: 80px;
    margin-bottom: 70px;   
}

.pagination {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination .page-item {
    display: flex;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    color: #33333380;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
}

.pagination .page-item.active .page-link {
    background: #f6f5ff;
    color: #7d65f2;
    border: none;
}

.pagination .page-item.disabled .page-link {
    background: #f5f5f5;
    color: #ccc;
    border: none;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination .page-item.disabled .page-link:hover {
    background: #f5f5f5;
    color: #ccc;
    border: none;
}

/* ===== 게시글 상세 스타일 ===== */
/* 기본 콘텐츠 스타일 */
.board-content {
    line-height: 1.8;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
    color: #333333;
    font-size: 15px;
}

/* 모든 요소가 컨테이너 안에 유지되도록 */
.board-content * {
    max-width: 100%;
    box-sizing: border-box;
}

.board-content h1 {
    font-size: 27px;
    font-weight: 600;
    margin: 60px 0 19px;
}

.board-content h2 {
    font-size: 25px;    
    line-height: 1.46;
    margin: 1em 0 20px;
}


.board-content h3 {
    font-size: 1.44rem;    
    line-height: 1.48;
    margin: 1em 0 20px;
    font-weight: normal;
    letter-spacing: -1px;
}

.board-content p {
    font-size: 16px;
    line-height: 1.75;
    margin-top: 10px;
    margin-bottom: 30px;
}

.board-content strong {
    font-weight: 600;
    font-size: 16px;
}

@media (max-width: 768px) {
    .board-content h1,
    .board-content h2,
    .board-content h3,
    .board-content h4 {
        font-size: 20px;
        padding: 1em 0 .35em;
        line-height: 1.5em;        
        word-break: break-word;
        margin: 0;
    }

    .board-content p {
        font-size: 14px;
        margin: 0;
        padding: 0;
    
    }
    .board-content strong {
        font-size: 14px;
    }
}


/* 대표 이미지 */
.featured-image {
    max-height: 500px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* 작성자 정보 */
.author-text {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.author-text-small {
    color: #33333380;
    font-size: 14px;
    font-weight: 500;
}


/* 태그 */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-badge {
    display: inline-block;        
    color: #33333380;    
    font-size: 10px;
}

/* 이전/다음 게시글 네비게이션 */
.board-nav {
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.board-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1rem;
}

.board-nav-item {
    flex: 1;
    max-width: 50%;
}

.board-nav-prev {
    text-align: left;
}

.board-nav-next {
    text-align: right;
}

.board-nav-link {
    display: block;
    padding: 0.75rem;
    color: #495057;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    height: 100%;
}

.board-nav-link:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.nav-label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.nav-title {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prev-link .nav-label {
    text-align: left;
}

.next-link .nav-label {
    text-align: right;
}

.next-link .nav-title {
    text-align: right;
}

/* 모바일 반응형 */
@media (max-width: 767.98px) {
    .board-nav-container {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .board-nav-item {
        max-width: 50%;
    }
    
    .board-nav-prev,
    .board-nav-next {
        text-align: center;
    }
    .prev-link .nav-label,
    .prev-link .nav-title {
        text-align: left;
    }

    .next-link .nav-label,
    .next-link .nav-title {
        text-align: right;
    }
}

/* 목록 버튼 */
.btn-list {
    background-color: #6c757d;
    color: #fff;
    padding: 0.5rem 2rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-list:hover {
    background-color: #5a6268;
    color: #fff;
}


/* 관련 게시글 */
.related-link {
    display: block;
    padding: 0.75rem;
    color: #212529;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.related-link:hover {
    background-color: #f8f9fa;
}

.related-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-info h6 {
    font-weight: 500;
    max-width: 200px;
}

/* 테이블 래퍼 스타일 */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

/* 기본 테이블 스타일 */
.board-content table {
    margin: 1.5rem auto;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
    width: auto;
    min-width: 600px;
    background-color: #fff;
}

/* 셀 스타일 */
.board-content table th,
.board-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    word-break: break-word;
    white-space: normal;
    vertical-align: middle;
    text-align: center;
}

/* 테이블 헤더 스타일 */
.board-content table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* 이미지 스타일 */
.board-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    width: 700px;
    height: auto;
}

/* 링크 스타일 */
.board-content a {
    color: #0d6efd;
    text-decoration: none;
    word-break: break-word;
}

.board-content a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* ===== 반응형 스타일 ===== */
@media (max-width: 767.98px) {
    /* 이미지 최적화 */
    .board-content img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
    
    /* 테이블 셀 패딩 줄이기 */
    .board-content table th,
    .board-content table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    /* 관련 게시글 */
    .related-info h6 {
        max-width: 150px;
    }
    
    /* 네비게이션 */
    .board-nav-link {
        padding: 0.5rem;
        font-size: 11px;
    }
    
    /* 댓글 폼 */
    .comment-form .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* 페이지네이션 모바일 스타일 */
    .pagination-container {
        padding-top: 50px;
        margin-bottom: 50px;
    }
    
    .pagination .page-link {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

.board-content-container {margin: 0 auto;padding: 0 15px;width: 100%;}
.board-detail-card-body { display: flex; flex-direction: column; height: auto; padding: 1.25rem 0 !important; position: relative;}