/* ============================================================
   NAVBAR.CSS
   ============================================================ */

:root {
  --nav-blue:       #2563eb;
  --nav-blue-dark:  #1d4ed8;
  --nav-blue-light: #eff6ff;
  --nav-text:       #111827;
  --nav-border:     #e5e7eb;
  --nav-white:      #ffffff;
  --nav-font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-height:     69px;
  --nav-height-sm:  57px;
}

html, body {
  margin: 0;
  padding: 0;
}

/* box-sizing only – ingen margin/padding-reset som förstör margin: auto */
#site-announcement,
#site-navbar,
#site-navbar * {
  box-sizing: border-box;
}

/* ── ANNOUNCEMENT BAR ──────────────────────────────────────── */
#site-announcement {
  background: var(--nav-blue);
  color: var(--nav-white);
  font-family: var(--nav-font);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 9px 16px;
  margin: 0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
}

#site-announcement,
#site-announcement * {
  font-family: var(--nav-font) !important;
  letter-spacing: 0;
}

.ann-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ann-link {
  color: var(--nav-white);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.5);
  text-underline-offset: 2px;
  white-space: normal;
  font-weight: 600;
  transition: text-decoration-color 0.15s;
}
.ann-link:hover {
  text-decoration-color: rgba(255,255,255,1);
}

.ann-side {
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  white-space: normal;
}

.ann-inner {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.ann-text {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.35;
}

/* Fallback om äldre markup med .ann-center fortfarande används */
.ann-center {
  flex: 1;
  text-align: center;
}

@media (max-width: 1200px) {
  .ann-side {
    display: none;
  }

  .ann-container {
    justify-content: center;
    padding: 0 16px;
  }

  .ann-inner {
    width: 100%;
  }

  .ann-text {
    max-width: none;
  }
}

/* Hemsidan behåller den bredare/tjockare varianten på desktop */
@media (min-width: 1201px) {
  #site-announcement {
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 20px;
  }

  .ann-container {
    max-width: 1480px;
    padding: 0 40px;
    gap: 16px;
  }

  .ann-side {
    font-weight: 600;
    color: var(--nav-white);
    white-space: nowrap;
  }

  .ann-text {
    max-width: none;
    line-height: 1.4;
  }

  .ann-link {
    white-space: nowrap;
  }
}

/* ── NAVBAR ────────────────────────────────────────────────── */
#site-navbar {
  position: relative;
  z-index: 1000;
  background: var(--nav-white);
  font-family: var(--nav-font);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
}

#nav-sticky-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* ── CONTAINER – högre specificitet för att slå igenom ──────── */
#site-navbar .nav-container {
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  transition: height 0.3s ease;
}

#site-navbar.nav-scrolled .nav-container {
  height: var(--nav-height-sm);
}

/* ── LOGO ──────────────────────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img {
  height: 46.5px;
  width: auto;
  display: block;
  transition: height 0.3s ease;
}

#site-navbar.nav-scrolled .nav-logo img {
  height: 40.5px;
}

.nav-logo-text {
  font-size: 19.5px;
  font-weight: 800;
  color: var(--nav-text);
  letter-spacing: -0.03em;
}
.nav-logo-text span {
  color: var(--nav-text);
}

/* ── DESKTOP LÄNKAR ────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  display: block;
  padding: 8px 15px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--nav-text);
  text-decoration: none;
  border-radius: 8px;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 15px;
  right: 15px;
  height: 2px;
  background: var(--nav-blue);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.nav-links li a:hover {
  color: var(--nav-blue);
  background: var(--nav-blue-light);
}

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

.nav-links li a.active {
  color: var(--nav-blue);
}

/* ── HAMBURGER ─────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 41px;
  height: 41px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s;
}

.nav-hamburger:hover {
  background: var(--nav-blue-light);
}

.nav-hamburger span {
  display: block;
  width: 23px;
  height: 2px;
  background: var(--nav-text);
  border-radius: 2px;
}

/* ── MOBIL MENY ────────────────────────────────────────────── */
.nav-mobile-menu {
  display: none;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  background: var(--nav-white);
  border-top: 1px solid var(--nav-border);
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.nav-mobile-menu.open {
  max-height: 320px;
  opacity: 1;
}

.nav-mobile-inner {
  padding: 12px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-mobile-menu a {
  display: block;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--nav-text);
  text-decoration: none;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
}

.nav-mobile-menu a:hover,
.nav-mobile-menu a.active {
  color: var(--nav-blue);
  background: var(--nav-blue-light);
}

/* ── RESPONSIV ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  #nav-sticky-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  /* Skjut ner sidans innehåll så det inte hamnar under navbar */
  body {
    padding-top: var(--nav-height);
  }

  #site-navbar .nav-container {
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    gap: 0;
  }

  .ann-container {
    padding: 0 20px;
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .ann-inner {
    order: 2;
  }

  .ann-left {
    order: 1;
  }

  .ann-right {
    order: 3;
  }

  .nav-right {
    gap: 0;
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-mobile-menu {
    display: block;
  }
}
.nav-left {
  justify-self: start;
}

.nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}
