/*
 * 반응형(모바일/태블릿) 보정 스타일
 * - style.css 뒤에 로드하여 데스크탑 고정 레이아웃을 화면 폭에 맞게 덮어쓴다.
 * - 1024px 초과에서는 아무 규칙도 적용되지 않아 기존 데스크탑 화면은 그대로다.
 * - 중단점: 1024px 이하(태블릿/모바일 상단 바 + 햄버거 메뉴), 600px 이하(모바일 세부 조정)
 */

.header-toggle {
  display: none;
}

/* 페이지네이션: 모바일 전용 요소는 데스크탑에서 숨김 */
.pagination .m-only {
  display: none;
}

/* 언어 전환: 데스크탑은 우측 상단, 모바일은 햄버거 메뉴 안(.header-gnb-lang) */
.lang-switch {
  position: absolute;
  top: 20px;
  right: 30px;
  z-index: 2;
  font-size: 12px;
}

.lang-switch a {
  display: inline-block;
  padding: 6px 16px 6px 34px;
  border: 1px solid #d7d7d7;
  border-radius: 999px;
  color: #666;
  line-height: 1.4;
  background: #fff url('../images/comon/globe.svg') no-repeat 13px center;
  background-size: 14px 14px;
  transition: border-color .15s, color .15s;
}

.lang-switch a:hover,
.lang-switch a:focus-visible {
  border-color: #979797;
  color: #333;
  text-decoration: none;
}

.header-gnb-lang {
  display: none;
}

@media (max-width: 1024px) {
  /* 헤더: 좌측 고정 사이드바 -> 상단 바 */
  .header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
    left: 0;
    width: auto;
    padding: 0 20px;
    border-bottom: 1px solid #e7e7e7;
    background-color: #fff;
  }

  .header-logo {
    position: relative;
    z-index: 2;
    display: inline-block;
    padding: 14px 0;
    line-height: 0;
  }

  .header-logo img {
    width: 125px;
    height: auto;
  }

  .header-toggle {
    display: block;
    position: absolute;
    z-index: 2;
    right: 8px;
    top: 4px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
  }

  .header-toggle-bar,
  .header-toggle-bar:before,
  .header-toggle-bar:after {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #333;
    transition: transform .2s, opacity .2s;
  }

  .header-toggle-bar {
    position: relative;
    margin: 0 auto;
  }

  .header-toggle-bar:before,
  .header-toggle-bar:after {
    content: '';
    position: absolute;
    left: 0;
  }

  .header-toggle-bar:before {
    top: -7px;
  }

  .header-toggle-bar:after {
    top: 7px;
  }

  .header.is-open .header-toggle-bar {
    background-color: transparent;
  }

  .header.is-open .header-toggle-bar:before {
    top: 0;
    transform: rotate(45deg);
  }

  .header.is-open .header-toggle-bar:after {
    top: 0;
    transform: rotate(-45deg);
  }

  /* 메뉴: 열면 화면 전체를 덮는다(로고/닫기 버튼은 위에 유지) */
  .header-gnb {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    margin: 0;
    padding: 76px 28px 32px;
    border: 0;
    overflow-y: auto;
    background-color: #fff;
  }

  .header.is-open .header-gnb {
    display: block;
  }

  html.menu-open {
    overflow: hidden;
  }

  .lang-switch {
    display: none;
  }

  .header-gnb-lang {
    display: block;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e7e7e7;
  }

  .header-gnb-lang a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    color: #666;
  }

  .header-gnb-lv1 > li {
    margin-top: 0;
  }

  .header-gnb-lv1 > li > a {
    display: block;
    padding: 14px 0;
    font-size: 20px;
  }

  .header-gnb-lv2 > li:first-child {
    margin-top: 0;
  }

  .header-gnb-lv2 > li {
    margin-bottom: 0;
  }

  .header-gnb-lv2 > li > a {
    display: block;
    padding: 10px 0 10px 14px;
    font-size: 16px;
  }

  /* 본문/푸터: 고정 폭 -> 유동 폭 */
  .content,
  .footer,
  .main .content,
  .main .footer {
    width: auto;
    padding-left: 20px;
    padding-right: 20px;
  }

  .content {
    min-height: 0;
    word-break: keep-all;
  }

  .footer {
    margin: 60px auto 0;
    padding-bottom: 40px;
  }

  /* 푸터: 로고 / 사이버 윤리 신고센터 / Copyright 순서의 세 줄 (텍스트 노드는 order 0) */
  .footer-cont {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.8;
  }

  .footer-logo {
    order: -1;
    top: 0;
    padding-right: 0;
    margin-bottom: 10px;
  }

  .footer-link {
    order: -1;
    margin: 0 0 6px;
  }

  .footer-link .bar {
    display: none;
  }

  .footer-link a {
    display: inline-block;
    padding: 4px 0;
  }

  #mainFlash img,
  .contact-map-img,
  .heading-msg,
  .doc img {
    max-width: 100%;
    height: auto;
  }

  .heading-msg {
    display: block;
  }

  /* 페이지 제목 영역 */
  .news-heading,
  .bizoper-heading,
  .history-heading,
  .servicegame-heading,
  .contact-heading {
    height: auto;
    padding: 24px 0 20px;
  }

  /* 목록 */
  .news-list-category {
    position: static;
    margin-bottom: 8px;
    text-align: right;
  }

  .news-list-category a {
    padding: 4px 0;
  }

  /* 터치하기 쉬운 크기. 링크(a)와 비활성 next(span)가 같은 크기여야 한다 */
  .pagination {
    height: auto;
  }

  .pagination a,
  .pagination .more,
  .pagination .next-page {
    box-sizing: border-box;
    min-width: 28px;
    min-height: 34px;
    line-height: 32px;
  }

  .news-list-item-title {
    padding-left: 12px;
  }

  .bizoper-list-item-title {
    padding-left: 12px;
  }

  /* 본문 문서(보도자료 상세 등) */
  .doc {
    overflow-x: auto;
  }

  .doc iframe,
  .doc video {
    max-width: 100%;
  }

  /* 게임 소개: 절대 위치 배치를 세로 흐름으로 */
  .servicegame section[class^="servicegame-"] {
    position: static;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 28px 0;
    border-bottom: 1px solid #e7e7e7;
  }

  .servicegame section[class^="servicegame-"]:last-of-type {
    border-bottom: 0;
  }

  .servicegame h1[class^="servicegame-"] {
    position: static;
    width: auto;
    margin-bottom: 14px;
    text-align: left;
    font-size: 24px;
  }

  .servicegame div[class$="-text"] {
    width: auto;
  }

  .servicegame img[class^="servicegame-"] {
    position: static;
    display: block;
    width: auto;
    max-width: 200px;
    height: auto;
    margin: 0 0 16px;
  }

  /* 연락처 */
  .contact-map {
    margin-top: 32px;
  }

  .contact-map-util {
    position: static;
    margin-top: 8px;
    text-align: right;
  }

  /* 오류 페이지 */
  .errorpage {
    width: auto;
    max-width: 530px;
    padding: 60px 20px;
    box-sizing: border-box;
  }

  .errorpage-gif {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 600px) {
  /* 페이지 번호는 5개씩만 표시 (나머지 절반은 … 로 대체) */
  .pagination a.m-hide {
    display: none;
  }

  .pagination .more.m-only,
  .pagination a.m-only {
    display: inline-block;
  }

  /* 경영활동 목록: 제목을 전체 폭(최대 1줄)으로, 날짜는 그 아래로 */
  .bizoper-list-items,
  .bizoper-list-items tbody {
    display: block;
  }

  .bizoper-list-items colgroup {
    display: none;
  }

  .bizoper-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px;
  }

  .bizoper-list-item-title {
    flex: 0 0 100%;
    min-width: 0;
    padding: 0;
    white-space: normal;
  }

  /* 1줄 제한이라 어디서 끊겨도 무방하다. break-all이어야 아이콘 옆 첫 줄에서 바로 잘린다 */
  .bizoper-list-item-title a {
    display: -webkit-box;
    max-width: none;
    white-space: normal;
    word-break: break-all;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
  }

  .bizoper-list-item-title .icon-bizoper-pdf {
    margin-right: 10px;
  }

  .bizoper-list-item-time {
    width: auto;
    margin-top: 4px;
    padding: 0;
    font-size: 12px;
    text-align: left;
  }

  /* 보도자료 목록: 제목을 한 줄 전체 폭(최대 2줄)으로, 분류/날짜는 그 아래로 */
  .news-list-items,
  .news-list-items tbody {
    display: block;
  }

  .news-list-items colgroup {
    display: none;
  }

  .news-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px;
  }

  .news-list-item-title {
    order: 1;
    flex: 0 0 100%;
    min-width: 0;
    padding: 0;
    white-space: normal;
  }

  .news-list-item-title a {
    display: -webkit-box;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }

  .news-list-item-category,
  .news-list-item-time {
    width: auto;
    padding: 0;
    font-size: 12px;
    text-align: left;
  }

  .news-list-item-category {
    order: 2;
    margin-top: 4px;
  }

  .news-list-item-category:after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 10px;
    margin: 0 8px;
    vertical-align: middle;
    background-color: #e1e1e1;
  }

  .news-list-item-time {
    order: 3;
    margin-top: 4px;
  }

  /* 회사연혁: 폭이 좁아 연도를 별도 줄로 올리고 항목을 그 아래에 둔다. */
  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table th,
  .history-table td {
    display: block;
    width: auto;
  }

  .history-table th {
    padding-bottom: 6px;
    border-right: 0;
    border-bottom: 1px solid #e1e1e1;
    font-size: 22px;
  }

  .history-table td {
    padding: 10px 0 0;
  }

  .history-table td p {
    top: 0;
    margin-top: 6px;
  }

  .history-table td p:first-child {
    margin-top: 0;
  }

  /* 윤리규정/사이버 윤리 신고센터 */
  .etc .ml20 {
    margin-left: 10px;
  }

  .etc .ml40 {
    margin-left: 20px;
  }

  .etc-title {
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 24px;
  }

  .etc-txt-info {
    margin-top: 30px;
  }

  .etc-txt-info > li {
    display: block;
    margin-bottom: 36px;
  }

  .etc-txt-info > li strong {
    display: block;
    width: auto;
    margin-bottom: 12px;
    font-size: 22px;
  }

  .etc-txt-info > li dl {
    width: auto;
  }

  .etc-txt-info > li dl dd {
    width: auto;
    clear: left;
  }

  .servicegame h1[class^="servicegame-"] {
    font-size: 22px;
  }
}
