/* 게시물 첨부파일 목록 (templates/partials/attachment_list.html)
   - 한 줄에 첨부 하나, 파일명은 한 줄 유지(가운데 생략), 다운로드·미리보기 아이콘 버튼(미리보기는 활성/비활성)
   - notice_detail.css 등 예전 규칙보다 우선하도록 .board_view__attachments 아래로 한정 */

.board_view .board_view__attachments {
    display: block;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.board_view__attachments h3 {
    margin: 0 0 12px;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.board_view__attachments .attachment_list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.board_view__attachments .attachment_item {
    display: flex;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

/* 파일명 줄 (누르면 다운로드) */
.board_view__attachments .attachment_link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.board_view__attachments .attachment_link:hover {
    background: #e3f2fd;
    border-color: #007bff;
    color: #007bff;
    text-decoration: none;
}

.board_view__attachments .attachment_link svg {
    flex: none;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.board_view__attachments .attachment_link__icon {
    color: #6c757d;
}

/* 가운데 생략: 앞부분만 줄어들며 … 표시, 확장자가 있는 뒷부분은 항상 보임 */
/* width:0 + flex:1 → 긴 파일명이 바깥 레이아웃 폭을 밀어 넓히지 않고, 남은 칸 안에서만 줄어든다 */
.board_view__attachments .attachment_name {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    display: flex;
    font-weight: 500;
}

.board_view__attachments .attachment_name__head {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board_view__attachments .attachment_name__tail {
    flex: none;
}

.board_view__attachments .attachment_size {
    flex: none;
    color: #6c757d;
    font-size: 0.9em;
}

/* 다운로드·미리보기 아이콘 버튼 (정사각형) */
.board_view__attachments .attachment_icon_btn {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    padding: 0;   /* notice_detail.css 의 .attachment_list a 여백 무시 */
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: #fff;
    color: #007bff;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.board_view__attachments .attachment_icon_btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.board_view__attachments a.attachment_icon_btn:hover,
.board_view__attachments a.attachment_icon_btn:focus-visible {
    background: #e3f2fd;
    border-color: #007bff;
    color: #0056b3;
    text-decoration: none;
}

/* 미리보기는 눈에 띄게 채운 버튼 */
.board_view__attachments a.attachment_preview {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.board_view__attachments a.attachment_preview:hover,
.board_view__attachments a.attachment_preview:focus-visible {
    background: #0056b3;
    border-color: #0056b3;
    color: #fff;
}

.board_view__attachments .attachment_preview--disabled {
    background: #f1f3f5;
    border-color: #e9ecef;
    color: #ced4da;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .board_view .board_view__attachments {
        margin: 15px 0;
        padding: 15px;
    }

    .board_view__attachments h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .board_view__attachments .attachment_link {
        gap: 6px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .board_view__attachments .attachment_icon_btn {
        width: 38px;
    }
}

@media (max-width: 480px) {
    .board_view__attachments .attachment_item {
        gap: 6px;
    }

    .board_view__attachments .attachment_link {
        padding: 10px;
    }

    .board_view__attachments .attachment_icon_btn {
        width: 36px;
    }
}

@media (max-width: 360px) {
    .board_view__attachments .attachment_size {
        display: none;
    }
}
