/*
 * Edmonton Korean Board Spacing Fix
 * 전체 게시판 공통 간격 축소
 *
 * 핵심:
 * - 페이지 번호 위 행 간격 축소
 * - 페이지 번호 아래 행 간격 축소
 * - 페이지 번호를 감싸는 회색 박스 높이 축소
 * - 글쓰기 버튼 위쪽 빈 공간 축소
 */

/* 게시판 전체 */
#bo_list,
#bo_v,
#bo_w {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
}

/* 리스트 마지막 글 아래쪽 간격 제거 */
#bo_list .tbl_wrap,
#bo_list .list-wrap,
#bo_list .board-list-wrap,
#bo_list .basic-list-wrap,
#bo_list .webzine-list-wrap,
#bo_list .gallery-list-wrap,
#bo_list .list-group,
#bo_list .board-list,
#bo_list .basic-list,
#bo_list .webzine-list,
#bo_list .gallery-list,
#bo_list ul,
#bo_list ol,
#bo_list table {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* 게시글 행 간격 축소 */
#bo_list li,
#bo_list tr,
#bo_list .list-item,
#bo_list .board-item,
#bo_list .post-item,
#bo_list .card,
#bo_list article {
    margin-bottom: 8px !important;
}

#bo_list li:last-child,
#bo_list tr:last-child,
#bo_list .list-item:last-child,
#bo_list .board-item:last-child,
#bo_list .post-item:last-child,
#bo_list .card:last-child,
#bo_list article:last-child {
    margin-bottom: 0 !important;
}

/* 페이지 번호가 들어있는 부모 박스 전체 축소 */
#bo_list:has(.pg_wrap),
#bo_list:has(.pagination),
#bo_list .bo_fx:has(.pg_wrap),
#bo_list .bo_fx2:has(.pg_wrap),
#bo_list .list-bottom:has(.pg_wrap),
#bo_list .list-footer:has(.pg_wrap),
#bo_list .board-footer:has(.pg_wrap),
#bo_list .pagination-wrap:has(.pg),
#bo_list .page-wrap:has(.pg),
#bo_list .bo_page:has(.pg),
#bo_list .bo_page_wrap:has(.pg) {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    min-height: 0 !important;
    height: auto !important;
}

/* 페이지 번호 바깥 줄 */
.pg_wrap,
#bo_list .pg_wrap,
#bo_v .pg_wrap,
#bo_w .pg_wrap,
.pagination-wrap,
.pagination-wrapper,
.page-wrap,
.page-wrapper,
.list-pagination,
.board-pagination,
.bo_page,
.bo_page_wrap {
    clear: both !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;

    margin-top: 2px !important;
    margin-bottom: 2px !important;

    padding-top: 0 !important;
    padding-bottom: 0 !important;

    min-height: 0 !important;
    height: auto !important;
    line-height: 1 !important;
}

/* 페이지 번호 내부 줄 */
.pg,
#bo_list .pg,
#bo_v .pg,
#bo_w .pg,
.pagination {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;

    gap: 3px !important;

    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;

    min-height: 0 !important;
    height: auto !important;
    line-height: 1 !important;
}

/* 페이지 번호 버튼 */
.pg a,
.pg strong,
.pg_page,
.pg_current,
.pg_start,
.pg_prev,
.pg_next,
.pg_end,
.pagination a,
.pagination span,
.pagination strong,
.page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-width: 24px !important;
    height: 24px !important;

    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 1px !important;
    margin-right: 1px !important;

    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 6px !important;
    padding-right: 6px !important;

    line-height: 1 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
}

/* 현재 페이지 */
.pg_current,
.pagination .active a,
.pagination .active span,
.page-item.active .page-link {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}

/* 페이지 번호 위쪽에 생기는 큰 빈 줄 제거 */
#bo_list .pg_wrap::before,
#bo_list .pg_wrap::after,
#bo_list .pagination-wrap::before,
#bo_list .pagination-wrap::after,
#bo_list .page-wrap::before,
#bo_list .page-wrap::after {
    display: none !important;
    content: none !important;
}

/* 글쓰기 버튼 영역 위아래 간격 축소 */
#bo_list .bo_fx,
#bo_list .bo_fx2,
#bo_list .bo_btn_top,
#bo_list .bo_btn_bottom,
#bo_list .btn_bo_user,
#bo_list .list-btn,
#bo_list .list-bottom,
#bo_list .list-footer,
#bo_list .board-footer,
#bo_list .bo_list_footer,
#bo_list .bo-list-footer,
#bo_list .bbs-footer,
#bo_list .na-footer,
#bo_list .na-board-footer {
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

/* 글쓰기 버튼 줄 */
#bo_list .btn_bo_user,
#bo_list .bo_fx,
#bo_list .bo_btn_bottom,
#bo_list .list-btn {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 8px !important;
}

/* 글쓰기 버튼 자체 */
#bo_list .btn_b01,
#bo_list .btn_b02,
#bo_list .btn_admin,
#bo_list .btn_submit,
#bo_list a[href*="write.php"],
#bo_list .btn_bo_user a,
#bo_list .bo_fx a {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* 페이지 번호 바로 다음 줄 */
.pg_wrap + .bo_fx,
.pg_wrap + .btn_bo_user,
.pg_wrap + .bo_btn_bottom,
.pg_wrap + .list-btn,
.pg_wrap + div,
.pagination-wrap + div,
.page-wrap + div {
    margin-top: 2px !important;
    padding-top: 0 !important;
}

/* 회색 배경 박스가 큰 경우 강제 축소 */
#bo_list .bg-light,
#bo_list .bg-gray,
#bo_list .bg-gray-50,
#bo_list .bg-slate-50,
#bo_list .bg-body-tertiary,
#bo_list [class*="bg-gray"],
#bo_list [class*="bg-slate"] {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    min-height: 0 !important;
}

/* 큰 빈 높이를 만드는 요소 강제 축소 */
#bo_list [style*="height"],
#bo_list [style*="min-height"] {
    min-height: 0 !important;
}

/* 단, 실제 게시글 카드 높이는 깨지지 않게 */
#bo_list .card,
#bo_list .list-item,
#bo_list .board-item,
#bo_list .post-item {
    height: auto !important;
}

/* 빈 목록 안내 영역은 너무 작아지지 않게 */
#bo_list .empty_table,
#bo_list .empty_list {
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
}

/* 모바일 */
@media (max-width: 768px) {
    #bo_list,
    #bo_v,
    #bo_w {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    #bo_list li,
    #bo_list tr,
    #bo_list .list-item,
    #bo_list .board-item,
    #bo_list .post-item,
    #bo_list .card,
    #bo_list article {
        margin-bottom: 6px !important;
    }

    .pg_wrap,
    #bo_list .pg_wrap,
    #bo_v .pg_wrap,
    #bo_w .pg_wrap,
    .pagination-wrap,
    .pagination-wrapper,
    .page-wrap,
    .page-wrapper,
    .list-pagination,
    .board-pagination,
    .bo_page,
    .bo_page_wrap {
        margin-top: 1px !important;
        margin-bottom: 1px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .pg,
    #bo_list .pg,
    #bo_v .pg,
    #bo_w .pg,
    .pagination {
        gap: 2px !important;
    }

    .pg a,
    .pg strong,
    .pg_page,
    .pg_current,
    .pg_start,
    .pg_prev,
    .pg_next,
    .pg_end,
    .pagination a,
    .pagination span,
    .pagination strong,
    .page-link {
        min-width: 22px !important;
        height: 22px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
    }

    #bo_list .bo_fx,
    #bo_list .bo_fx2,
    #bo_list .bo_btn_top,
    #bo_list .bo_btn_bottom,
    #bo_list .btn_bo_user,
    #bo_list .list-btn,
    #bo_list .list-bottom,
    #bo_list .list-footer,
    #bo_list .board-footer,
    #bo_list .bo_list_footer,
    #bo_list .bo-list-footer,
    #bo_list .bbs-footer,
    #bo_list .na-footer,
    #bo_list .na-board-footer {
        margin-top: 2px !important;
        margin-bottom: 2px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    #bo_list .bg-light,
    #bo_list .bg-gray,
    #bo_list .bg-gray-50,
    #bo_list .bg-slate-50,
    #bo_list .bg-body-tertiary,
    #bo_list [class*="bg-gray"],
    #bo_list [class*="bg-slate"] {
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }
}

/* 작은 모바일 */
@media (max-width: 430px) {
    .pg_wrap,
    #bo_list .pg_wrap,
    #bo_v .pg_wrap,
    #bo_w .pg_wrap {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .pg a,
    .pg strong,
    .pg_page,
    .pg_current,
    .pg_start,
    .pg_prev,
    .pg_next,
    .pg_end,
    .pagination a,
    .pagination span,
    .pagination strong,
    .page-link {
        min-width: 21px !important;
        height: 21px !important;
        font-size: 12px !important;
    }
}
