/* Shared site navbar — logo left + links (homepage + articles) */
:root {
  --bas-blue: #2563EB;
  --bas-ink: #121212;
  --bas-muted: #5a5a5a;
  --bas-border: #e2e2e2;
  --bas-white: #ffffff;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
}

html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
}

.np-header {
  position: sticky;
  top: 0;
  z-index: 3000;
  background: var(--bas-white);
  border-bottom: 1px solid var(--bas-border);
  font-family: var(--font-sans);
  overflow: visible;
}

.np-nav-bar,
.np-nav-inner,
.np-navbar,
.np-dropdown {
  overflow: visible;
}

.np-edition-bar {
  background: var(--bas-white);
  border-bottom: 1px solid var(--bas-border);
}

.np-edition-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 24px;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  color: var(--bas-muted);
  letter-spacing: 0.02em;
}

.np-disclosure-link {
  color: var(--bas-muted);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.np-disclosure-link:hover {
  color: var(--bas-ink);
}

/* Single row: logo left | nav center | search right */
.np-nav-bar {
  background: var(--bas-white);
  overflow: visible;
}

.np-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  overflow: visible;
}

.np-nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  justify-self: start;
  margin-right: 0;
}

.np-nav-logo img,
.np-logo {
  height: 60px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  display: block;
}

.np-navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 0;
  background: transparent;
  border: none;
}

.np-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 4px;
}


/* Top-level nav links only — do not bleed into dropdown panels */
.np-navbar > a,
.np-navbar > a:visited {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--bas-ink) !important;
  text-decoration: none !important;
  padding: 10px 16px;
  border: none;
  transition: color 0.15s, text-decoration-color 0.15s;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: 0;
}

.np-navbar > a:hover,
.np-navbar > a.active {
  background: transparent !important;
  color: var(--bas-ink) !important;
  text-decoration: underline !important;
  text-underline-offset: 4px;
}

/* Articles dropdown */
.np-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.np-dropdown-toggle {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--bas-ink) !important;
  text-decoration: none !important;
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.np-dropdown-toggle::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-top: 1px;
  opacity: 0.55;
  transition: transform 0.18s ease;
}

.np-dropdown:hover .np-dropdown-toggle::after,
.np-dropdown:focus-within .np-dropdown-toggle::after {
  transform: rotate(180deg);
}

.np-dropdown:hover .np-dropdown-toggle,
.np-dropdown:focus-within .np-dropdown-toggle {
  color: var(--bas-blue) !important;
  text-decoration: none !important;
}

.np-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d0d7e2;
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.14),
    0 4px 12px rgba(15, 23, 42, 0.08);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 3200;
  border-radius: 12px;
  isolation: isolate;
}

/* Invisible bridge so menu doesn't close in the gap under the toggle */
.np-dropdown-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
  background: transparent;
}

/* Category list panel — compact */
.np-dropdown-menu.np-mega-menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
  left: 0;
  right: auto;
  width: 232px;
  min-width: 220px;
  max-width: min(240px, calc(100vw - 32px));
  padding: 6px;
  overflow: visible;
  transform: translateY(6px);
  background-color: #ffffff !important;
}

.np-dropdown-menu.np-mega-menu::after {
  content: "Browse topics";
  order: -1;
  display: block;
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 6px 10px 8px;
  margin: 0 2px 2px;
  border-bottom: 1px solid #e8edf4;
  background: transparent;
}

.np-dropdown:hover .np-dropdown-menu,
.np-dropdown:focus-within .np-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.np-dropdown-section {
  padding: 0;
  position: relative;
  background: transparent;
}

.np-dropdown-section + .np-dropdown-section {
  border-top: none;
}

.np-dropdown-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #1e293b !important;
  text-decoration: none !important;
  padding: 8px 10px;
  line-height: 1.25;
  border-radius: 8px;
  background: transparent;
  transition: background 0.12s ease, color 0.12s ease;
}

.np-flyout > .np-dropdown-label::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.np-dropdown-menu .np-dropdown-label:hover,
.np-dropdown-menu .np-flyout:hover > .np-dropdown-label,
.np-dropdown-menu .np-flyout:focus-within > .np-dropdown-label {
  color: var(--bas-blue) !important;
  text-decoration: none !important;
  background-color: #eff6ff !important;
  box-shadow: none;
}

.np-flyout:hover > .np-dropdown-label::after,
.np-flyout:focus-within > .np-dropdown-label::after {
  opacity: 1;
  transform: rotate(45deg) translate(1px, -1px);
}

/* Article flyout panel */
.np-flyout-panel {
  position: absolute;
  top: -6px;
  left: calc(100% + 6px);
  min-width: 280px;
  width: max(280px, max-content);
  max-width: min(340px, calc(100vw - 40px));
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d0d7e2;
  border-radius: 12px;
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.14),
    0 4px 12px rgba(15, 23, 42, 0.08);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(6px);
  transform-origin: left top;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 3300;
  isolation: isolate;
}

/* Hover bridge between category and flyout */
.np-flyout-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -12px;
  width: 12px;
  background: transparent;
}

.np-flyout-panel.is-left {
  left: auto;
  right: calc(100% + 6px);
  transform: translateX(-6px);
  transform-origin: right top;
}

.np-flyout-panel.is-left::before {
  left: auto;
  right: -12px;
}

.np-flyout:hover > .np-flyout-panel,
.np-flyout:focus-within > .np-flyout-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.np-flyout:hover > .np-flyout-panel.is-left,
.np-flyout:focus-within > .np-flyout-panel.is-left {
  transform: translateX(0);
}

.np-dropdown-menu a.np-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569 !important;
  text-decoration: none !important;
  padding: 7px 10px;
  white-space: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  border-radius: 8px;
  background: transparent;
  transition: background 0.12s ease, color 0.12s ease;
}

.np-dropdown-menu a.np-dropdown-item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  margin-top: 0.4em;
  transition: background 0.12s ease;
}

.np-dropdown-menu a.np-dropdown-item:hover {
  color: var(--bas-blue) !important;
  background-color: #f1f5f9 !important;
  text-decoration: none !important;
  transform: none;
}

.np-dropdown-menu a.np-dropdown-item:hover::before {
  background: var(--bas-blue);
  transform: none;
}

@media (max-width: 900px) {
  .np-dropdown-menu.np-mega-menu {
    width: min(240px, calc(100vw - 32px));
    background-color: #ffffff !important;
  }

  .np-dropdown-menu.np-mega-menu::after {
    display: none;
  }

  .np-flyout-panel {
    position: static;
    left: auto;
    right: auto;
    width: auto;
    max-width: none;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 2px 6px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    background-color: transparent !important;
  }

  .np-flyout-panel::before {
    display: none;
  }

  .np-flyout > .np-dropdown-label::after {
    display: none;
  }

  .np-dropdown-menu a.np-dropdown-item {
    padding: 7px 10px 7px 14px;
    font-size: 0.8125rem;
  }
}

.np-nav-logo,
.np-nav-logo:hover {
  color: inherit !important;
  background: none !important;
  text-decoration: none !important;
}

.np-search-btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--bas-ink) !important;
  text-decoration: none !important;
  padding: 10px 12px;
  border: none;
  transition: color 0.15s, text-decoration-color 0.15s;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: 0;
}

.np-search-btn:hover {
  background: transparent !important;
  color: var(--bas-ink) !important;
  text-decoration: underline !important;
  text-underline-offset: 4px;
}

.np-search-btn svg {
  width: 16px;
  height: 16px;
}

/* Search overlay (shared across all pages) */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2100;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.search-overlay.active {
  display: flex;
}

.search-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 560px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid var(--bas-border);
  border-radius: 8px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.search-box input:focus {
  border-color: var(--bas-blue);
}

.search-results {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.search-result-item {
  display: block;
  padding: 12px;
  border-bottom: 1px solid var(--bas-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: #f8fafc;
  color: var(--bas-ink);
}

.search-result-item .category-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bas-blue);
  margin-bottom: 4px;
}

.search-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.np-mobile-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--bas-ink);
  flex-shrink: 0;
}

.np-mobile-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

@media (max-width: 900px) {
  .np-nav-inner {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .np-navbar {
    display: none;
  }

  .np-nav-actions {
    gap: 2px;
  }

  .np-mobile-btn {
    display: flex;
    margin-left: 0;
  }

  /* Keep search usable on mobile without crowding the old hamburger flow */
  .np-search-btn {
    padding: 8px 10px;
    font-size: 0;
    gap: 0;
  }

  .np-search-btn svg {
    width: 18px;
    height: 18px;
  }

  .np-nav-logo {
    margin-right: 0;
  }

  .np-nav-inner {
    padding: 10px 16px;
  }

  .np-nav-logo img,
  .np-logo {
    height: 50px;
  }

  .np-edition-inner {
    padding: 6px 16px;
    font-size: 0.625rem;
  }

  .np-edition-label {
    display: none;
  }
}

/* Mobile drawer (same behavior as homepage) */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #fff;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-sans);
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bas-border);
  flex-shrink: 0;
}

.mobile-nav-header .header-logo,
.mobile-nav-header img {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.mobile-nav-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--bas-ink);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 8px 24px;
}

.mobile-nav-links > a,
.mobile-nav-group a {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bas-ink);
  text-decoration: none;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bas-border);
  white-space: normal;
  line-height: 1.35;
}

.mobile-nav-links > a:hover,
.mobile-nav-group a:hover {
  color: var(--bas-blue);
}

.mobile-nav-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-bottom: none;
  padding: 0;
  margin: 0 8px 6px;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}

.mobile-nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--bas-ink);
  padding: 14px 16px;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
}

.mobile-nav-group-title::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.45;
  transition: transform 0.18s ease;
  margin-top: -3px;
}

.mobile-nav-group.is-open .mobile-nav-group-title {
  color: var(--bas-blue);
  background: #eff6ff;
}

.mobile-nav-group.is-open .mobile-nav-group-title::after {
  transform: rotate(225deg);
  margin-top: 3px;
  opacity: 0.8;
}

.mobile-nav-group a {
  display: none;
  border-bottom: none;
  padding: 11px 16px 11px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  background: #fff;
  border-top: 1px solid #eef2f7;
}

.mobile-nav-group.is-open a {
  display: block;
}

.mobile-nav-group a:hover {
  color: var(--bas-blue);
  background: #f8fafc;
}

/* Compact newsletter strip — landing pages */
.bas-newsletter {
  background: #eff6ff;
  border-top: 1px solid #dbeafe;
  border-bottom: 1px solid #dbeafe;
  padding: 0.85rem 1rem;
}

.bas-newsletter-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1rem;
}

.bas-newsletter-title {
  font-family: var(--font-sans, Inter, sans-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e3a8a;
  margin: 0;
  white-space: nowrap;
}

.bas-newsletter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 280px;
  max-width: 420px;
}

.bas-newsletter-form input[type="email"] {
  flex: 1 1 160px;
  min-width: 0;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-family: var(--font-sans, Inter, sans-serif);
  font-size: 0.875rem;
  color: #0f172a;
  background: #fff;
}

.bas-newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.bas-newsletter-form button {
  height: 36px;
  padding: 0 0.95rem;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font-family: var(--font-sans, Inter, sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.bas-newsletter-form button:hover {
  background: #1e3a8a;
}

.bas-newsletter-msg {
  width: 100%;
  margin: 0;
  text-align: center;
  font-family: var(--font-sans, Inter, sans-serif);
  font-size: 0.75rem;
  color: #1e40af;
}

@media (max-width: 600px) {
  .bas-newsletter {
    padding: 0.75rem 0.85rem;
  }

  .bas-newsletter-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .bas-newsletter-title {
    text-align: center;
    white-space: normal;
  }

  .bas-newsletter-form {
    max-width: none;
    flex: 1 1 auto;
  }
}
