/* =========================
   게시판 공통
========================= */
.board-wrap {
    width: 100%;
    margin-top: 20px;
}

.board-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.board-total {
    font-size: 14px;
    color: #555;
}

.board-search {
    display: flex;
    gap: 5px;
}

.board-search select,
.board-search input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.board-search button {
    height: 36px;
    width: 36px;
    border: none;
    background: #333;
    color: #fff;
    cursor: pointer;
}

/* =========================
   게시판 테이블
========================= */
.board-table-wrap {
    overflow-x: auto;
}

.board-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 2px solid #333;
}

.board-table th,
.board-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
}

.board-table tbody tr:hover{
    background-color: #eee;
}

.board-table th {
    background: #f7f7f7;
    font-weight: 600;
    text-align: center !important;
}

.board-table .col-no, .board-table .col-hit {
    text-align: center;
    width:60px;
}
.board-table .col-writer,.board-table .col-date {
    text-align: center;
    width:100px;
}

.board-table .col-title {
    text-align: left;
}

.board-table .col-title a {
    color: #333;
    text-decoration: none;
}

.board-table .col-title a:hover {
    text-decoration: underline;
}

.board-table .notice a {
    font-weight: 700;
    color: #005bac;
}

/* =========================
   페이지네이션
========================= */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    gap: 5px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.page-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.page-btn:hover {
    background: #eee;
}

@media (max-width: 768px) {

    /* 가로 스크롤 원천 차단 */
    .board-table-wrap,
    .board-table,
    .board-table tr {
        overflow-x: hidden;
    }

    .board-table thead {
        display: none;
    }

    .board-table tr {
        display: block;
        padding: 12px 10px;
        border-bottom: 1px solid #ddd;
    }

    .board-table td {
        display: block;
        padding: 0;
        border: none;
        text-align: left;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* =========================
       제목 (핵심 수정)
    ========================= */
    .board-table .col-title {
        font-size: 15px;
        font-weight: 600;
        margin-bottom: 8px;

        /* 🔥 가로폭 제한 + 줄바꿈 */
        max-width: 100%;
        white-space: normal;      /* 줄바꿈 허용 */
        word-break: break-word;   /* 긴 단어 강제 분리 */
    }

    .board-table .col-title a {
        display: block;
        max-width: 100%;
    }

    /* =========================
       메타 정보
    ========================= */
    .board-table .col-writer,
    .board-table .col-date,
    .board-table .col-hit {
        font-size: 12px;
        color: #777;
        line-height: 1.4;
    }

    /* 작성자: 왼쪽 */
    .board-table .col-writer {
        float: left;
        max-width: 50%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 작성일 + 조회수: 오른쪽 */
    .board-table .col-date {
        float: right;
        white-space: nowrap;
        margin-left: 20px;
    }

    .board-table .col-hit {
        float: right;
        width: 70px;               /* 자릿수 무관 */
        margin-left: 20px;
        padding-left: 10px;
        border-left: 1px solid #ddd;

        text-align: right;
        white-space: nowrap;
    }

    .board-table .col-hit::before {
        content: "👁 ";
    }

    /* 번호 숨김 */
    .board-table .col-no {
        display: none;
    }

    /* float 정리 */
    .board-table tr::after {
        content: "";
        display: block;
        clear: both;
    }

    
}

/* =========================
   게시판 상세보기
========================= */
.board-view-wrap {
    /*border-top: 2px solid #333;*/
    margin-top: -20px;
}

.board-view-header {
    padding: 20px 10px 15px;
    border-bottom: 1px solid #ddd;
}

.board-view-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.board-view-meta {
    font-size: 13px;
    color: #777;
    display: flex;
    align-items: center;
    gap: 12px;
}

.board-view-meta span::after {
    content: "·";
    margin-left: 12px;
}

.board-view-meta span:last-child::after {
    content: "";
}

/* =========================
   첨부파일
========================= */
.board-view-files {
    padding: 12px 10px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

.board-view-files ul {
    margin-top: 6px;
}

.board-view-files li {
    margin-top: 4px;
}

.board-view-files a {
    color: #005bac;
    text-decoration: none;
}

.board-view-files i {
    margin-right: 6px;
}

/* =========================
   본문
========================= */
.board-view-content {
    padding: 20px 10px;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.board-view-content img {
    max-width: 100%;
    height: auto;
}

/* =========================
   하단 버튼
========================= */
.board-view-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-top: 1px solid #ddd;
}

.board-view-buttons a {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #ccc;
    color: #333;
    text-decoration: none;
}

.btn-list {
    background: #f5f5f5;
}

.btn-edit {
    background: #fff;
}

.btn-delete {
    color: #fff;
}

/* ===== 글쓰기 래퍼 ===== */
.board-write-wrap {
    border-top: 2px solid #333;
    padding-top: 30px;
}

/* ===== 헤더 ===== */
.board-write-header {
    margin-bottom: 25px;
}

.board-write-title {
    font-size: 20px;
    font-weight: 600;
}

/* ===== 폼 ===== */
.board-write-form .form-row {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.board-write-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
}

.board-write-form input[type="text"],
.board-write-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.board-write-form textarea {
    resize: vertical;
}

.input-short {
    width: 220px;
}

/* ===== 안내문 ===== */
.form-noti {
    font-size: 13px;
    color: #777;
    margin-top: 6px;
}

/* ===== 버튼 ===== */
.board-write-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn-cancel {
    padding: 8px 18px;
    border: 1px solid #ccc;
    background: #f7f7f7;
    color: #333;
    text-decoration: none;
}

.btn-submit {
    padding: 8px 20px;
    background: #333;
    color: #fff;
    border: none;
    cursor: pointer;
}

.btn-submit:hover {
    background: #000;
}

/* ===== 첨부파일 ===== */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-item input[type="file"] {
    flex: 1;
}

.btn-file-add {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #ccc;
    background: #f7f7f7;
    cursor: pointer;
    display: inline-block;
    margin-left: auto;   /* 핵심 */
}

.btn-file-remove {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}

.btn-file-remove:hover {
    color: #c00;
}


/* =========================
   모바일 반응형
========================= */
@media (max-width: 768px) {

    .board-view-title {
        font-size: 17px;
    }

    .board-view-meta {
        font-size: 12px;
        justify-content: space-between;
    }

    .board-view-meta span::after {
        display: none;
    }

    .board-view-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .btn-right {
        display: flex;
        gap: 8px;
        width: 100%;
    }

    .btn-right a {
        flex: 1;
        text-align: center;
    }

    .btn-list {
        width: 100%;
        text-align: center;
    }

        .board-write-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
        text-align: center;
    }
}
