/*
Theme Name: MateWP
Theme URI: https://www.pmate.co.kr
Author: Yoons
Author URI: https://www.pmate.co.kr
Author Email: sskim731@gmail.com
Description: 웹페이지 제작 전용 한글 테마 (Elementor 기반 초경량 독립 마스터 테마)
Version: 1.0.0
Text Domain: matewp
*/

/* ==========================================================================
   1. 기본 리셋 및 전역 레이아웃
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", "Segoe UI", Roboto, sans-serif;
    font-size: var(--mate-body-size, 16px);
    line-height: var(--mate-body-lh, 1.7);
    color: var(--mate-body-color, #333333);
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

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

/* 사이트 공통 컨테이너 및 Elementor 연동 */
.mate-container,
.site-container,
.elementor-section.elementor-section-boxed > .elementor-container {
    max-width: var(--mate-site-width, 1200px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ==========================================================================
   2. 상단 헤더 및 네비게이션
   ========================================================================== */
.mate-header {
    width: 100%;
    background-color: var(--mate-header-bg, #ffffff);
    border-bottom: 1px solid var(--mate-header-border, #eaeaea);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    z-index: 9999;
}

/* 스티키 헤더 설정 */
.mate-header.is-sticky {
    position: sticky;
    top: 0;
    left: 0;
}

/* 스크롤 시 그림자 */
.mate-header.is-scrolled {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

.mate-header-inner {
    max-width: var(--mate-site-width, 1200px);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 로고 */
.mate-logo {
    display: flex;
    align-items: center;
}

.mate-logo a {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.mate-logo img {
    height: var(--mate-logo-height, 42px);
    width: auto;
    display: block;
    object-fit: contain;
}

.mate-logo .site-title-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--mate-menu-color, #222222);
    letter-spacing: -0.5px;
}

/* PC 네비게이션 */
.mate-desktop-nav {
    display: block;
}

.mate-desktop-nav .mate-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
    align-items: center;
}

.mate-desktop-nav .mate-menu li {
    position: relative;
    margin: 0;
    padding: 0;
}

.mate-desktop-nav .mate-menu > li > a {
    display: block;
    padding: 8px 6px;
    font-size: var(--mate-pc-menu-size, 16px);
    font-weight: 600;
    color: var(--mate-menu-color, #222222);
    transition: color 0.2s ease;
}

.mate-desktop-nav .mate-menu > li > a:hover,
.mate-desktop-nav .mate-menu > li.current-menu-item > a {
    color: var(--mate-menu-hover, #136ef7);
}

/* PC 서브메뉴(드롭다운) */
.mate-desktop-nav .mate-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background-color: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    display: none;
    z-index: 10000;
}

.mate-desktop-nav .mate-menu li:hover > .sub-menu {
    display: block;
}

.mate-desktop-nav .mate-menu .sub-menu li {
    width: 100%;
}

.mate-desktop-nav .mate-menu .sub-menu a {
    display: block;
    padding: 9px 18px;
    font-size: 14.5px;
    font-weight: 500;
    color: #444444;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mate-desktop-nav .mate-menu .sub-menu a:hover {
    background-color: #f7f9fc;
    color: var(--mate-menu-hover, #136ef7);
}

/* ==========================================================================
   3. 모바일 네비게이션
   ========================================================================== */
.mate-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    width: 32px;
    height: 28px;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.mate-mobile-toggle .bar {
    width: 100%;
    height: 2.5px;
    background-color: var(--mate-menu-color, #222222);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 햄버거 X 애니메이션 */
.mate-mobile-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.mate-mobile-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}
.mate-mobile-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* 모바일 드롭다운 메뉴 래퍼 */
.mate-mobile-menu-wrap {
    display: none;
    width: 100%;
    background-color: var(--mate-header-bg, #ffffff);
    border-top: 1px solid var(--mate-header-border, #eaeaea);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
}

.mate-mobile-menu-wrap.is-open {
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.mate-mobile-menu {
    list-style: none;
    margin: 0;
    padding: 10px 20px 20px;
}

.mate-mobile-menu li {
    border-bottom: 1px solid #f2f2f2;
}

.mate-mobile-menu li:last-child {
    border-bottom: none;
}

.mate-mobile-menu a {
    display: block;
    padding: 12px 4px;
    font-size: var(--mate-mo-menu-size, 16px);
    font-weight: 600;
    color: var(--mate-menu-color, #222222);
}

.mate-mobile-menu a:hover {
    color: var(--mate-menu-hover, #136ef7);
}

/* 모바일 서브메뉴 */
.mate-mobile-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 10px 16px;
}

.mate-mobile-menu .sub-menu a {
    font-size: 14.5px;
    font-weight: 500;
    padding: 7px 0;
    color: #666666;
}

/* ==========================================================================
   4. 본문 영역
   ========================================================================== */
.mate-main-content {
    min-height: 60vh;
    width: 100%;
}

/* ==========================================================================
   5. 하단 푸터 (사업자 정보)
   ========================================================================== */
.mate-footer {
    background-color: var(--mate-footer-bg, #222222);
    color: var(--mate-footer-color, #aaaaaa);
    padding: 40px 20px;
    font-size: 13.5px;
    line-height: 1.85;
}

.mate-footer-inner {
    max-width: var(--mate-site-width, 1200px);
    margin: 0 auto;
    text-align: center;
}

.mate-footer-lines p {
    margin: 4px 0;
}

.mate-footer a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mate-footer a:hover {
    color: #ffffff;
}

.mate-footer .copyright {
    margin-top: 15px;
    font-size: 12.5px;
    opacity: 0.85;
}

/* ==========================================================================
   6. 반응형 미디어 쿼리 (768px 모바일 전환)
   ========================================================================== */
@media (max-width: 768px) {
    .mate-desktop-nav {
        display: none;
    }
    
    .mate-mobile-toggle {
        display: flex;
    }
    
    .mate-mobile-menu-wrap {
        display: block;
    }
    
    .mate-header-inner {
        padding: 10px 16px;
    }
    
    .mate-footer {
        padding: 30px 16px;
        font-size: 13px;
    }
}