/**
 * FUFU 모바일 최적화 (≤767px 전용)
 * PC 기존 스타일 유지, 모바일만 보정
 */

/* Paperlogy 폰트 — 전 페이지 항상 로드 */
@font-face {
    font-family: 'Paperlogy';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-4Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Paperlogy';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-6SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Paperlogy';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-8ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}

@media (max-width: 767px) {

    /* ========== 1. 컨테이너 / 패딩 ========== */
    .container,
    .container-wrap,
    .nectar-recent-posts-single_featured .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
        max-width: 100% !important;
    }
    /* 풀 와이드 row 내부 좌우 패딩 보정 */
    .vc_row.full-width-section,
    .vc_row[data-vc-full-width] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .vc_row.full-width-section > .col,
    .vc_row[data-vc-full-width] > .col {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* ========== 2. 섹션 vertical rhythm ========== */
    .vc_row,
    section {
        padding-top: 56px !important;
        padding-bottom: 56px !important;
    }
    .vc_row.no-section-padding,
    .vc_row[data-no-section-padding] {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* ========== 3. 컬럼 스택 (모든 다중 컬럼 → 1열) ========== */
    .vc_row .wpb_column,
    .vc_row .vc_column_container {
        width: 100% !important;
        margin-bottom: 16px;
    }
    .vc_row .wpb_column:last-child,
    .vc_row .vc_column_container:last-child {
        margin-bottom: 0;
    }
    .vc_row .wpb_column .wpb_wrapper,
    .vc_column-inner {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* ========== 4. 이미지 ========== */
    img {
        max-width: 100%;
        height: auto;
    }
    .vc_single_image-wrapper img {
        width: 100% !important;
        height: auto !important;
    }

    /* ========== 5. 가로 스크롤 차단 ========== */
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }
    body, #wrapper, #ajax-content-wrap, #page-header-bg {
        max-width: 100vw;
    }

    /* ========== 6. 타이포 ========== */
    /* 본문 문단 */
    p, .wpb_text_column p, .wpb_wrapper p {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }
    /* h1~h3 */
    h1, .h1 { font-size: clamp(28px, 8vw, 40px) !important; line-height: 1.2 !important; }
    h2, .h2 { font-size: clamp(24px, 6.8vw, 32px) !important; line-height: 1.2 !important; }
    h3, .h3 { font-size: clamp(20px, 5.6vw, 26px) !important; line-height: 1.25 !important; }
    h4, .h4 { font-size: clamp(18px, 4.8vw, 22px) !important; line-height: 1.3 !important; }
    h5, .h5 { font-size: 16px !important; line-height: 1.4 !important; }
    h6, .h6 { font-size: 14px !important; line-height: 1.45 !important; }

    /* fufu-title 위젯이 자체 처리하므로 위 규칙 제외 */
    .fufu-title-wrap h1, .fufu-title-wrap h2,
    .fufu-title { font-size: inherit !important; }

    /* ========== 7. 버튼 ========== */
    .nectar-button,
    .vc_btn3,
    .vc_general,
    button.btn,
    .button,
    .nectar_btn {
        min-height: 52px !important;
        padding: 14px 24px !important;
        font-size: 15px !important;
        line-height: 1.2 !important;
    }
    /* 단독 CTA는 풀너비 */
    .vc_column_container > .vc_column-inner > .wpb_wrapper > .nectar-button-wrap,
    .single-cta { width: 100%; }
    .single-cta .nectar-button { width: 100%; display: flex; justify-content: center; align-items: center; }

    /* ========== 8. FUFU 컴포넌트 보정 ========== */
    /* 그리드 — 모바일 강제 1~2열 */
    .fufu-grid { gap: 12px !important; }
    /* 데코 이미지 모바일 숨김 (fufu-title 외에 다른 데코 패턴) */
    .fufu-deco, .fufu-decoration, .deco-only-pc { display: none !important; }

    /* 가맹문의 플로팅 버튼 — 너무 큰 경우 축소 */
    .fufu-floating, .floating-banner {
        width: 64px !important;
        right: 12px !important;
        bottom: 12px !important;
    }

    /* ========== 9. 헤더 / 메뉴 ========== */
    #header-outer { padding: 12px 0 !important; }

    /* ========== 10. 풋터 ========== */
    .fufu-footer, footer {
        padding: 32px 20px !important;
        text-align: center;
    }
    .fufu-footer p, footer p {
        font-size: 13px !important;
        line-height: 1.6 !important;
    }
}

/* ============================================
   2단계 통일 패스 — 좌우 20px / 폰트 5등급 / 칼럼 간격 통일
   ============================================ */
@media (max-width: 767px) {

    /* ===== 좌우 20px 강제 통일 ===== */
    body .container,
    body .container-wrap,
    body .vc_row-fluid,
    body .full-width-section,
    body .full-width-content {
        padding-left: 10px !important;
        padding-right: 10px !important;
        max-width: 100% !important;
    }
    body .vc_row[data-vc-full-width] {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    body .vc_row[data-vc-full-width] > .wpb_column,
    body .vc_row[data-vc-full-width] > .vc_column_container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    body #header-outer .container,
    body #footer-outer .container,
    body .fufu-footer {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* ===== 폰트 5등급 통일 (h1=30 / h2=24 / h3=20 / body=15 / caption=13) ===== */
    /* 제목 — Paperlogy 통일 */
    body h1, body .h1, body .vc_custom_heading h1,
    body h2, body .h2, body .vc_custom_heading h2,
    body h3, body .h3, body .vc_custom_heading h3,
    body h4, body h5, body h6,
    body .nectar-fancy-heading,
    body .wpb_heading {
        font-family: 'Paperlogy', 'Noto Sans KR', sans-serif !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        letter-spacing: -0.02em !important;
        margin-top: 0 !important;
    }
    body h1, body .h1, body .vc_custom_heading h1 { font-size: 30px !important; }
    body h2, body .h2, body .vc_custom_heading h2 { font-size: 24px !important; }
    body h3, body .h3, body .vc_custom_heading h3 { font-size: 20px !important; }
    body h4, body h5, body h6 { font-size: 18px !important; }

    /* 본문 + 칼럼 설명 통일 — Noto Sans KR */
    body p, body li,
    body .wpb_text_column p, body .wpb_text_column li,
    body .vc_column_container .wpb_text_column p,
    body .vc_column_container .wpb_text_column li,
    body .vc_column .wpb_wrapper p,
    body .vc_column .wpb_wrapper li {
        font-size: 15px !important;
        font-weight: 400 !important;
        line-height: 1.6 !important;
        letter-spacing: -0.01em !important;
    }

    /* 캡션/메타/스몰 */
    body small, body .caption, body figcaption {
        font-size: 13px !important;
        line-height: 1.5 !important;
        font-weight: 400 !important;
    }

    /* fufu-title / fufu-card-name 등 자체 처리 컴포넌트 제외 (.fufu-qual-title 등 모바일 별도 지정 컴포넌트 제외) */
    body .fufu-title-wrap *, body .fufu-title, body .fufu-title-line,
    body .fufu-card-name, body .fufu-card-status,
    body [class^="fufu-"][class*="title"]:not(.fufu-qual-title),
    body [class^="fufu-"][class*="name"] {
        font-size: revert !important;
        font-family: revert !important;
        line-height: revert !important;
        letter-spacing: revert !important;
    }

    /* ===== 칼럼 스택 시 vertical gap 통일 ===== */
    body .vc_row .wpb_column,
    body .vc_row .vc_column_container {
        margin-bottom: 24px !important;
    }
    body .vc_row .wpb_column:last-child,
    body .vc_row .vc_column_container:last-child {
        margin-bottom: 0 !important;
    }
    /* 칼럼 내부 텍스트 가운데 정렬 (단, 정렬 지정된 경우 제외) */
    body .vc_row .wpb_column .wpb_text_column:not([class*="text-left"]):not([class*="text-right"]) {
        text-align: center;
    }

    /* tit_l/tit_m/tit_s/con 내부 p, li 는 바깥에서 지정한 폰트크기 따라가도록 */
    body .tit_l p, body .tit_l li,
    body .tit_m p, body .tit_m li,
    body .tit_s p, body .tit_s li,
    body .con p, body .con li {
        font-size: inherit !important;
        font-weight: inherit !important;
        line-height: inherit !important;
        letter-spacing: inherit !important;
    }
}

/* ========== 360px 이하 미세 조정 ========== */
@media (max-width: 360px) {
    body .container, body .container-wrap,
    body .vc_row[data-vc-full-width] > .wpb_column {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    body h1, body .h1 { font-size: 26px !important; }
    body h2, body .h2 { font-size: 22px !important; }
    body h3, body .h3 { font-size: 18px !important; }
}
