/* ==========================================================================
           1. Variables & Reset
           ========================================================================== */
:root {
    --primary-color: #008751;
    --primary-dark: #006039;
    --text-color: #111111;
    --text-gray: #666666;
    --light-bg: #f8f9fa;
    --border-color: #e5e5e5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    word-break: keep-all;
    /* 한글 줄바꿈 최적화 */
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* ==========================================================================
           2. Layout & Common
           ========================================================================== */
.cp-section {
    padding: 120px 0;
    overflow: hidden;
    /* 가로 스크롤 방지 */
}

.cp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.cp-header {
    text-align: center;
    margin-bottom: 80px;
}

.cp-label {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cp-title {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
}

.cp-desc {
    font-size: 18px;
    color: var(--text-gray);
}

/* ==========================================================================
           3. Header & Hero
           ========================================================================== */
.cp-hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    background: url('/img/page/pagetop02.jpg') no-repeat center/cover;
    /* 배경 이미지 없을 시 대체 색상 */
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.cp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.cp-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.cp-hero-subtitle {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #4ade80;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cp-hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
}

.cp-hero-desc {
    font-size: 20px;
    font-weight: 300;
    opacity: 0.9;
}

/* Sticky Nav */
.cp-nav-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.cp-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.cp-nav a {
    padding: 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-gray);
    position: relative;
    transition: 0.3s;
    white-space: nowrap;
}

.cp-nav a.active,
.cp-nav a:hover {
    color: var(--primary-color);
}

.cp-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
}

/* ==========================================================================
           4. Sections
           ========================================================================== */

/* CEO Message */
.ceo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ceo-quote-area {
    margin-bottom: 40px;
}

.ceo-quote-area h3 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-color);
}

.ceo-img-box {
    width: 100%;
    margin-bottom: 50px;
}

.ceo-img-box img {
    width: 100%;
    max-width: 1200px;
    /* 너무 커지지 않게 제한 */
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.ceo-content {
    width: 100%;
    max-width: 800px;
}

.ceo-text {
    text-align: left;
    font-size: 18px;
    color: #1c1c1c;
    line-height: 1.8;
}

.ceo-text p {
    margin-bottom: 20px;
}

.ceo-sign {
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    width: 100%;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.ceo-sign-name {
    font-size: 20px;
    font-weight: 600;
}

.ceo-sign-role {
    font-size: 18px;
    color: #666;
}

/* Vision & Values */
.vision-section {
    background: var(--light-bg);
}

.vision-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.vision-card {
    background: #fff;
    padding: 50px 40px;
    border-radius: 20px;
    transition: 0.4s;
    border: 1px solid transparent;
}

.vision-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 135, 81, 0.2);
}

.vision-icon {
    width: 70px;
    height: 70px;
    background: #e6f3ed;
    color: var(--primary-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 30px;
}

.vision-card h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.vision-card p {
    color: var(--text-gray);
    font-size: 16px;
}

/* History (Timeline) */
.history-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* 중앙 라인 (PC) */
.history-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #eee;
    transform: translateX(-50%);
}

.history-item {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 60px;
    position: relative;
}

.history-year {
    background: var(--primary-color);
    color: #fff;
    padding: 8px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 135, 81, 0.3);
    flex-shrink: 0;
}

.history-content {
    position: absolute;
    width: 45%;
    top: 10px;
}

/* 홀수 아이템: 왼쪽 */
.history-item:nth-child(odd) .history-content {
    left: 0;
    text-align: right;
    padding-right: 40px;
}

/* 짝수 아이템: 오른쪽 */
.history-item:nth-child(even) .history-content {
    right: 0;
    text-align: left;
    padding-left: 40px;
}

.history-content li {
    margin-bottom: 8px;
    font-size: 16px;
    color: #333;
}

/* Social Contribution (Styles moved from Inline) */
.social-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.social-text h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.social-text p {
    font-size: 16px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
}

.social-tags {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-tag-item {
    background: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: #008751;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.social-img img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Partners & Cert */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

.cert-card {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cert-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.cert-logo {
    height: 60px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.partner-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.partner-box {
    border: 1px solid #eee;
    border-radius: 12px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #fff;
    transition: 0.3s;
}

.partner-box:hover {
    border-color: var(--primary-color);
}

.partner-box img {
    opacity: 1;
    transition: 0.3s;
}

.partner-box:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Branch Network */
.branch-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.branch-card {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #eee;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: 0.3s;
}

.branch-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.branch-icon {
    width: 50px;
    height: 50px;
    background: #f0fdf4;
    color: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.branch-info h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.branch-info p {
    color: #555;
    font-size: 15px;
    margin-bottom: 5px;
}


/* ==========================================================================
           5. Responsive Media Queries (Mobile Optimization)
           ========================================================================== */

/* Tablet & Small Desktop (Max 1024px) */
@media (max-width: 1024px) {
    .cp-hero-title {
        font-size: 42px;
    }

    .cp-nav {
        gap: 30px;
    }

    .partner-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile (Max 768px) */
@media (max-width: 768px) {

    .ceo-sign {justify-content: center;  }

    .history-timeline::before {
        display: none;
    }

    /* Common */
    .cp-section {
        padding: 80px 0;
    }

    .cp-title {
        font-size: 28px;
    }

    .cp-desc {
        font-size: 16px;
    }

    /* Hero */
    .cp-hero-title {
        font-size: 32px;
        word-break: keep-all;
    }

    .cp-hero-desc {
        font-size: 16px;
        word-break: keep-all;
    }

    /* Navigation (Scrollable) */
    .cp-nav-wrap {
        padding: 0;
    }

    .cp-nav {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 20px;
        gap: 20px;
        /* 스크롤바 숨기기 */
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        /* Firefox */
    }

    .cp-nav::-webkit-scrollbar {
        display: none;
    }

    /* Chrome, Safari */

    /* CEO */
    .ceo-quote-area h3 {
        font-size: 22px;
        word-break: keep-all;
    }

    .ceo-text {
        font-size: 16px;
    }

    /* Vision Grid */
    .vision-grid {
        grid-template-columns: 1fr;
    }

    .vision-card {
        padding: 30px;
    }

    /* History Timeline (Mobile Rewrite) */
    .history-timeline {
        margin-left: 0;
        padding-left: 0;
    }

    /* 라인을 왼쪽으로 이동 */
    .history-timeline::before {
        left: 20px;
        transform: none;
    }

    .history-item {
        flex-direction: column;
        /* 세로 정렬 */
        align-items: flex-start;
        margin-left: 50px;
        /* 라인 공간 확보 */
        margin-bottom: 40px;
    }

    .history-year {
        position: static;
        /* 절대위치 해제 */
        margin-bottom: 15px;
        font-size: 16px;
        padding: 6px 18px;
        transform: translateX(-30px);
        /* 아이콘을 라인 위로 살짝 이동 */
    }

    /* 좌우 구분 없이 콘텐츠 통일 */
    .history-item:nth-child(odd) .history-content,
    .history-item:nth-child(even) .history-content {
        position: static;
        width: 100%;
        text-align: left;
        padding: 0;
    }

    /* Social */
    .social-wrap {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .social-text {
        order: 2;
    }

    /* 이미지가 위로 오게 하려면 order 조정 */
    .social-img {
        order: 1;
    }

    .social-text h3 {
        font-size: 24px;
    }

    /* Partners */
    .cert-grid {
        grid-template-columns: 1fr;
    }

    .partner-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Branch */
    .branch-cards {
        grid-template-columns: 1fr;
    }

    .branch-card {
        padding: 30px;
    }
}