/* ─────────────────────────────────────────────────────────────
 * 크로스 브라우저 + 모바일 + OS 호환성 보강
 * - 구형 Safari/iOS/Edge/삼성인터넷/안드로이드 크롬 대응
 * ───────────────────────────────────────────────────────────── */

/* a 태그 기본 underline 제거 (한글 윗선과 strikethrough처럼 겹치는 현상 방지)
 * — wp_reset.css 의 .wp_wrap a 만 적용되어 wp_wrap 밖에선 적용 안 됨, 전역 보강 */
a, a:visited, a:hover, a:active, a:focus,
.wp_wrap a, .wp_wrap a:visited, .wp_wrap a:hover, .wp_wrap a:active, .wp_wrap a:focus {
    text-decoration: none;
    text-decoration-line: none;
    -webkit-text-decoration: none;
    color: inherit;
}

/* 본문/Privacy 페이지의 텍스트 링크에는 underline 유지 (가독성·접근성) */
.privacy_container a,
.work_description a,
.des_cont a {
    text-decoration: underline;
    color: #1a73e8;
}

/* 모든 버튼/CTA 박스 안의 a 명시적으로 underline 제거 (안전망) */
.btn_box a, .work_btn a, .partners_btn a, .footer_utill a,
.tab_mnu a, .gnb a, .mnu_list a, .menu ul li a, .footer_info a {
    text-decoration: none !important;
}

/* iPhone notch 영역 보호 */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-left:  env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    #header .cm_inner {
        padding-top: env(safe-area-inset-top);
    }
    footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 시스템 폰트 fallback (웹폰트 로딩 실패 시 안정적) */
body, button, input, select, textarea {
    font-family:
        var(--font-no),
        -apple-system, BlinkMacSystemFont,
        "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "맑은 고딕",
        "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* iOS Safari 모바일 줌 방지 (input focus 시 16px 미만은 강제 줌) */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

/* iOS 100vh 버그 보정 (주소창 포함) */
#s_video .video_inner,
#s_video .vimeo_wrap,
#s_video video.movie {
    width: 100%;
    max-width: 100vw;
    height: auto;
}

/* 영상 모바일 대응 */
#s_video video.movie {
    object-fit: cover;
    -webkit-object-fit: cover;
}

/* 터치 디바이스에서 hover 효과 보정 */
@media (hover: none) and (pointer: coarse) {
    a:hover, button:hover, .work_container:hover {
        opacity: 1 !important;
    }
    .work_container .img_frame:hover .img_bg {
        transform: none !important;
    }
}

/* 모바일 가로 스크롤 방지 */
html, body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img {
    max-width: 100%;
    height: auto;
    -ms-interpolation-mode: bicubic; /* 구형 IE/Edge */
}

/* flexbox prefix 보강 (구형 사파리 9-) */
.wp_row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

/* 모바일에서 햄버거 등 아이콘 버튼만 터치 영역 확보 (텍스트 버튼은 padding 유지) */
@media (max-width: 768px) {
    .mo_mnu button,
    .ham_menu_btn button,
    .btn-open,
    #mnu_pop_cls,
    .pop_cls_btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
}

/* 캠퍼스/CTA 버튼 강제 inline-block (세로 늘어남 방지) */
#s_campus .btn_box a,
#s_inquiry .btn_box a,
#s_work .work_btn a,
#s_partners .partners_btn a,
#s_employment .btn_box a {
    display: inline-block !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
}

/* 모바일 헤더 sticky 안정화 */
#header {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 모바일에서 큰 폰트 줄임 - webplanet wp_responsive.css 보완 */
@media (max-width: 480px) {
    .cm_tit2 { font-size: 28px !important; line-height: 1.25; }
    .cm_tit3 { font-size: 22px !important; line-height: 1.3; }
    .cm_tit4 { font-size: 18px !important; }
    .sub_txt, .tit_des p { font-size: 14px !important; }
    .main_txt { font-size: 24px !important; }
}

/* Print(인쇄) CSS - 깔끔하게 */
@media print {
    #header, footer, #s_video, .top_btn_box,
    .mnu_main_pop, #mnu_pop, .ham_menu_btn { display: none !important; }
    body { color: #000 !important; background: #fff !important; }
    a { text-decoration: none !important; color: #000 !important; }
}

/* prefers-reduced-motion 사용자 대응 (애니메이션 최소화) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* prefers-color-scheme (다크모드 사용자 가독성) - 현재 라이트만 지원이지만 다크 사용자도 깨지지 않게 */
@media (prefers-color-scheme: dark) {
    body {
        background: #fff;  /* 강제 라이트 유지 */
        color: #1a1a1a;
        color-scheme: light;
    }
}

/* 작품 카드 hover 부드럽게 + 모바일 터치 피드백 */
.work_container .img_frame .img_bg {
    -webkit-transition: -webkit-transform .8s ease;
    transition: transform .8s ease;
}

/* 안드로이드 크롬: address bar fade 시 viewport 변동 안정화 */
@supports (height: 100dvh) {
    #s_video, #s_imgMain { min-height: auto; }
}

/* 한글 word-break (영어 단어가 줄 끊지 않도록 자연스럽게) */
p, h1, h2, h3, h4, h5, h6, li, td, th {
    word-break: keep-all;
    overflow-wrap: break-word;
    -ms-word-break: keep-all;
}

/* 작품 카드 메인 제목 라인 클램프 (긴 제목 처리) */
.work_inner .work_list li .work_container .main_tit h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    max-height: 2.8em;
}

/* 폼/버튼 터치 피드백 (높이 강제 안 함 - webplanet padding 유지) */
button, .btn_box a, .work_btn a, .partners_btn a {
    -webkit-tap-highlight-color: rgba(0,0,0,0.05);
}

/* 모바일 가로 모드 (landscape) */
@media (max-width: 900px) and (orientation: landscape) {
    #s_video { max-height: 80vh; overflow: hidden; }
}
