/* 전체 컨테이너 제어 */
.detail-container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 120px 1.5rem;
}

/* 메인 카드 스타일 */
.detail-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #eef2f7;
    box-shadow: 0 10px 30px rgba(76, 81, 191, 0.05) !important; /* 인디고 빛 미세 그림자 */
    overflow: hidden;
}

/* 제목 영역 */
.detail-header {
    padding: 2.5rem 2rem 1.5rem;
}

.detail-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* 작성 정보 (유저아이디, 날짜) */
.info-bar {
    display: flex;
    align-items: center;
    padding: 0 2rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.info-bar a {
    color: #64748b !important;
    font-weight: 500;
    text-decoration: none !important;
}

.info-bar .date-divider {
    margin: 0 10px;
    color: #cbd5e1;
}

/* 본문 영역 */
.detail-content {
    padding: 2.5rem 2rem;
    line-height: 1.8;
    font-size: 1.05rem;
    color: #334155;
    min-height: 400px;
}

/* 파일 리스트 영역 (고급스럽게) */
.file-section {
    margin: 0 2rem 2.5rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
}
.file-section > h5 { font-size:16px; }
.file-section .file { display:flex; flex-wrap:wrap; gap:10px; }
.file-section .file img { width:18px; }
.file-item { display:flex; align-items:center; color:#0b0c10; text-decoration: underline; }

/* 이전글/다음글 네비게이션 */
.board-nav {
    border-top: 1px solid #f1f5f9;
    background: #fdfeff;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.nav-item:hover {
    background: #f8faff;
}

.nav-label {
    width: 100px;
    font-weight: 700;
    color: #4c51bf; /* 인디고 블루 */
    font-size: 0.9rem;
}

.nav-title a {
    color: #475569;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-title a:hover {
    color: #4c51bf;
    font-weight: 600;
}

/* 버튼 하단 영역 */
.action-buttons {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-custom {
    padding: 0.75rem 2rem !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    transition: all 0.2s !important;
}

/* 목록 버튼 (다크 인디고) */
.btn-list {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: white !important;
}

/* 수정/삭제 버튼 (연한 그레이 무드) */
.btn-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.btn-secondary:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

/* --- 게시글 상세 페이지 반응형 대응 --- */

/* 1. 태블릿 이하 (1024px 이하) */
@media screen and (max-width: 1024px) {
    .detail-container {
        padding: 70px 1rem;
    }

    .detail-header h2 {
        font-size: 1.5rem; /* 제목 크기 살짝 축소 */
    }
}

/* 2. 모바일 (768px 이하) - 핵심 수정 구간 */
@media screen and (max-width: 768px) {
    /* 카드 여백 타이트하게 조정 */
    .detail-header {
        padding: 1.5rem 1.25rem 1rem;
    }

    .detail-header h2 {
        font-size: 1.35rem;
        word-break: keep-all; /* 한글 단어 단위 줄바꿈으로 가독성 확보 */
    }

    /* 정보 바 (작성자, 날짜) 세로 정렬 방지 및 폰트 축소 */
    .info-bar {
        padding: 0 1.25rem 1rem;
        flex-wrap: wrap; /* 공간 부족 시 자연스럽게 줄바꿈 */
        font-size: 0.9rem;
    }

    /* 본문 영역 - 모바일 가독성을 위해 자간/행간 최적화 */
    .detail-content {
        padding: 1.5rem 1.25rem;
        font-size: 1rem;
        line-height: 1.7;
    }

    /* 파일 섹션 - 모바일에서 너무 붕 뜨지 않게 */
    .file-section {
        margin: 0 1.25rem 1.5rem;
        padding: 1rem;
    }
    .file-item { display:inline-block; vertical-align: middle }
    .file-item span { display:inline-block; vertical-align: middle }

    /* 이전글/다음글 네비게이션 - 라벨과 제목을 상하로 배치 */
    .nav-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.25rem;
        gap: 4px;
    }

    .nav-label {
        width: auto;
        font-size: 0.8rem;
    }

    .nav-title {
        width: 100%;
        font-size: 0.95rem;
        /* 긴 제목 말줄임표 처리 (선택사항) */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 하단 버튼 영역 - 버튼들을 세로로 쌓거나 가로로 꽉 채움 */
    .action-buttons {
        padding: 1.25rem;
        flex-direction: column; /* 세로 배치 */
        gap: 12px;
    }

    .action-buttons > div {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .btn-custom {
        width: 100%; /* 버튼 가로 꽉 채우기 */
        padding: 0.7rem 1rem !important;
        text-align: center;
        font-size: 0.95rem;
    }
}

/* 3. 초소형 기기 (480px 이하) */
@media screen and (max-width: 480px) {
    .detail-header h2 {
        font-size: 1.2rem;
    }

    .info-bar span, .info-bar a {
        font-size: 0.85rem;
    }
}