/* sub4.css - 조직도 페이지 (완전 재설계) */

/* ============================================
   1. 기본 서브 구조 - sub3.css 완전 동기화
   ============================================ */
.sub_wrapper { background-color: #fff; min-height: 100vh; }

.sub_hero { position: relative; width: 100%; margin: -1px 0 !important; padding: 0 !important; line-height: 0; font-size: 0; overflow: hidden; background: none !important; }
.sub_hero img { width: 100%; height: auto !important; display: block; margin: 0 !important; padding: 0 !important; border: none !important; }
.hero_text_overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; background-color: rgba(0,0,0,0.2); z-index: 10; }
.hero_text_overlay .hero_title { font-size: 42px; font-weight: 800; color: #fff; margin-bottom: 10px; text-shadow: 0 4px 10px rgba(0,0,0,0.3); letter-spacing: -1px; }
.hero_text_overlay .hero_subtitle { font-size: 18px; color: #eee; font-weight: 500; text-shadow: 0 2px 5px rgba(0,0,0,0.3); }

.sub_lnb { border-bottom: 1px solid #eee; background-color: #fcfcfc; position: relative; z-index: 900; height: 60px; display: flex; align-items: center; margin: 0 !important; padding: 5px !important; border-top: none !important; }
.sub_lnb .lnb_inner { display: flex; align-items: center; gap: 15px; }
.sub_lnb .home_btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background-color: #fff; border: 1px solid #eee; border-radius: 50%; font-size: 16px; color: #444; transition: 0.3s; }
.sub_lnb .home_btn:hover { background-color: var(--accent-color); color: #fff; border-color: var(--accent-color); }
.sub_lnb .lnb_item { position: relative; }
.sub_lnb .lnb_btn { height: 44px; padding: 0 25px; background-color: #fff; border: 1px solid #eee; border-radius: 30px; font-size: 14px; font-weight: 600; color: #444; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: 0.3s; }
.sub_lnb .lnb_btn:hover { border-color: var(--accent-color); }
.sub_lnb .lnb_btn.color_accent { border-color: var(--accent-color); color: var(--accent-color); background-color: rgba(130,180,41,0.05); }
.sub_lnb .lnb_dropdown { position: absolute; top: calc(100% + 8px); left: 0; min-width: 160px; background-color: #fff; border: 1px solid #eee; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); display: none; padding: 10px 0; overflow: hidden; z-index: 1000; }
.sub_lnb .lnb_dropdown.show { display: block; }
.sub_lnb .lnb_dropdown li a { display: block; padding: 10px 20px; font-size: 14px; color: #666; transition: 0.2s; }
.sub_lnb .lnb_dropdown li a:hover,
.sub_lnb .lnb_dropdown li.active a { background-color: #f9f9f9; color: var(--accent-color); font-weight: 700; }

.sub_content_area { padding: 80px 0 120px; }
.sub_content_area .content_inner { display: flex; gap: 80px; }

.sub_sidebar { width: 260px; flex-shrink: 0; }
.sub_sidebar .side_title_box { background: linear-gradient(45deg, var(--accent-color), #6e9a0f); padding: 30px 25px; margin-bottom: 0; border-radius: 8px 8px 0 0; }
.sub_sidebar .side_title { color: #fff; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.sub_sidebar .side_menu_list { border: 1px solid #eee; border-top: none; border-radius: 0 0 8px 8px; overflow: hidden; }
.sub_sidebar .side_menu_list li a { display: flex; justify-content: space-between; align-items: center; padding: 18px 25px; font-size: 16px; color: #555; font-weight: 500; border-bottom: 1px solid #f2f2f2; transition: 0.3s; }
.sub_sidebar .side_menu_list li.active a { background-color: #f8faf2; color: var(--accent-color); font-weight: 700; }

.sub_main_content { flex: 1; }
.content_header { margin-bottom: 60px; }
.content_header .page_title { font-size: 36px; font-weight: 800; color: #111; margin-bottom: 15px; }
.content_header .title_bar { width: 40px; height: 4px; background-color: var(--accent-color); }

/* ============================================
   2. 조직도 전용 스타일
   - 가상요소(top: 음수)의 모바일 넘침 클리핑을 막는 새로운 flex 기반 명시적 구조
   ============================================ */

.oc-chart-wrapper {
    padding: 20px 0;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.oc-chart-container {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 900px; /* Force minimum width to prevent line breakage */
    margin: 0 auto;
}

/* Background lines for cross-column connections */
.oc-bg-lines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Connects Center of CEO Column to Center of Advisor Column */
.oc-line-ceo-adv {
    position: absolute;
    top: 105px; /* height of CEO block (75) + 30px (mid of vertical line) */
    left: 37.5%; /* exact center of the left 75% block */
    width: 50%; /* exactly spans to the center of the right 25% block (37.5 + 50 = 87.5) */
    height: 60px; /* drops down to align with departments */
    border-top: 2px solid #ccc;
    border-right: 2px solid #ccc;
    box-sizing: border-box;
}

/* Main column (CEO + 3 Departments) */
.oc-main-branch {
    flex: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* Advisor column */
.oc-adv-branch {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.oc-adv-spacer {
    width: 100%;
    height: 165px; /* Aligns Advisor top to Department tops */
}

/* Block Styles */
.oc-node {
    border-radius: 4px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

.oc-ceo {
    background-color: var(--accent-color);
    color: #fff;
    font-size: 22px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 60px;
    box-shadow: 0 8px 20px rgba(130,180,41,0.25);
    white-space: nowrap;
}

.oc-vline {
    width: 2px;
    background-color: #ccc;
    margin: 0 auto;
    flex-shrink: 0;
}

/* 3 Departments Sub-Structure */
.oc-depts-wrap {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.oc-depts-hline {
    position: absolute;
    top: 0;
    left: 16.666%; /* center of 1st department */
    width: 66.666%; /* spans to center of 3rd department */
    height: 2px;
    background-color: #ccc;
}

.oc-depts-row {
    display: flex;
    width: 100%;
}

.oc-dept-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
}

.oc-adv-inner {
    width: 100%;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.oc-dept {
    width: 100%;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    background: #fff;
    padding: 16px 10px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oc-sub {
    width: 100%;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.9;
    padding: 25px 15px;
    flex: 1; /* Stretches to same height in flex container */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.oc-adv {
    width: 100%;
    background-color: #eee;
    color: #333;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oc-adv-sub {
    width: 100%;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.9;
    padding: 25px 15px;
}

@media screen and (max-width: 768px) {
    .sub_content_area { padding: 40px 0 80px; }
    .content_header .page_title { font-size: 28px; }
    
    .oc-chart-wrapper { padding: 20px 0; }
    .oc-chart-container { min-width: 800px; }
    
    .sub_lnb { height: auto; padding: 5px 0 10px 0 !important; }
    .sub_lnb .lnb_inner { gap: 10px; flex-wrap: wrap; justify-content: center; }
    .sub_lnb .home_btn { width: 40px; height: 40px; min-width: 40px; }
    .sub_lnb .lnb_btn { padding: 0 15px; font-size: 13px; }
    
    .hero_text_overlay .hero_title { font-size: 24px; margin-bottom: 5px; }
    .hero_text_overlay .hero_subtitle { font-size: 13px; }
}
