/* ========== Global Layout ========== */
.wrap{max-width:1200px; margin:0 auto; padding:0 20px}
.container{padding:var(--space-6) 0}


body{
  min-height:100vh;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
}

/* 본문이 남는 높이를 채움 */
body > main.container.wrap{
  flex:1 0 auto;
  width:100%;
}

/* 푸터를 항상 맨 아래로 밀기 */
body > .site-footer{
  margin-top:auto !important;
  flex-shrink:0;
}
/* Header (GNB) */
.site-header{background:var(--bg); border-bottom:1px solid var(--line)}
.gnb{display:flex; align-items:center; justify-content:space-between; padding:var(--space-4) 0}
.brand{display:flex; align-items:center; gap:10px}
.brand a{text-decoration:none; color:var(--brand)}
.logo-mark{width:26px;height:26px;display:inline-grid;place-items:center;border:2px solid #555;color:#555;font-weight:800;border-radius:4px;line-height:1}
.logo-text{font-weight:800; letter-spacing:1px; font-size:22px}
.gnb .menu{display:flex; gap:36px}
.gnb .menu a{text-decoration:none; color:#1c2430; font-weight:800; text-transform:uppercase; letter-spacing:.5px; position:relative; padding:6px 0}
.gnb .menu a::after{content:"";position:absolute;left:0;bottom:-10px;height:3px;width:0;background:#1c2430;transition:width .18s ease}
.gnb .menu a:hover::after{width:100%}
.gnb.gnb--bar{
  display:grid;
  grid-template-columns:minmax(180px,1fr) auto minmax(180px,1fr);
  align-items:center;
  padding:20px 0;
  justify-content:initial;
}
.gnb.gnb--bar .brand{ justify-self:start; }
.gnb.gnb--bar .menu{
  grid-column:2;
  display:flex; gap:24px; margin:0; padding:0; list-style:none;
  flex-wrap: nowrap;
}
.gnb.gnb--bar .menu li { flex: 0 0 auto; }   /* shrink 금지 */
.gnb.gnb--bar .menu a  { white-space: nowrap; word-break: keep-all; }

/* Footer */
.site-footer{background:var(--bg); border-top:1px solid var(--line); padding:18px 0;}
.footer-top{display:flex; gap:12px; flex-wrap:wrap; margin-bottom:8px}
.footer-top a{color:var(--muted); text-decoration:none; font-size:14px}
.address{color:var(--muted)}

/* fragments2 전용 톤다운 버전 */
.header-compact .header-bar{height:64px}
.header-compact .gnb__menu{gap:24px}


/* ====== Header / GNB ====== */
.site-header{position:sticky; top:0; z-index:50;
  background:rgba(255,255,255,.86);
  border-bottom:1px solid #eceff4;
  backdrop-filter:saturate(180%) blur(12px);
}
.header-bar{display:flex; align-items:center; gap:28px; height:68px}
.brand a{display:block; font-weight:800; letter-spacing:.02em; color:#222; text-decoration:none}

/* 메뉴: 가운데 정렬 + 간격 + 하이라이트 언더라인 */
.gnb__menu{list-style:none; margin:0 auto; padding:0; display:flex; gap:28px}
.gnb__menu a{position:relative; display:inline-block; padding:8px 0;
  text-decoration:none; color:#222; font-weight:700; letter-spacing:.01em}
.gnb__menu a::after{content:""; position:absolute; left:0; right:0; bottom:-8px;
  height:2px; background:var(--brand,#533388); opacity:0; transform:translateY(4px);
  transition:transform .16s ease, opacity .16s ease}
.gnb__menu a:hover::after,
.gnb__menu li.is-active > a::after{opacity:1; transform:translateY(0)}

.util{margin-left:auto; display:flex; align-items:center; gap:16px; font-size:14px}
.util a{color:#616671; text-decoration:none}
.util .dot{margin:0 6px; color:#c2c6cf}

/* 히어로 위에서 투명 헤더(텍스트를 흰색으로) */
.site-header.is-over-hero{position:absolute; inset-inline:0; top:0;
  background:linear-gradient(to bottom, rgba(0,0,0,.28), rgba(0,0,0,0));
  border-bottom-color:transparent;
}
.site-header.is-over-hero .brand a,
.site-header.is-over-hero .gnb__menu a,
.site-header.is-over-hero .util a{color:#fff}
.site-header.is-over-hero .gnb__menu a::after{background:#fff}

/* 스크롤되면 솔리드(흰 배경)로 전환 */
.site-header.is-solid{position:sticky; background:#fff; border-bottom:1px solid #eceff4}
.site-header.is-solid .brand a,
.site-header.is-solid .gnb__menu a,
.site-header.is-solid .util a{color:#222}
/* 맨 위로 버튼 공통 스타일 */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 90px;
  height: 90px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  display: none;              /* 처음에는 숨김 */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
}

.to-top img {
  width: 40px;
  height: 40px;
  display: block;
}

/* 모바일에서 살짝 위/안쪽으로 */
@media (max-width: 768px){
  .to-top {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
  }
}



@media (max-width: 960px){
  .footer-inner{
    grid-template-columns: 1fr;      /* 세로 스택 */
    gap:12px; text-align:center;
  }
  .footer-links{ justify-content:center; }
}

/* ===== Back-to-top FAB ===== */
.to-top{
  position:fixed; right:22px; bottom:22px;
  width:44px; height:44px; border-radius:50%;
  background:#fff; color:#333; border:0;
  box-shadow:0 8px 18px rgba(0,0,0,.18);
  font-weight:800; cursor:pointer;
  display:none;        /* 스크롤 시에만 보이게 */
}
.to-top:hover{ transform:translateY(-2px); }


/* 모바일(간단): 메뉴 간격 축소 */
@media (max-width:980px){
  .header-bar{height:60px}
  .gnb__menu{gap:18px}
}
@media (max-width:720px){
  .gnb__menu{gap:14px; font-size:15px}
  .util{display:none}
}




/* Mega Panel 기본 숨김 강화 */
nav.gnb .mega-panel {
  display: none !important;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 16px 36px rgba(0,0,0,.08);
  z-index: 30;
  padding: 28px 24px;
}

/* is-open 시 패널 표시 (grid로 모든 컬럼 보임) */
nav.gnb[data-gnb-mode="mega"].is-open .mega-panel {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 24px;
}

/* 개별 컬럼 스타일 (기본 불투명, active 시 강조) */
.mega-col {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.mega-col h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #222;
}

.mega-col a:hover {
  color: #533388;
}
.mega-col.active {
  opacity: 1;
}
/* =========================================================
   GNB2 : 메가 GNB (index3 전용, index3.html 전용)
   ========================================================= */
/* =========================
   GNB2 정렬 패치 공통 적용
   모든 페이지 동일 적용
   ========================= */
@media (min-width: 981px){

  /* 상단 1뎁스 메뉴 미세 조정 */
  .site-header--gnb2 .gnb2-depth1 > li{
    position: relative;
  }

  .site-header--gnb2 .gnb2-depth1 > li:nth-child(1){ left: 0px; }
  .site-header--gnb2 .gnb2-depth1 > li:nth-child(2){ left: 0px; }
  .site-header--gnb2 .gnb2-depth1 > li:nth-child(3){ left: 0px; }
  .site-header--gnb2 .gnb2-depth1 > li:nth-child(4){ left: 0px; }

  /* 메가 컬럼 미세 조정
     gnb2-mega-inner / gnb2-mega__inner 둘 다 대응 */
  .site-header--gnb2 .gnb2-mega-inner .mega-cols > .mega-col,
  .site-header--gnb2 .gnb2-mega__inner .mega-cols > .mega-col{
    position: relative;
  }

  .site-header--gnb2 .gnb2-mega-inner .mega-cols > .mega-col:nth-child(1),
  .site-header--gnb2 .gnb2-mega__inner .mega-cols > .mega-col:nth-child(1){
    left: 100px;
  }

  .site-header--gnb2 .gnb2-mega-inner .mega-cols > .mega-col:nth-child(2),
  .site-header--gnb2 .gnb2-mega__inner .mega-cols > .mega-col:nth-child(2){
    left: 30px;
  }

  .site-header--gnb2 .gnb2-mega-inner .mega-cols > .mega-col:nth-child(3),
  .site-header--gnb2 .gnb2-mega__inner .mega-cols > .mega-col:nth-child(3){
    right: 40px;
  }

  .site-header--gnb2 .gnb2-mega-inner .mega-cols > .mega-col:nth-child(4),
  .site-header--gnb2 .gnb2-mega__inner .mega-cols > .mega-col:nth-child(4){
    right: 160px;
  }
}
/* 헤더 바 전체 */
.site-header--gnb2 {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #eceff4;
  backdrop-filter: saturate(180%) blur(12px);
}

/* 로고 | 메뉴 | 우측 유틸 3열 */
.site-header--gnb2 .gnb2-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  min-height: 80px;
  position: static;
  overflow: visible;
}

/* ===== GNB2 hover 끊김 수정 (폭 유지 버전) ===== */
.site-header--gnb2 .gnb2{
  display: flex;
  align-items: center;
  min-height: 80px;   /* .gnb2-bar 높이와 맞춤 */
}

.site-header--gnb2 .gnb2-depth1{
  display: flex;
  align-items: center;
  min-height: 80px;
}

.site-header--gnb2 .gnb2-depth1::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;   /* 필요시 24~40px 사이 조절 */
}

/* 메가패널 위치 재지정 */
.site-header--gnb2 .gnb2-mega{
  top: 100%;
  left: 0;
  right: 0;
}

/* 혹시라도 상위 요소가 잘라먹지 않게 */
.site-header--gnb2,
.site-header--gnb2 .gnb2,
.site-header--gnb2 .gnb2-mega{
  overflow: visible;
}
/* (선택) 로고 래퍼 있으면 활용 */
.gnb2-logo img,
.header-logo {
  height: 64px;
  width: auto;
  display: block;
}

/* 1뎁스 메뉴 줄 */
.gnb2 {
  justify-self: center;
}

.gnb2-depth1 {
  display: flex;
  gap: 56px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gnb2-depth1 > li {
  position: relative;
}

.gnb2-depth1 > li > .top-link {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  font-weight: 500; /* 400=Regular, 500=Medium, 600=SemiBold, 700=Bold */
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
  color: #111827;
}

/* hover / active 밑줄 */
.gnb2-depth1 > li > .top-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0;
  height: 2px;
  background: #194A6C;
  transition: width .18s ease;
}

.gnb2-depth1 > li:hover > .top-link::after,
.gnb2-depth1 > li.is-active > .top-link::after {
  width: 100%;
}

/* 우측 유틸 */
.gnb2-util {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.gnb2-util .util-link {
  text-decoration: none;
  color: #202020;
}
.gnb2-util .util-link:hover { color: #111827; }
.gnb2-util .util-divider {
  width: 1px;
  height: 14px;
  background: #d5d8e0;
  display: inline-block;
}
.gnb2-util .util-lang {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

/* =================== 메가 패널 =================== */

/* 헤더 아래 전체 폭 패널 (처음엔 숨김) */
.site-header--gnb2 .gnb2-mega {
  position: absolute;
  left: 0;
  right: 0;
 top: 100%;
  background: #fff;
  border-top: 1px solid #eceff4;
  box-shadow: 0 16px 40px rgba(15,23,42,.12);
  padding: 28px 0 32px;
  z-index: 910;

  opacity: 0;
  visibility: hidden;
  transform: none;       /* ← translateY(6px) 제거 */
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

/* nav 전체에 마우스 올렸을 때 메가패널 표시 */
.site-header--gnb2 .gnb2:hover .gnb2-mega,
.site-header--gnb2 .gnb2:focus-within .gnb2-mega {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

/* 안쪽: 왼쪽 hero + 오른쪽 컬럼 그리드 */
.gnb2-mega-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px 48px;
  align-items: flex-start;
}

/* 왼쪽 설명 텍스트 */
.mega-hero p { margin: 0 0 8px; }
.mega-hero .mega-en {
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #9ca3af;
}
.mega-hero .mega-ko {
  font-size: 14px;
  color: #4b5563;
}

/* 오른쪽 4컬럼 */
.mega-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  column-gap: 36px;
  row-gap: 24px;
}

/* 각 컬럼 스타일 */
.mega-col h4 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #000000;
}
.mega-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.mega-col li + li { margin-top: 4px; }
.mega-col a {
  display: inline-block;
  font-size: 14px;
  color: #000000;
  text-decoration: none;
  padding: 3px 0;
}
.mega-col a:hover { color: #111827; }

/* 살짝 연출 (처음엔 전체 흐리게, 첫 컬럼만 진하게) */
.mega-col {
  opacity: .6;
  transition: opacity .18s ease, transform .18s ease;
}
.mega-cols .mega-col:first-child { opacity: 1; }

/* 1뎁스 탭에 hover 하면 해당 컬럼만 강조 (옵션) */
.gnb2:hover .mega-col { opacity: .3; }
.depth1-intro:hover  ~ .gnb2-mega .col-intro,
.depth1-cert:hover   ~ .gnb2-mega .col-cert,
.depth1-news:hover   ~ .gnb2-mega .col-news,
.depth1-community:hover ~ .gnb2-mega .col-community {
  opacity: 1;
  transform: translateY(-2px);
}
.site-header--gnb2 .mega-cols {
  display: flex !important;     /* grid로 잡혀 있던 거 무시하고 flex로 강제 */
  flex-wrap: nowrap;            /* 넓은 화면에서는 한 줄로 고정 */
  gap: 36px;
  align-items: flex-start;
}

.site-header--gnb2 .mega-col {
  flex: 1 1 0;
  margin-top: 0;                /* 혹시 남아있을 margin-top 제거 */
}
/* ---------------- 반응형 ---------------- */
@media (max-width: 1200px){
  .site-header--gnb2 .mega-cols {
    flex-wrap: wrap;
  }
  .site-header--gnb2 .mega-col {
    flex: 1 1 calc(50% - 18px);
    margin-bottom: 24px;
  }
}

@media (max-width: 960px){
  .site-header--gnb2 .gnb2-bar{
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    row-gap: 10px;
  }
  .gnb2{
    grid-column: 1 / 3;
    justify-self: center;
  }
  .gnb2-depth1{ gap: 24px; font-size: 14px; }
  .mega-cols{
    grid-template-columns: repeat(2, minmax(160px,1fr));
    row-gap: 24px;
  }
}

@media (max-width: 720px){
  .gnb2-depth1{ gap: 18px; font-size: 13px; }
  .mega-cols{ grid-template-columns: repeat(2, minmax(140px,1fr)); }
}


.gnb2-item:hover > .gnb2-link::after,
.gnb2-item.is-active > .gnb2-link::after {
  width: 100%;
}

/* 우측 유틸 */
.gnb2-util {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.gnb2-util .util-link {
  text-decoration: none;
  color: #616671;
}

.gnb2-util .util-link:hover { color: #111827; }

.gnb2-util .util-divider {
  width: 1px;
  height: 14px;
  background: #d5d8e0;
}

.util-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

/* ========================
   메가 패널
   ======================== */

/* 안쪽 그리드 */
.gnb2-mega__inner {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding: 28px 20px 32px;
}

/* 왼쪽 히어로 텍스트 */
.mega-hero-en {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0 0 12px;
}

.mega-hero-ko {
  font-size: 18px;
  line-height: 1.6;
  color: #111827;
  margin: 0;
}

.mega-hero-ko strong {
  font-weight: 800;
}

/* 오른쪽 컬럼들 */
.mega-cols {
  display: contents;   /* 컬럼 3개를 그리드에 직접 배치 */
}

.mega-col h4 {
  font-size: 15px;
  margin: 0 0 8px;
  font-weight: 700;
  color: #111827;
}

.mega-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-col li + li {
  margin-top: 4px;
}



.mega-col a:hover {
  color: #111827;
}

/* ========================
   반응형
   ======================== */
@media (max-width: 1200px) {
  .gnb2-depth1 { gap: 40px; }
  .gnb2-mega__inner {
    grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(0, 1fr));
    row-gap: 28px;
  }
}

@media (max-width: 960px) {
  .site-header--gnb2 .gnb2-bar {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    row-gap: 10px;
  }
  .gnb2 { grid-column: 1 / 3; justify-self: center; }
  .gnb2-depth1 { gap: 28px; font-size: 14px; }
}

@media (max-width: 720px) {
  /* 모바일에선 메가메뉴 안쓰고, 나중에 햄버거로 교체하는 게 낫지만
     일단 간단히 간격만 줄임 */
  .gnb2-depth1 { gap: 18px; font-size: 13px; }
  .gnb2-mega__inner {
    grid-template-columns: 1fr;
  }
}

