/**
 * 우리마음상담센터 - 헤더/푸터 스타일
 */

/* ========================================
   헤더 스타일
   ======================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0;
    background: linear-gradient(to right, #f0f0f0 0%, #ffffff 15%, #ffffff 85%, #f0f0f0 100%);
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 0;
    border-bottom: none;
    line-height: 1;
}

.header-main-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row-1 {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.row-2 {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* 로고 */
.site-logo .logo-link {
    display: block;
    width: 200px;
    height: 60px;
    background-image: url('../images/woorimaum logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    text-indent: -9999px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.site-logo .logo-link:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

/* 전화번호 버튼 */
.direct-number, .emergency-number {
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: clamp(0.8rem, 3.0vw, 0.95rem) !important;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 140px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 45px;
    box-sizing: border-box;
}

.direct-number {
    background: linear-gradient(135deg, #27AE60, #2ECC71);
    color: white;
}

.emergency-number {
    background: linear-gradient(135deg, #3498DB, #5DADE2);
    color: white;
}

.direct-number:hover {
    background: linear-gradient(135deg, #2ECC71, #27AE60);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
    color: white;
}

.emergency-number:hover {
    background: linear-gradient(135deg, #2980B9, #3498DB);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
    color: white;
}

/* 전화번호 버튼 이모티콘 */
.direct-number::before, .emergency-number::before {
    content: "📞";
    font-size: 0.9rem;
    margin-right: 0.4rem;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}

/* 워드프레스 관리자 바 대응 */
.admin-bar .site-header {
    top: 32px !important;
}

.admin-bar .main-navigation {
    top: calc(32px + 75px) !important;
}

/* 모바일에서 관리자 바 높이 다름 */
@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px !important;
    }
    
    .admin-bar .main-navigation {
        top: calc(46px + 75px) !important;
    }
}

/* ========================================
   네비게이션
   ======================================== */
.main-navigation {
    position: fixed;
    top: 75px;
    left: 0;
    right: 0;
    z-index: 998;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    height: 50px;
    border-bottom: 1px solid #f1f1f1;
}

.main-navigation .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
}

.nav-wrapper {
    height: 100%;
    width: 100%;
}

.desktop-menu {
    height: 100%;
}

/* 메뉴 스타일 */
.main-menu {
    display: flex;
    height: 50px;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
}

.main-menu li {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    margin: 0;
    padding: 0;
    border-right: 1px solid #f1f1f1;
}

.main-menu li:last-child {
    border-right: none;
}

.main-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    padding: 0 clamp(2px, 0.8vw, 5px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
    text-align: center;
}

.main-menu a:hover {
    color: #27AE60;
    font-size: clamp(0.9rem, 1.3vw, 1rem);
    transform: scale(1.02);
}

/* 모바일 메뉴 토글 */
.mobile-menu-toggle {
    display: none;
}

/* 햄버거 버튼 */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1003;
    gap: 4px;
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* 모바일 메뉴 */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1002;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-menu.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: #ffffff;
    padding: 0;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active .mobile-menu-container {
    transform: translateX(0);
}

/* 모바일 메뉴 중복 스타일 제거됨 */

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-list li {
    border-bottom: 1px solid #f1f1f1;
}

.mobile-menu-list a {
    display: block;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-menu-list a:hover {
    background-color: #f8f9fa;
    color: #27AE60;
    padding-left: 2rem;
}

/* 메뉴가 열렸을 때만 body 스크롤 방지 */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ========================================
   푸터
   ======================================== */
.site-footer {
    background: #ffffff;
    color: #333;
    padding: 2rem 0 1rem 0;
    margin-top: 3rem;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #27AE60;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    color: #666;
}

.contact-info-item strong {
    min-width: 60px;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    color: #888;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
}

/* 작은 화면에서 메뉴 추가 조정 */
@media (max-width: 1200px) {
    .main-menu a {
        font-size: clamp(0.85rem, 1.3vw, 0.9rem);
        padding: 0 clamp(1px, 0.6vw, 4px);
    }
    
    .main-menu a:hover {
        font-size: clamp(0.9rem, 1.4vw, 0.95rem);
        transform: scale(1.01);
    }
}

@media (max-width: 900px) {
    .main-menu a {
        font-size: clamp(0.8rem, 1.1vw, 0.85rem);
        padding: 0 clamp(1px, 0.4vw, 3px);
    }
    
    .main-menu a:hover {
        font-size: clamp(0.85rem, 1.2vw, 0.9rem);
        transform: scale(1.01);
    }
}

/* ========================================
   반응형 헤더/푸터
   ======================================== */
@media (max-width: 768px) {
    /* 헤더 배경 완전 불투명 */
    .site-header {
        background: linear-gradient(to right, #f0f0f0 0%, #ffffff 10%, #ffffff 90%, #f0f0f0 100%) !important;
        height: auto;
    }
    
    /* 모바일 메뉴가 헤더 바로 아래 위치하도록 - 네거티브 마진 사용 */
    .mobile-menu-container {
        top: 0px !important;
        height: 100vh !important;
        background: #ffffff !important;
        padding-top: 0px !important;
        margin-top: 0px !important;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* 모바일 메뉴 리스트가 헤더 아래에서 시작하도록 */
    .mobile-menu-list {
        margin-top: 10px !important;
        padding-top: 0 !important;
    }
    
    /* 혹시 네비게이션이 영향을 주는 경우를 위해 */
    .main-navigation {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* 헤더 모바일 스타일 - 3단 구조 */
    .header-main-flex {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0.5rem 0.8rem 0.5rem;
        margin-bottom: 0 !important;
    }
    
    /* 헤더 하단 간격 완전 제거 */
    .site-header {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        z-index: 1001 !important;
    }
    
    /* 모바일 메뉴 z-index 조정 */
    .mobile-menu {
        z-index: 1000 !important;
    }
    
    .mobile-menu-container {
        z-index: 1000 !important;
    }
    
    .row-1 {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .row-2 {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }
    
    .site-logo {
        flex: 1;
    }
    
    .mobile-menu-toggle {
        order: 2;
        display: block !important;
    }
    
    .hamburger-btn {
        display: flex !important;
    }
    
    /* 네비게이션 숨기기 */
    .main-navigation {
        height: 0px !important;
        overflow: hidden !important;
        border-bottom: none !important;
        box-shadow: none !important;
        background: transparent !important;
        position: absolute !important;
        top: 0 !important;
    }
    
    /* 햄버거 버튼은 보이도록 */
    .hamburger-btn {
        visibility: visible !important;
        display: flex !important;
    }
    
    .desktop-menu,
    .main-menu {
        display: none !important;
    }
    
    /* 모바일 메뉴 토글 보이기 */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* 전화번호 버튼 모바일 조정 */
    .direct-number, .emergency-number {
        min-width: 120px;
        padding: 0.6rem 1rem;
        font-size: clamp(0.7rem, 3.8vw, 0.85rem) !important;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 40px;
        box-sizing: border-box;
    }
    
    /* 모바일 호버 효과 */
    .direct-number:hover {
        transform: translateY(-1px) scale(1.03);
        box-shadow: 0 6px 15px rgba(39, 174, 96, 0.4);
    }
    
    .emergency-number:hover {
        transform: translateY(-1px) scale(1.03);
        box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
    }
    
    /* 푸터 모바일 */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-content {
        padding: 2rem 0 1rem;
    }
}

/* 아이폰 같은 작은 화면 (480px 이하) */
@media (max-width: 480px) {
    .header-main-flex {
        padding: 0.5rem 0.5rem 1rem 0.5rem;
        gap: 0.5rem;
    }
    
    .row-1 {
        gap: 1rem;
    }
    
    .row-2 {
        gap: 0.5rem;
    }
    
    /* 전화번호 버튼 더 작게 */
    .direct-number, .emergency-number {
        min-width: 90px;
        padding: 0.5rem 0.6rem;
        font-size: clamp(0.65rem, 4.2vw, 0.8rem) !important;
        height: 35px;
        border-radius: 20px;
        white-space: nowrap;
    }
    
    /* 로고 크기 조정 */
    .site-logo .logo-link img {
        max-height: 35px;
    }
    
    /* 햄버거 메뉴 버튼 크기 조정 */
    .hamburger-btn {
        width: 35px;
        height: 35px;
        padding: 0.3rem;
    }
    
    .hamburger-btn span {
        height: 2px;
    }
}

/* 매우 작은 화면 (360px 이하) */
@media (max-width: 360px) {
    .header-main-flex {
        padding: 0.3rem 0.3rem 1rem 0.3rem;
        gap: 0.3rem;
    }
    
    .row-1 {
        gap: 0.5rem;
    }
    
    .row-2 {
        gap: 0.3rem;
    }
    
    /* 전화번호 버튼 매우 작게 */
    .direct-number, .emergency-number {
        min-width: 80px;
        padding: 0.4rem 0.5rem;
        font-size: clamp(0.6rem, 4.8vw, 0.75rem) !important;
        height: 32px;
        border-radius: 16px;
        white-space: nowrap;
    }
    
    /* 햄버거 버튼 더 작게 */
    .hamburger-btn {
        width: 32px;
        height: 32px;
        padding: 0.25rem;
    }
    
    .hamburger-btn span {
        width: 20px;
        height: 2px;
    }
}
