@charset "utf-8";

/* =========================================
   Organization Chart Styles - Premium Tree
   ========================================= */

.organization_wrap {
    padding: 100px 0;
    background: #fcfcfc;
    border-top: 1px solid #eaeaea;
    position: relative;
    overflow: hidden;
}

/* Section Title */
.organization_title {
    text-align: center;
    margin-bottom: 60px;
}

.organization_title h3 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    font-family: 'Noto Serif KR', serif;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.organization_title h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #cba062;
    /* Gold Accent */
}

/* Tree Container */
.org_tree {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    /* Allow horizontal scroll on very small screens if needed */
    padding-bottom: 50px;
}

.org_tree ul {
    padding-top: 20px;
    position: relative;
    transition: all 0.5s;
    display: flex;
    justify-content: center;
}

.org_tree li {
    float: left;
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 5px 0 5px;
    transition: all 0.5s;
}

/* Connector Lines Logic */
/* Downward vertical line from parent */
.org_tree ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 20px;
    border-left: 1px solid #ccc;
}

/* Root UL shouldn't have top line */
.org_tree>ul::before {
    display: none;
}


/* Connecting lines for children */
.org_tree li::before,
.org_tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 1px solid #ccc;
    width: 50%;
    height: 20px;
}

.org_tree li::after {
    right: auto;
    left: 50%;
    border-left: 1px solid #ccc;
}

/* Remove connectors from the single child */
.org_tree li:only-child::after,
.org_tree li:only-child::before {
    display: none;
}

/* Remove connectors from first child (left part) */
.org_tree li:first-child::before {
    border: 0 none;
}

/* Remove connectors from last child (right part) */
.org_tree li:last-child::after {
    border: 0 none;
}

/* Clean up the vertical line for last child */
.org_tree li:last-child::before {
    border-right: 1px solid #ccc;
    border-radius: 0 5px 0 0;
}

.org_tree li:first-child::after {
    border-radius: 5px 0 0 0;
}

/* The Connector vertical line down from node */
.org_tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 1px solid #ccc;
    width: 0;
    height: 20px;
}

/* Node Styling */
.org_node {
    display: inline-block;
    padding: 15px 30px;
    text-decoration: none;
    color: #333;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.3s;
    position: relative;
    z-index: 10;
    min-width: 140px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.org_node:hover {
    background: #fff;
    border-color: #cba062;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(203, 160, 98, 0.2);
}

.org_node .role {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #1a1a1a;
}

.org_node .name {
    display: block;
    font-size: 13px;
    color: #777;
    margin-top: 2px;
}

/* Level Specific Styles */
/* Level 1: CEO */
.org_tree>ul>li>.org_node {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
    padding: 20px 40px;
}

.org_tree>ul>li>.org_node .role {
    color: #cba062;
    /* Gold text */
    font-size: 18px;
    margin-bottom: 0;
}

.org_tree>ul>li>.org_node:hover {
    background: #333;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Level 2: Executives */
.org_tree>ul>li>ul>li>.org_node {
    background: #fff;
    border-top: 3px solid #1a1a1a;
    /* Top hint */
}

/* Department Level */
.dept_node {
    background: #f8f8f8;
    border: 1px solid #eee;
    padding: 12px 20px;
    min-width: 120px;
}

.dept_node .role {
    font-size: 14px;
}

/* Highlighted Department */
.dept_main {
    border-top: 3px solid #cba062;
    background: #fff;
}

.dept_main .role {
    color: #c0392b;
    /* Accent Color if needed */
}

/* Animation Classes */
.org_tree li {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.org_tree li.visible {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================
   Mobile Logic (Vertical Stack)
   ========================================= */
/* =========================================
   Mobile Logic (Vertical Directory Tree)
   ========================================= */
@media (max-width: 1024px) {
    .org_tree {
        display: block;
        padding: 0 10px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Reset Flex and Floats */
    .org_tree ul {
        display: block;
        padding-top: 0;
        padding-left: 30px; /* Indent for children */
        position: relative;
        justify-content: flex-start;
    }

    /* Remove Desktop Connectors */
    .org_tree ul::before,
    .org_tree li::before,
    .org_tree li::after,
    .org_tree ul ul::before {
        display: none !important;
    }

    .org_tree li {
        float: none;
        display: block;
        text-align: left;
        padding: 10px 0;
        width: 100%;
        position: relative;
    }

    /* Mobile Connector Lines (Folder Tree Style) */
    .org_tree ul li::before {
        /* Vertical Line */
        content: '';
        display: block !important;
        position: absolute;
        left: -20px;
        top: 0;
        bottom: 0;
        width: 1px;
        background: #ddd;
        height: auto;
    }

    .org_tree ul li::after {
        /* Horizontal Line */
        content: '';
        display: block !important;
        position: absolute;
        left: -20px;
        top: 25px; /* Aligns with middle of simple node */
        width: 20px;
        height: 1px;
        background: #ddd;
    }

    /* Fix Last Child Vertical Line (Stop at horizontal connection) */
    .org_tree ul li:last-child::before {
        height: 26px; /* Stop exactly after connecting */
    }

    /* Root Node Special Case */
    .org_tree>ul {
        padding-left: 0;
    }
    .org_tree>ul>li::before,
    .org_tree>ul>li::after {
        display: none !important;
    }

    /* Node Styling for Mobile */
    .org_node {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 15px;
        text-align: left;
        margin: 0;
        min-width: 0;
        /* Flex for internal alignment */
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .org_node:hover {
        transform: none; /* Disable hover movement on mobile */
    }

    /* Role/Name alignment */
    .org_node .role {
        font-size: 15px;
        margin-bottom: 0;
    }
    .org_node .name {
        margin-top: 0;
        font-size: 13px;
    }

    /* Department Group Header */
    .dept_main {
        background: #fdfdfd;
        border-right: 3px solid #cba062; /* Right Accent */
        border-top: 1px solid #e0e0e0;
    }
    
    /* Level 1 (CEO) Spacing */
    .org_tree>ul>li>.org_node {
        margin-bottom: 10px;
        background: #1a1a1a;
        color: #fff;
        justify-content: center;
    }
}