/* =========================
   Global / Reset
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  min-height: 110vh;
  /* 페이지가 짧아도 푸터 밀착 테스트용 */
}

/* =========================
   Header / Nav
   ========================= */
header {
  width: 100%;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3000;
}

.header_top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  height: 80px;
  background-color: #fff;
}

.logo img {
  height: 60px;
  padding-left: 200px;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 30px;
  height: 4px;
  background: #333;
  margin: 3px 0;
}

.whether {
  flex: 1;
  text-align: center;
  font-size: 16px;
  color: #555;
  padding: 0 2px;
}

.member {
  display: flex;
  gap: 10px;
  padding-right: 200px;
}

.login_button,
.join_button {
  text-decoration: none;
  color: #333;
  border: 2px solid #333;
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 18px;
  transition: .3s;
}

.login_button:hover,
.join_button:hover {
  background: #002B5B;
  color: #fff;
}

/* 헤더 아래 메뉴 */
.header_bottom {
  height: 65px;

  line-height: 25px;
  display: flex;
  justify-content: center;
  width: 100%;
  background-color: #002B5B;

}

nav {
  height: auto;
  /* 200px에서 auto로 변경하여 내용에 맞게 조정 */
  overflow: visible;
}

.mainmenu {
  margin: 0 auto;
  text-align: center;
}

.mainmenu>li {
  float: left;
  text-align: center;
  line-height: 60px;
  width: 150px;
  position: relative;
  list-style: none;
  font-size: 20px;
}

.mainmenu>li a {
  color: #272424;
}

.mainmenu>li>a span {
  position: relative;
  display: inline-block;
  padding: 5px 0;
  height: 30px;
  color: #fff;
}

.mainmenu>li>a span:hover {
  font-weight: 700;
}

/* 서브메뉴 */
.mainmenu .sub {
  display: none;
  background: linear-gradient(#ffffff 70px, rgba(255, 255, 255, 0.8) 50px, rgba(255, 255, 255, 0.8) 100%);
  min-width: 150px;
  /* 메인 메뉴와 동일한 너비 */
  min-height: 160px;
  /* 서브메뉴 높이를 줄임 (220px → 160px) */
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10050;
}

.mainmenu:hover .sub {
  display: block;
  z-index: 10051;
}

.sub li {
  line-height: 40px;
  /* 서브메뉴 간격을 줄임 (60px → 40px) */
  list-style: none;
  width: 150px;
  /* 메인 메뉴와 동일한 너비 */
  text-align: center;
  /* 메인 메뉴와 동일한 정렬 */
  font-size: 20px;
  /* 메인 메뉴와 동일한 폰트 크기 */
}

.sub li a {
  color: #272424;
  text-decoration: none;
  display: block;
  /* 전체 영역 클릭 가능하도록 */
  padding: 5px 0;
  /* 메인 메뉴와 동일한 패딩 */
}

.sub li a:hover {
  color: #28325e;
  /* 메인 메뉴 hover와 동일한 색상 */
  font-weight: 700;
}

/* =========================
   Main / Footer
   ========================= */
main {
  flex: 1 0 auto;
  min-height: calc(100vh - 300px);
  /* 헤더+푸터 대략치만큼 보정 */
  padding-bottom: 20px;
  /* 아래 공간 소폭 */
}

.site-footer {
  position: relative;
  z-index: 100;
  margin-top: auto;
}

/* =========================
   Chat (fixed 버전)
   ========================= */
/* 기존 .chatInput 레거시 유지시 필요하면 남겨두고, 새 위젯은 .fc-chat 사용 */


/* 로그/입력 UI는 별도 파일(mainChatbot.css)을 쓰는 경우 여긴 최소만 둠 */
.fc-chat__log {
  display: none;
}

.fc-chat.active .fc-chat__log {
  display: block;
}

#weather-info-pc {
  display: block;
}

#weather-info-mobile {
  display: none;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 768px) {
  body.menu-open {
    overflow: hidden;
  }

  @media screen and (max-width: 768px) {
    #weather-info-pc {
      display: none;
    }

    #weather-info-mobile {
      display: block;
      max-width: 200px;
    }
  }

  header {
    display: flex;
  }

  .logo img {
    padding-left: 0;
  }

  .whether {
    display: flex;
    justify-content: center;
  }

  .hamburger {
    display: flex;
    justify-content: right;
    order: 2;
  }

  .member {
    display: none;
  }

  .header_bottom {
    background: #fff;
    height: 0;
  }

  /* 왼쪽 카테고리 패널 */
  .mainmenu {
    position: fixed;
    top: 80px;
    left: 0;
    height: calc(100vh - 80px);
    width: 45vw;
    background: #002B5B;
    border-right: 1px solid #ddd;
    display: none;
    flex-direction: column;
    padding: 10px 0;
    z-index: 3500;
  }

  .mainmenu.active {
    display: flex;
  }

  .mainmenu>li {
    position: static;
    float: none;
    width: 100%;
    height: 60px;
    line-height: 60px;
    text-align: center;
    padding: 0 12px;
    border-bottom: 1px solid #FFF;
  }

  /* 오른쪽 서브 패널 */
  .mainmenu li .sub {
    position: fixed;
    top: 80px;
    left: 45vw;
    width: 55vw;
    height: calc(100vh - 80px);
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 10px;
    overflow-y: auto;
    display: none;
    z-index: 3501;
  }

  /* 서브메뉴 내부 아이템 왼쪽 정렬 */
  .mainmenu li .sub li {
    text-align: left;
    padding-left: 16px;
  }

  .mainmenu li.open>.sub {
    display: block;
  }

  .mainmenu:hover .sub {
    display: none;
  }

  /* 메뉴 열리면 챗봇 숨김 */
  body.menu-open .fc-chat,
  body:has(.mainmenu.active) .fc-chat {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* z-index 정리(모바일 패널이 항상 위) */
@media (max-width: 768px) {
  .mainmenu {
    z-index: 10050 !important;
  }

  .mainmenu li .sub {
    z-index: 10051 !important;
  }
}