/**
 * mobile-first.css v2 — 안전한 모바일 강제 오버라이드
 * 원칙: 최소 14px · 터치 44px · overflow 차단 · 구체적 선택자만 사용
 */

/* ══ 0. 전역 — 모든 해상도 ══ */
*, *::before, *::after { box-sizing: border-box; }
img, video { max-width: 100%; height: auto; }

/* ══ 1. 768px 모바일 ══ */
@media (max-width: 768px) {

  /* 가로 스크롤 원천 차단 */
  html { overflow-x: hidden; }
  body { overflow-x: hidden; max-width: 100vw; }
  .site-canvas, .l14-shell { overflow-x: hidden; }

  /* ── 이미지 오버플로우 차단 ── */
  img { max-width: 100% !important; height: auto !important; }

  /* ── input iOS zoom 방지 (font-size 16px) ── */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  input[type="date"],
  input[type="datetime-local"],
  textarea,
  select {
    font-size: 16px !important;
  }

  /* ── 버튼 최소 터치 타깃 44px ── */
  button:not([class*="nhx2"]):not([class*="l14"]):not([class*="fv4"]):not([aria-hidden]),
  [type="submit"],
  [type="button"] {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* ── 테이블 가로 스크롤 (내용은 줄바꿈 허용) ── */
  table {
    width: 100%;
    border-collapse: collapse;
  }
  .table-scroll, [class*="-table-wrap"], [class*="-tbl-wrap"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table td, table th {
    font-size: 14px !important;
    word-break: keep-all;
  }

  /* ── 수평 스크롤 네비 ── */
  [class*="-subnav"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  [class*="-subnav"]::-webkit-scrollbar { display: none; }

  /* ── 사이드바 숨김 (명확한 클래스만) ── */
  .pub-sidebar,
  .ev-sidebar,
  .biz-sidebar,
  .blc-sidebar,
  .pl-tree-col,
  .pl-body-col + .pl-tree-col,
  .ev-tree-col,
  .pub-tree-col {
    display: none !important;
  }

  /* ── 2열 그리드 → 1열 (구체적 클래스만) ── */
  .pub-body,
  .ev-body,
  .biz-detail-layout,
  .biz-row2,
  .biz-row3,
  .blc-page-layout,
  .ev-with-tree,
  .pl-with-tree,
  .re-content-wrap,
  .onl-content-wrap,
  .mkt-content-wrap,
  .sh-list-wrap,
  .wk-content-wrap,
  .sh-cart-wrap,
  .sh-order-wrap,
  .red-wrap-inner {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
  }

  /* ── 카드 그리드 2열로 축소 ── */
  .ev-view-card,
  .pub-cat-grid,
  .biz-grid,
  .biz-pro-grid,
  .sp-card-grid,
  .dl-card-grid,
  .tr-card-grid,
  .wk-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── 페이지 헤더 스택 ── */
  .pl-page-header-inner,
  .ev-page-hd,
  .biz-page-header,
  .pub-list-hd {
    flex-wrap: wrap !important;
  }

  /* ── 텍스트 오버플로우 방지 ── */
  .pub-latest-meta,
  .pub-row-meta,
  .ev-card-meta {
    display: none !important;
  }
  .pub-latest-title,
  .pub-row-title {
    white-space: normal !important;
    word-break: keep-all !important;
  }

  /* ── 페이지네이션 ── */
  .pub-pagination,
  .pl-pagination,
  .biz-pagination {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
}

/* ══ 2. 480px ══ */
@media (max-width: 480px) {

  /* 카드 그리드 1열 */
  .ev-view-card,
  .pub-cat-grid,
  .biz-grid,
  .biz-pro-grid,
  .ev-view-news,
  .sp-card-grid,
  .dl-card-grid,
  .tr-card-grid,
  .wk-card-grid {
    grid-template-columns: 1fr !important;
  }

  /* 히어로 압축 */
  .biz-hero,
  .pub-hero,
  .ev-hero,
  [class$="-hero"] {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}
