.nav-main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s;
}


/* --- Desktop & Base Styles --- */
.navbar .nav-main-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  gap: 16px;
}

.logo {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin-right: auto;
}

/* The full church name wraps awkwardly (or gets clipped) once the navbar
   also has to fit every nav link inline — with 10 of them now (plus the
   language switcher), that's true well before the mobile breakpoint, so
   this swaps to the short form at a much wider threshold than the
   hamburger-menu cutoff below. */
.nav-brand-short {
  display: none;
}
.nav-brand-full,
.nav-brand-short {
  font-size: 14px;
}
@media (max-width: 1400px) {
  .nav-brand-full {
    display: none;
  }
  .nav-brand-short {
    display: inline;
  }
}

.nav-logo-link {
  display: flex;
  align-items: center;
}

/* An admin-uploaded logo image almost always carries its own baked-in
   white background (most aren't transparent PNGs) — cropping that straight
   into a circle looks like an accidental white square peeking through,
   especially in dark mode. A deliberate white "coin" frame with a border
   and shadow makes that same white backdrop read as an intentional badge
   in both themes instead. */
.nav-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  flex: none;
}
.nav-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 13px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 100%;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-brand a {
  font-weight: 700;
  color: var(--navy-dark);
}
.nav-brand a::after {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switcher {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-switcher-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  text-decoration: none;
}
.lang-switcher-option:hover {
  color: var(--ink);
}
.lang-switcher-option.active {
  background: var(--ink);
  color: var(--bg);
}

.menu-toggle {
  display: none; /* Hidden on Desktop */
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
  gap: 5px;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: var(--navy);
  transition: 0.3s;
}

.nav-overlay {
  display: none;
}

/* --- Tablet & Mobile Styles (< 1024px) ---
   Raised from 768px: with 9 nav links plus the theme toggle, tablet widths
   (768-1024px) had nowhere to put them in a single row without shrinking
   text/tap-targets past the point of usability — switching to the toggle
   menu earlier is the standard fix, not an ever-shrinking font size. */
@media (max-width: 1024px) {
  .nav-main-container {
    padding: 0 16px;
  }

  .menu-toggle {
    display: flex; /* Show Hamburger */
    z-index: 1001;
    padding: 8px;
  }

  .nav-container {
    position: fixed;
    top: 0;
    right: 0;
    /* Hidden off-screen via transform, not a "right: -100%" layout offset —
       a fixed element positioned off-canvas that way still extends the
       page's scrollable width (document.documentElement.scrollWidth
       counts it even though it's never visible), causing the whole site to
       gain horizontal scroll/shift on mobile. transform is purely visual
       and never affects layout/scroll bounds, so this avoids that
       entirely. */
    transform: translateX(100%);
    width: 82%;
    max-width: 320px;
    height: 100vh;
    background: var(--card);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s cubic-bezier(0.22, 0.9, 0.36, 1);
    z-index: 1000;
    padding-top: 84px;
    overflow-y: auto;
  }

  .nav-container.active {
    transform: translateX(0); /* Slide in */
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 0 1.25em;
  }

  .nav-links a {
    display: block;
    padding: 12px 4px;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 26, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
  }

  .nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Animate Hamburger to 'X' when active */
  .menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

@media (max-width: 420px) {
  .logo img {
    width: 34px !important;
    height: 34px !important;
  }
  .nav-main-container {
    height: 62px;
  }
}
