/* ── Shared Navigation Bar ─────────────────────────────── */
.sn-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  background: rgba(5, 5, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.12);
  animation: navSlideDown 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sn-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
}

.sn-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sn-link {
  position: relative;
  padding: 8px 14px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s, background 0.2s, opacity 0.2s;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.sn-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #a78bfa;
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sn-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sn-link:hover::after {
  transform: scaleX(1);
}

.sn-link--active {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
  animation: snActivePulse 2.4s ease-in-out infinite;
}

/* aria-current="page" 시에도 수식어 적용 */
.sn-link[aria-current="page"] {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
}

.sn-link--active::after {
  transform: scaleX(1);
  opacity: 0.7;
}
.sn-link[aria-current="page"]::after {
  transform: scaleX(1);
  opacity: 0.7;
}

.sn-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sn-left .sn-logo {
  margin-right: 8px;
}

.sn-arrows {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sn-btn {
  padding: 8px 14px;
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.sn-btn:hover:not(:disabled) {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.4);
  color: #a78bfa;
}

.sn-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 페이지 콘텐츠가 fixed nav 아래 가려지지 않도록 */
body {
  padding-top: 56px;
}

/* ── 햄버거 버튼 ─────────────────────────────── */
.sn-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1001;
  flex-shrink: 0;
}

.sn-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.sn-bar--open .sn-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sn-bar--open .sn-hamburger span:nth-child(2) {
  opacity: 0;
}

.sn-bar--open .sn-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sn-right {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

@media (max-width: 768px) {
  .sn-bar {
    display: flex;
    justify-content: space-between;
  }

  .sn-hamburger {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .sn-right > *:not(.sn-hamburger) {
    display: none;
  }

  .sn-bar--open .sn-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .sn-bar--open .sn-right > .sn-arrows {
    display: none;
  }

  .sn-bar--open .sn-right > .sn-page-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    order: 10;
  }

  .sn-bar:not(.sn-bar--open) .sn-page-actions {
    display: none;
  }

  .sn-bar:not(.sn-bar--open) .sn-links {
    display: none;
  }

  .sn-bar:not(.sn-bar--open) .sn-left .sn-link--auth {
    display: none;
  }

  .sn-bar--open .sn-links,
  .sn-bar--open .sn-page-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: auto;
  }

  .sn-bar--open .sn-links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(5, 5, 15, 0.97);
    padding: 12px 16px 4px;
    border-bottom: 1px solid rgba(167, 139, 250, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    gap: 2px;
    animation: navSlideDown 0.2s ease-out;
  }

  .sn-bar--open .sn-page-actions {
    position: absolute;
    top: calc(56px + var(--sn-links-h, 280px));
    left: 0;
    right: 0;
    background: rgba(5, 5, 15, 0.97);
    padding: 4px 16px 16px;
    border-bottom: 1px solid rgba(167, 139, 250, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    gap: 8px;
    margin-right: 0;
  }

  /* 하지만 조금 더 간단하게 — 자체 flow로 연결 */
  .sn-bar--open {
    height: auto;
    flex-wrap: wrap;
  }
  .sn-bar--open .sn-links { position: relative; top: auto; }
  .sn-bar--open .sn-page-actions { position: relative; top: auto; flex-basis: 100%; }

  .sn-bar--open .sn-links .sn-link {
    padding: 12px 14px;
    font-size: 0.92rem;
    min-height: 44px;
  }

  .sn-bar--open .sn-page-actions > * {
    min-height: 44px;
    justify-content: center;
  }

  .sn-bar--open .sn-sep {
    display: none;
  }

  .sn-bar {
    padding: 0 16px;
  }
}

/* ── 페이지별 액션 버튼 영역 ─────────────────────────────── */
.sn-page-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 구분선 */
.sn-sep {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  margin: 0 4px;
  user-select: none;
}

/* index.html 섹션 링크 */
.sn-link--section {
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.8rem;
}

.sn-link--section:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.04);
}
