@charset "utf-8";

/* ===================================
   RESPONSIVE CSS FOR ZIKGU.INFO
   PC/Mobile unified responsive design
   =================================== */

/* 기본 초기화 및 공통 스타일 */
html {
  overflow-y: scroll;
  height: 100%;
  min-width: 320px;
  font-size: 16px; /* 기본 폰트 크기를 rem 기준으로 설정 */
  overflow-x: hidden; /* prevent browser-level horizontal scrollbar */
}

body {
  margin: 0;
  padding: 0;
  font-size: 0.875rem; /* 14px */
  font-family: 'Malgun Gothic', dotum, sans-serif;
  background: #f5f5f5;
  line-height: 1.5;
  overflow-x: hidden; /* ensure no horizontal overflow at body */
}

html,
h1,
h2,
h3,
h4,
h5,
h6,
form,
fieldset,
img {
  margin: 0;
  padding: 0;
  border: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 1em;
  font-family: 'Malgun Gothic', dotum, sans-serif;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

ul,
dl,
dt,
dd {
  margin: 0;
  padding: 0;
  list-style: none;
}

legend {
  position: absolute;
  margin: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
  text-indent: -9999em;
  overflow: hidden;
}

label,
input,
button,
select,
img {
  vertical-align: middle;
  font-size: 1em;
}

input,
button {
  margin: 0;
  padding: 0;
  font-family: 'Malgun Gothic', dotum, sans-serif;
  font-size: 1em;
}

input[type='submit'],
button {
  cursor: pointer;
}

textarea,
select {
  font-family: 'Malgun Gothic', dotum, sans-serif;
  font-size: 1em;
}

select {
  margin: 0;
}

p {
  margin: 0;
  padding: 0;
  word-break: break-all;
}

hr {
  display: none;
}

pre {
  overflow-x: scroll;
  font-size: 1.1em;
}

a {
  color: #000;
  text-decoration: none;
}

*,
:after,
:before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

/* 입력 요소 스타일 */
input[type='text'],
input[type='password'],
textarea {
  -webkit-transition: all 0.3s ease-in-out;
  -moz-transition: all 0.3s ease-in-out;
  -ms-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  outline: none;
  border: 1px solid #ddd;
  padding: 0.5rem;
  border-radius: 4px;
}

input[type='text']:focus,
input[type='password']:focus,
textarea:focus,
select:focus {
  -webkit-box-shadow: 0 0 5px #9ed4ff;
  -moz-box-shadow: 0 0 5px #9ed4ff;
  box-shadow: 0 0 5px #9ed4ff;
  border: 1px solid #558ab7 !important;
}

.placeholdersjs {
  color: #aaa !important;
}

/* ===================================
   레이아웃 구조
   =================================== */

/* Global base font size: slightly smaller sitewide */
html {
  font-size: 14px; /* reduce overall scale ~12.5% for rem-based sizes */
}

/* 메인 컨테이너 - 중앙 정렬 고정 너비 */
#wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  min-height: 100vh;
}

#container_wr {
  padding: 1rem 0;
}

#container {
  position: relative;
}

/* ===================================
   로그인 메시지 및 디버그 정보 완전 숨김
   =================================== */

#hd_login_msg {
  display: none !important;
}

/* 상단 시스템 메시지 완전 제거 */
.at-notice,
.at-alert,
.alert,
.notice,
.system-msg,
.debug-msg,
.update-msg,
#quick_menu,
.quick_menu {
  display: none !important;
}

/* 브라우저 기본 팝업도 숨김 */
#hd::before,
body::before,
html::before {
  display: none !important;
}

/* 절대 위치 메시지들도 숨김 */
*[style*='position: absolute'][style*='top: 0'],
*[style*='position: fixed'][style*='top: 0'] {
  display: none !important;
}

/* ===================================
   헤더 스타일
   =================================== */

#hd {
  position: relative;
  background: #212020;
  color: #fff;
}

#hd:after {
  display: block;
  visibility: hidden;
  clear: both;
  content: '';
}

#hd_h1 {
  position: absolute;
  font-size: 0;
  text-indent: -9999em;
  line-height: 0;
  overflow: hidden;
}

/* 상단 네비게이션 */
#tnb {
  background: #333;
  border-bottom: 1px solid #444;
}

#tnb .inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

#hd_qnb {
  float: right;
  display: flex;
  margin: 0;
  padding: 0;
  margin-left: auto;
}

#hd_qnb li {
  list-style: none;
}

#hd_qnb li a {
  display: block;
  padding: 0.5rem 1rem;
  color: #ccc;
  font-size: 0.8rem;
  border-right: 1px solid #444;
}

#hd_qnb li:last-child a {
  border-right: none;
}

#hd_qnb li a:hover {
  color: #fff;
  background: #444;
}

/* 헤더 래퍼 */
#hd_wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  position: relative;
}

/* 로고 - 왼쪽 정렬 */
#logo {
  flex: 0 0 auto;
  text-align: left;
}

#logo a {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
}

#logo .logoimg {
  vertical-align: top;
  max-height: 50px;
  width: auto;
}

#logo .fa-plane {
  margin-right: 0.5rem;
}

/* 헤더 로그인 영역 - 우측 정렬 */
.hd_login {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  align-items: center;
  margin-left: auto; /* push member menu to the right side */
}

.hd_login li {
  margin-left: 1rem;
}

.hd_login li a {
  color: #ccc;
  font-size: 0.9rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s;
}

.hd_login li a:hover {
  color: #fff;
  background: #444;
}

.hd_login .member_name {
  color: #fff;
  font-size: 0.9rem;
  margin-right: 0.5rem;
}

.hd_login .member_name strong {
  color: #9ed4ff;
}

/* ===================================
   네비게이션 스타일
   =================================== */

#gnb {
  background: #333;
  border-top: 1px solid #444;
}

.gnb_wrap {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

#gnb_1dul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gnb_1dli {
  position: relative;
}

.gnb_1da {
  display: block;
  padding: 1rem 1.5rem;
  color: #ccc;
  text-decoration: none;
  transition: all 0.3s;
}

.gnb_1da:hover {
  color: #fff;
  background: #444;
}

/* 하위메뉴 스타일 */
.gnb_2dul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  min-width: 200px;
}

.gnb_1dli:hover .gnb_2dul {
  display: block;
}

.gnb_2dul_box {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gnb_2dli {
  border-bottom: 1px solid #eee;
}

.gnb_2dli:last-child {
  border-bottom: none;
}

.gnb_2da {
  display: block;
  padding: 0.8rem 1rem;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.gnb_2da:hover {
  background: #f8f9fa;
  color: #007bff;
}

/* 하위분류 라벨 숨김 */
.gnb_1dli .bg {
  display: none;
}

/* 모바일 메뉴 버튼 */
.gnb_menu_btn {
  display: none;
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.5rem;
  padding: 1rem;
  cursor: pointer;
}

.gnb_menu_btn:hover {
  color: #fff;
}

/* 전체 메뉴 */
#gnb_all {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: #fff;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

#gnb_all.show {
  transform: translateX(0);
}

#gnb_all_bg {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9998;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#gnb_all_bg.show {
  opacity: 1;
}

.gnb_close_btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  z-index: 10000;
}

/* 모바일 로그인 영역 */
.mobile_login_area {
  padding: 2rem 1rem 1rem;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.mobile_login_btn,
.mobile_register_btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  margin: 0.3rem;
  background: #007bff;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.mobile_register_btn {
  background: #6c757d;
}

.mobile_login_btn:hover {
  background: #0056b3;
}

.mobile_register_btn:hover {
  background: #545b62;
}

.mobile_member_info {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #333;
}

/* 모바일 메뉴 리스트 */
.gnb_al_ul {
  padding: 1rem 0;
  margin: 0;
  list-style: none;
}

.gnb_al_li {
  position: relative;
  border-bottom: 1px solid #eee;
}

.gnb_al_a {
  display: block;
  padding: 1rem 1.5rem;
  color: #333;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.3s;
}

.gnb_al_a:hover {
  background: #f8f9fa;
  color: #007bff;
}

/* 모바일 서브메뉴 */
.btn_mobile_sub {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile_sub_menu {
  display: none;
  background: #f8f9fa;
  border-top: 1px solid #eee;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile_sub_menu li {
  border-bottom: 1px solid #eee;
}

.mobile_sub_menu li:last-child {
  border-bottom: none;
}

.mobile_sub_menu a {
  display: block;
  padding: 0.8rem 3rem;
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.mobile_sub_menu a:hover {
  background: #e9ecef;
  color: #007bff;
}

/* 모바일 유틸 메뉴 */
.mobile_util_menu {
  padding: 1rem 0 2rem;
  margin: 0;
  list-style: none;
  border-top: 2px solid #eee;
  background: #f8f9fa;
}

.mobile_util_menu li {
  border-bottom: 1px solid #e9ecef;
}

.mobile_util_menu li:last-child {
  border-bottom: none;
}

.mobile_util_menu a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.mobile_util_menu a:hover {
  background: #e9ecef;
  color: #007bff;
}

.mobile_util_menu i {
  margin-right: 0.5rem;
  width: 1.2rem;
  text-align: center;
}

/* 메뉴 열림 시 body 스크롤 방지 */
body.menu_open {
  overflow: hidden;
}

/* ===================================
   컨텐츠 영역
   =================================== */

#container_title {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8f8f8;
  border-left: 4px solid #007bff;
  font-size: 1.2rem;
  font-weight: bold;
}

/* ===================================
   메인 페이지 스타일
   =================================== */

/* 홈 상단 히어로 레이아웃 */
.home-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}
@media (min-width: 1025px) {
  .home-hero {
    grid-template-columns: 1fr 1fr;
  }
  .home-hero .newstape-content {
    max-width: 100%;
    margin: 0;
  }
}

.main_buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  padding: 0 1rem;
}

/* PC(데스크톱)에서도 2열 구성 (좌측 컬럼 내에서 2x2 카드) */
@media (min-width: 1025px) {
  .main_buttons {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

.btn_index {
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.25);
  position: relative;
  overflow: hidden;
}

/* 각 버튼별 개별 색상 테마 */
.btn_index:nth-child(1) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.25);
}

.btn_index:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 8px 30px rgba(240, 147, 251, 0.25);
}

.btn_index:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 8px 30px rgba(79, 172, 254, 0.25);
}

.btn_index:nth-child(4) {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  box-shadow: 0 8px 30px rgba(67, 233, 123, 0.25);
}

.btn_index::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 카드 내부 글로우 효과 */
.btn_index::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  transition: all 0.6s ease;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 0;
}

.btn_index:hover::after {
  width: 200px;
  height: 200px;
}

/* 텍스트와 배지가 글로우 효과 위에 나타나도록 */
.btn_index .btn_text,
.btn_index .w3-badge {
  position: relative;
  z-index: 1;
}

.btn_index:hover::before {
  left: 100%;
}

.btn_index:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.35);
}

/* 각 버튼별 호버 효과 */
.btn_index:nth-child(1):hover {
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn_index:nth-child(2):hover {
  box-shadow: 0 15px 40px rgba(240, 147, 251, 0.4);
}

.btn_index:nth-child(3):hover {
  box-shadow: 0 15px 40px rgba(79, 172, 254, 0.4);
}

.btn_index:nth-child(4):hover {
  box-shadow: 0 15px 40px rgba(67, 233, 123, 0.4);
}

.btn_index:active {
  transform: translateY(-1px);
}

.btn_index .btn_text {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: block;
}

.btn_index .w3-badge {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 45px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.btn_index:hover .w3-badge {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 뉴스테이프 스타일 */
.newstape {
  margin: 1.25rem 0;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 0.75rem;
  overflow: hidden;
  position: relative;
}

.newstape h2 {
  background: none;
  color: #222;
  margin: 0 0 0.5rem 0;
  padding: 0;
  border-radius: 0;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

/* 뉴스테이프 콘텐츠 - 리스트 형태 */
.newstape-content {
  position: relative;
  height: 265px !important; /* 고정 높이 설정 */
  overflow: hidden; /* 숨김 처리 */
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  padding: 0;
}

/* 롤링 컨테이너 */
.newstape-content .rolling-container {
  position: relative;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
}

/* Constrain width on desktop for a more compact look */
@media (min-width: 1025px) {
  .newstape-content {
    max-width: 720px;
    margin: 0 auto;
  }
}

/* 반응형 뉴스 블록 */
.news-block {
  background: #fff;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #eee;
  color: #333;
  line-height: 1.5;
  font-size: 0.85rem;
}

.news-block:last-child {
  border-bottom: none;
}

.news-block strong {
  color: #007bff;
  font-weight: 600;
  display: inline-block;
  margin: 0 0.5rem 0 0;
  font-size: 0.95rem;
}

.news-meta {
  display: inline-block;
  margin: 0;
}

.news-meta small {
  color: #666;
  font-size: 0.78rem;
}

.news-content {
  margin: 0.4rem 0 0.35rem;
  color: #333;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 뉴스 헤더: 이름/날짜 + 더보기 링크 한 줄 구성 */
.news-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.news-head-left {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}
.news-date small {
  color: #666;
  font-size: 0.78rem;
}

.news-more-link {
  color: #007bff;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}
.news-more-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* 데스크톱에서는 평가글 내용도 보이되, 한 줄로만 표기 (날짜 아래 한 줄) */
@media (min-width: 1025px) {
  .home-hero .news-content {
    display: -webkit-box !important;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.25rem;
  }
  .home-hero .news-block {
    padding: 0.55rem 0.6rem;
  }
}

/* ===================================
   최신글 목록 스타일
   =================================== */

.latest_top_wr {
  margin: 2rem 0;
  padding: 0 1rem;
  /* Ensure floated board list starts below previous sections */
  clear: both;
}

.latest_top_wr::after {
  content: '';
  display: block;
  clear: both;
}

.lt_wr {
  width: 49% !important;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.lt_wr_3col {
  width: 32% !important;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

/* 3단 최신글 반응형 스타일 */
@media (max-width: 1024px) {
  .lt_wr_3col {
    width: 49% !important;
    margin-left: 0 !important;
  }

  .lt_wr_3col:nth-child(odd) {
    margin-left: 0 !important;
  }

  .lt_wr_3col:nth-child(even) {
    margin-left: 2% !important;
  }
}

@media (max-width: 768px) {
  .lt_wr_3col {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-bottom: 1rem;
  }
}

.latest_wr {
  margin: 1rem 0;
  padding: 0 1rem;
}

/* ===================================
   푸터 스타일
   =================================== */

#ft {
  background: #333;
  color: #ccc;
  margin-top: 3rem;
  padding: 2rem 0;
}

#ft_wr {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

#ft_link,
#ft_company {
  margin-bottom: 1rem;
}

#ft_company h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #fff;
}

#ft_company .ft_info {
  line-height: 1.6;
  margin-bottom: 1rem;
  text-align: left;
}

#ft_company a {
  color: #9ed4ff;
  text-decoration: none;
}

#ft_company a:hover {
  color: #fff;
}

#ft_copy {
  border-top: 1px solid #555;
  padding-top: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

#top_btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
  z-index: 1000;
}

#top_btn:hover {
  background: #0056b3;
  transform: translateY(-2px);
}

/* 뉴스테이프 리스트 스타일 */
.newstape-content .news-block {
  opacity: 1;
  height: auto;
  min-height: auto;
  display: block;
}

/* 스크롤 표시 */
.newstape-content::-webkit-scrollbar {
  width: 4px;
}

.newstape-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.newstape-content::-webkit-scrollbar-thumb {
  background: #007bff;
  border-radius: 2px;
}

.newstape-content::-webkit-scrollbar-thumb:hover {
  background: #0056b3;
}

/* ===================================
   미디어 쿼리 - 태블릿
   =================================== */

@media (max-width: 1024px) {
  #wrapper {
    max-width: 768px;
    padding: 0 0.5rem;
  }

  #hd_wrapper {
    max-width: 768px;
    padding: 0.5rem;
    min-height: 70px;
  }

  #tnb .inner {
    max-width: 768px;
  }

  .gnb_wrap {
    max-width: 768px;
  }

  #logo .logoimg {
    max-height: 40px;
  }

  #gnb_1dul {
    flex-wrap: wrap;
  }

  .gnb_1da {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }

  .btn_index {
    max-width: none;
    width: 100%;
    padding: 1.5rem 1rem;
    font-size: 1rem;
  }
}

/* ===================================
   미디어 쿼리 - 모바일
   =================================== */

@media (max-width: 768px) {
  * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html {
    font-size: 14px;
    min-width: 0 !important; /* 최소 너비 제거 */
    overflow-x: hidden !important;
  }

  body {
    background: #f8f8f8;
    overflow-x: hidden !important; /* 가로 스크롤 방지 */
    width: 100vw !important;
    max-width: 100vw !important;
  }

  #wrapper {
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 0 0.5rem;
    box-shadow: none;
    box-sizing: border-box;
  }

  /* 상단 네비게이션 숨김 */
  #tnb {
    display: none;
  }

  /* 헤더 모바일 스타일 */
  #hd_wrapper {
    flex-direction: column;
    padding: 0.5rem;
    min-height: 60px;
  }

  #logo {
    order: 1;
    margin-bottom: 0.5rem;
  }

  #logo .logoimg {
    max-height: 35px;
  }

  /* 헤더 로그인 영역 */
  .hd_login {
    order: 2;
    justify-content: center;
    flex-wrap: wrap;
  }

  .hd_login li {
    margin: 0 0.5rem;
  }

  .hd_login li a {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

  /* 데스크톱 네비게이션 숨김 */
  #gnb {
    display: none;
  }

  /* 모바일 메뉴 버튼 표시 */
  .gnb_menu_btn {
    display: block;
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
  }

  /* 컨테이너 */
  #container_wr {
    padding: 0.5rem;
  }

  #container_title {
    margin: 0.5rem 0;
    padding: 0.8rem;
    font-size: 1.1rem;
  }

  /* 메인 버튼 모바일: 한 줄에 2개 */
  .main_buttons {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.8rem;
    margin: 1rem 0;
    padding: 0;
    width: 98% !important;
    max-width: 100% !important;
    overflow: hidden;
  }

  .btn_index {
    padding: 1.2rem 0.8rem;
    font-size: 0.9rem;
    min-height: 120px; /* 최소 높이 설정 */
    max-height: 140px; /* 최대 높이 제한 */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .btn_index .btn_text {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    line-height: 1.2;
    word-break: keep-all; /* 한글 단어 분리 방지 */
  }

  .btn_index .w3-badge {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
  }

  /* 히어로 레이아웃 모바일에서 세로 배치 */
  .home-hero {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    overflow: hidden; /* 오버플로우 방지 */
    width: 100% !important;
    max-width: 100% !important;
  }

  .hero-left,
  .hero-right {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* 뉴스테이프 모바일 */
  .newstape {
    margin: 1rem 0;
    padding: 0.8rem 0.5rem;
    order: 2; /* 카드 아래로 배치 */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .newstape h2 {
    font-size: 1.1rem;
    padding: 0.8rem;
  }

  .newstape-content {
    height: 200px !important; /* 모바일에서 더 컴팩트한 높이 */
    max-width: 100%;
    box-sizing: border-box;
  }

  .news-block {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .news-block strong {
    font-size: 0.9rem;
  }

  /* 모바일에서 평가 텍스트 한 줄 제한 */
  .news-content {
    display: -webkit-box !important;
    -webkit-line-clamp: 1 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    line-height: 1.3 !important;
    margin-top: 0.3rem !important;
  }

  /* 최신글 목록 모바일 */
  .latest_top_wr {
    margin: 1rem 0;
    padding: 0 0.5rem;
  }

  .lt_wr {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-bottom: 1rem;
  }

  .lt_wr_3col {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-bottom: 1rem;
  }

  /* 푸터 모바일 */
  #ft {
    margin-top: 2rem;
    padding: 1.5rem 0;
  }

  #ft_wr {
    padding: 0 0.5rem;
  }

  #top_btn {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }

  /* 폰트 크기 조정 */
  .ts_up {
    font-size: 1.1em;
  }
  .ts_up2 {
    font-size: 1.2em;
  }
}

/* ===================================
   미디어 쿼리 - 작은 모바일
   =================================== */

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  #hd_wrapper {
    padding: 0.3rem;
  }

  #logo .logoimg {
    max-height: 30px;
  }

  .hd_login li a {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }

  #container_wr {
    padding: 0.3rem;
  }

  #container_title {
    padding: 0.6rem;
    font-size: 1rem;
  }

  .btn_index {
    padding: 1rem 0.8rem;
    font-size: 0.9rem;
  }
}

/* ===================================
   유틸리티 클래스
   =================================== */

/* Header containers should span full width so right-aligned menus reach viewport edge */
#tnb .inner,
#hd_wrapper {
  max-width: 100% !important;
  width: 100% !important;
}

/* Remove legacy fixed min-width that causes horizontal scrollbars */
#hd,
#wrapper,
#ft {
  min-width: 0 !important;
}

/* Remove legacy fixed widths; keep containers fluid */
#gnb .gnb_wrap,
#container_wr,
#ft_wr {
  width: 100% !important; /* override old width:1200px */
}

/* Footer columns layout */
#ft_wr .ft_cols {
  display: grid;
  grid-template-columns: 1fr; /* mobile: stacked */
  gap: 1.25rem;
}
#ft_wr .ft_cnt {
  min-width: 0; /* allow content to shrink within grid cell */
}
#ft_wr .ft_exrate {
  overflow-x: auto; /* prevent overflow for wide tables */
}
@media (min-width: 1025px) {
  #ft_wr .ft_cols {
    grid-template-columns: repeat(3, 1fr); /* desktop: 3 columns side-by-side */
    align-items: start;
  }
}

/* Footer unified titles */
#ft_wr .ft_cnt h2 {
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  font-size: 1.05rem;
  line-height: 1.3;
  color: #e5e5e5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* Footer exchange table dark theme */
#ft_wr .ft_exrate table {
  width: 100%;
  border-collapse: collapse;
}
#ft_wr .ft_exrate thead th {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}
#ft_wr .ft_exrate th,
#ft_wr .ft_exrate td {
  padding: 6px 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #e0e0e0 !important;
  background: transparent !important;
}
#ft_wr .ft_exrate tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03) !important;
}
#ft_wr .ft_exrate .exrate-side {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #bdbdbd;
}

/* Footer copyright */
#ft_copy {
  text-align: center;
  padding: 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #c9c9c9;
}

.hidden {
  display: none !important;
}

.visible-mobile {
  display: none !important;
}

.visible-desktop {
  display: block !important;
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none !important;
  }

  .visible-mobile {
    display: block !important;
  }

  .visible-desktop {
    display: none !important;
  }
}

/* 텍스트 정렬 */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* 여백 */
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}

.p-1 {
  padding: 0.5rem;
}
.p-2 {
  padding: 1rem;
}
.p-3 {
  padding: 1.5rem;
}

/* 반응형 이미지 */
.img-responsive {
  max-width: 100%;
  height: auto;
}

/* W3.CSS 호환성 */
.w3-btn {
  border: none;
  padding: 8px 16px;
  display: inline-block;
  vertical-align: middle;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background-color: inherit;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
}

.w3-black {
  background-color: #000 !important;
  color: #fff !important;
}

.w3-badge {
  border-radius: 50%;
  font-size: 12px;
  color: #fff;
  background-color: #000;
  text-align: center;
  display: inline-block;
  min-width: 10px;
  padding: 4px 8px;
  font-weight: bold;
}

.w3-padding {
  padding: 8px 16px !important;
}

.w3-round-xlarge {
  border-radius: 16px !important;
}

.w3-large {
  font-size: 18px !important;
}

.w3-margin-left {
  margin-left: 16px !important;
}

.w3-white {
  color: #000 !important;
  background-color: #fff !important;
}

.msg_sound_only,
.sound_only {
  display: inline-block !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0;
  line-height: 0;
  border: 0 !important;
  overflow: hidden !important;
}
/* flair */
.okview {
  display: inline-block;
}
.noview {
  display: none;
}
.page-header {
  padding-bottom: 9px;
  margin: 40px 0 20px;
  border-bottom: 1px solid #eee;
}
.h1,
h1 {
  font-size: 26px;
}

/* ===================================
   Company list (comp_list.php) styles
   =================================== */
.comp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}
@media (max-width: 768px) {
  .comp-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
}

.btn_each_comp {
  display: block !important;
  width: 100% !important;
  text-align: left;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  color: #333 !important;
  border-radius: 8px;
  padding: 0.6rem 0.75rem 0.55rem !important;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.05s;
}
.btn_each_comp:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.btn_each_comp:active {
  transform: translateY(1px);
}

.btn_each_comp .w3-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  background: #e11d48 !important; /* ensure visible red */
}

.btn_each_comp .comp-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  padding-right: 2rem; /* keep space for badge */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comp-country {
  margin-top: 0.2rem;
}
.btn_each_comp .btn_small_txt {
  color: #666;
  font-size: 0.78rem;
}

/* ===================================
   Utility: horizontal scroll container for wide content (comp.php)
   =================================== */
.h-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}
/* Ensure table is wide enough on mobile so the local scrollbar appears */
@media (max-width: 768px) {
  .h-scroll > table,
  .h-scroll table {
    min-width: 900px; /* adjust if columns change */
  }
}
