/* 모바일 가로 넘침 해제 — 767px 이하에서만 동작한다.
   구 사이트는 최상위 래퍼가 1920px 고정이고 모바일 규칙이 없어 문서 폭이 뷰포트를 넘었다.
   기존 CSS 는 한 줄도 고치지 않고 여기서만 덮어쓴다. 768px 이상은 이 파일이 비어 있는 것과 같다. */

@media all and (max-width: 1023px) {

  /* ── 1. 문서 뿌리 ─────────────────────────────────────────── */
  html,
  body {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  
  body *:not(.swiper-wrapper):not(.swiper-notification) {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  
  img,
  video,
  iframe,
  canvas,
  svg,
  embed,
  object {
    max-width: 100% !important;
  }

  /* ── 4. 표 ───────────────────────────────────────────────
     넘치는 표는 «한 건도 없었다»(38지면 전수). 그래서 display 를
       바꾸지 않는다 — display:block 으로 바꾸면 칸 정렬이 깨진다.
       넘치는 표가 생기면 그때 그 표만 감싸 굴린다. */
  table {
    max-width: 100% !important;
  }

  /* ── 5. 긴 한 줄(코드·주소)도 자기 안에서 굴린다 ────────── */
  pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── 6. 가로로 배치된 줄은 접히게 한다 ──────────────────
     flex 한 줄에 여러 칸이 나란히 서면 좁은 화면에서 반드시 넘친다. */
  .container,
  .container-xl,
  .container-fluid,
  .row {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  
  html body #smart#smart #section05 div.wide .container,
  html body #smart#smart #section06 .position-relative .container .boxAll {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* ── 8. 제목의 nowrap 해제 ───────────────────────────────
     PC 에서 한 줄로 두려고 white-space:nowrap 을 건 제목이 좁은 화면에서
     그대로 가로로 뻗는다(680px 제목이 375 화면에서 잘린다). */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    white-space: normal !important;
  }

  /* ── 9. 푸터 오른쪽 끝에 띄워 둔 칸 ──────────────────────
     PC 좌표(left 320)로 절대배치돼 있어 화면 밖으로 나간다.
     모바일에서는 흐름 안으로 되돌린다. */
  html body footer.position-relative > div.position-absolute {
    position: static !important;
    width: auto !important;
    margin: 12px auto 0 !important;
    text-align: center;
  }
}
