/* =====================================================================
   휴대폰 화면 (폭 767px 이하)
   - <meta name="viewport"> 가 있는 페이지에서만 실제로 적용됨
     (메타가 없는 페이지는 휴대폰도 980px 로 그려져 이 규칙에 안 걸림)
   - PC 화면은 전혀 건드리지 않음
   ===================================================================== */
/* 휴대폰 전용 '+' 더보기 메뉴는 PC에서 숨김 */
header ul.menu li.m_more { display: none; }

@media screen and (max-width: 767px) {

    /* ---------- 공통 ---------- */
    body, th, td, input, select, textarea, button { font-size: 15px; }
    header, .wrap { min-width: 0; }
    img, video, iframe { max-width: 100%; }
    br.pc { display: none; }                 /* PC용 줄바꿈은 휴대폰에서 자연스럽게 흘려보냄 */
    .sec_title br.pc, .big_title br.pc { display: inline; }

    /* ---------- 머리글: 로고 + 메뉴 4개 한 줄 ---------- */
    header, header .header_wrap { height: 52px; }
    header .header_wrap { padding: 0 12px; gap: 10px; }
    /* logo.png(162px)는 오른쪽 절반이 투명 여백 → 글자 부분(88px)만 보이게 잘라서 크게 */
    header .logo { position: static; transform: none; flex: none; width: 96px; overflow: hidden; }
    header .logo img { display: block; width: 177px; max-width: none; }   /* 96 × 162/88 */
    header .header_wrap { gap: 0; }
    header ul.menu { flex: 1; width: auto; justify-content: space-between; gap: 0; margin-left: 14px; }   /* 로고~햄버거 사이에 고르게 */
    header ul.menu li a { padding: 6px 0; font-size: 14px; white-space: nowrap; }
    header ul.menu li a:after { display: none; }
    header ul.menu li.pc_only { display: none; }

    /* '+' 더보기: 누르면 아래로 작은 목록 */
    header ul.menu li.m_more { display: block; position: relative; }
    /* 햄버거(세 줄) 아이콘: 메뉴 글자와 같은 색, 열리면 × */
    header .m_more_btn {
        position: relative;
        display: block;
        width: 30px;
        height: 30px;
        padding: 0;
        border: none;
        background: transparent;
        cursor: pointer;
    }
    header .m_bar,
    header .m_bar:before,
    header .m_bar:after {
        position: absolute;
        left: 5px;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: #0b0405;
        transition: transform 0.2s ease, background 0.2s ease, top 0.2s ease;
    }
    header .m_bar { top: 14px; }
    header .m_bar:before,
    header .m_bar:after { content: ''; left: 0; }
    header .m_bar:before { top: -6px; }
    header .m_bar:after { top: 6px; }
    header .m_more.open .m_bar { background: transparent; }
    header .m_more.open .m_bar:before { top: 0; transform: rotate(45deg); }
    header .m_more.open .m_bar:after { top: 0; transform: rotate(-45deg); }
    header .m_more_list {
        display: none;
        position: absolute;
        top: 42px;
        right: -4px;
        min-width: 132px;
        padding: 6px 0;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    }
    header .m_more.open .m_more_list { display: block; }
    header ul.menu .m_more_list li a { padding: 11px 18px; color: #333; font-size: 14px; }
    header ul.menu .m_more_list li a:hover { color: #c4553a; }

    /* ---------- 하단(푸터): 세로로 쌓기 ---------- */
    footer .footer { padding: 32px 16px 24px; }
    footer .footer .ci { margin-bottom: 20px; width: auto; height: 60px; }
    footer .footer .footerText { flex-direction: column; gap: 22px; }
    footer .footer .footerText > div > span { font-size: 13px; margin-bottom: 6px; }
    footer .footer .footerText > div > ul > li { align-items: flex-start; }
    footer .footer .footerText > div > ul > li span,
    footer .footer .footerText > div > ul > li p { font-size: 12.5px; line-height: 1.9; }
    footer .footer .footerText > div > ul > li span { flex: none; width: 96px; margin-right: 8px; }
    footer .link_area { padding: 14px 0; }
    footer .link_area .linkWrap { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 16px; }
    footer .link_area a { margin-right: 0; font-size: 12.5px; }
    [data-ml-modal] .modal-dialog { width: calc(100vw - 24px); max-height: 80vh; }
    [data-ml-modal] .modal-content { height: calc(80vh - 60px); font-size: 13px; }
    .up_scroll, .down_scroll { right: 8px; }
    .up_scroll img, .down_scroll img { width: 36px; height: 36px; }
    .up_scroll { bottom: 52px; }

    /* =================== 메인 =================== */
    section .section_wrap { padding: 0 16px; }
    section.section01 { padding-top: 52px; max-width: none; }
    /* 이벤트 배너(1920×400)는 좌우 여백이 커서, 휴대폰에선 가운데 내용(가로 300~1620, 세로 50~400)만 잘라 화면 꽉 채움 */
    section.section01 > div.hero_banner { margin: 10px 0 14px; padding: 0; }
    section.section01 > div.hero_banner a {
        display: block;
        width: 100%;
        aspect-ratio: 1320 / 350;
        overflow: hidden;
    }
    section.section01 > div.hero_banner img {
        display: block;
        width: 145.4545%;              /* 1920 / 1320 */
        max-width: none;
        height: auto;
        margin: -3.788% 0 0 -22.727%;  /* 위 50px, 왼쪽 300px 만큼 잘라냄 (÷1320) */
    }

    /* 소식·후기: 손가락으로 밀어 넘기기 (화살표는 숨김) */
    section.section01 > div.hero_proof { margin-bottom: 24px; padding: 0 12px; }
    .hero_proof .mp_box { padding: 10px 12px 12px; }
    .hero_proof .mp_head { gap: 8px; margin-bottom: 8px; }
    .hero_proof .mp_label { width: 58px; font-size: 11px; }
    .hero_proof .mp_title { font-size: 14.5px; }
    .hero_proof .mp_nav { display: none !important; }
    .hero_proof .mp_more,
    .hero_proof .mp_nav + .mp_more { margin-left: auto; font-size: 12.5px; }   /* 화살표를 숨겼으니 더보기를 오른쪽 끝으로 */
    .hero_proof .mp_news { grid-auto-columns: 82%; gap: 10px; }
    .hero_proof .mp_news img { width: 84px; }
    .hero_proof .mp_reviews { grid-auto-columns: 42%; gap: 10px; }
    .hero_proof .mp_card_title { font-size: 12.5px; }

    /* 키트 영상 → 정지 사진 (누르면 구매) */
    section.section01 > div.section_wrap { margin: 0 0 8px; padding: 0 12px; }
    section.section01 video.mainVisual { display: block; width: 100%; height: auto; }

    /* 섹션2: 장식 배경 숨김, 소개 영상 화면 폭 16:9 */
    /* 장식 배경: 휴대폰에서도 보이도록 크기·위치 재조정 (글·영상 뒤에 깔림) */
    section.section02 .bg { display: none; }        /* 절대위치 그림 대신 각 블록 배경으로 */
    section.section02 .benefit {
        background: url(../resource/img/main/bg_sec02left.png) no-repeat left -60px top -30px / 78% auto;
    }
    section.section02 .benefit.scd {
        background: url(../resource/img/main/bg_sec02right.png) no-repeat right -50px top -20px / 72% auto;
    }
    section.section04 { overflow: hidden; }
    section.section04 .bg { display: block; width: 230vw; max-width: none; z-index: 1; }
    section.section02 .video_content {
        margin: 24px 12px 0;
        width: auto;
        max-width: none;
        transform: none;
        box-shadow: none;
    }
    section.section02 .video_content iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; }
    section.section02 .benefit,
    section.section02 .benefit.scd {
        flex-direction: column;
        margin: 36px auto 0;
        padding: 0 16px;
        font-size: 15px;
    }
    section.section02 .benefit > img { width: 66%; margin-bottom: 18px; }
    section .text_area span.sec_title { margin-bottom: 0.8em; font-size: 1.45em; }
    section .text_area p { font-size: 0.93em; line-height: 1.7; }
    section.section02 .benefit.scd .text_area { margin: 0 0 16px !important; }
    section.section02 .benefit .benefit_list > img { display: none; }   /* 그림 속 작은 글씨 → 안 읽힘 */
    section.section02 .benefit .benefit_list .section_wrap { padding: 0; }
    section.section02 .benefit .benefit_list video.mainVisual { display: block; width: 100%; height: auto; }
    section.section02 .benefit.scd { margin-bottom: 40px; }

    /* 섹션3: 작품 영상은 빼고 버튼만, 4단계는 작은 동그라미 4개 한 줄 */
    section.section03 { padding: 40px 0 50px; background-size: 160% auto; background-repeat: repeat-y; }
    section.section03:after { display: none; }
    section.section03 .makers_area { display: block; margin-bottom: 0; padding: 0 16px; }
    section.section03 .makers_area .video_content03 { display: none; }
    section.section03 .ourClass { margin: 40px auto 0; padding: 0 16px; }
    section.section03 .ourClass .big_title { font-size: 1.45em; line-height: 1.35; }
    section.section03 .ourClass > p { font-size: 0.9em; }
    section.section03 .ourClass .link_area { display: block; margin: 22px auto; }
    section.section03 .ourClass .link_area a.link.big { display: block; width: 72%; margin: 0 auto; }
    section.section03 .ourClass .link_area .small_link { display: none; }  /* 연결된 곳 없는 그림 버튼 */
    section.section03 .ourClass .progress_area ul { height: auto; gap: 8px; }
    section.section03 .ourClass .progress_area ul li,
    section.section03 .ourClass .progress_area ul li:hover {
        flex: 1;
        width: auto;
        max-height: none;
        padding: 14px 4px;
        border-width: 3px;
        border-radius: 14px;
    }
    section.section03 .ourClass .progress_area ul li.pa01:hover { background-color: #f2ab9c !important; }
    section.section03 .ourClass .progress_area ul li.pa02:hover { background-color: #f8d3a0 !important; }
    section.section03 .ourClass .progress_area ul li.pa03:hover { background-color: #cdb5dd !important; }
    section.section03 .ourClass .progress_area ul li.pa04:hover { background-color: #92d6bf !important; }
    section.section03 .ourClass .progress_area ul li .prog_title > img.ico,
    section.section03 .ourClass .progress_area ul li:hover .prog_title > img.ico { display: block; width: 28px; margin-bottom: 4px; }
    section.section03 .ourClass .progress_area ul li .prog_title > img.ico_c,
    section.section03 .ourClass .progress_area ul li:hover .prog_title > img.ico_c { display: none; }
    section.section03 .ourClass .progress_area ul li .prog_title .name,
    section.section03 .ourClass .progress_area ul li:hover .prog_title .name { color: #fff; font-size: 12.5px; white-space: nowrap; }
    section.section03 .ourClass .progress_area ul li p { display: none; }

    /* 휴대폰은 제목·설명·버튼 가운데 정렬 */
    section .text_area { width: 100%; text-align: center; }
    section .text_area a,
    section.section04 .contactUs a.btn { margin-left: auto !important; margin-right: auto !important; }
    section.section04 .contactUs { text-align: center; }

    /* 섹션4: 기관 문의 */
    section.section04 { padding: 36px 0; }
    section.section04 .contactUs { display: block; padding: 0 16px; font-size: 15px; }
    section.section04 .contactUs .big_title { font-size: 1.3em; line-height: 1.4; }
    section.section04 .contactUs .text_area p { font-size: 0.9em; }
    section.section04 .contactUs .text_area a { margin-top: 1.2em; }
}

/* =====================================================================
   하위 페이지 공통 + 나의 강의실 (휴대폰)
   ===================================================================== */
@media screen and (max-width: 767px) {

    /* 하위 페이지 상단 띠(분홍): 낮게, 그림은 오른쪽에 작게 */
    .sub_visual { height: auto; margin-bottom: 24px; padding: 52px 0 0; }
    .sub_visual .section_wrap { padding: 22px 16px 20px; align-items: center; }
    .sub_visual .section_wrap .slogan span.bigSlg { margin-bottom: 4px; font-size: 22px; line-height: 1.35; }
    .sub_visual .section_wrap .slogan p { font-size: 13px; line-height: 1.6; }
    .sub_visual .section_wrap .slogan p br { display: none; }
    .sub_visual .section_wrap img.subVisual { flex: none; width: 34%; max-width: 140px; height: auto; margin-left: 8px; }

    /* 하단 '지금 시작해보세요' 배너 */
    .banner.bottom { height: auto; margin: 0 12px 40px; max-width: none; width: auto; padding: 22px 16px 20px; }
    .banner.bottom .bg { display: none; }
    .banner.bottom span { font-size: 16px; line-height: 1.5; }
    .banner.bottom a.btn { margin-top: 12px; padding: 10px 28px; font-size: 14px; }

    /* ---------- 강의실 코드 입력 화면 ---------- */
    /* 입력칸 글자는 16px 이상 — 작으면 아이폰이 입력할 때 화면을 확대해 버림 */
    .couponGate { min-height: 0; padding: 84px 20px 48px; }
    .couponGate .couponBox { width: 100%; }
    .couponGate .couponBox h1 { margin-bottom: 18px; }
    .couponGate .couponBox h1 img { max-width: 150px; }
    .couponGate .couponBox .gate_title { font-size: 21px; }
    .couponGate .couponBox .gate_desc { margin: 10px 0 14px; font-size: 14px; }
    .couponGate .couponBox .gate_desc br,
    .couponGate .couponBox .gate_notice br,
    .couponGate .couponBox .gate_hint br { display: none; }
    .couponGate .couponBox .gate_notice { margin: 0 0 18px; font-size: 13px; text-align: left; }
    .couponGate .couponBox .input_area input { font-size: 17px; padding: 12px 8px; border-radius: 0; }
    .couponGate .couponBox a.btn.enter { margin-top: 14px; padding: 13px 8px 11px; font-size: 16px; }
    .couponGate .couponBox .gate_error { font-size: 14px; }
    .couponGate .couponBox .gate_hint { margin-top: 18px; font-size: 13px; }

    /* ---------- 강의실 목록(허브) ---------- */
    .classroom_tools { justify-content: flex-start; margin-bottom: 22px; padding: 0 12px; }
    .classroom_tools a { padding: 7px 14px; font-size: 13px; }
    .classroom_area { margin-bottom: 30px; }
    .hub_band { margin: 0 12px 30px; }
    .hub_band_head { flex-wrap: wrap; margin-bottom: 12px; }
    .hub_band_head .kit_name { font-size: 17px; }
    .hub_band_head small { font-size: 12px; }
    .hub_band_cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .hub_band_cards .hub_card { width: auto; }
    .hub_card .thumb img { height: 104px; }
    .lang_badge { top: 6px; left: 6px; font-size: 11px; }
    .hub_card .thumb:after { font-size: 13px; }
    .hub_card .text_area { padding: 8px 9px 10px; }
    .hub_card .text_area .title { font-size: 13.5px; line-height: 1.4; min-height: 2.8em; }
    .hub_card .text_area a.play { margin-top: 8px; padding: 7px 0; font-size: 13px; }

    /* ---------- 강의실 상세: 강의 목록 ---------- */
    .course_nav { margin: 0 12px 14px; }
    .course_nav a.back_hub { padding: 7px 14px; font-size: 13px; }
    .classroom_area .course_box { margin: 0 12px 40px; }
    .classroom_area .course_head { display: block; }
    .classroom_area .course_head .course_title { font-size: 19px; line-height: 1.35; }
    .classroom_area .course_head .course_title small { font-size: 13px; }
    .classroom_area .course_head .course_materials { margin-top: 12px; gap: 6px; }
    .classroom_area .course_head .course_materials a { padding: 6px 12px; font-size: 13px; }
    .classroom_area ul.lesson_list { display: block; }
    .classroom_area ul.lesson_list li,
    .classroom_area ul.lesson_list li:nth-child(3n) { width: 100%; margin: 0 0 16px; }
    .classroom_area ul.lesson_list li .thumb img { height: auto; aspect-ratio: 16 / 9; }
    .classroom_area ul.lesson_list li .thumb:after { font-size: 16px; }
    .classroom_area ul.lesson_list li .text_area { padding: 12px 14px 14px; }
    .classroom_area ul.lesson_list li .text_area span.title { font-size: 15.5px; line-height: 1.45; min-height: 0; }
    .classroom_area ul.lesson_list li .text_area .btn_row { margin-top: 10px; }
    .classroom_area ul.lesson_list li .text_area a.play,
    .classroom_area ul.lesson_list li .text_area .noVideo_tag { padding: 7px 16px; font-size: 14px; }
    .classroom_area ul.lesson_list li .text_area .mat_list a {
        padding: 6px 0;                 /* 손가락으로 누르기 쉽게 */
        font-size: 14px;
        white-space: normal;            /* 긴 자료 이름은 줄바꿈 */
    }

    /* 유튜브 재생 창: 화면 폭 가득 */
    [data-ml-modal] .modal-dialog.videoPlay { width: calc(100vw - 16px); }
    [data-ml-modal] .modal-dialog.videoPlay .video_title { padding-right: 40px; font-size: 14px; line-height: 1.4; }
    [data-ml-modal] .modal-dialog.videoPlay .modal-close { top: -0.6em; right: -6px; }
}

/* =====================================================================
   소식·후기 / 코딩라운지 (같은 카드 목록) — 휴대폰
   ===================================================================== */
@media screen and (max-width: 767px) {

    /* 탭(All·뉴스·후기) 한 줄 + 검색칸은 아래 줄 전체 */
    .board_community ul { flex-wrap: wrap; margin: 0 12px; padding-bottom: 14px !important; gap: 8px; }
    .board_community ul li { width: auto; margin: 0; }
    .board_community ul li a { width: auto; }
    .board_community ul li a .text_area {
        width: auto;
        padding: 7px 18px;
        font-size: 14px !important;
        border: 1px solid #dcdcdc;
        border-radius: 5em;
    }
    .board_community ul li:last-child { flex: 0 0 100%; }

    /* 검색칸 (소식·라운지 공통): 화면 폭에 맞춤, 글자 16px (아이폰 확대 방지) */
    .codingLounge_list .filter_area { width: auto; margin: 0 12px 14px; }
    .board_community .filter_area { margin: 4px 0 0; }
    .codingLounge_list .filter_area .search_area .input_area_lounge,
    .codingLounge_list .filter_area .search_news_area .input_area_news {
        display: flex;
        align-items: center;
        gap: 0;                         /* 사이 공백 글자도 한 칸으로 쳐서 간격이 두 번 들어가므로 gap 대신 버튼 margin 사용 */
        margin-left: 0;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        font-size: 0;                   /* 입력칸·버튼 사이 &nbsp; 공백 제거 → 간격은 gap 으로만 */
    }
    .codingLounge_list .filter_area .search_area .input_area_lounge input,
    .codingLounge_list .filter_area .search_news_area .input_area_news input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        height: 40px;
        padding: 0 14px;
        box-sizing: border-box;
        font-size: 16px;
        border-color: #dcdcdc;
    }
    /* 돋보기 버튼: 기본 여백 없이 40×40 동그라미로 고정 → 화면 끝에서 잘리지 않음 */
    .codingLounge_list .filter_area .search_area .input_area_lounge button,
    .codingLounge_list .filter_area .search_news_area .input_area_news button {
        flex: 0 0 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px !important;
        height: 40px !important;
        padding: 0;
        margin: 0 0 0 8px;
        box-sizing: border-box;
        border-radius: 50%;
    }
    .codingLounge_list .filter_area .search_area .input_area_lounge button img,
    .codingLounge_list .filter_area .search_news_area .input_area_news button img { display: block; width: 20px; height: 20px; }

    /* 소식·후기 검색칸은 탭 목록(ul) 안에 있어서, 일부 휴대폰 브라우저가 폭을 넓게 계산함
       → 검색칸 폭을 '화면 폭 − 버튼(40) − 간격(8)'으로 못박아 라운지와 똑같이 보이게 */
    .board_community ul li:last-child { width: 100%; min-width: 0; max-width: 100%; }
    .board_community .filter_area,
    .board_community .search_news_area,
    .codingLounge_list .filter_area .search_news_area .input_area_news { width: 100%; min-width: 0; max-width: 100%; }
    .codingLounge_list .filter_area .search_news_area .input_area_news input,
    .codingLounge_list .filter_area .search_area .input_area_lounge input {
        flex: 0 0 auto;
        width: calc(100% - 48px) !important;
        max-width: calc(100% - 48px);
    }

    /* 카드: 한 줄에 2개, 사진은 2:1 비율로 (인라인 400×200 고정값 무시) */
    .codingLounge_list ul.thumb_list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; margin: 0 12px; }
    .codingLounge_list ul.thumb_list li,
    .codingLounge_list ul.thumb_list li:nth-child(3n) { width: auto; margin: 0; }
    .codingLounge_list ul.thumb_list li img {
        display: block;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 2 / 1;
        object-fit: cover;
    }
    .codingLounge_list ul li .text_area { padding: 8px 4px 4px; }
    .codingLounge_list ul li .text_area .search { display: none; }   /* 검색용 태그는 숨김 */
    .codingLounge_list ul li .text_area span.title { font-size: 13.5px; line-height: 1.4; height: 2.8em; }
    .codingLounge_list ul li .text_area p { font-size: 11.5px; }
    .thumb_list .text_area .writer { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* 아주 좁은 휴대폰 (360px 이하) */
@media screen and (max-width: 360px) {
    header ul.menu { margin-left: 18px; }
    header ul.menu li a { font-size: 13px; }
    header .logo { width: 84px; }
    header .logo img { width: 155px; }
}
