/* ============================================================
   신일케미칼 - 모바일 반응형 스타일
   breakpoints: 1280px / 1024px / 768px / 480px
   ============================================================ */

/* ── 1280px 이하 ────────────────────────────────────────────── */
@media (max-width: 1280px) {
  :root { --inner-width: 100%; }
  .inner { padding: 0 30px; }
  .gnb-item > a { padding: 0 18px; font-size: 14px; }
}

/* ── 1024px 이하 ────────────────────────────────────────────── */
/* ── 1024px 이하 ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --header-height: 70px; }

  .hamburger { display: flex; z-index: 100002; }
  .hamburger:focus { outline: none !important; box-shadow: none !important; }
  
  /* 모바일 햄버거 스팬 색상 제어 */
  #header .hamburger span {
    background: #fff;
  }
  #header.header-scrolled .hamburger span,
  #header.header-open .hamburger span {
    background: #333;
  }
  
  /* 모바일 메뉴 활성화 시 헤더 스타일 */
  #header.mob-menu-open {
    z-index: 100001 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #header.mob-menu-open .logo {
    opacity: 0;
    visibility: hidden;
  }
  #header.mob-menu-open .hamburger span {
    background: #fff !important;
  }

  /* 모바일에서 PC용 전체메뉴 배경 가림 */
  .nav-bg { display: none !important; }

  #gnb {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: #fff;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: 100000;
    padding-top: var(--header-height, 70px);
    box-sizing: border-box;
    display: block !important;
  }
  #gnb.open { left: 0; }
  
  /* PC 데스크톱 flexbox 스타일 강제 오버라이드 (100px 격차 제거 및 100% 너비 확보) */
  .gnb-list {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    width: 100% !important;
  }
  
  .gnb-item {
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* 1뎁스 텍스트 가독성 확보 (컴팩트 여백 및 심플 보더) */
  #header #gnb .gnb-item > a {
    color: #222 !important;
    height: auto !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid #f2f2f2 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    background: #fff !important;
    display: block !important;
    line-height: normal !important;
    text-align: left !important;
  }
  #header #gnb .gnb-item > a::after { display: none !important; content: none !important; }
  #header #gnb .gnb-item > a:hover,
  #header #gnb .gnb-item.active > a,
  #header #gnb .gnb-item.open > a {
    color: var(--theme-orange, #f26522) !important;
  }

  /* 서브메뉴가 닫혔을 때는 패딩과 보더가 공간을 차지하지 않도록 0으로 설정 */
  .sub-menu {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: #fcfcfc !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
  }
  
  /* 서브메뉴가 열렸을 때만 안쪽 패딩과 보더 라인을 부여 */
  .gnb-item.open .sub-menu {
    max-height: 500px;
    padding: 8px 0 !important;
    border-bottom: 1px solid #eee !important;
  }
  
  /* 2뎁스 서브메뉴 가독성 확보 및 컴팩트 레이아웃 */
  #header #gnb .sub-menu li {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #header #gnb .sub-menu li a {
    padding: 10px 30px !important;
    color: #555 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    background: #fcfcfc !important;
    display: block !important;
    line-height: normal !important;
    text-align: left !important;
    transition: all 0.2s ease !important;
    border: none !important;
  }
  #header #gnb .sub-menu li a:hover {
    background: #f4f5f7 !important;
    color: var(--theme-orange, #f26522) !important;
    padding-left: 35px !important;
  }

  /* 모바일 오버레이 (z-index를 서브탭 9999보다 높은 99999로 설정) */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
  }
  .nav-overlay.show { display: block; }

  /* 헤더 우측 */
  .header-right .btn-admin { display: none; }

  /* 서브탭 */
  .sub-tab ul { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sub-tab li a {padding: 14px 20px;white-space: nowrap;}

  /* 게시판 테이블 */
  .board-table .hide-mobile { display: none; }
  .board-table td, .board-table th { padding: 10px 8px; font-size: 13px; }
}

/* ── 768px 이하 ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --header-height: 60px; }
  .inner { padding: 0 20px; }

  .page-hero { height: 180px; }
  .page-hero h2 { font-size: 24px; }

  .section { padding: 60px 0; }
  .section-title { font-size: 26px; }

  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }

  /* 게시판 검색 */
  .board-top { flex-direction: column; gap: 12px; align-items: flex-start; }
  .board-search { flex-wrap: wrap; }
  .board-search input { flex: 1; min-width: 150px; }

  /* 게시글 상세 */
  .view-title { font-size: 18px; }
  .view-meta { flex-wrap: wrap; gap: 10px; }
  .view-btn { flex-wrap: wrap; }

    /* 게시판 테이블 */
  .board-table td, .board-table th {padding: 8px 4px;font-size: 12px;}
  .board-table td.al{padding-left:0}
  .badge-status{
    padding: 2px 4px;
    font-size: 10px;
    font-weight: 400;
    margin-right: 0;
    min-width: 35px;
    text-align: center;
}
  .board-table td:nth-child(1), .board-table th:nth-child(1){
    width:50px !important
  }
  .board-table td:nth-child(3), .board-table th:nth-child(3){
    width: 85px !important;
    font-size:12px;
  }

  /* 스크롤 TOP */
  #scrollTop { bottom: 20px; right: 20px; width: 44px; height: 44px; font-size: 16px; }

  /* 서브탭 */
  .sub-tab {margin-bottom: 0px;background: none;border-bottom: none;}
}

/* ── 480px 이하 ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .logo-text { font-size: 17px; }
  .section-label { font-size: 11px; letter-spacing: 2px; }
  .section-title { font-size: 22px; }

  .pagination a { width: 34px; height: 34px; font-size: 13px; }

  .btn { padding: 10px 20px; font-size: 14px; }
}

/* ── 모바일 메뉴 햄버거 애니메이션 ─────────────────────────── */
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
