/* nav.css — 네비게이션 + 프로그래스 바 (plan.md Section 4-0) */

#main-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: var(--white);
  transition: none;            /* JS가 compact 토글 시 transition 활성화 */
}

.nav-logo{
  height: 32px;
  width: auto;
  transition: height 0.3s ease;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h-desktop);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 40px;
  transition: height 0.3s ease;
  position: relative;
}

.nav-inner .logo-container {
  width: 177px;
}

/* ── 스크롤 시 축소 상태 ── */
#main-nav.nav-compact .nav-inner {
  height: 56px;
}

#main-nav.nav-compact .nav-logo {
  height: 24px;
}

.nav-logo {
  font-family: var(--font-pretendard);
  font-weight: 700;
  font-size: 20px;
  color: var(--black);
}

.nav-links {
  display: flex;
  gap: 48px;
  height: 100%;
  align-items: center;
}

.nav-links li{
  height: 100%;
}

.nav-links a {
  font-family: var(--font-nanum);
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  opacity: 0.4;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links li > a:hover,
.nav-links li > a.active {
  font-family: var(--font-nanum);
  font-weight: 900;
  opacity: 1;
  color: var(--black);
}

.nav-progress {
  position: relative;
  height: 2px;
}

.nav-progress-bar {
  height: 200%;
  width: 0;
  background: var(--gradient);
  position: absolute;
  bottom: 0;
  border-radius: 0 2px 2px 0;
}

/* ── 4-4 콘텐츠 활용 기록물 버튼 (데스크탑 전용) ── */
.nav-record-btn {
  display: flex;
  align-items: center;
  border-radius: 110px;
  border: 1px solid #02489d;
  color: #02489d;
  font-family: var(--font-nanum);
  font-weight: 700;
  font-size: 16px;
  line-height: 32px;
  padding: 7px 23px;
  background: var(--white);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  width: 177px;
  height: 48px;
  transition: height 0.3s ease;
}

.nav-record-btn:hover {
  background: #f0f5ff;
}

.nav-compact .nav-record-btn{
  height: 34px;
}

/* ── 4-5 햄버거 (모바일 오버레이 트리거) ── */
#nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ── 4-5 모바일 오버레이 드로어 ── */
#nav-mobile-overlay {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: var(--z-nav-overlay);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

#nav-mobile-overlay.is-open {
  transform: translateX(0);
}

.nav-mobile-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

#nav-mobile-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 4-6 모바일 아코디언 ── */
.nav-mobile-accordion {
  display: flex;
  flex-direction: column;
  gap: 48px;
  width: 296px;
  margin: 104px auto 0;
  padding-bottom: 48px;
}

.nav-accordion-item {
  display: flex;
  flex-direction: column;
}

.nav-accordion-header {
  /* height: 32px; */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  background: none;
  border: none;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  width: 100%;
}

.nav-accordion-title {
  font-family: var(--font-nanum);
  font-weight: 700;
  font-size: 20px;
  color: #9e9e9e;
  letter-spacing: -0.4px;
  line-height: 32px;
}

.nav-accordion-item.is-open > .nav-accordion-header .nav-accordion-title {
  font-weight: 900;
  color: #0c0c0c;
}

.nav-accordion-chevron {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-accordion-item.is-open > .nav-accordion-header .nav-accordion-chevron {
  transform: rotate(180deg);
}

.nav-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-accordion-item.is-open > .nav-accordion-body {
  max-height: 600px;
}

.nav-year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 24px;
  font-family: var(--font-nanum);
  font-size: 18px;
  letter-spacing: -0.36px;
  padding-top: 24px;
}

.nav-year-grid a {
  font-weight: 400;
  color: #0c0c0c;
  text-decoration: none;
}

.nav-year-grid a.active {
  font-weight: 900;
}

/* ── 4-7 데스크탑 연도 드롭다운 ── */
.nav-links li {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  width: 136px;
  padding: 0;
  border: 1px solid #e0e6ed;
  border-radius: 8px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: calc(var(--z-nav) + 1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nav-links li:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
}

.nav-dropdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-dropdown-list li {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-dropdown-list a {
  font-family: var(--font-nanum);
  font-size: 14px;
  font-weight: 700;
  color: #0c0c0c;
  opacity: 0.4;
  text-decoration: none;
  display: block;
  width: 100%;
  padding: 8px 0;
  text-align: center;
  letter-spacing: -0.28px;
  line-height: 24px;
}

.nav-dropdown-list li.is-active > a {
  background: #02489d;
  color: #ffffff;
  font-weight: 900;
  opacity: 1;
}
