/* 행보기향 - 메인 CSS 파일 */
/* 기존 UI 및 색상 완전 유지, 성능 최적화 추가 */

/* 기본 스타일 및 중요한 레이아웃 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: white;
    color: #374151;
    line-height: 1.6;
}

/* 헤더 스타일 - 최우선 z-index 설정 */
.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100 !important; /* 최우선 z-index로 강제 설정 */
    width: 100%;
    border-bottom: 1px solid #e5e7eb; /* 경계선 추가 */
}

/* ================================================================= */
/* ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ */
/* >>>>> 수정된 부분 <<<<<                      */
/* 헤더 내부 아이템 정렬 수정 (검색창/메뉴 우측 정렬) */
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* 양쪽 끝으로 정렬 */
}
/* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */
/* ================================================================= */


/* 컨테이너 및 레이아웃 - 간격 최적화 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 메인 콘텐츠 영역과 사이드바 간격 줄이기 */
.flex-col.md\:flex-row.gap-6 {
    gap: 1rem; /* 기존 gap-6에서 gap-4로 줄임 */
}

@media (min-width: 768px) {
    .flex-col.md\:flex-row.gap-6 {
        gap: 1.5rem; /* 태블릿 이상에서는 좀 더 여유있게 */
    }
}

/* Flexbox 유틸리티 클래스 */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-y-6 > * + * { margin-top: 0.375rem; } /* 글목록 간격 기본값 */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }

/* 텍스트 스타일 */
.text-2xl { font-size: 1.5rem; }
.text-xl { font-size: 1.25rem; }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-3xl { font-size: 1.875rem; }

/* 폰트 굵기 */
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* 색상 스타일 - 기존 색상 체계 완전 유지 */
.text-gray-900 { color: #111827; }
.text-gray-800 { color: #1f2937; }
.text-gray-700 { color: #374151; }
.text-gray-600 { color: #4b5563; }
.text-gray-500 { color: #6b7280; }
.text-sky-600 { color: #0284c7; }
.text-sky-700 { color: #0369a1; }
.text-red-500 { color: #ef4444; }
.bg-white { background-color: white; }
.bg-sky-600 { background-color: #0284c7; }
.bg-sky-700 { background-color: #0369a1; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }

/* 호버 효과 */
.hover\:text-sky-700:hover { color: #0369a1; }
.hover\:text-sky-600:hover { color: #0284c7; }
.hover\:bg-sky-700:hover { background-color: #0369a1; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:underline:hover { text-decoration: underline; }

/* 레이아웃 유틸리티 */
.min-h-screen { min-height: 100vh; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }
.w-32 { width: 8rem; }
.w-24 { width: 6rem; }
.w-16 { width: 4rem; }
.w-64 { width: 16rem; }
.h-6 { height: 1.5rem; }
.h-24 { height: 6rem; }
.h-16 { height: 4rem; }
.h-64 { height: 16rem; }
.max-w-none { max-width: none; }
.max-w-md { max-width: 28rem; }

/* 간격 및 패딩 - 최적화된 간격 */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-4 { margin-left: 1rem; }

/* 테두리 및 그림자 */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-transparent { border-color: transparent; }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* 위치 및 z-index */
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.top-4 { top: 1rem; }
.left-4 { left: 1rem; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }

/* 변환 및 애니메이션 */
.transform { transform: translateX(var(--tw-translate-x, 0)) translateY(var(--tw-translate-y, 0)) rotate(var(--tw-rotate, 0)) skewX(var(--tw-skew-x, 0)) skewY(var(--tw-skew-y, 0)) scaleX(var(--tw-scale-x, 1)) scaleY(var(--tw-scale-y, 1)); }
.translate-x-full { --tw-translate-x: 100%; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* 기타 유틸리티 */
.block { display: block; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }
.cursor-pointer { cursor: pointer; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.leading-relaxed { line-height: 1.625; }
.object-cover { object-fit: cover; }
.overflow-hidden { overflow: hidden; }
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }

/* 포커스 스타일 */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); }
.focus\:ring-inset:focus { box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.5); }
.focus\:ring-sky-500:focus { box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.5); }
.focus\:ring-offset-2:focus { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(14, 165, 233, 0.5); }
.focus\:border-sky-500:focus { border-color: #0ea5e9; }

/* 로딩 애니메이션 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.1rem;
    color: #6b7280;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* 접근성 스타일 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* 트리 메뉴 스타일 - 기존 색상 완전 유지 + 5단계 특별 하이라이트 추가 */
.tree-menu-item.active {
    background-color: #e0f2fe;
    color: #0c4a6e;
    font-weight: 600;
}

/* 트리메뉴 현재 선택 항목 스타일 */
.tree-item-current {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    font-weight: 600 !important;
    border-radius: 0.375rem;
}

/* 트리메뉴 경로 상의 항목들 약한 하이라이트 */
.tree-item-current-path {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 500 !important;
    border-radius: 0.375rem;
}

/* 5단계 키워드 특별 하이라이트 (배경색 변경) */
.tree-item-level5-current {
    background-color: #fbbf24 !important; /* 주황색 배경 */
    color: #92400e !important; /* 어두운 주황색 텍스트 */
    font-weight: 700 !important;
    border-radius: 0.375rem;
    border: 2px solid #f59e0b !important; /* 주황색 테두리 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

#tree-menu {
    transition: transform 0.3s ease-in-out;
}

#overlay.active {
    display: block;
}

.tree-menu-toggle {
    cursor: pointer;
    user-select: none;
}

.tree-menu-content {
    display: none;
}

/* ▼▼▼▼▼ 트리메뉴 스크롤 추가 ▼▼▼▼▼ */
.tree-menu-content {
    max-height: 70vh; /* 화면 높이의 70%를 최대로 설정하여 메뉴가 너무 길어지는 것을 방지 */
    overflow-y: auto; /* 내용이 max-height를 초과할 경우 세로 스크롤바를 자동으로 표시 */
    padding-right: 0.5rem; /* 스크롤바가 내용과 겹치지 않도록 우측에 약간의 여백 추가 */
    box-sizing: border-box; /* 패딩 값이 너비에 영향을 주지 않도록 설정 */
}
/* ▲▲▲▲▲ 트리메뉴 스크롤 추가 ▲▲▲▲▲ */

.tree-menu-content.expanded {
    display: block;
}

/* 트리 메뉴 선택 상태 표시 */
.tree-item-selected {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

/* 페이지네이션 스타일 - 기존 색상 유지 */
.pagination-btn {
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f9fafb;
}

.pagination-btn.active {
    background-color: #0c4a6e;
    color: white;
    font-weight: 700;
    pointer-events: none;
    border-color: #0c4a6e;
}

/* 댓글 섹션 스타일 - 기존 UI 완전 유지 (절대 변경 금지) */
#comments-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

#comments-section h3 {
    color: #212529;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

#comments-list {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    min-height: 80px;
    margin-bottom: 20px;
}

.comment-card {
    background-color: #FFFFFF;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.comment-card strong {
    color: #495057;
    font-size: 0.95em;
    font-weight: 600;
}

.comment-card .comment-content {
    margin: 10px 0;
    color: #343a40;
    line-height: 1.6;
}

.comment-card .comment-date {
    font-size: 0.8em;
    color: #adb5bd;
    text-align: right;
}

.comment-actions {
    text-align: right;
    margin-top: 10px;
}

.comment-actions button {
    background-color: #6c757d;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    margin-left: 5px;
    transition: background-color 0.2s;
}

.comment-actions button:hover {
    background-color: #5a6268;
}

.comment-actions .delete-comment-btn {
    background-color: #dc3545;
}

.comment-actions .delete-comment-btn:hover {
    background-color: #c82333;
}

.comment-form {
    background-color: #FFFFFF;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.comment-form h4 {
    margin-top: 0;
    color: #212529;
    font-size: 1.2rem;
    font-weight: 600;
}

.comment-form .form-group {
    margin-bottom: 15px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.comment-form input[type="text"],
.comment-form input[type="password"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    color: #495057;
    transition: border-color 0.15s ease-in-out;
    box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #0c4a6e;
    box-shadow: 0 0 0 2px rgba(12, 74, 110, 0.1);
}

.comment-form textarea {
    min-height: 80px;
    resize: vertical;
}

.comment-form .submit-button {
    background-color: #0c4a6e;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s;
    float: right;
}

.comment-form .submit-button:hover {
    background-color: #0a3d5a;
}

.comment-form::after {
    content: "";
    display: table;
    clear: both;
}

/* 글자수 카운터 스타일 */
.char-count {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: right;
    margin-top: 4px;
}

.char-count.warning {
    color: #f59e0b;
    font-weight: 500;
}

.char-count.danger {
    color: #dc2626;
    font-weight: 600;
}

/* 브레드크럼 스타일 개선 - 간격 50% 축소 */
.breadcrumb-nav {
    padding: 0.1rem 0;
    margin-bottom: 0; /* 기존 0.5rem에서 0.25rem으로 50% 축소 */
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #9ca3af;
    user-select: none;
}

.breadcrumb-item a {
    color: #0284c7;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: #0369a1;
    text-decoration: underline;
}

/* ================================================================= */
/* ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ */
/* >>>>> 수정된 게시글 카드 스타일 (높이 고정 적용) <<<<<                      */
.post-card {
    display: flex; /* 내부 요소(텍스트, 이미지) 정렬을 위해 flex 유지 */
    height: 8rem; /* 카드의 높이를 8rem (128px)으로 고정 (값은 조절 가능) */
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 0.5rem;
    padding: 0; /* 내부 여백 제거 */
    overflow: hidden; /* 자식 요소가 카드를 벗어나지 않도록 설정 */
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-card:focus-within { /* 키보드 네비게이션 시에도 하이라이트 */
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

.post-card-text {
    flex-grow: 1; /* 이미지를 제외한 나머지 공간을 모두 차지 */
    display: flex; /* 내부 텍스트 요소들을 유연하게 배치하기 위해 flex 적용 */
    flex-direction: column; /* 제목,내용,날짜를 수직으로 정렬 */
    justify-content: space-between; /* 위아래 공간을 최대로 활용하여 정렬 */
    padding: 0.7rem; /* 텍스트 영역에만 여백 적용 */
}

.post-card .post-card-text h3 {
    margin-bottom: 0.35rem;
    line-height: 1.2;
    font-size: 1.125rem;
}

.post-card .post-card-text p {
    margin-bottom: 0.35rem;
    line-height: 1.4; /* 2줄 표시에 맞게 줄간격 조정 */
    font-size: 1rem;
    /* 2줄 이상일 때 ... 처리 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 2줄로 제한 */
    -webkit-box-orient: vertical;
}

.post-card .post-card-text time {
    font-size: 0.75rem;
}

/* [수정] 썸네일 이미지에만 스타일이 적용되도록 선택자를 수정합니다. */
.post-card > .flex-shrink-0 img {
    width: 6.5rem !important; /* 너비를 약간 늘림 */
    height: 100%; /* 부모 요소(카드)의 높이를 꽉 채움 */
    object-fit: cover;
    border-radius: 0 0.375rem 0.375rem 0; /* 오른쪽 모서리만 둥글게 */
}
/* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */
/* ================================================================= */


/* 상세 페이지 디자인 개선 */
#detail-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    line-height: 1.3;
}

#detail-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #16a340;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

#detail-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* ================================================================= */
/* ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ */
/* >>>>> 수정된 상세 페이지 이미지 스타일 (반응형 적용) <<<<< */
#detail-content img {
    width: 100%;
    max-width: 100%;
    max-height: 70vh; /* PC 화면 최대 높이 */
    height: auto;
    object-fit: contain; /* 이미지 비율 유지 */
    display: block;
    margin: 2.5rem auto;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}
/* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */
/* ================================================================= */

#detail-content blockquote {
    border-left: 4px solid #16a340;
    padding-left: 1rem;
    margin-left: 0;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-style: italic;
    color: #4b5563;
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

#detail-content section {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: box-shadow 0.3s;
}

#detail-content section:hover {
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* 상세 페이지 카드 스타일 */
.detail-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem 2rem;
}

/* ================================================================= */
/* ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ */
/* >>>>> 추가/수정된 상세 페이지 탐색 버튼 스타일 <<<<<              */
.post-nav-container {
    display: flex;
    justify-content: center; /* 중앙 정렬 */
    gap: 0.5rem;
}

/* ================================================================= */
/* ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ */
/* >>>>> 요청에 따라 수정된 부분 <<<<< */
#post-nav-top {
    margin-top: 0; /* 상단 버튼 영역과 위쪽 컨텐츠 사이의 간격 */
    margin-bottom: 0px; /* 상단 버튼 영역과 아래쪽 컨텐츠 사이의 간격 */
}

#post-nav-bottom {
    margin-top: 10px; /* 하단 버튼 영역과 위쪽 컨텐츠 사이의 간격 */
    margin-bottom: 0px; /* 하단 버튼 영역과 아래쪽 컨텐츠 사이의 간격 */
}
/* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */
/* ================================================================= */

.post-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* 텍스트 중앙 정렬 */
    min-width: 6.4rem; /* 버튼 크기 80%로 축소 */
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    color: white;
    background-color: #0284c7; /* 하늘색 배경 */
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-nav-button:hover {
    background-color: #0369a1; /* 더 어두운 하늘색 */
}

.post-nav-button:focus {
    outline: none;
    box-shadow: none; /* 포커스 시 하늘색 선 제거 */
}

.post-nav-button:disabled {
    background-color: #e5e7eb; /* 옅은 회색 */
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */
/* ================================================================= */

/* 성능 최적화 - 이미지 지연 로딩 */
img {
    max-width: 100%;
    height: auto;
}

.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy-load.loaded {
    opacity: 1;
}

/* 토스트 알림 스타일 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.toast.info {
    background-color: #0ea5e9;
}

.toast.success {
    background-color: #10b981;
}

.toast.error {
    background-color: #ef4444;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 반응형 디자인 개선 - 간격 최적화 */
@media (max-width: 767px) {
    /* ▼▼▼▼▼ 수정된 부분 ▼▼▼▼▼ */
    .container {
        padding-left: 0; /* 모바일 화면에서 좌우 여백을 제거하여 꽉 찬 화면으로 만듭니다. */
        padding-right: 0;
    }

    #posts-container.space-y-6 > * + * {
        margin-top: 0.1125rem; /* 모바일에서 글 목록 간격을 기존의 30%로 줄입니다. (0.375rem * 0.3) */
    }
    /* ▲▲▲▲▲ 수정된 부분 ▲▲▲▲▲ */

    .text-2xl {
        font-size: 1.25rem;
    }

    .text-3xl {
        font-size: 1.5rem;
    }

    .space-x-4 > * + * {
        margin-left: 0.5rem;
    }

    .w-32 {
        width: 6rem;
    }

    /* 모바일에서 트리메뉴 스타일 */
    #tree-menu {
        border-left: 1px solid #e5e7eb;
    }

    /* ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ */
    /* >>>>> 요청에 따라 추가된 부분: 모바일 트리메뉴 폰트 크기 조정 <<<<< */
    #tree-menu nav {
        font-size: 1.2em; /* 기존 글씨 크기의 1.5배로 확대 */
    }
    /* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */

    /* 모바일에서 게시글 카드 간격 조정 - 70% 축소 */
    .post-card {
        padding: 0; /* 내부 여백 제거 */
    }

    .post-card-text {
        padding: 0.5rem 0;
    }

    /* 모바일에서 썸네일 크기 조정 */
    .post-card > .flex-shrink-0 img {
        width: 5rem !important;
    }

    /* 댓글 폼 스타일 조정 */
    .comment-form {
        padding: 15px;
    }

    /* 모바일에서 메인 콘텐츠와 사이드바 간격 더 줄이기 */
    .flex-col.md\:flex-row.gap-6 {
        gap: 0.5rem;
    }

    /* 모바일 상세페이지 디자인 */
    .detail-card {
        padding: 0.5rem 0;
    }
    #detail-content h1 {
        font-size: 1.75rem;
    }
    #detail-content h3 {
        font-size: 1.25rem;
    }

    .pagination-btn {
        padding: 0.45rem 0.9rem; /* 90% of original padding */
        font-size: 0.8rem; /* Slightly smaller font for better fit */
    }

    /* ================================================================= */
    /* ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ */
    /* >>>>> 추가된 상세 페이지 이미지 모바일 스타일 <<<<< */
    #detail-content img {
        max-height: 50vh; /* 모바일 화면 최대 높이 */
    }
    /* ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ */
    /* ================================================================= */
}

/* 태블릿 크기 대응 */
@media (min-width: 768px) {
    #tree-menu {
        transform: translateX(0);
    }

    .w-32 {
        width: 12rem;
    }

    /* >>>>> 추가된 부분: PC에서 헤더 콘텐츠가 메인 영역의 너비에 맞게 정렬되도록 수정 <<<<< */
    .header .container {
        padding-right: 25%; /* PC뷰에서 사이드바(w-1/4) 너비만큼 우측 여백을 주어 정렬 */
        box-sizing: border-box; /* 패딩이 너비에 포함되도록 설정 */
    }
}

/* 큰 화면 대응 */
@media (min-width: 1024px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    /* 큰 화면에서는 간격을 조금 더 여유있게 */
    .flex-col.md\:flex-row.gap-6 {
        gap: 2rem;
    }
}

/* 프린트 스타일 */
@media print {
    .header,
    #tree-menu,
    #pagination,
    .comment-form,
    #hamburger-btn,
    #close-btn,
    .post-nav-container { /* 프린트 시 탐색 버튼 숨김 */
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .container {
        max-width: none;
        padding: 0;
    }
}

/* 다크모드 대응 (선택사항) */
@media (prefers-color-scheme: dark) {
    /* 다크모드 스타일은 사용자 요청시에만 추가 */
}

/* 고대비 모드 대응 (접근성) */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #000000;
    }

    .text-gray-500 {
        color: #333333;
    }

    .border {
        border-color: #000000;
    }
}

/* ================================================================= */
/* ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ */
/* >>>>> [새로 추가된 부분] 댓글 폼 헤더 및 관리자 기능 스타일 <<<<< */
/* ================================================================= */

/* 댓글 폼 헤더 (제목과 관리자 기능 영역을 감싸는 컨테이너) */
.comment-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px; /* 기존 h4의 하단 여백 유지 */
}

/* 관리자 기능 영역 (입력창과 버튼을 감쌈) */
.admin-actions {
    display: flex;
    align-items: center;
    gap: 8px; /* 입력창과 버튼 사이의 간격 */
    float:right;
}

/* 관리자 암호 입력창 스타일 */
.admin-password-input {
    /* padding: 8px; */
    border: 1px solid white; /* 다른 입력창과 통일성 유지 */
    /* border-radius: 4px; */
    width: 50px; /* 적절한 너비 지정 */
    font-size: 0.7em;
}

/* 포커스(클릭) 시 스타일 */
.admin-password-input:focus {
    outline: none; /* 기본 아웃라인 제거 */
    border-color: white; /* 옅은 회색 테두리로 변경 */
}


/* 관리자용 삭제 버튼 스타일 (모바일 클릭 문제 해결) */
.admin-delete-button {
    padding: 8px 12px; /* 터치 영역 확보를 위해 패딩 증가 */
    min-height: 25px; /* 최소 높이 지정으로 터치 용이성 확보 */
    background-color: white; /* 눈에 띄는 배경색 */
    color: rgb(240, 238, 238); /* 위험을 나타내는 붉은색 글자 */
    border: 1px solid white; /* 테두리 추가 */
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: 500;
}

/* 모바일 햄버거 버튼 클릭 시 포커스 링(하늘색 박스) 제거 */
#hamburger-btn:focus {
    box-shadow: none;
}

/* ================================================================= */
/* ▼▼▼▼▼▼▼▼▼▼▼▼ [새로 추가된 부분] 내부 링크 스타일 ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ */
/* ================================================================= */

/* 함께 보면 좋은 글 (내부 링크) */
#internal-links-container {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
    margin-top: 2rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

.internal-links-header {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #374151;
}

.internal-link-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    margin-bottom: 0.5rem; /* 링크 간 간격 */
}

.internal-link-item:hover {
    background-color: #f0f9ff;
}

.internal-link-item:last-child {
    margin-bottom: 0;
}

.internal-link-image {
    width: 4rem; /* 64px */
    height: 4rem; /* 64px */
    object-fit: cover;
    border-radius: 0.375rem;
    margin-right: 1rem;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}

.internal-link-title {
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 500;
    color: #1f2937;
}

#internal-links-container img {
            /* 원하는 크기로 명확하게 지정 */
            width: 6rem; /* 96px, 기존 32px의 3배 */
            height: 6rem; /* 96px, 기존 32px의 3배 */
            
            /* 기존의 강력한 규칙이 적용한 스타일들을 초기화 */
            max-width: none;
            max-height: none;
            margin: 0 1rem 0 0;
            box-shadow: none;
            display: inline-block;
            object-fit: cover;
        }

/* 추가적인 링크 아이템 스타일 */
.internal-link-item {
            display: flex;
            align-items: center;
            padding: 0;
            margin-bottom: 0.5rem;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            transition: all 0.2s ease-in-out;
            text-decoration: none;
}
        
.internal-link-item:hover {
            background-color: #f9fafb;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* ================================================================= */
/* ▼▼▼▼▼▼▼▼▼▼▼▼ [요청사항 반영] 게시글 목록 아이콘 스타일 추가 ▼▼▼▼▼▼▼▼▼▼▼ */
/* ================================================================= */

/* 등록일자와 아이콘 그룹을 한 줄에 정렬하기 위한 컨테이너 */
.post-meta-info {
    display: flex;
    justify-content: space-between; /* 양 끝으로 정렬 (날짜는 왼쪽, 아이콘은 오른쪽) */
    align-items: center; /* 수직 중앙 정렬 */
    width: 100%;
    margin-top: auto; /* 텍스트 영역 하단에 붙도록 설정 */
}

/* 아이콘들을 담는 컨테이너 */
.post-counts {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* 아이콘 그룹 사이의 간격 */
}

/* 아이콘 이미지 스타일 */
.post-meta-icon {
    height: 10px; /* 높이를 10px로 고정 */
    width: auto; /* 가로는 비율에 맞게 자동 조정 */
    margin-right: 0.2rem; /* 아이콘과 숫자 사이의 간격 */
    vertical-align: middle;
}

/* ================================================================= */
/* ▼▼▼▼▼▼▼▼▼▼▼ [MODIFIED] Post Actions (Like/Dislike) Styles ▼▼▼▼▼▼▼▼▼ */
/* ================================================================= */

#post-actions-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem; /* 아이콘 그룹 사이의 간격 */
    padding: 0; /* 요청에 따라 패딩을 0으로 설정 */
    margin: 0;  /* 요청에 따라 마진을 0으로 설정 */
    border-top: 1px solid #e5e7eb; /* 상단 구분선은 유지 */
    border-bottom: none; /* 하단 테두리 제거 */
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* 아이콘과 숫자 사이의 간격 */
}

.action-icon {
    height: 13px; /* 요청에 따라 높이를 13px로 수정 */
    width: auto;  /* 너비는 높이에 맞춰 비율 유지 */
    object-fit: contain;
}

.action-icon.clickable {
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.action-icon.clickable:hover {
    transform: scale(1.1);
}

.action-count {
    font-size: 1rem;
    font-weight: 500;
    color: #4b5563;
}


/* 상세페이지 차트 기본 스타일 (데스크탑 등 넓은 화면) */
#linechart-container, #barchart-container { /* 쉼표로 두 선택자 동시 선택 */
    width: 100%;
    height: 300px;
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* 모바일 화면 (가로 768px 이하)에만 적용되는 스타일 */
@media (max-width: 768px) {
    #linechart-container {
        min-height: 30vh; /* 선 차트 높이 */
    }
    #barchart-container {
        min-height: 40vh; /* 막대 차트 높이 (원하는 값으로 조절) */
    }
}

