/* _nav.css */

/* Nav height contract:
   - desktop: --nav-h
   - mobile:  --nav-h-mobile
   mainsite.css must use these same variables for body padding-top.
*/

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 1000;

  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #e5e7eb;

  height: var(--nav-h);
  display: flex;
  align-items: center;
}

/* Inner layout */
.nav-inner {
  width: 100%;
  max-width: 90%;
  margin: 0 auto;
  padding: 12px 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* =========================
   Title (center anchor)
========================= */
.nav-title {
  flex: 1 1 auto;
  min-width: 160px;

  text-align: center;
  line-height: 1.2;

  font-family: "Nanum Myeongjo", serif;
  font-size: 1.6rem;
  font-weight: 800;        /* Nanum shines at heavier weights */
  letter-spacing: -0.01em; /* reduce tracking vs sans-serif */

  color: #111827;
  position: relative;
}

@media (max-width: 700px) {
  .nav-title {
    font-size: 1.35rem;
    letter-spacing: -0.005em;
  }
}


/* Subtle accent underline */
.nav-title::after {
  content: "";
  display: block;
  width: 2.75rem;
  height: 3px;
  margin: 0.35rem auto 0;
  background: #d32f2f;
  border-radius: 2px;
}

.nav-title-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

.nav-title-link:hover {
  text-decoration: none;
}


/* =========================
   Links
========================= */
.nav-links {
  display: flex;
  gap: 20px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.nav-link {
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;

  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;

  color: #374151;

  padding: 6px 10px;
  border-radius: 10px;

  transition: background 120ms ease, color 120ms ease;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #111827;
}

/* =========================
   Social icons
========================= */
.social-nav {
  flex: 0 0 auto;
}

.social-list {
  display: flex;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-link {
  display: block;
  align-items: center;
  justify-content: center;

  width: 24px;
  height: 24px;
  border-radius: 8px;

  transition: background 0.15s ease, transform 0.1s ease;
}

@media (max-width: 700px) {
  .social-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .nav-link {
    padding: 10px 12px;
  }
}


.social-link:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

/* =========================
   Accessibility
========================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================
   Mobile adjustments
========================= */
@media (max-width: 700px) {
  /* On mobile, sticky prevents overlay-blocking while staying visible */
  .site-nav {
    position: sticky;
    top: 0;              /* KEY: ensure it sticks to top */
    height: auto;
    align-items: stretch;
    padding: 10px 0;
  }

  .nav-inner {
    max-width: 100%;
    padding: 10px 12px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  /* Links row: wrap nicely and center */
  .nav-links {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .nav-link {
    font-size: 1rem;
    padding: 10px 12px; /* better tap target */
  }

  /* Title row */
  .nav-title {
    width: 100%;
    min-width: 0;
    font-size: 1.4rem;
    line-height: 1.15;
    text-align: center;
  }

  /* Social row: WRAP so it never overflows screen width */
  .social-nav {
    width: 100%;
  }

  .social-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .social-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .social-link img {
    display: block;
    width: 18px;
    height: 18px;
  }
}
