/* 글씨 크기 고정 및 깜빡임 방지 */
.greetings-box { 
    /* line-height: 1.8;  */
    color: #444; 
    /* font-size: 1.1rem; */
    word-break: keep-all; 
}

/* 서명 영역 스타일 수정 */
.management-wrap { 
    display: flex; 
    justify-content: space-between; /* 양 끝으로 최대한 벌림 */
    align-items: flex-start; 
    margin: 50px auto 0; /* 중앙 정렬 */
    max-width: 500px; /* ← 이 숫자를 키우면 더 멀어지고, 줄이면 가까워집니다 */
    width: 100%;
}


/* 개별 아이템 정렬 */
.manager-item {
    text-align: center;
    flex: 1; /* 동일한 비율로 공간 차지 */
}

/* .manager-item .name { 
    font-size: 1.3rem; 
    font-weight: bold; 
    color: #000; 
    letter-spacing: 5px; 
} */

.logo img { 
     height: 42px; /* ← 약간 키움 */
    width: auto;
    display: block;
}


/* 1. 초기화 및 웹폰트 설정 */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* 폰트 로딩 시 깜빡임 방지를 위해 font-display: swap 추가 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    word-break: keep-all;
    letter-spacing: -0.01em; /* 한글 읽기 편하게 미세 조정 */
    font-family: 'Pretendard', sans-serif;
    background: #f5f7fa;
}

/* 2. 헤더 (상단바) 공통 */
.header { 
    position: fixed; 
    top: 0; 
    width: 100%; 
    height: 80px; 
    z-index: 1000; 
    transition: 0.3s; 
    display: flex; 
    align-items: center; 
}
.header-inner { 
width: 90%; 
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: flex-start; /* space-between 대신 flex-start로 변경 */
    align-items: center;
    
}

.logo {
    margin-right: 300px; /* 로고와 첫 번째 메뉴 사이의 거리 */
}

/* 메인페이지/서브페이지 헤더 배경 설정 */
.main-page .header { background: transparent; }
/* .main-page .header.scrolled { background: #0b1f3a; height: 70px; } */
.sub-page .header { background: #0b1f3a; }

/* 3. 로고 & 회사명 (중복 제거 및 통합) */
.logo a, .footer-logo { 
    display: flex; 
    align-items: center; 
    text-decoration: none; 
    /* gap: 100px; */
}

/* .logo img { height: 45px; width: auto; display: block; } */
.logo-name { 
    font-size: 20px; 
    font-weight: 700; 
    color: #fff; 
    white-space: nowrap; 
    line-height: 1;
}

/* 4. 네비게이션 메뉴 */
nav ul { display: flex; list-style: none; }
/* nav li { margin-left: 30px; } */
nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; transition: 0.3s; }
nav a:hover, nav a.active { color: #f4b400; }

/* 5. 메인 슬라이더 (index.html) */
/* 수정 후 (푸터 높이가 약 200px이므로 계산해서 줄임) */
.visual-slider { 
    position: relative; 
    width: 100%; 
    height: calc(100vh - 150px); /* 전체 높이에서 푸터 높이(200px)만큼 뺌 */
    overflow: hidden; 
    background: #000; 
}

.slide { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background-size: cover; background-position: center; 
    display: flex; justify-content: center; align-items: center; 
    color: #fff; text-align: center; opacity: 0; 
    transition: opacity 1.2s ease-in-out, transform 5s ease-out; 
    z-index: 1; 
}
.slide.active { opacity: 1; z-index: 2; transform: scale(1.05); }
.v-content h1 { font-size: 60px; font-weight: 800; margin-bottom: 10px; }
.v-content h2 { font-size: 50px; font-weight: 800; margin-bottom: 15px; }
.v-content p { font-size: 20px; font-weight: 300; letter-spacing: 2px; }

/* 슬라이더 인디케이터 */
.slider-dots { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.4); transition: 0.3s; }
.dot.active { background: #f4b400; width: 30px; border-radius: 10px; }

/* 6. 서브페이지 공통 스타일 */
.sub-visual { height: 350px; background: #0b1f3a; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #fff; padding-top: 80px; }
.sub-visual h2 { font-size: 40px; margin-bottom: 10px; }
.container { 
    width: 95%; /* 기존 90%에서 살짝 확장 */
    max-width: 1200px; /* 기존 1000px에서 1200px 정도로 넓히면 사이드바가 더 왼쪽으로 이동합니다 */
    margin: 50px auto;
}
.section-title { margin-bottom: 30px; border-left: 5px solid #f4b400; padding-left: 15px; }
.section-title span { color: #f4b400; font-weight: 700; font-size: 14px; }
.section-title h3 { font-size: 28px; color: #333; }

/* 표 및 기타 요소 */
.info-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.info-table th { background: #f8f8f8; padding: 15px; border: 1px solid #ddd; width: 20%; text-align: left; }
.info-table td { padding: 15px; border: 1px solid #ddd; }
.signature { margin-top: 30px; font-size: 20px; text-align: right; }


.footer-inner { width: 90%; max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-logo img { height: 70px; width: auto; }
.footer-info { text-align: right; }
.f-address { font-size: 15px; color: #ccc; margin-bottom: 10px; }
.f-contact { font-size: 14px; margin-bottom: 5px; }
.f-contact span { margin-left: 20px; }
.f-copyright { font-size: 13px; color: #666; margin-top: 15px; }

/* 8. 반응형 (모바일) - 모든 미디어 쿼리는 맨 아래에 모음 */
@media (max-width: 768px) {

    html, body {
        overflow-x: hidden !important; /* 가로 스크롤 방지 */
        width: 100% !important;
    }

    .footer-inner {
        padding: 0 20px !important; /* 200px 같은 큰 수치 대신 반드시 작은 수치로 */
        width: 100% !important;
        box-sizing: border-box !important; /* 패딩이 너비를 먹지 않게 함 */
    }

    /* 이미지나 로고가 화면보다 커지는 것 방지 */
    .footer-logo img {
        max-width: 100% !important;
        height: auto !important;
    }
    /* 1. 푸터 높이 고정 해제 및 중앙 정렬 */
    .footer { height: auto !important; padding: 40px 0 !important; }
    .footer-inner { flex-direction: column !important; align-items: center !important; text-align: center !important; gap: 40px !important; }
    
    /* 2. 로고 영역: 중앙으로, 글씨 키움 */
    .footer-logo { justify-content: center !important; margin-bottom: 10px; }
    .footer-logo-text { font-size: 1.6rem !important; } /* 다른 페이지처럼 크게! */
    
    /* 3. 정보 영역: 중앙 정렬 및 가로 분리 */
    .footer-info-wrapper { align-items: center !important; width: 100% !important; }
    .f-info-container { justify-content: center !important; text-align: center !important; flex-direction: column !important; gap: 30px !important; }
    
    /* 4. 세로 구분선: 모바일에서는 숨기거나 가로선으로 대체 */
    .v-line { width: 80% !important; height: 1px !important; margin: 0 auto !important; background: #333 !important; }
    
    /* 5. 텍스트 크기 키우기 */
    .f-office span { font-size: 1rem !important; line-height: 1.8; }
    .f-office strong { font-size: 1.1rem !important; margin-bottom: 5px; }
    
    /* 6. 본문 영역 대응 (세로 쏟아짐 방지) */
    .sub-wrapper { flex-direction: column !important; gap: 40px !important; }
    .sub-sidebar { width: 100% !important; position: static !important; }
    .sidebar-menu { display: flex !important; gap: 10px !important; flex-wrap: wrap !important; }
    .side-link { text-align: center !important; padding: 12px 5px !important; font-size: 14px !important; flex: 1 !important; min-width: 100px !important; }
    
    /* 7. 조직도 대응 (카드를 크게) */
    .member-card { width: 100% !important; max-width: 400px; }
    .org-row { flex-direction: column; align-items: center; }
}

/* 모든 서브페이지 공통 반응형 (모바일 확대 방지 및 정렬) */
@media (max-width: 1024px) {
    /* 1. 바디 영역 넘침 방지 */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    nav { position: relative; }


    /* 3. 메뉴 사이 120px 여백 제거 (범인 2) */
    nav .has-sub:not(:last-child)::after {
        display: none !important; /* 세로선 숨김 */
        margin: 0 !important;    /* 여백 제거 */
    }
    
    /* 5. 푸터 200px 패딩 강제 제거 (범인 3) */
    .footer-inner {
        padding: 0 20px !important; /* 200px 대신 20px만 */
        flex-direction: column !important;
        text-align: center !important;
    }

    /* 6. 본문 영역(컨테이너) 넘침 방지 */
    .container {
        width: 100% !important;
        padding: 0 15px !important;
        box-sizing: border-box !important;
    }


    /* 7. 지도 및 본문 박스 100% 채우기 */
    .sub-content, .map-section, .map-container, .map-box {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 1. 서브메뉴 위치 재설정 (모바일용) */
    nav .sub-menu {
        position: absolute !important;
        top: 60px !important; /* 메인 메뉴 아래 적당한 위치 */
        left: 5px !important;
        right: 0 !important; /* 오른쪽 기준으로 정렬 */
        width: 160px !important;
        min-width: 160px !important;
        display: none !important; /* 기본은 숨김 */
        background: #fff !important;
        border: 1px solid #ccc !important;
        border-top: 3px solid #00468c !important;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
        z-index: 9999 !important;
    }
    /* 2. 메뉴 클릭 시 활성화 (클래스 기반) */
    nav .has-sub.is-active .sub-menu {
        display: block !important;
    }

    /* 3. 모바일에서 서브메뉴 글자색 조정 */
    nav .sub-menu a {
        color: #333 !important;
        padding: 12px 0 !important;
        font-size: 14px !important;
        text-align: center !important;
        border-bottom: 1px solid #eee;
    }


    nav .sub-menu li:last-child a { border-bottom: none; }

    nav .has-sub > a {
        height: auto !important;
        line-height: 50px !important; /* 터치하기 적당한 높이 */
    }
    
}


/* 메인 메뉴 설정 */
nav ul.main-menu {
    display: flex;
    list-style: none;
    align-items: center; /* 세로선과 글자 높이를 수직 중앙으로 맞춤 */
    margin: 0;
    padding: 0;
}

nav .has-sub {
    position: relative;
    display: flex; /* 글자와 세로선을 한 줄에 배치 */
    align-items: center;
}

/* 2. 회사소개와 인증현황 사이 간격 & 세로선 */
nav .has-sub:not(:last-child)::after {
    content: "";
    display: block;
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.3);
    /* 좌우 간격을 동일하게 주어야 선이 정중앙에 위치합니다 */
    margin-left: 60px; 
    margin-right: 60px; 
}

/* [중요] 기존에 nav li 에 들어있던 margin-left가 있다면 0으로 초기화해야 합니다 */
nav li {
    margin-left: 0 !important;
}

nav .has-sub > a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 19px;
    height: 80px;
    line-height: 80px;
    display: block;
    white-space: nowrap; /* 글자가 줄바꿈되어 박스가 틀어지는 것 방지 */
}

/* 4. 마우스 호버 효과 */
nav .has-sub:hover > a {
    color: #f4b400;
}


nav .sub-menu ul {
    display: block !important; /* 가로 정렬 해제 */
    padding: 0;
    margin: 0;
    list-style: none;
}

/* 부메뉴(서브메뉴) 기본 디자인 */
nav .sub-menu {
    position: absolute;
    top: 65px;
    /* 세로선 여백 때문에 밀리는 현상을 방지하기 위해 
       부모 너비와 상관없이 글자 위치 근처로 고정 */
    left: 0; 
    transform: translateX(calc(-50% + 30px)); /* 미세 조정: 글자 길이에 맞춰 중앙값 보정 */
    
    background: #ffffff;
    min-width: 180px;
    padding: 8px 0;
    border-radius: 4px;
    display: none;
    z-index: 1000;
    border: 1px solid #ccc;
    border-top: 3px solid #00468c;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* 부메뉴 개별 항목 */
nav .sub-menu li {
    margin: 0;
    width: 100%;
}

/* 부메뉴 글자 스타일 (흰색 배경엔 어두운 글자) */
nav .sub-menu a {
    display: block;
    padding: 12px 0;
    font-size: 14px;
    color: #333 !important; /* 글자색을 어두운 회색으로 고정 */
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

/* 마우스 올렸을 때 효과 */
nav .sub-menu a:hover {
    background: #f4b400; /* 배경을 노란색으로 반전 */
    color: #000; /* 글자는 검정색으로 해서 대비 극대화 */
    font-weight: 700;
}

/* 드롭다운 활성화 상태 */
nav .has-sub:hover .sub-menu {
    display: block;
}


/* 오시는 길 전용 스타일 */
.map-section {
    margin-bottom: 50px;
    background: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.office-name {
    font-size: 22px;
    color: #0b1f3a;
    font-weight: 800;
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 4px solid #00468c;
}

.map-box {
    width: 100%;
    height: 400px;
    background: #f0f0f0;
    margin-bottom: 25px;
    border-radius: 4px;
    overflow: hidden;
}

.address-details {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

.address-details p {
    font-size: 16px;
    margin-bottom: 10px;
    color: #444;
    line-height: 1.6;
}

.address-details p strong {
    color: #000;
    margin-right: 10px;
}

/* 모바일 대응 */
/* @media (max-width: 768px) {
    .map-box { height: 300px; }
    .office-name { font-size: 18px; }
} */


/* 안전관리본부 아래 3개 부서 위치 미세조정 */

.org-chart > ul > li > ul {
    display: flex;
    justify-content: center;
}

.org-chart > ul > li > ul > li {
    flex: 0 0 200px;   /* 너 박스 가로크기에 맞게 숫자 수정 */
}



.org-chart > ul > li > ul > li > ul {
    display: flex;
    justify-content: center;
    /* display: flex; */
    /* justify-content: center; */
    gap: 100px; /* ★ 이 숫자를 키우면 부서 사이 간격이 더 넓어집니다 (현재 80px) */
    /* padding: 0; */
}

/* 두 번째 (안전진단) 기준 이동 */
.org-chart > ul > li > ul > li > ul > li:nth-child(2) {
    position: relative;
    left: -74px;   /* 여기 숫자 조절g해야지 안전진단부분 이동됨 */
}

/* 1. 기업부설연구소와 하위 팀 전체를 왼쪽으로 이동 */
.org-chart .dept-li:nth-child(3) {
    position: relative;
    left: -75px; /* 이 숫자를 키울수록 왼쪽으로 더 많이 이동합니다 */
}

/* 2. 박스가 이동해도 선이 박스 머리 중앙(50%)에 딱 붙게 고정 */
/* .org-chart .dept-li:nth-child(3)::before,
.org-chart .dept-li:nth-child(3)::after {
    left: 50% !important;
    right: auto !important;
} */

/* 3. 연구소 오른쪽으로 삐져나가는 불필요한 선 제거 */
.org-chart .dept-li:last-child::after {
    display: none !important;
}


/* [최종] 조직도 선 굵기 및 연결 통일 */
.org-chart { padding: 40px 0; text-align: center; }
.org-chart ul { 
    display: flex; justify-content: center; position: relative; 
    padding-top: 25px; list-style: none; margin: 0;
}
.org-chart li { text-align: center; position: relative; padding: 25px 15px 0 15px; }

/* 1. 모든 선 굵기를 1.5px로 통일 (#bbb 색상) */
/* 선 굵기 및 중앙 정렬 유지 */
.org-chart ul ul::before {
    content: ''; position: absolute; top: 0; left: 50%;
    border-left: 1.5px solid #bbb; width: 0; height: 25px;
}
.org-chart li::before, .org-chart li::after {
    content: ''; 
    position: absolute; 
    top: 0; 
    right: 50%;
    border-top: 1.5px solid #bbb; 
    width: 90%; 
    height: 25px;
    z-index: 1;
}


.org-chart li::after { 
    right: auto; 
    left: 50%; 
    border-left: 1.5px solid #bbb; 
}

.org-chart > ul > li > ul > li > ul > li:first-child::before { border: 0 none !important; }
.org-chart > ul > li > ul > li > ul > li:last-child::after { border: 0 none !important; }



/* 2. 불필요한 선 제거 및 곡선 처리 */
.org-chart li:only-child::after, .org-chart li:only-child::before { display: none; }
.org-chart li:only-child { padding-top: 0; }
.org-chart li:first-child::before, .org-chart li:last-child::after { border: none; }
.org-chart li:last-child::before { border-right: 1.5px solid #bbb; border-radius: 0 5px 0 0; }
.org-chart li:first-child::after { border-radius: 5px 0 0 0; }



/* 3. 박스 디자인 (CEO & 본부 사이즈 축소 반영) */
.org-chart .box {
    display: inline-block; padding: 12px 20px; border-radius: 8px;
    background: #fff; border: 1px solid #ddd; font-weight: 700;
    position: relative; z-index: 10; transition: 0.3s;
    font-size: 14px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* 박스별 개별 설정 */
.org-chart .box.ceo { padding: 15px 40px; font-size: 20px !important; background: #0b1f3a; color: #fff; min-width: 180px; border: none; }
.org-chart .box.hq { padding: 12px 30px; font-size: 18px !important; background: #f8f9fa; border: 1.5px solid #0b1f3a; color: #0b1f3a; min-width: 160px; }
/* 3. 토목, 안전진단 등 부서명 박스 글자 크기 조절 */
.org-chart .box.dept {
    font-size: 16px !important;
    font-weight: 700 !important;
}

.org-chart .box {
    font-size: 15px !important; /* 위에서 정의하지 않은 나머지 박스들 */
}

/* 부서 간격 및 색상 */
.dept-li { position: relative;
    flex: 0 1 auto; /* 고정 크기 대신 내용에 맞게 */
    padding: 25px 0 0 0 !important; /* 기존 padding 초기화 */ }
.box.dept { min-width: 150px; color: #fff; border: none; }
.box.civil { background: #2c3e50; } 
.box.safety { background: #e67e22; }
.box.research { background: #27ae60; }

/* 최하단 팀 박스 */
.org-chart ul ul ul .box { background: #fff; color: #333; border: 1px solid #eee; font-size: 13px; min-width: 120px; }



/* 박스 디자인 */
.box {
  display: inline-block;
  padding: 15px 25px;
  border-radius: 12px;
  background: white;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  font-size: 14px;
  font-weight: 600;
  transition: 0.3s;
}

.box span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #666;
  margin-top: 5px;
}

.box:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }

.ceo {
  background: #1f2d3d;  /* 살짝 밝은 네이비 */
  color: #fff;
}

.ceo span {
  color: rgba(255, 255, 255, 0.9);
}

.tall {
  line-height: 1.8;
}


/* .org-wrapper {
  position: relative;
} */

.president-box {
  position: absolute;
  top: 0;
  right: 5%;
  padding: 15px 25px;
  border-radius: 12px;
  background: white;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.president-box span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #666;
  margin-top: 5px;
}


.top-area {
  position: relative;
  margin-bottom: 40px;
}

/* 대표이사는 정확히 중앙 */
.ceo-area {
  display: flex;
  justify-content: center;
}

/* 사장은 오른쪽으로 이동 */
.president-area {
  position: absolute;
  top: 18px;
  right: 10%;
}

/* 대표이사 아래 선이 중앙 유지되도록 */
.org-chart > ul > li::before,
.org-chart > ul > li::after {
  top: -20px;
}



/* .ceo-root > ul::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 50%;
    width: 2px;
    height: 20px;
    background: #ccc;
} */




/* 이미지 박스 - 배경색 일치 및 경계 완화 */
.process-img-box { 
    width: 100%;
    /* 투명도 강제 지정 */
    background-color: transparent !important; 
    overflow: hidden; 
    margin-top: 20px;
    border-radius: 8px;
}

.process-img-box img { 
    display: block;
    width: 100%; 
    height: auto; 
    object-fit: contain;
    /* 배경이 흰색으로 렌더링되는 것을 방지 */
    background: none !important;
    /* 모바일 브라우저의 그림자/색상 처리 강제 초기화 */
    -webkit-appearance: none;
    -webkit-backface-visibility: hidden;
}