@charset "UTF-8";
/* ==========================================================
   [더원크레인 스페어 시스템 V5.3] 통합 게시판 모듈 스타일 (board.css)
   - 모던 슬레이트 & 반응형 미디어쿼리 완벽 탑재
========================================================== */

/* 1. 메인 공지 위젯 (대시보드 노출용) 영역 */
.main-notice-widget {
    margin: 0 0 14px;
    background: #ffffff;
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: left;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    min-height: 112px;
    box-sizing: border-box;
    width: 100%;
}

.notice-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.notice-widget-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
    font-weight: bold;
}

.notice-widget-header button {
    background: none;
    border: none;
    color: #2563eb;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.2s;
}

.notice-widget-header button:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

#mainNoticeList {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    position: relative;
    min-height: 64px;
    overflow: hidden;
}

.main-notice-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
    border: 1px solid #dbeafe;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
    box-sizing: border-box;
    cursor: pointer;
}

.main-notice-item.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.main-notice-badge {
    font-size: 18px;
    flex-shrink: 0;
}

.main-notice-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.main-notice-copy strong {
    font-size: 14px;
    color: #0f172a;
    line-height: 1.4;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.main-notice-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    min-width: 0;
}

.main-notice-author {
    color: #475569;
    font-weight: 600;
}

.main-notice-date {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}


/* 2. 게시판 탭 본문 영역 (#board) */
#sec-board {
    display: none;
}

#sec-board.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#board.tab-content {
    padding: 20px;
    background: #f8fafc;
    min-height: 0;
    width: 100%;
}

.board-inner-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

/* 상단 타이틀 및 검색/필터/글쓰기 컨트롤 바 */
.board-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.board-header-bar h2 {
    flex: 1 1 260px;
}

.board-header-bar h2 {
    margin: 0;
    font-size: 22px;
    color: #0f172a;
    font-weight: bold;
}

.board-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* 카테고리 필터 (전체보기/공지사항/일반글) */
#boardFilterCategory {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background-color: #ffffff;
    color: #334155;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#boardFilterCategory:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#boardSearchInput {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    width: 220px;
}

.board-write-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.board-write-btn:hover {
    background: #1d4ed8;
}


#boardSearchInput:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pinned-wrap {
    display: none;
    align-items: center;
    gap: 10px;
}

.board-pin-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: #f59e0b;
}

.btn-write {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-write:hover {
    background: #1d4ed8;
}


/* 3. 게시판 테이블 스타일 */
.board-table-container {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.board-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    table-layout: fixed;
    min-width: 600px;
}

.board-table-row-header {
    background: #f1f5f9;
    color: #475569;
    border-bottom: 1px solid #cbd5e1;
}

.board-table th,
.board-table td {
    padding: 12px 16px;
}

.board-table-col-number,
.board-table-col-center {
    text-align: center;
}

.board-table-col-number {
    width: 8%;
}

.board-table-col-date {
    width: 12%;
}

.board-table-col-count {
    width: 8%;
}

.board-table-col-title {
    width: 48%;
}

.board-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    word-break: break-word;
    white-space: normal;
}

.board-table tbody tr {
    transition: background 0.15s ease;
    cursor: pointer;
}

.board-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.board-modal[data-open="true"] {
    display: flex;
}

.board-modal-content {
    background: #fff;
    width: 100%;
    max-width: 600px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

.board-modal-heading {
    margin: 0 0 20px;
    font-size: 18px;
    color: #1e293b;
}

.board-modal-row {
    margin-bottom: 15px;
}

.board-modal-row--textarea {
    margin-bottom: 20px;
}

.board-modal-label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #475569;
    margin-bottom: 5px;
}

.board-modal-input,
.board-modal-select,
.board-modal-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #334155;
    background: #fff;
}

.board-modal-text-disabled {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 500;
}

.board-modal-textarea {
    resize: vertical;
    min-height: 140px;
}

.board-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.board-modal-button {
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.board-modal-button-secondary {
    background: #e2e8f0;
    color: #334155;
}

.board-modal-button-primary {
    background: #2563eb;
    color: #fff;
}

.board-view-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.board-view-modal[data-open="true"] {
    display: flex;
}

.board-view-modal-content {
    background: #fff;
    width: 100%;
    max-width: 650px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

.board-view-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.board-view-modal-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0284c7;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.board-view-modal-title {
    margin: 8px 0 0 0;
    font-size: 18px;
    color: #0f172a;
    font-weight: bold;
}

.board-view-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #94a3b8;
}

.board-view-modal-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 10px;
    border-radius: 6px;
}

.board-view-modal-body {
    min-height: 120px;
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 25px;
}

.board-view-modal-admin-actions {
    display: none;
    gap: 10px;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px dashed #cbd5e1;
}

.board-view-modal-action {
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
}

.board-view-modal-action--notice {
    background: #f59e0b;
}

.board-view-modal-action--danger {
    background: #dc2626;
}

.board-view-modal-footer {
    display: flex;
    justify-content: flex-end;
}

.board-view-modal-button {
    background: #475569;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}


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


/* 4. 모달 공통 레이아웃 (화면 꽉채움 방지 & 정중앙 정렬) */
.board-modal-overlay {
    display: none; /* JS 제어로 flex 전환 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    padding: 16px;
    box-sizing: border-box;
}

.board-modal-box {
    background: #ffffff;
    width: 100%;
    max-width: 600px;          /* 최대 폭 제한 */
    max-height: 85vh;          /* 화면 전체 꽉참 방지 */
    overflow-y: auto;          /* 내용 길어질 경우 내부 스크롤 */
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    position: relative;
    box-sizing: border-box;
    margin: auto;
}

.board-modal-box.wide {
    max-width: 650px;
}

.board-modal-box h3 {
    margin-top: 0;
    font-size: 18px;
    color: #1e293b;
    margin-bottom: 20px;
    font-weight: bold;
}

/* 폼 입력 필드 디자인 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #475569;
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input:disabled {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 500;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* 📌 공지고정 체크박스 영역 스타일 */
.pinned-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    cursor: pointer;
}

.pinned-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #d97706;
    cursor: pointer;
}

.pinned-wrap label {
    margin: 0;
    font-size: 13px;
    color: #92400e;
    font-weight: bold;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* 모달 버튼 그룹 */
.modal-btn-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.btn-cancel {
    background: #e2e8f0;
    color: #334155;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: #cbd5e1;
}

.btn-submit {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #1d4ed8;
}


/* 5. 상세 보기 모달 전용 스타일 */
.view-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.view-modal-badge {
    background: #e0f2fe;
    color: #0284c7;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.view-modal-title {
    margin: 8px 0 0 0;
    font-size: 18px;
    color: #0f172a;
    font-weight: bold;
    line-height: 1.4;
}

.view-modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 4px;
    line-height: 1;
}

.view-modal-close-btn:hover {
    color: #0f172a;
}

.view-meta-box {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 6px;
    gap: 10px;
    flex-wrap: wrap;
}

.view-content-body {
    min-height: 120px;
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 25px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.admin-actions-box {
    display: none;
    gap: 10px;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px dashed #cbd5e1;
    flex-wrap: wrap;
}

.btn-delete-post {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete-post:hover {
    background: #b91c1c;
}


/* ==========================================================
   [반응형 미디어쿼리 (Responsive Web Design)]
========================================================== */
@media screen and (max-width: 768px) {
    #board.tab-content {
        padding: 10px;
    }

    .board-inner-container {
        padding: 16px;
        border-radius: 8px;
    }

    .board-header-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .board-controls {
        width: 100%;
        flex-direction: column;
    }

    #boardFilterCategory,
    #boardSearchInput,
    .btn-write {
        width: 100%;
        box-sizing: border-box;
    }

    .board-modal-overlay {
        padding: 12px;
    }

    .board-modal-box {
        padding: 20px 16px;
        max-height: 90vh;
        border-radius: 10px;
    }
}

.image-upload-box {
    margin: 12px 0 16px;
}

.image-upload-guide {
    margin: 8px 0 0;
    font-size: 12px;
    color: #64748b;
}

.image-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.image-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    background: #f5f7fa;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.image-upload-btn:hover {
    background: #e9edf2;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
    max-width: 720px;
}

.image-preview.count-1 {
    grid-template-columns: minmax(0, 1fr);
    max-width: 340px;
}

.image-preview.count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 460px;
}

.image-preview.count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-preview-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.image-preview.count-1 .image-preview-item {
    aspect-ratio: 16 / 10;
}

.image-preview-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: zoom-in;
}

.image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 16px;
    line-height: 22px;
    cursor: pointer;
}

.image-remove-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

.post-images {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.post-images.count-1 {
    grid-template-columns: minmax(0, 1fr);
}

.post-images.count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-images.count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.board-view-text {
    white-space: pre-wrap;
}

.post-image-trigger {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: zoom-in;
}

.post-image {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.post-images.count-1 .post-image {
    height: auto;
    max-height: 460px;
    object-fit: contain;
    background: #f8fafc;
}

.board-image-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(2, 6, 23, 0.86);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.board-image-modal-content {
    position: relative;
    width: min(960px, calc(100vw - 40px));
    display: flex;
    align-items: center;
    justify-content: center;
}

.board-image-modal-image {
    width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 12px;
    background: #0f172a;
}

.board-image-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.board-image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.board-image-modal-nav--prev {
    left: 12px;
}

.board-image-modal-nav--next {
    right: 12px;
}

.board-image-modal-counter {
    position: absolute;
    bottom: -38px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    color: #f8fafc;
    font-size: 12px;
    letter-spacing: 0.2px;
}

@media screen and (max-width: 768px) {
    .image-preview.count-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .image-preview.count-3 .image-preview-item:nth-child(3) {
        grid-column: 1 / -1;
    }

    .post-images.count-2,
    .post-images.count-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-images.count-3 .post-image-trigger:nth-child(3) {
        grid-column: 1 / -1;
    }

    .post-image {
        height: 180px;
    }

    .board-image-modal {
        padding: 14px;
    }

    .board-image-modal-content {
        width: calc(100vw - 28px);
    }

    .board-image-modal-close {
        top: -38px;
    }

    .board-image-modal-nav {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .board-image-modal-nav--prev {
        left: 8px;
    }

    .board-image-modal-nav--next {
        right: 8px;
    }
}