/* 플랫폼(Laravel) 전용 보정 스타일 — djpm_v25_4 에서 복사한 style.css/sub.css/home.css 와 분리해 두어,
   디자인 CSS 를 다시 복사해도 사라지지 않게 한다. layouts/app.blade.php 에서 sub.css 뒤에 로드. */

/* 한글이 단어 중간(예: "연/결", "진흥/원")에서 끊기지 않게 — 모바일 좁은 폭에서 어색한 줄바꿈 방지.
   긴 영문·URL 처럼 도저히 안 들어가는 경우에만 overflow-wrap 으로 끊는다. */
@media(max-width:720px){
    body{ word-break:keep-all; overflow-wrap:break-word; }
    /* 표는 칸이 좁아 keep-all 이면 가로로 넘치므로 기존 방식 유지 */
    table, table th, table td{ word-break:normal; }
}

/* 좁은 화면에서 페이지 이동 버튼·입력+버튼 한 줄이 화면 밖으로 밀리지 않게 */
.pagination{ flex-wrap:wrap; }
.form-input-row{ min-width:0; }
.form-input-row .form-input{ min-width:0; }
.search-row input{ min-width:0; text-overflow:ellipsis; }

/* iOS Safari: 입력칸 글자가 16px 미만이면 터치할 때 화면을 자동 확대하고, 포커스가 빠져도
   확대 상태가 남는다. 모바일에서는 입력류를 16px로 고정. */
@media(max-width:768px){
    input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=submit]):not([type=button]):not([type=hidden]),
    select, textarea{ font-size:16px !important; }
    /* 파일 선택 칸은 iOS 자동 확대 대상은 아니지만 다른 입력칸과 글자 크기를 맞춘다(가입 화면 사업자등록증 업로드) */
    input[type=file]{ font-size:16px !important; }
}

/* WebKit(iOS Safari): <select>가 가장 긴 option 글자 폭만큼 부모(form-group 등)의 scrollWidth 를 키워
   페이지가 가로로 넓어지는 문제 — (white-space:normal 이 실제로 해결, 나머지는 안전장치) */
select, .form-select{ max-width:100%; min-width:0; text-overflow:ellipsis; white-space:normal; }

/* ═══════════════ 모바일/태블릿 메뉴 (≤1100px) ═══════════════
   원본 디자인에는 모바일 메뉴가 없어 720px 이하에서 nav 가 숨겨지면 이동 수단이 없었다. */
.m-menu-btn, .m-menu, .m-menu-backdrop{ display:none; }
@media(max-width:1100px){
    .nav{ display:none; }
    .header-right{ gap:8px; }
    .m-menu-btn{
        display:flex; align-items:center; justify-content:center; flex:none;
        width:44px; height:44px; padding:0; border-radius:50%;
        background:var(--navy); border:none; cursor:pointer; -webkit-tap-highlight-color:transparent;
    }
    .m-menu-btn:focus-visible, .m-menu-close:focus-visible{ outline:3px solid var(--gold); outline-offset:2px; }
    .search-btn{ width:44px; height:44px; padding:0; justify-content:center; }
    .search-btn span{ display:none; }
    .m-menu-bars{ position:relative; display:block; width:20px; height:14px; }
    .m-menu-bars i{ position:absolute; left:0; right:0; height:2px; border-radius:2px; background:#fff; }
    .m-menu-bars i:nth-child(1){ top:0; }
    .m-menu-bars i:nth-child(2){ top:6px; }
    .m-menu-bars i:nth-child(3){ top:12px; }
    .m-menu-bars.is-x i:nth-child(1){ top:6px; transform:rotate(45deg); }
    .m-menu-bars.is-x i:nth-child(2){ opacity:0; }
    .m-menu-bars.is-x i:nth-child(3){ top:6px; transform:rotate(-45deg); }

    .m-menu-backdrop{
        display:block; position:fixed; top:0; right:0; bottom:0; left:0; z-index:300; background:rgba(14,22,33,.55);
        opacity:0; visibility:hidden; transition:opacity .22s ease, visibility 0s linear .22s;
    }
    .m-menu-backdrop.open{ opacity:1; visibility:visible; transition:opacity .22s ease; }
    .m-menu{
        display:flex; flex-direction:column; position:fixed; top:0; right:0; bottom:0; z-index:301;
        width:min(88vw, 380px); background:#fff; box-shadow:-12px 0 40px rgba(0,0,0,.18);
        transform:translateX(100%); visibility:hidden; transition:transform .25s ease, visibility 0s linear .25s;
        padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom);
    }
    .m-menu.open{ transform:translateX(0); visibility:visible; transition:transform .25s ease; }
    .m-menu-head{ display:flex; align-items:center; justify-content:space-between; height:60px; padding:0 16px 0 22px; border-bottom:1px solid var(--line); flex:none; }
    .m-menu-title{ font-size:17px; font-weight:900; color:var(--ink); letter-spacing:-.02em; }
    .m-menu-close{ display:flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; border:none; border-radius:50%; background:var(--navy); cursor:pointer; -webkit-tap-highlight-color:transparent; }
    .m-menu-body{ flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; padding:18px 18px 28px; display:flex; flex-direction:column; gap:18px; }
    .m-menu-cta{ width:100%; justify-content:center; height:50px; font-size:16px; }
    .m-menu-list{ list-style:none; margin:0; padding:0; border-top:1px solid var(--line); }
    .m-menu-list > li{ border-bottom:1px solid var(--line); }
    .m-menu-list summary, .m-menu-list .m-link{
        display:flex; align-items:center; justify-content:space-between; min-height:52px; padding:0 4px;
        font-size:16px; font-weight:800; color:var(--ink); cursor:pointer; list-style:none; text-decoration:none;
        -webkit-tap-highlight-color:transparent;
    }
    .m-menu-list summary::-webkit-details-marker{ display:none; }
    .m-menu-list summary::after{ content:''; width:8px; height:8px; margin-right:6px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(45deg); transition:transform .18s; flex:none; }
    .m-menu-list details[open] > summary::after{ transform:rotate(-135deg); margin-top:6px; }
    .m-menu-list details[open] > summary{ color:var(--teal-d); }
    .m-sub{ display:flex; flex-direction:column; padding:0 0 12px 4px; }
    .m-sub a{ display:flex; align-items:center; min-height:44px; padding:0 12px; border-radius:10px; font-size:15px; font-weight:600; color:var(--text); text-decoration:none; }
    .m-sub a:active, .m-sub a:hover, .m-menu-list .m-link:active{ background:var(--teal-s); color:var(--teal-d); }
    .m-menu-account{ display:flex; gap:10px; }
    .m-menu-account form{ flex:1; display:flex; }
    .m-acc-btn{ flex:1; justify-content:center; height:46px; width:100%; }
    .m-menu-contact{ display:flex; flex-direction:column; gap:4px; padding-top:6px; }
    .m-menu-contact a{ display:flex; align-items:center; gap:10px; min-height:44px; font-size:14px; font-weight:600; color:var(--muted); text-decoration:none; }
    .m-menu-contact svg, .m-menu-contact i{ width:16px; height:16px; color:var(--teal); flex:none; }
    body.m-menu-open{ overflow:hidden; }
}
@media(prefers-reduced-motion:reduce){
    .m-menu, .m-menu-backdrop{ transition:none !important; }
}

/* ═══════════════ 터치 영역 보정 (모바일/태블릿) ═══════════════
   링크·버튼이 손가락으로 누르기엔 너무 작은 곳(푸터 링크, 현재 위치 경로, 슬라이더 점·화살표 등) */
@media(max-width:1100px){
    .footer-grid a, .footer-links a, .footer-bottom a{ display:inline-flex; align-items:center; min-height:40px; }
    .footer-grid a{ display:flex; }
    .breadcrumb a, .breadcrumb span{ display:inline-flex; align-items:center; min-height:32px; }
    .toc-list a, .toc-nav a, .related-list a{ display:flex; align-items:center; min-height:40px; }
    .bbs-table td.bbs-title a{ min-height:36px; }
    .auth-footer a, .auth-options a, .auth-card a, .aside-info a{ display:inline-flex; align-items:center; min-height:36px; }
    .hsb-suggest button{ height:38px !important; padding:0 16px !important; }
    .sort-btn{ min-height:38px; padding:8px 4px; }
    .slider-prev, .slider-next, .slider-pause{ width:40px !important; height:40px !important; }
    .sdot{ position:relative; }
    .sdot::after{ content:''; position:absolute; top:-14px; bottom:-14px; left:-6px; right:-6px; }
    .hsb-input-row input, .search-row input{ min-height:40px; }
}

/* ═══════════════ 브라우저 공통 보정 ═══════════════ */
/* iOS Safari: 가로 회전 시 글자가 자동으로 커지는 것 방지 */
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
/* 움직임 줄이기 설정을 쓰는 사용자에게는 부드러운 스크롤 끄기 */
@media(prefers-reduced-motion:reduce){ html{ scroll-behavior:auto; } }
/* 모바일: 플로팅 버튼이 내용을 덜 가리고 iPhone 홈 인디케이터와 겹치지 않게 */
@media(max-width:720px){
    .chat-float{ right:14px; bottom:calc(16px + env(safe-area-inset-bottom)); gap:8px; }
    .chat-btn{ height:44px; padding:0 16px; }
}
body.m-menu-open .chat-float{ display:none; }

/* ═══════════════ 모바일/터치 화면 디자인 보강 (2026-10-21) ═══════════════ */

/* 1) 터치 기기에는 hover 가 없어, 데스크톱에서 마우스를 올려야 보이던 카드 배경 사진이 영원히 안 보였다
      → 터치 기기(hover:none)에서는 기본으로 은은하게 깔아 준다(글자 대비는 흰색 덮개로 유지). */
@media (hover:none){
    .hc-char, .sc-bg, .cat-bg{ opacity:1 !important; }
    .hc-char::after{ background:rgba(255,255,255,.88) !important; }
    .sc-bg::after{ background:rgba(255,255,255,.92) !important; }
    .cat-bg::after{ background:rgba(255,255,255,.86) !important; }
    .hc-desc, .sc-desc{ color:var(--text); }
    .highlight-card .hc-title, .cat-card .cat-name{ text-shadow:0 0 8px rgba(255,255,255,.9); }
}

/* 2) 업체 대표 이미지(로고)가 없을 때: no-img 대신 "인쇄마켓 아이콘 + 업체명" (x-company-image 컴포넌트) */
.co-img{ display:block; }
.co-img.is-logo{ object-fit:contain; background:#fff; padding:14px 20px; box-sizing:border-box; }
.co-ph{
    width:100%; height:100%; box-sizing:border-box;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
    padding:14px; text-align:center;
    background:linear-gradient(160deg,#f7f9fa 0%,#e6f7f5 100%);
}
.co-ph img.co-ph-mark{ width:44px; height:44px; flex:none; object-fit:contain; filter:none; transform:none; }
.co-ph-name{
    max-width:100%; font-size:16px; font-weight:800; color:var(--ink); line-height:1.3; letter-spacing:-.03em;
    word-break:keep-all; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.co-ph-cap{ font-size:11px; font-weight:700; color:var(--teal-d); letter-spacing:.02em; }
.co-ph--thumb{ gap:4px; padding:6px; }
.co-ph--thumb img.co-ph-mark{ width:26px; height:26px; }
.co-ph--thumb .co-ph-name{ font-size:10.5px; letter-spacing:-.04em; }
.comp-thumb .co-img.is-logo{ padding:4px; }

/* 3) 모바일 공지 표 → 읽기 좋은 목록(구분·날짜 한 줄, 제목은 아래 크게) */
@media(max-width:720px){
    #homeBoardTable, #homeBoardTable tbody{ display:block; }
    #homeBoardTable thead{ display:none; }
    #homeBoardTable tr{ display:grid; grid-template-columns:1fr auto; grid-template-areas:"kind date" "title title"; gap:4px 12px; padding:14px 2px; }
    #homeBoardTable td{ padding:0; border:0; }
    #homeBoardTable td:first-child{ grid-area:kind; width:auto; font-size:12px; }
    #homeBoardTable td.title{ grid-area:title; font-size:15px; font-weight:700; line-height:1.5; }
    #homeBoardTable td.date{ grid-area:date; width:auto; text-align:right; font-size:12px; }
    #homeBoardTable td.views{ display:none; }
}

/* 4) 모바일 푸터: 링크 묶음을 2열로(세로로 길게 늘어지던 것 단축), 소개 블록은 전체 폭 */
@media(max-width:720px){
    .footer-grid{ grid-template-columns:1fr 1fr; gap:24px 16px; }
    .footer-grid > :first-child{ grid-column:1 / -1; }
}

/* 홈 검색창: 아주 좁은 화면(320px)에서 안내 문구가 버튼 밑으로 겹치지 않게 줄임표 */
.hsb-input-row input{ text-overflow:ellipsis; }
@media(max-width:360px){ .hsb-ico{ display:none; } .hsb-input-row{ padding-left:16px !important; } }

/* ═══════════════ 업체 대표 이미지: 로고 없는 업체 = 인쇄마켓 로고 + 상호 (2026-10-21) ═══════════════ */
/* 업체 상세 상단 */
.company-hero-img.is-logo, .company-hero-img.is-empty{ height:auto; background:#fff; }
.company-hero-img.is-logo{ display:flex; align-items:center; justify-content:center; min-height:240px; padding:36px 28px; box-sizing:border-box; }
.company-hero-img.is-logo img.co-img{ width:auto; height:auto; max-width:min(100%,520px); max-height:200px; object-fit:contain; filter:none; padding:0; background:transparent; }
.company-hero-img.is-empty{ height:260px; }
.co-ph--hero{ gap:14px; }
.co-ph--hero img.co-ph-mark{ width:72px; height:72px; }
.co-ph--hero .co-ph-name{ font-size:28px; }
.co-ph--hero .co-ph-cap{ font-size:13px; }
@media(max-width:720px){
    .company-hero-img.is-logo{ min-height:180px; padding:28px 20px; }
    .company-hero-img.is-logo img.co-img{ max-height:150px; }
    .company-hero-img.is-empty{ height:210px; }
    .co-ph--hero .co-ph-name{ font-size:22px; }
    .co-ph--hero img.co-ph-mark{ width:56px; height:56px; }
}
/* 홈 참여업체 목록: 로고(위) / 상호(아래) 카드 */
.company-card{ flex-direction:column !important; align-items:stretch !important; gap:0 !important; padding:0 !important; min-height:0 !important; text-align:center; }
.company-card .comp-thumb{ width:100%; height:130px; border-radius:0; background:#fff; border-bottom:1px solid var(--line); }
.company-card .comp-thumb .co-img.is-logo{ padding:14px 18px; }
.company-card .comp-thumb .co-img.is-photo{ object-fit:cover; }
.company-card .co-ph--logo{ background:linear-gradient(160deg,#f7f9fa 0%,#e6f7f5 100%); }
.company-card .co-ph--logo img.co-ph-mark{ width:52px; height:52px; }
.company-card .comp-name{ font-size:17px; font-weight:900; color:var(--ink); letter-spacing:-.02em; line-height:1.35; padding:14px 14px 16px; word-break:keep-all; overflow-wrap:break-word; }
@media(max-width:720px){
    .company-grid{ grid-template-columns:repeat(2, minmax(0,1fr)) !important; gap:12px !important; }
    .company-card .comp-thumb{ height:104px; }
    .company-card .co-ph--logo img.co-ph-mark{ width:42px; height:42px; }
    .company-card .comp-name{ font-size:15px; padding:12px 10px 14px; }
}

/* ── 업체 상세: 상담 정보(연락처 링크 + SNS 아이콘) ───────────────────────────── */
.contact-item a.contact-link{ color:inherit; text-decoration:none; }
.contact-item a.contact-link:hover strong{ color:var(--teal-d); text-decoration:underline; }
.contact-item div{ min-width:0; }
.contact-item strong, .contact-item a strong{ overflow-wrap:anywhere; }
.contact-item .contact-url{ font-size:14px; font-weight:800; color:var(--teal-d); text-decoration:underline; text-underline-offset:2px; overflow-wrap:anywhere; }
.sns-block{ margin-top:18px; padding-top:16px; border-top:2px solid var(--off-2); }
.sns-title{ font-size:12px; font-weight:800; color:var(--muted); margin-bottom:10px; }
.sns-icons{ display:flex; flex-wrap:wrap; gap:10px; }
.sns-btn{ width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; transition:transform .15s, box-shadow .15s; box-shadow:0 1px 3px rgba(0,0,0,.12); }
.sns-btn:hover{ transform:translateY(-2px); box-shadow:0 4px 10px rgba(0,0,0,.18); }
.sns-btn svg{ width:24px; height:24px; display:block; }
.sns-kakao{ background:#FEE500; }
.sns-naver{ background:#03C75A; }

/* ═══════════════ 로고 없는 업체: 상호가 주(主) — 상호 크게, 마크는 작게 (2026-10-21) ═══════════════ */
.co-ph{ gap:8px; padding:16px 18px; }
.co-ph img.co-ph-mark{ width:30px; height:30px; opacity:.9; }
.co-ph-name{ font-size:24px; font-weight:900; line-height:1.25; letter-spacing:-.04em; -webkit-line-clamp:3; }
.co-ph-cap{ font-size:11px; }
.co-ph--hero{ gap:10px; }
.co-ph--hero img.co-ph-mark{ width:44px; height:44px; }
.co-ph--hero .co-ph-name{ font-size:38px; }
.co-ph--hero .co-ph-cap{ font-size:13px; }
.co-ph--logo{ padding:10px 12px; }
.co-ph--logo img.co-ph-mark, .company-card .co-ph--logo img.co-ph-mark{ width:26px; height:26px; }
.co-ph--logo .co-ph-name{ font-size:21px; -webkit-line-clamp:3; }
.company-card .comp-thumb:has(.co-ph--logo){ height:150px; border-bottom:0; }
.co-ph--thumb .co-ph-name{ font-size:12px; }
@media(max-width:720px){
    .co-ph-name{ font-size:20px; }
    .co-ph--hero .co-ph-name{ font-size:28px; }
    .co-ph--hero img.co-ph-mark{ width:38px; height:38px; }
    .co-ph--logo .co-ph-name{ font-size:17px; }
    .company-card .comp-thumb:has(.co-ph--logo){ height:116px; }
    .co-ph--logo img.co-ph-mark, .company-card .co-ph--logo img.co-ph-mark{ width:22px; height:22px; }
}

/* 홈 카드: 한 줄에 로고 있는 카드/없는 카드가 섞여도 높이가 같게(없는 쪽 박스가 남는 높이를 채움) */
.company-card .comp-thumb:has(.co-ph--logo){ flex:1; height:auto; min-height:116px; }
@media(min-width:721px){ .company-card .comp-thumb:has(.co-ph--logo){ min-height:150px; } }

/* 업체 상세: 홈페이지는 주소가 길어 상담 목록과 별도 버튼으로 */
.home-link-btn{ display:flex; align-items:center; gap:12px; margin-top:16px; padding:12px 14px; border:1.5px solid var(--teal); border-radius:var(--r-md); background:var(--teal-s); color:var(--teal-d); text-decoration:none; min-width:0; transition:.15s; }
.home-link-btn:hover{ background:var(--teal); color:#fff; }
.home-link-btn > i, .home-link-btn > svg{ width:20px; height:20px; flex:none; }
.home-link-btn .hl-ext{ width:16px; height:16px; opacity:.7; }
.home-link-btn .hl-text{ display:flex; flex-direction:column; min-width:0; flex:1; }
.home-link-btn .hl-text b{ font-size:14px; font-weight:900; }
.home-link-btn .hl-text em{ font-style:normal; font-size:12px; opacity:.85; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.home-text-note{ margin-top:14px; font-size:13px; color:var(--muted); line-height:1.6; overflow-wrap:anywhere; }
.home-text-note b{ color:var(--ink); margin-right:4px; }

/* 업체 목록 카드(인쇄·디자인)의 "전화·카카오톡·이메일 상담 가능" 줄 — 이 줄은 원본 디자인에 스타일이 없어
   lucide 아이콘이 기본 크기(24px)로 커 보이던 것을 글자 크기에 맞춘다(2026-10-30). */
.cgc-channel{ display:flex; align-items:center; gap:6px; }
.cgc-channel svg, .cgc-channel i{ width:14px; height:14px; flex:none; color:var(--teal); }
