/* =========================================================
   common.css
   - Reset / Base / Layout
   - Header + GNB (대/중/소 3뎁스 드롭다운, hover-gap 방지)
   - Common components / Footer
   ========================================================= */

/* -------------------------
   Reset / Base
   ------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
html { 
  scroll-padding-top: var(--header-height); 
  scroll-behavior: smooth;
}
body {
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;     /* ⭐ 중요 */
  margin: 0;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; }
table { border-collapse: collapse; border-spacing: 0; }

/* -------------------------
   Variables
   ------------------------- */
:root{
  --container: 1200px;
  --header-height: 80px;

  --brand: #005EB8;
  --text: #222;
  --muted: #666;
  --border: rgba(0,0,0,0.10);
  --shadow: 0 10px 24px rgba(0,0,0,0.10);
  --radius: 10px;
}

/* -------------------------
   Layout Helpers
   ------------------------- */
.container{
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.content { flex: 1 0 auto; }
.page-wrap{
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* -------------------------
   Buttons (optional)
   ------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn.ghost { background: transparent; color: var(--text); }

/* =========================================================
   HEADER
   ========================================================= */
#header{
  position: sticky;
  top: 0;
  z-index: 3000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow: visible;
}

.header-inner{
  height: var(--header-height);
  display: flex;
  align-items: center;            /*  수직 가운데 */
  justify-content: space-between;
  gap: 24px;
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  overflow: visible;
}

/* LOGO 정렬 */
.logo{
  display: flex;                  /*  */
  align-items: center;            /*  */
  height: var(--header-height);   /*  */
}
.logo a{
  display: flex;                  /*  */
  align-items: center;            /*  */
  height: 100%;                   /*  */
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text);
}

/* GNB 정렬 */
.gnb{
  position: relative;
  overflow: visible;
  display: flex;                  /*  */
  align-items: center;            /*  */
  height: var(--header-height);   /*  */
}

.gnb-menu{
  display: flex;
  align-items: center;            /*  */
  gap: 26px;
  height: 100%;                   /*  */
}

/*  여기 핵심: line-height로 억지 높이 주지 말고 padding으로 */
.gnb-menu > li > a{
  display: flex;                  /*  */
  align-items: center;            /*  */
  height: 100%;                   /*  */
  padding: 0 6px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);

  line-height: 1.1;               /*  (header-height 제거) */
}

/* UTIL 정렬 */
.util-menu{
  display: flex;
  align-items: center;            /*  */
  gap: 10px;
  height: var(--header-height);   /*  */
  white-space: nowrap;
}
.util-menu a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}


/* =========================================================
   GNB (대/중/소 3뎁스 드롭다운)
   - 2뎁스: 아래로
   - 3뎁스: 오른쪽으로
   - hover gap 방지(브릿지) + pointer-events로 꼬임 방지
   ========================================================= */
.gnb{ position: relative; overflow: visible; }
.gnb-menu{
  display: flex;
  align-items: center;
  gap: 26px;
}

.gnb-menu > li{
  position: relative;
  z-index: 1;
}
.gnb-menu > li:hover { z-index: 5000; }

.gnb-menu > li > a{
  display: block;
  height: var(--header-height);
  line-height: var(--header-height);
  padding: 0 6px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}
.gnb-menu > li > a:hover{
  color: var(--brand);
}

/* 2뎁스 (첫 드롭다운) */
.gnb-menu > li > .sub-menu{
  position: absolute;
  left: 0;
  top: calc(100% - 2px); /* 대메뉴와 붙여서 hover-gap 방지 */
  min-width: 220px;

  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 0;

  z-index: 3100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

/* 2뎁스 열림 */
.gnb-menu > li.has-sub:hover > .sub-menu{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* 2뎁스 항목 */
.gnb-menu > li > .sub-menu > li{
  position: relative;
}
.gnb-menu > li > .sub-menu > li > a{
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.gnb-menu > li > .sub-menu > li > a:hover{
  background: rgba(0,0,0,0.04);
}

/* 3뎁스: 2뎁스 오른쪽에 표시 */
.gnb-menu > li > .sub-menu > li > .sub-menu{
  position: absolute;
  top: 0;                    /* ⬅ 위로 말려 올라가지 않게 */
  left: 100%;                /* ⬅ 2뎁스 기준 오른쪽 */
  margin-left: 8px;          /* 간격 */
  min-width: 240px;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  padding: 10px 0;

  opacity: 0;
  visibility: hidden;
  transform: translateX(6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}


/* 3뎁스 열림 */
.gnb-menu > li > .sub-menu > li.has-sub:hover > .sub-menu{
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

/* 3뎁스 항목 */
.gnb-menu > li > .sub-menu > li > .sub-menu > li > a{
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.gnb-menu > li > .sub-menu > li > .sub-menu > li > a:hover{
  background: rgba(0,0,0,0.04);
}

/* 중메뉴에 화살표 */
.gnb-menu > li > .sub-menu > li.has-sub > a{
  padding-right: 28px;
}
.gnb-menu > li > .sub-menu > li.has-sub > a::after{
  content: "›";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .6;
}

/* Hover-gap 방지 브릿지(2뎁스 내려갈 때 끊김 방지) */
.gnb-menu > li.has-sub::after{
  content:"";
  position:absolute;
  left:0;
  top:100%;
  width:100%;
  height:10px;
  background:transparent;
}

/* Hover-gap 방지 브릿지(2뎁스에서 3뎁스로 이동 시 끊김 방지) */
.gnb-menu > li > .sub-menu > li.has-sub::after{
  content:"";
  position:absolute;
  left:100%;
  top:0;
  width:10px;
  height:100%;
  background:transparent;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px){
  :root{ --header-height: 72px; }

  .header-inner{
    gap: 12px;
  }
  .gnb-menu{
    gap: 14px;
  }
  .gnb-menu > li > a{
    font-size: 14px;
    font-weight: 800;
  }

  /* 작은 화면에서는 3뎁스를 우측이 아니라 아래로 펼치기 */
  .gnb-menu > li > .sub-menu > li > .sub-menu{
    left: 0;
    top: calc(100% - 2px);
    transform: translateY(6px);
  }
  .gnb-menu > li > .sub-menu > li.has-sub:hover > .sub-menu,
  .gnb-menu > li > .sub-menu > li.has-sub:focus-within > .sub-menu{
    transform: translateY(0);
  }
  .gnb-menu > li > .sub-menu > li.has-sub > a::after{ content: "▾"; }

  /* 모바일에서는 우측 브릿지 불필요 */
  .gnb-menu > li > .sub-menu > li.has-sub::after{ display:none; }
}

@media (max-width: 640px){
  .util-menu a{
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }
  .gnb-menu{ gap: 10px; }
}


/* Common Title */
.section-title {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
}

/* .section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: #005EB8;
  margin: 16px auto 0;
  border-radius: 2px;
} */

.section-subtitle {
  font-size: 16px;
  margin-top: -30px;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  color: #666;
}

.section-subtitle-L {
  font-size: 20px;
  margin-top: -30px;
  text-align: center;
  position: relative;
  color: #666;
}

.section-subtitle-L strong{
  font-size: 22px;
  color: #004fac;
  font-weight: 700;
}

.section-title span.dot{
    letter-spacing: -0.25em;
    margin: 0 0.25em 0 0;
}
