﻿/*
 * 파일명: integrated-style.css
 * 위치: /blog/assets/css/integrated-style.css
 * 기능: SRT 블로그 통합 스타일시트 (메인 + 블로그)
 * 작성일: 2025-05-23
 * 수정일: 2025-05-23
 */

/* ===================================
* 전역 스타일 및 변수
* =================================== */
:root {
   --primary-color: #10a37f;
   --primary-color-light: #1ad1a4;
   --primary-color-dark: #0b755c;
   --secondary-color: #343541;
   --light-bg: #f8f9fa;
   --card-shadow: 0 2px 15px rgba(0,0,0,0.05);
   --transition-speed: 0.3s;
   --gradient-start: #10a37f;
   --gradient-end: #5664d2;
}

body { 
    font-family: 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

main {
    flex: 1;
    margin-top: 100px; /* 고정 네비게이션 높이만큼 */
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary-color), #5664d2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===================================
* 네비게이션 스타일
* =================================== */
.navbar {
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    padding: 1rem 0;
    background-color: #fff !important;
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.nav-link:hover {
    background-color: rgba(16, 163, 127, 0.15);
}

.nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(16, 163, 127, 0.1);
}

/* ===================================
* 버튼 스타일
* =================================== */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.15);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 163, 127, 0.25);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.15);
}

/* ===================================
* 블로그 카드 스타일
* =================================== */
.blog-post-card { 
    transition: transform 0.2s ease; 
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.blog-post-card:hover { 
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* ===================================
* 사이드바 스타일
* =================================== */
.sidebar {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.sidebar-title {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.category-link {
    color: #495057;
    text-decoration: none;
    transition: color 0.3s;
}

.category-link:hover {
    color: var(--primary-color);
}



.sidebar-category {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.sidebar-category:hover {
    background-color: rgba(16, 163, 127, 0.1);
    transform: translateX(5px);
    color: #10a37f;
    text-decoration: none;
}

.sidebar-category.active {
    background-color: rgba(16, 163, 127, 0.15);
    font-weight: 600;
}

.sidebar-category-badge {
    background-color: #10a37f;
    color: white;
    transition: all 0.3s ease;
    border-radius: 50rem;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    display: inline-block;
    text-align: center;
}

.sidebar-category:hover .sidebar-category-badge {
    transform: scale(1.1);
}



.tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.875rem;
    transition: background-color 0.3s;
}

.tag:hover {
    background-color: rgba(16, 163, 127, 0.1);
    color: var(--primary-color);
}

/* ===================================
* 입력 필드 스타일
* =================================== */
.input-group-text { 
    border-right: none; 
    background-color: #fff; 
}

.form-control { 
    border-left: none; 
    padding-left: 0; 
}

/* ===================================
* 페이지네이션 스타일
* =================================== */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    color: var(--primary-color-dark);
}

/* ===================================
* 푸터 스타일
* =================================== */
.footer {
    background: var(--secondary-color);
    color: white;
    border-top: none;
    padding: 4rem 0 2rem;
    margin-top: 3rem;
}

.footer h5 {
    color: white;
    font-weight: 600;
}

.footer .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

/* ===================================
* 브레드크럼 스타일
* =================================== */
.breadcrumb {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    margin-top: 1rem; /* 상단 마진 추가 */
	margin-bottom: 0;
    font-size: 0.9rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
    padding: 0 0.5rem;
    font-weight: bold;
}

.breadcrumb-item a {
    color: var(--primary-color);
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.breadcrumb-item a:hover {
    color: var(--primary-color-dark);
    background-color: rgba(16, 163, 127, 0.1);
    transform: translateY(-1px);
}

.breadcrumb-item.active {
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* ===================================
* 게시물 컨텐츠 스타일
* =================================== */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.post-meta {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.post-tags {
    margin-top: 1rem;
}

/* ===================================
* 관리자 컨트롤
* =================================== */
.admin-controls {
    position: sticky;
    top: 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    z-index: 10;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

/* ===================================
* 관련 게시물 및 태그 클라우드
* =================================== */
.related-posts .card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    border-radius: 12px;
}

.related-posts .card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.tag-cloud {
    line-height: 2;
}

.tag-cloud .tag {
    margin: 0.25rem;
    background-color: #e9ecef;
    border-radius: 12px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.tag-cloud .tag:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 15px rgba(16, 163, 127, 0.4);
    border-color: var(--primary-color);
}

/* ===================================
* 댓글 섹션 스타일
* =================================== */
.comments-section {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    border: 1px solid #dee2e6;
}

.comment-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1.5rem 0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: var(--secondary-color);
}

.comment-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.comment-content {
    color: var(--secondary-color);
    line-height: 1.7;
}

/* ===================================
* 검색 페이지 전용 스타일
* =================================== */
.search-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.search-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.search-form-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.search-highlight {
    background-color: #fff3cd;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ===================================
* 카테고리/태그 페이지 전용 스타일
* =================================== */
.tag-header,
.category-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.tag-name {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 2rem;
}

.tag-name::before {
    content: '#';
    color: #6c757d;
}

.category-name {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 2rem;
}

/* ===================================
* 빈 상태 스타일
* =================================== */
.empty-blog-state,
.empty-search-state {
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.empty-blog-state i,
.empty-search-state i {
    color: #6c757d;
}

.empty-blog-state h2,
.empty-blog-state h3,
.empty-search-state h2,
.empty-search-state h3 {
    color: #6c757d;
    margin-top: 1rem;
}

/* ===================================
* 알림 메시지 스타일
* =================================== */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert i {
    margin-right: 0.5rem;
}

/* ===================================
* 로딩 애니메이션
* =================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================
* 스크롤바 커스터마이징
* =================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-dark);
}

/* ===================================
* 접근성 개선
* =================================== */
.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;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* 포커스 스타일 개선 */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===================================
* 애니메이션
* =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeIn {
    animation: fadeIn 0.5s ease-out;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 163, 127, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 163, 127, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===================================
* 반응형 조정
* =================================== */
@media (max-width: 991.98px) {
    main {
        margin-top: 90px;
    }
    
    .section-header h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 767.98px) {
    main {
        margin-top: 85px;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    .sidebar {
        padding: 1rem;
    }
    
    .search-header,
    .tag-header,
    .category-header {
        padding: 1.5rem;
    }
    
    .search-title,
    .tag-name,
    .category-name {
        font-size: 1.5rem;
    }
    
    .empty-blog-state,
    .empty-search-state {
        padding: 2rem 1rem;
    }
}

@media (max-width: 575.98px) {
    main {
        margin-top: 80px;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    .sidebar {
        padding: 0.75rem;
    }
    
    .search-header,
    .tag-header,
    .category-header {
        padding: 1rem;
    }
    
    .search-title,
    .tag-name,
    .category-name {
        font-size: 1.3rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 0.3rem;
    }
    
    .breadcrumb-item.active {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ===================================
* 프린트 스타일
* =================================== */
@media print {
    .navbar,
    .sidebar,
    .footer,
    .admin-controls,
    .breadcrumb,
    .btn,
    .search-form-section {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    main {
        margin-top: 0;
    }
    
    .container.mt-4 {
        margin-top: 0 !important;
    }
}

/* ===================================
* 다크모드 지원 (향후 확장용)
* =================================== */
@media (prefers-color-scheme: dark) {
    /* 다크모드 스타일은 향후 추가 예정 */
}

/* ===================================
* 고대비 모드 지원
* =================================== */
@media (prefers-contrast: high) {
    .tag,
    .sidebar-tag,
    .btn-outline-primary {
        border: 2px solid;
    }
    
    .search-highlight {
        background-color: yellow;
        color: black;
    }
}

/* ===================================
* 모션 감소 설정 지원
* =================================== */
@media (prefers-reduced-motion: reduce) {
    .fadeIn,
    .pulse,
    .loading-spinner {
        animation: none;
    }
    
    .blog-post-card,
    .related-posts .card,
    .sidebar-tag,
    .btn,
    .nav-link {
        transition: none;
    }
}