/*
 * LBF Nav v2 — lbf-nav-v2.css
 * Architecture:
 *   #site-header  = full-width fixed transparent frame (just a z-index layer)
 *   .nav-card     = the actual floating glass card, centred with max-width + margin
 *   .nav-inner    = flex row inside card: logo | nav | actions
 *
 * This file loads AFTER style.css. All rules use specificity or !important
 * only where needed to override specific conflicting style.css declarations.
 */

/* ── §0  NEUTRALISE OLD NAV-CTA RULES FROM style.css ── */
/* style.css has .nav-cta { background: var(--gold) !important } — reset it */
.nav-cta,
.nav-cta:hover,
body.home #site-header .nav-cta,
body.home #site-header .nav-cta:hover,
body.home.is-scrolled #site-header .nav-cta,
body.is-scrolled #site-header .nav-cta {
  background: transparent !important;
  color: inherit !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-left: 0 !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

/* ── §1  HEADER FRAME (transparent, full-width, fixed) ── */
#site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  /* Z-index high enough to beat any content stacking context */
  z-index: 9999 !important;
  /* Transparent frame — all visuals on .nav-card */
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.625rem 0 0 0 !important;
  height: auto !important;
  overflow: visible !important;
  /* Must NOT be pointer-events:none — that can cause paint ordering issues */
  pointer-events: none !important;
  /* Force new stacking context above everything */
  isolation: isolate;
}
.admin-bar #site-header { top: 32px !important; }
@media screen and (max-width: 782px) {
  .admin-bar #site-header { top: 46px !important; }
}

/* ── §2  FLOATING GLASS CARD ── */
.nav-card {
  pointer-events: all;
  max-width: calc(1480px - 2 * clamp(0.75rem, 2vw, 1.5rem));
  margin: 0 auto;
  border-radius: 18px;
  /* Translucent at rest — solidifies visibly on scroll */
  background: rgba(255,255,255,0.80);
  border: 1px solid rgba(219,231,251,0.75);
  box-shadow: 0 4px 18px rgba(28,53,101,0.07);
  overflow: visible;
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
/* Scrolled: fully opaque white, blue-tinted top border, stronger shadow */
body.is-scrolled .nav-card {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: #cdd9f5;
  box-shadow:
    0 2px 0 rgba(47,93,170,0.15),
    0 8px 30px rgba(28,53,101,0.13);
}

/* ── §3  INNER FLEX ROW ── */
.nav-inner {
  transition: height 0.3s ease;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  height: 62px !important;
  padding: 0 1.25rem !important;
  gap: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  overflow: visible !important;
  transition: height 0.3s ease;
}
body.is-scrolled .nav-inner { height: 54px !important; transition: height 0.3s ease; }

/* ── §4  LOGO ── */
.site-branding {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  margin-right: 1.25rem !important;
  text-decoration: none !important;
  overflow: visible !important;
  position: static !important;
  transform: none !important;
}
.site-branding .lbf-nav-logo,
.site-branding .custom-logo {
  height: 52px !important;
  width: auto !important;
  max-width: none !important;
  display: block !important;
  object-fit: contain !important;
}
body.is-scrolled .site-branding .lbf-nav-logo,
body.is-scrolled .site-branding .custom-logo { height: 36px !important; }

/* ── §5  DESKTOP NAV ── */
#primary-navigation {
  flex: 1 1 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.nav-menu {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0 !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.nav-menu li a {
  display: block !important;
  padding: 0.4rem 0.6rem !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: #374151 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  border-radius: 7px !important;
  box-shadow: none !important;
  transition: color 0.14s ease, background 0.14s ease !important;
}
.nav-menu li a:hover,
.nav-menu li a[aria-current="page"] {
  color: #2f5daa !important;
  background: rgba(47,93,170,0.07) !important;
  box-shadow: inset 0 -2px 0 #2f5daa !important;
  font-weight: 700 !important;
}

/* ── §6  MOBILE BAR (hidden on desktop) ── */
.nav-mobile-bar { display: none !important; }

/* ── §7  RIGHT ACTIONS ── */
.nav-actions {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-left: 0.75rem !important;
  position: relative !important;
  flex-wrap: nowrap !important;
}

/* Search pill */
.nav-search-form {
  display: flex !important;
  align-items: center !important;
  gap: 0.375rem !important;
  height: 36px !important;
  width: 180px;
  /* Icon left, input right — reversed order via flex-direction normal, icon first */
  padding: 0 12px 0 10px !important;
  background: #fff !important;
  border: 1.5px solid #cfe0fb !important;
  border-radius: 999px !important;
  box-shadow: 0 2px 10px rgba(47,93,170,0.06) !important;
  flex-shrink: 0 !important;
  transition: border-color 0.18s, box-shadow 0.18s, width 0.22s !important;
}
.nav-search-form:focus-within {
  border-color: #8fb5ff !important;
  box-shadow: 0 4px 18px rgba(47,93,170,0.13) !important;
  width: 230px;
}
/* Magnifier icon stays left */
.nav-search-icon { display: flex; align-items: center; flex-shrink: 0; color: #5f7eb7; }
.nav-search-icon svg { width: 15px; height: 15px; }
/* Input fills remaining space, text right-aligned */
.nav-search-input {
  flex: 1 !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-size: 0.8125rem !important;
  color: #0e1525 !important;
  min-width: 0 !important;
  text-align: right !important;
}
.nav-search-input::placeholder { color: #9ca3af; text-align: right; }
.nav-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
/* Blue Search button hidden */
.nav-search-btn {
  display: none !important;
}

/* CTA buttons — rounded rectangle
   Using high-specificity selectors to beat style.css .nav-cta rules */
#site-header .nav-cta--outline,
#site-header .nav-cta--gold,
.nav-cta--outline,
.nav-cta--gold {
  flex-shrink: 0 !important;
  height: 34px !important;
  padding: 0 0.9rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  margin: 0 !important;
  transition: background 0.14s ease, border-color 0.14s ease !important;
}
#site-header .nav-cta--outline,
.nav-cta--outline {
  background: transparent !important;
  color: #2f5daa !important;
  border: 1.5px solid rgba(47,93,170,0.3) !important;
  box-shadow: none !important;
}
#site-header .nav-cta--outline:hover,
.nav-cta--outline:hover {
  background: rgba(47,93,170,0.06) !important;
  border-color: #2f5daa !important;
}
#site-header .nav-cta--gold,
.nav-cta--gold {
  background: #f3c303 !important;
  color: #16325c !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(200,150,0,0.2) !important;
}
#site-header .nav-cta--gold:hover,
.nav-cta--gold:hover { background: #c9a000 !important; }

/* ── §8  LIVE RESULTS DROPDOWN ── */
.nav-live-results {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  width: 520px !important;
  max-width: calc(100vw - 2rem) !important;
  background: #fff !important;
  border: 1px solid #dbe7fb !important;
  border-radius: 18px !important;
  box-shadow: 0 20px 60px rgba(28,53,101,0.14) !important;
  overflow: hidden !important;
  z-index: 1100 !important;
}
.nav-live-results[hidden] { display: none !important; }

.nav-live-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; }
.nav-live-col { padding: 0.875rem 1.125rem; }
.nav-live-col + .nav-live-col { border-left: 1px solid #f0f4fb; }
.nav-live-col-label { font-size: 0.67rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.17em; color: #6f87b6; margin-bottom: 0.5rem; font-family: 'Plus Jakarta Sans',sans-serif; }
.nav-live-quick { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.375rem; border-radius: 10px; text-decoration: none; color: #1e293b; transition: background 0.1s; }
.nav-live-quick:hover, .nav-live-quick.is-focused { background: #f2f7ff; }
.nav-live-quick-icon { width: 28px; height: 28px; border-radius: 8px; background: #edf4ff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #2f5daa; }
.nav-live-quick-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav-live-quick-title { font-size: 0.7875rem; font-weight: 700; color: #1e293b; display: block; font-family: 'Plus Jakarta Sans',sans-serif; }
.nav-live-quick-sub   { font-size: 0.68rem; color: #94a3b8; display: block; }
.nav-live-result { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.5rem 0.375rem; border-radius: 10px; text-decoration: none; color: #1e293b; transition: background 0.1s; }
.nav-live-result:hover, .nav-live-result.is-focused { background: #f2f7ff; }
.nav-live-result-tag { display: inline-flex; align-self: flex-start; background: #edf4ff; color: #2f5daa; font-size: 0.63rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; border-radius: 999px; padding: 0.1em 0.45em; }
.nav-live-result-title { font-size: 0.7875rem; font-weight: 700; color: #1e293b; font-family: 'Plus Jakarta Sans',sans-serif; }
.nav-live-result-title mark { background: none; color: #2f5daa; font-weight: 800; }
.nav-live-result-desc  { font-size: 0.7rem; color: #64748b; }
.nav-live-footer { border-top: 1px solid #f0f4fb; padding: 0.5rem 1.125rem; display: flex; align-items: center; justify-content: space-between; }
.nav-live-footer a { font-size: 0.775rem; font-weight: 700; color: #2f5daa; text-decoration: none; display: flex; align-items: center; gap: 0.3rem; font-family: 'Plus Jakarta Sans',sans-serif; }
.nav-live-footer a svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.nav-live-single { padding: 1.25rem; text-align: center; font-size: 0.85rem; color: #64748b; font-family: 'Plus Jakarta Sans',sans-serif; }
.nav-live-single strong { display: block; color: #1e293b; margin-bottom: 0.2rem; }
.nav-spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(47,93,170,0.15); border-top-color: #2f5daa; border-radius: 50%; animation: nav-spin 0.65s linear infinite; vertical-align: middle; margin-right: 0.4rem; }
@keyframes nav-spin { to { transform: rotate(360deg); } }

/* ── §9  MOBILE NAV PANEL ── */
.mobile-nav-panel {
  position: fixed;
  top: calc(62px + 0.625rem + 0.625rem);  /* header height + top offset + gap */
  left: 0.75rem; right: 0.75rem;
  z-index: 999;
  background: linear-gradient(180deg,#fff 0%,#f7fbff 100%);
  border: 1px solid #dbe7fb;
  border-radius: 18px;
  box-shadow: 0 16px 56px rgba(28,53,101,0.15);
  padding: 1rem;
  transform-origin: top center;
  transform: scale(0.97) translateY(-6px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s ease;
}
.mobile-nav-panel[hidden] { display: none !important; }
.mobile-nav-panel.is-open { display: block !important; transform: scale(1) translateY(0); opacity: 1; }

.mobile-nav-search { display: flex; align-items: center; gap: 0.4rem; background: #f8fbff; border: 1.5px solid #cfe0fb; border-radius: 999px; padding: 0 0.75rem; height: 42px; margin-bottom: 0.75rem; }
.mobile-nav-search:focus-within { border-color: #8fb5ff; }
.mobile-nav-search-icon { display: flex; align-items: center; color: #5f7eb7; flex-shrink: 0; }
.mobile-nav-search-icon svg { width: 15px; height: 15px; }
.mobile-nav-search-input { flex: 1; border: none !important; outline: none !important; background: transparent; font-family: 'Plus Jakarta Sans',sans-serif; font-size: 0.875rem; color: #0e1525; }
.mobile-nav-search-input::placeholder { color: #9ca3af; }

.mobile-nav-chips { display: flex; gap: 0.375rem; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: none; margin-bottom: 0.75rem; }
.mobile-nav-chips::-webkit-scrollbar { display: none; }
.mobile-chip { flex-shrink: 0; white-space: nowrap; border-radius: 999px; border: 1.5px solid #d9e5fa; background: #fff; padding: 0.3rem 0.7rem; font-family: 'Plus Jakarta Sans',sans-serif; font-size: 0.75rem; font-weight: 700; color: #374151; text-decoration: none; }
.mobile-chip:hover { background: #edf4ff; color: #2f5daa; }

.mobile-nav-menu { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.mobile-nav-menu li a { display: block; padding: 0.65rem 0.875rem; border-radius: 11px; font-family: 'Plus Jakarta Sans',sans-serif; font-size: 0.9375rem; font-weight: 600; color: #1e293b; text-decoration: none; transition: background 0.12s, color 0.12s; }
.mobile-nav-menu li a:hover { background: rgba(47,93,170,0.07); color: #2f5daa; }

.mobile-nav-ctas { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px solid #edf2fb; }
.mobile-nav-cta { display: flex; align-items: center; justify-content: center; height: 42px; border-radius: 10px; font-family: 'Plus Jakarta Sans',sans-serif; font-size: 0.875rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.mobile-nav-cta--outline { background: #f3c303; color: #16325c; border: none; } /* override: both CTAs gold */
.mobile-nav-cta--gold    { background: #f3c303; color: #16325c; border: none; }

/* Mobile top-bar buttons (hamburger + search icon) */
.menu-toggle {
  display: flex !important;
  flex-direction: column !important; justify-content: center !important; gap: 5px !important;
  width: 38px !important; height: 38px !important;
  background: rgba(255,255,255,0.9) !important;
  border: 1.5px solid #d8e4f8 !important;
  border-radius: 10px !important;
  cursor: pointer !important; padding: 7px !important;
  visibility: hidden; /* desktop hidden; mobile uses §10 */
}
.menu-toggle .bar { display: block; height: 2px; background: #2f5daa; border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-search-trigger { display: none !important; }
.mobile-search-trigger svg { width: 17px; height: 17px; }

.nav-backdrop { position: fixed; inset: 0; z-index: 998; background: rgba(5,20,60,0.35); opacity: 0; transition: opacity 0.2s ease; }
.nav-backdrop[hidden] { display: none !important; }
.nav-backdrop.is-visible { opacity: 1; }

/* ── §10  RESPONSIVE ── */
@media (max-width: 1100px) {
  .nav-menu li a { font-size: 0.775rem !important; padding: 0.375rem 0.45rem !important; }
  .nav-search-form { width: 140px; }
  .nav-cta--outline, .nav-cta--gold { padding: 0 0.7rem !important; font-size: 0.75rem !important; }
}

@media (max-width: 767px) {
  #primary-navigation { display: none !important; }
  .nav-actions        { display: none !important; }
  .nav-mobile-bar     { display: flex !important; align-items: center; gap: 0.4rem; margin-left: auto; }
  .menu-toggle            { visibility: visible !important; }
  .mobile-search-trigger  { visibility: visible !important; }

  .nav-inner { height: 58px !important; padding: 0 0.875rem !important; }
  body.is-scrolled .nav-inner { height: 52px !important; }

  /* Logo centred on mobile */
  .site-branding {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-right: 0 !important;
  }
  .site-branding .lbf-nav-logo,
  .site-branding .custom-logo { height: 36px !important; }

  .mobile-nav-panel { top: calc(58px + 0.625rem + 0.5rem); }
  body.is-scrolled .mobile-nav-panel { top: calc(52px + 0.625rem + 0.5rem); }
}
@media (max-width: 480px) { .mobile-nav-ctas { grid-template-columns: 1fr; } }

/* Accessibility */
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
