/*
 * HANSCNC site quality layer
 * 기존 Vertex/Beaver Builder 레이아웃은 유지하고 글자·표·미디어·메뉴만 보정합니다.
 */

:root {
  --hans-font-sans: "Pretendard Variable", Pretendard, -apple-system,
    BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR",
    "Segoe UI", sans-serif;
  --hans-text: #18212b;
  --hans-muted: #5b6673;
  --hans-line: #dfe4ea;
  --hans-focus: #1769aa;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--hans-font-sans) !important;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  color: var(--hans-text);
  overflow-wrap: break-word;
}

p,
li,
td,
th,
label,
input,
select,
textarea {
  line-height: 1.65;
}

h1,
h2,
h3,
h4,
h5,
h6,
#top-menu .nav a {
  font-family: var(--hans-font-sans) !important;
  word-break: keep-all;
}

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

img {
  height: auto;
}

iframe[src*="youtube.com"],
iframe[src*="youtube-nocookie.com"],
iframe[src*="youtu.be"] {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  background: #0b0e12;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  vertical-align: middle;
}

th {
  text-align: left;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hans-focus), transparent 35%);
  outline-offset: 3px;
}

/* 기존 헤더 크기와 위치를 유지하면서 중복 인라인 CSS를 캐시 가능한 파일로 이동. */
#top-area,
body.home #top-area {
  padding-top: 55px !important;
  padding-bottom: 55px !important;
  min-height: 0 !important;
  height: auto !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

#top-area .container {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

#top-area h1,
#top-area h1.title,
#top-area .hanscnc-page-banner-title {
  color: #f00 !important;
  font-size: clamp(22px, 6vw, 32px) !important;
  line-height: 1.12 !important;
  padding: 0 !important;
  letter-spacing: -0.2px;
  max-width: 980px;
  margin: 0 auto !important;
}

#top-area .hanscnc-page-banner-title {
  font-family: var(--hans-font-sans) !important;
  font-weight: 700;
  text-align: center;
  word-break: keep-all;
}

#slider .et-slide,
.et-slide {
  min-height: 320px !important;
  height: auto !important;
}

#top-menu {
  padding: 10px 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

#et-logo img {
  height: 34px !important;
  width: auto !important;
}

#top-menu .nav > li {
  margin: 0 10px !important;
}

#top-menu .nav > li > a {
  position: relative;
  padding: 8px 2px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px;
  opacity: 0.95;
}

#top-menu .nav > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.85;
  transition: width 0.25s ease;
}

#top-menu .nav > li > a:hover::after,
#top-menu .nav > li.current_page_item > a::after,
#top-menu .nav > li.current-menu-item > a::after,
#top-menu .nav > li.current-menu-ancestor > a::after {
  width: 100%;
}

#top-menu .nav ul {
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

#top-menu .nav ul li a {
  padding: 10px 14px !important;
  font-weight: 600 !important;
}

/*
 * 스크롤 후 고정 메뉴를 본문 읽기에 방해되지 않는 56px 바로 축소합니다.
 * Vertex가 자체적으로 붙이는 et-fixed 클래스를 사용하므로 레이아웃과 URL은 변경하지 않습니다.
 */
#top-menu.et-fixed {
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 !important;
  transition: height 0.18s ease, min-height 0.18s ease, box-shadow 0.18s ease;
}

#top-menu.et-fixed > .container {
  height: 56px !important;
  min-height: 56px !important;
  padding-top: 0 !important;
}

#top-menu.et-fixed .hanscnc-header-cta {
  display: none !important;
}

#top-menu.et-fixed nav {
  margin: 0 !important;
  padding: 0 !important;
}

#top-menu.et-fixed .nav > li > a {
  padding-top: 17px !important;
  padding-bottom: 17px !important;
}

#top-menu.et-fixed #et_mobile_nav_menu {
  box-sizing: border-box;
  height: 56px !important;
  padding: 5px 0 !important;
}

#top-menu.et-fixed #et_mobile_nav_menu .et_mobile_menu {
  top: 54px !important;
}

body.hanscnc-compact-header {
  padding-top: 56px !important;
}

/* 드롭다운 여부를 텍스트 기호로 일관되게 표시해 별도 아이콘 파일 요청을 없앱니다. */
#top-menu .menu-item-has-children > a {
  padding-right: 15px !important;
}

#top-menu .menu-item-has-children > a::before {
  content: "";
  position: absolute;
  right: 1px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  opacity: 0.75;
}

.tagline,
#top-area .tagline,
#pre-footer .tagline,
#top-area .container .tagline,
#top-area p.tagline,
#top-area h2.tagline,
#main-footer .tagline,
#top-area .et-description,
#top-area .et-description .tagline {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 980px) {
  #slider .et-slide,
  .et-slide {
    min-height: 280px !important;
  }
}

@media (max-width: 767px) {
  #top-area,
  body.home #top-area {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }

  #top-area h1,
  #top-area h1.title,
  #top-area .hanscnc-page-banner-title {
    font-size: clamp(28px, 7vw, 40px) !important;
    line-height: 1.18 !important;
  }

  #slider .et-slide,
  .et-slide {
    min-height: 240px !important;
  }

  #top-menu {
    padding: 8px 0 !important;
  }

  #top-menu .nav > li {
    margin: 0 6px !important;
  }
}

@media (max-width: 479px) {
  #slider .et-slide,
  .et-slide {
    min-height: 210px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
