/* style.css - 최종 통합본 (연혁 디자인 수정 완료) */

/* 1. 폰트 및 변수 설정 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");
/* 숫자용 폰트 추가 (연혁 날짜용) */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@500;700&display=swap'); 
/* 연도용 폰트 추가 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@800;900&display=swap');

:root {
    --primary-color: #2563eb;       /* 메인 블루 */
    --primary-hover: #1d4ed8;       
    --text-dark: #0f172a;           
    --text-body: #334155;           
    --text-light: #64748b;          
    --bg-light: #f9fafb;            /* 연한 회색 배경 */
    --white: #ffffff;               
    --footer-bg: #1e293b;           
    --border-color: #e2e8f0;    
    
    --title-bg-highlight: #eff6ff;  
    --title-font-size: 2.1rem;      
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Pretendard', sans-serif; }

body { color: var(--text-body); line-height: 1.6; word-break: keep-all; }
a { text-decoration: none; color: inherit; }
img { display: block; } 

/* 2. 유틸리티 & 공통 레이아웃 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
section { padding: 80px 0; background-color: var(--white); } /* 기본 배경 흰색 */

/* [중요] 섹션 배경색 교차 설정 */
#business_areas, 
#notice, 
#membership {
    background-color: var(--bg-light); /* 연한 회색 배경 */
}

.btn {
    display: inline-block; padding: 15px 30px; background: var(--primary-color);
    color: var(--white); 
    border-radius: 8px; font-weight: 700;
    transition: background 0.3s; border: none; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); }

/* 섹션 제목 스타일 (H2) */
section h2 { 
    font-size: var(--title-font-size); 
    font-weight: 800; 
    color: var(--text-dark); 
    margin-bottom: 20px; 
    padding: 5px 20px;
    display: inline-block; 
    background-color: var(--white); 
    border-bottom: 4px solid var(--primary-color);
    border-radius: 4px 4px 0 0;
    padding-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.features h2 + p, .contact h2 + p, .gallery-title h2 + p, section h2 + p { margin-bottom: 30px; }

/* ---------------------------------------------------
   LANDING PAGE
--------------------------------------------------- */

/* 헤더 */
header {
    background: var(--white); box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed; width: 100%; top: 0; z-index: 1000;
}
nav { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { display: flex; align-items: center; height: 100%; opacity: 1; transition: opacity 0.2s; }
.logo:hover { opacity: 0.8; }
.logo img { max-height: 40px; width: auto; }

/* 네비게이션 메뉴 */
.nav-links a { 
    margin-left: 40px; color: var(--text-dark); font-weight: 600; 
    transition: color 0.2s; font-size: 1rem; 
}
.nav-links a:hover { color: var(--primary-color); }
.nav-links .btn { color: var(--white); } 


/* 히어로 섹션 */
.hero {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    text-align: center; padding: 180px 0 120px;
}
.hero h1 { font-size: 3rem; margin-bottom: 20px; line-height: 1.3; color: var(--text-dark); font-weight: 800; }
.hero-intro-text {
    background: transparent; border: none; padding: 0; text-align: center;
    max-width: 800px; margin: 30px auto 0;
}
.hero-intro-text p {
    font-weight: 400; color: #333; font-size: 1.1rem; margin-bottom: 10px;
}


/* 센터 소개 및 주요 사업 (박스형 디자인) */
.features { text-align: center; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 50px; }
.feature-item { 
    padding: 40px; 
    background: var(--white); 
    border-radius: 12px; 
    transition: transform 0.3s; 
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
    border: 1px solid #f1f5f9;
}
.feature-item:hover { transform: translateY(-5px); }
.feature-item h3 { margin-bottom: 15px; font-size: 1.4rem; color: var(--text-dark); }

/* [추가] 주요 프로그램 5개 박스 디자인 (약한 배경색) */
#program_guide .feature-item {
    background-color: #f4f9ff !important; /* 아주 연한 하늘색 배경 */
    border: 1px solid #e6f0fa; /* 테두리도 배경과 어울리게 */
    transition: all 0.3s ease;
}
#program_guide .feature-item:hover {
    background-color: #eef6ff !important;
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.1);
}


/* 문의 폼 섹션 */
.contact-form { max-width: 600px; margin: 50px auto 0; background: var(--white); padding: 40px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-dark); }
.form-group input, .form-group textarea {
    width: 100%; padding: 14px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.form-group textarea { height: 150px; resize: vertical; }


/* 공지사항 섹션 */
.notice-list { border-top: 2px solid var(--text-dark); }
.notice-item { border-bottom: 1px solid #e2e8f0; transition: background 0.2s; }
.notice-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 15px; cursor: pointer;
}
.notice-header:hover { background: #f8fafc; }
.notice-title-area { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

/* [수정] 공지사항 NEW 배지 (주황색 박스 스타일) */
.notice-badge {
    display: inline-block; background-color: #f97316; color: #ffffff; font-size: 0.75rem; font-weight: 800;
    padding: 3px 8px; border-radius: 4px; margin-right: 8px; vertical-align: middle; line-height: 1;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.2);
}

.notice-title { font-weight: 600; color: var(--text-dark); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-meta { display: flex; align-items: center; gap: 15px; margin-left: 20px; }
.notice-date { color: #94a3b8; font-size: 0.9rem; white-space: nowrap; }
.notice-arrow { color: #cbd5e1; transition: transform 0.3s; font-size: 0.9rem; }
.notice-content {
    display: none; padding: 30px 20px; background: #f8fafc; color: var(--text-body);
    font-size: 0.95rem; line-height: 1.7; border-top: 1px dashed #e2e8f0; overflow-x: auto;
}
.notice-content img { max-width: 100%; height: auto; }
.notice-item.active .notice-content { display: block; }
.notice-item.active .notice-header { background: #eff6ff; }
.notice-item.active .notice-title { color: var(--primary-color); }
.notice-item.active .notice-arrow { transform: rotate(180deg); color: var(--primary-color); }
.pagination-container { margin-top: 40px; text-align: center; display: flex; justify-content: center; gap: 5px; }
.page-btn {
    display: inline-block; width: 32px; height: 32px; line-height: 32px; text-align: center;
    border: 1px solid #e2e8f0; border-radius: 4px; background-color: #fff; color: #64748b; font-size: 0.9rem; text-decoration: none; transition: all 0.2s;
}
.page-btn:hover { background-color: #f1f5f9; color: var(--primary-color); border-color: var(--primary-color); }
.page-btn.active { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); font-weight: bold; }


/* 사진첩 갤러리 섹션 (어두운 배경) */
#gallery.gallery-section { 
    padding: 80px 0; 
    background-color: #111827; /* 어두운 배경 */
    color: #fff; 
}
#gallery h2 { 
    background-color: transparent; 
    color: #fff; 
    border-bottom: 4px solid #3b82f6; 
    box-shadow: none;
}
#gallery p { color: #9ca3af; }
.gallery-wrapper { max-width: 1200px; margin: 0 auto; }
.gallery-title { text-align: center; margin-bottom: 50px; }
.gallery-grid {
    display: grid; gap: 20px; width: 100%;
}
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1023px) and (min-width: 600px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .gallery-grid { grid-template-columns: repeat(1, 1fr); } }

.gallery-item {
    position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1 / 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5); transition: transform 0.3s; background-color: #1f2937;
}
.gallery-item:hover { transform: translateY(-5px); z-index: 10; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-caption {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.7); color: white; padding: 10px 15px;
    font-size: 0.9rem; font-weight: 600; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 어두운 배경용 페이지 버튼 */
#gallery .page-btn { background-color: #1f2937; border-color: #374151; color: #d1d5db; }
#gallery .page-btn:hover { background-color: #374151; color: #fff; }
#gallery .page-btn.active { background-color: #2563eb; border-color: #2563eb; color: #fff; }

.img-modal-overlay {
    display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9); align-items: center; justify-content: center; cursor: zoom-out;
}
.img-modal-content {
    max-width: 90%; max-height: 90%; object-fit: contain; border-radius: 4px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2); animation: zoomIn 0.3s;
}
@keyframes zoomIn { from {transform:scale(0)} to {transform:scale(1)} }


/* [수정] 연혁 타임라인 (연도/월/내용 구분 디자인) */
.history-timeline { max-width: 900px; margin: 0 auto; position: relative; padding: 20px 0; }
.history-timeline::after {
    content: ''; position: absolute; width: 4px; background-color: #e2e8f0; top: 0; bottom: 0; left: 50%; margin-left: -2px;
}
.history-item {
    margin-bottom: 40px; position: relative; width: 46%; 
    padding: 30px; 
    background: #fff; border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); border: 1px solid #f1f5f9;
}
.history-item:nth-child(even) { left: 0; text-align: right; }
.history-item:nth-child(odd) { left: 54%; text-align: left; }

.history-item::before {
    content: ''; position: absolute; width: 14px; height: 14px;
    background: var(--primary-color); border-radius: 50%; border: 4px solid #eff6ff;
    box-shadow: 0 0 0 1px #dbeafe; top: 30px; z-index: 1; 
}
.history-item:nth-child(even)::before { right: -8.7%; }
.history-item:nth-child(odd)::before { left: -8.7%; }

/* 연도 디자인 (굵고 진하게) */
.year-label {
    font-size: 2rem; font-weight: 900; color: #1e293b; /* 진한 남색 */
    margin-bottom: 20px; line-height: 1;
    font-family: 'Montserrat', sans-serif; /* 별도 폰트 적용 */
    border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; display: inline-block;
}

/* 상세 내용 리스트 */
.history-details { display: flex; flex-direction: column; gap: 12px; }
.history-row {
    display: flex; align-items: flex-start; gap: 20px; /* 간격 확보 */
    font-size: 0.95rem; line-height: 1.6; color: var(--text-body);
    margin-bottom: 5px;
}
/* 짝수(왼쪽) 박스는 내용 정렬 반대 */
.history-item:nth-child(even) .history-row { flex-direction: row-reverse; }

/* 월/날짜 디자인 (고정폭 글꼴 + 색상 강조) */
.history-date-sm {
    font-family: 'Roboto Mono', monospace; 
    font-weight: 700; color: var(--primary-color); 
    min-width: 60px; /* 너비 고정으로 줄맞춤 */
    text-align: right; flex-shrink: 0;
}
/* 별표 디자인 */
.history-star {
    color: #f97316; /* 주황색 */
    font-weight: bold; min-width: 60px; text-align: right; flex-shrink: 0;
    font-family: sans-serif;
}
.history-desc { color: #475569; word-break: keep-all; }


/* 협력기관 (박스 제거) */
.partners-box { background: transparent; padding: 0; border-radius: 0; text-align: center; margin-top: 60px; border: none; }
.partners-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 20px; }
.partner-tag {
    background: #fff; padding: 8px 16px; border-radius: 20px; 
    border: 1px solid #ddd; /* 옅은 테두리 */
    color: #666; font-weight: 500; font-size: 0.9rem;
}


/* 퀵 메뉴 */
.quick-menu {
    position: fixed; right: 30px; top: 50%; transform: translateY(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 12px;
}
.quick-btn {
    display: block; width: 90px; padding: 15px 0; text-align: center; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); 
    font-size: 0.9rem; font-weight: 700; transition: all 0.3s ease; line-height: 1.2;
}
.quick-btn:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }
.btn-top { background: var(--white); color: var(--text-dark); border: 1px solid #e2e8f0; }
.btn-apply-float { background: var(--primary-color); color: var(--white); border: 1px solid var(--primary-color); }
.btn-apply-float:hover { background: var(--primary-hover); }
.btn-direct-edit {
    display: inline-block; font-size: 0.75rem; color: #64748b; border: 1px solid #cbd5e1; padding: 2px 8px; border-radius: 4px; margin-left: 10px; text-decoration: none; transition: all 0.2s; background: #fff; z-index: 10;
}
.btn-direct-edit:hover { background: #f1f5f9; color: #2563eb; border-color: #2563eb; }


/* 관리자 페이지 공통 스타일 (admin.php용) */
.admin-body { background-color: #f1f5f9; }
.admin-container { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
.dashboard-card { background: var(--white); border-radius: 16px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); overflow: hidden; margin-top: 30px; }
.admin-section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; color: var(--text-dark); border-left: 5px solid var(--primary-color); padding-left: 15px; }


/* RESPONSIVE (모바일 대응) */
@media (max-width: 1024px) {
    .nav-links a { margin-left: 25px; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .nav-links { display: none; }
    .contact-form { padding: 25px; }
    
    .quick-menu { right: 15px; top: auto; bottom: 30px; transform: none; }
    .quick-btn { width: 60px; padding: 10px 0; font-size: 0.75rem; border-radius: 50%; height: 60px; display: flex; align-items: center; justify-content: center; }

    /* 타임라인: 모바일에서 1단으로 복귀 */
    .history-timeline { border-left: 2px solid #e2e8f0; margin-left: 10px; }
    .history-timeline::after { display: none; }
    .history-item, .history-item:nth-child(odd), .history-item:nth-child(even) {
        width: calc(100% - 20px); margin-left: 20px; margin-bottom: 30px;
        left: 0; text-align: left; padding: 20px;
    }
    .history-item::before, .history-item:nth-child(even)::before, .history-item:nth-child(odd)::before {
        left: -28px; right: auto; top: 25px; /* 점 위치 왼쪽 고정 */
    }
    
    /* 모바일에서도 리스트 정렬 왼쪽으로 통일 */
    .history-item:nth-child(even) .history-row { flex-direction: row; }
    .history-date-sm, .history-star { min-width: 40px; text-align: left; }
    
    .notice-date { display: none; } 
    .feature-grid { grid-template-columns: 1fr; }
}