/* ==========================================================================
   style-archive.css — archive.php 전용 스타일
   ========================================================================== */

/* 기본 안전장치 */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ── 페이지 헤더 ── */
.archive-header-banner {
    background: linear-gradient(135deg, #1f3b64 0%, #102a43 100%);
    color: white;
    padding: 56px 0 48px;
    text-align: center;
}

.archive-header-banner .breadcrumb {
    font-size: 13px;
    color: #93c5fd;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.archive-header-banner h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.archive-header-banner p {
    font-size: 15px;
    color: #cbd5e1;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.75;
    word-break: keep-all;
}

/* ── 본문 레이아웃 ── */
.archive-body {
    padding: 52px 0 80px;
}

.archive-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 36px;
    align-items: start;
    min-width: 0;
}

/* ── 카테고리 사이드 탭 ── */
.archive-cat-nav {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    position: sticky;
    top: 80px;
    min-width: 0;
}

.archive-cat-nav-title {
    padding: 14px 18px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.06em;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.archive-cat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #52606d;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    transition: 0.15s;
}

.archive-cat-btn:last-child {
    border-bottom: none;
}

.archive-cat-btn:hover {
    background: #f8fafc;
    color: #1f3b64;
}

.archive-cat-btn.active {
    background: #eff6ff;
    color: #1f3b64;
    font-weight: 700;
}

.archive-cat-btn .cat-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
}

.archive-cat-btn .cat-count {
    margin-left: auto;
    background: #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.archive-cat-btn.active .cat-count {
    background: #1f3b64;
    color: white;
}

/* ── 검색 + 필터 바 ── */
.archive-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.archive-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.archive-search-wrap input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Pretendard', sans-serif;
    outline: none;
    background: white;
    color: #1e293b;
    transition: border-color 0.2s;
}

.archive-search-wrap input:focus {
    border-color: #1f3b64;
}

.archive-search-wrap .si {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

.archive-total {
    font-size: 13.5px;
    color: #64748b;
    white-space: nowrap;
}

.archive-total strong {
    color: #1f3b64;
}

/* ── 섹션 ── */
.archive-section {
    margin-bottom: 48px;
}

.archive-section:last-child {
    margin-bottom: 0;
}

.archive-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #1f3b64;
}

.archive-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.archive-section-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #102a43;
}

.archive-section-header .sec-count {
    margin-left: auto;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
}

/* ── 테이블 ── */
.archive-table-wrap {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.archive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.archive-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 13px 18px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    white-space: nowrap;
}

.archive-table thead th.center {
    text-align: center;
}

.archive-table tbody tr {
    transition: background 0.15s;
}

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

.archive-table tbody td {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: top;
}

.archive-table tbody tr:last-child td {
    border-bottom: none;
}

.archive-table .td-num {
    width: 48px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.archive-table .td-date {
    width: 90px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    white-space: nowrap;
}

.archive-table .td-type {
    width: 90px;
    text-align: center;
}

.archive-table .td-action {
    width: 130px;
    text-align: center;
}

/* 자료 제목 */
.doc-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    display: block;
    line-height: 1.5;
    word-break: keep-all;
}

.doc-title a {
    color: #1e293b;
    transition: color 0.15s;
}

.doc-title a:hover {
    color: #1f3b64;
    text-decoration: underline;
}

.doc-desc {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.55;
    word-break: keep-all;
}

/* 버튼 */
.action-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: 0.15s;
    border: 1px solid #e2e8f0;
    color: #475569;
    background: #f8fafc;
}

.action-btn:hover {
    background: #e2e8f0;
    color: #1f3b64;
}

.action-btn.primary {
    background: #1f3b64;
    color: white !important;
    border-color: #1f3b64;
}

.action-btn.primary:hover {
    background: #102a43;
}

/* ==========================================================================
   모바일
   ========================================================================== */

@media (max-width: 860px) {

    body {
        overflow-x: hidden;
    }

    .archive-header-banner {
        padding: 36px 0 30px;
    }

    .archive-header-banner h2 {
        font-size: 24px;
    }

    .archive-header-banner p {
        font-size: 14px;
        padding: 0 16px;
    }

    /* 레이아웃 세로화 */
    .archive-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

   /* 카테고리 */
.archive-cat-nav {
    position: static;
    border-radius: 12px;
    border: none;
    background: transparent;
    overflow: visible;
}

.archive-cat-nav-title {
    display: none;
}

/* 기존 가로스크롤 제거 */
.archive-cat-nav-scroll {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow: visible;
    max-width: 100%;
}

/* 버튼 카드형 */
.archive-cat-btn {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    min-width: 0;

    padding: 14px 12px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: white;

    font-size: 12px;
    font-weight: 600;

    text-align: left;

    transition: 0.15s;
}

.archive-cat-btn:last-child {
    border-right: none;
}

.archive-cat-btn .cat-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.archive-cat-btn .cat-count {
    margin-left: auto;

    background: #e2e8f0;
    color: #64748b;

    font-size: 10px;
    font-weight: 700;

    padding: 2px 6px;
    border-radius: 20px;
}

.archive-cat-btn.active {
    background: #1f3b64;
    color: white;
    border-color: #1f3b64;
}

.archive-cat-btn.active .cat-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

    /* 검색 */
    .archive-top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .archive-search-wrap {
        width: 100%;
    }

    .archive-total {
        text-align: right;
    }

    /* 모바일 카드형 */
    .archive-table-wrap {
        overflow: visible;
        border: none;
        background: transparent;
    }

    .archive-table,
    .archive-table thead,
    .archive-table tbody,
    .archive-table th,
    .archive-table td,
    .archive-table tr {
        display: block;
        width: 100%;
    }

    .archive-table thead {
        display: none;
    }

    .archive-table tbody tr {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        padding: 14px;
        margin-bottom: 14px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    }

    .archive-table tbody td {
        border: none;
        padding: 4px 0;
        width: 100% !important;
        text-align: left !important;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .archive-table .td-num {
        display: none;
    }

    .archive-table .td-date,
    .archive-table .td-type {
        font-size: 12px;
        color: #94a3b8;
    }

    .archive-table .td-action {
        margin-top: 10px;
    }

    .action-btns {
        justify-content: flex-start;
    }

    .doc-title {
        font-size: 15px;
        line-height: 1.5;
    }

    .doc-desc {
        font-size: 12.5px;
        line-height: 1.6;
    }
}