/* Shared top nav - included via templates/mapui/_navbar.html on every
   real page. navbar.css itself is loaded on every single page (confirmed:
   all 15 templates), so it's also the one safe place for a site-wide
   mobile-overflow guard: a real bug was found where an un-scrollable wide
   table on Search forced <body> wider than the viewport, which stretched
   the navbar (width:100% of body) off both edges on mobile ("white bars on
   the sides"). Fixed at the table (see search.css's .table-scroll), but
   this is a defensive backstop against the same class of bug anywhere else
   on the site - the page should scroll vertically only, any wide content
   (tables, etc.) must contain its own horizontal scroll. */
/* overflow-x: clip, not hidden - clip prevents the same horizontal
   overflow without establishing a new scroll container, which is what
   was silently breaking every position:sticky element on the site
   (found directly: the property report's new sticky tab nav never stuck -
   any ancestor with overflow other than visible does this to sticky
   descendants, html/body included). clip achieves the identical visual
   backstop with none of that side effect. */
html { overflow-x: clip; max-width: 100%; }
body { overflow-x: clip; max-width: 100%; }

/* Promo-link offer (see apps.mapui.context_processors.promo_offer) - a
   real popup window (direct request, replacing an earlier top-banner-only
   version), auto-shown once per session (see auth-modal.js) on whichever
   page a shared promo link happens to point at. Same modal visual
   language as #auth-modal-backdrop/#auth-modal (auth-modal.css) -
   deliberately not shared markup/CSS with it since this is a standalone
   announcement, not a form. */
#promo-popup-backdrop {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(18, 35, 59, .55); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 20px;
}
#promo-popup-backdrop.open { display: flex; }
#promo-popup {
  background: #fff; border-radius: 16px; width: 100%; max-width: 380px;
  padding: 32px 28px 28px; position: relative; box-shadow: 0 24px 60px -12px rgba(18,35,59,.35);
  text-align: center;
}
#promo-popup-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: #f2f4f7; color: #4b5768; font-size: 18px; line-height: 1; cursor: pointer;
  transition: background .12s;
}
#promo-popup-close:hover { background: #e6e9ee; }
#promo-popup-text { font-size: 15px; font-weight: 600; color: #12293a; line-height: 1.5; margin: 0 0 20px; }
#promo-popup-cta {
  background: linear-gradient(135deg, #e0ac4a, #9c7020); color: #fff; border: none;
  font-weight: 700; padding: 11px 24px; border-radius: 999px; font-size: 14px; cursor: pointer;
}

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&display=swap');

/* Nivora wordmark logotype - Syne, navy-to-gold gradient text (chosen
   directly by the user from a set of font/color proofs). Two variants:
   the default reads on light surfaces (footer, auth pages); -inverse
   swaps the dark end for a pale blue so it stays legible on the navbar's
   dark navy background, where navy-on-navy text would vanish. */
.nivora-wordmark {
  font-family: 'Syne', sans-serif; font-weight: 700; letter-spacing: -.01em;
  background: linear-gradient(90deg, #12293a, #c8922e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nivora-wordmark-inverse {
  font-family: 'Syne', sans-serif; font-weight: 700; letter-spacing: -.01em;
  background: linear-gradient(90deg, #ffffff, #e0ac4a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Light navbar - direct request to move off the navy background. Text/
   border colors below are literal hex (not var()) on purpose: navbar.css
   loads on every single page, each with its own self-contained stylesheet
   that may or may not define the same custom properties (this project's
   own convention - see report.css/home.css each declaring their own
   :root), so the navbar can't safely depend on another page's tokens. */
.app-nav {
  display: flex; align-items: center; gap: 22px; padding: 0 24px; height: 60px; flex: none;
  background: #fff; color: #12233b; position: relative; z-index: 20;
  border-bottom: 1px solid #e6e9ee; box-shadow: 0 2px 16px rgba(18,35,59,.05);
}
.app-nav-brand {
  display: flex; align-items: center; text-decoration: none;
  font-size: 21px; letter-spacing: -.01em;
}

/* Real bug fix, direct report: on phones the nav (brand + 6-7 links +
   language select + profile/auth buttons, all in one fixed-width flex row)
   had no breakpoint at all - it just overflowed horizontally with no way
   to reach the links past the edge of the screen. Below 860px, the links
   and profile section collapse into a hamburger-toggled dropdown panel
   instead of trying to cram everything into one 56px-tall row. */
.app-nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 32px; height: 32px; margin-left: auto; background: none; border: none;
  cursor: pointer; padding: 0;
}
.app-nav-toggle span { display: block; width: 20px; height: 2px; background: #12233b; border-radius: 2px; }

.app-nav-collapse { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 0; }

/* Modern minimal indicator: a thin gold underline on the active item
   instead of a filled pill - direct feedback that with 8 flat links the
   bar looked cluttered/dated. The less-core pages (Piemērs/Jauni
   sludinājumi/Raksti/Paziņojumi) now live in the "Vairāk" dropdown below,
   so the always-visible row stays down to 5 links + that one trigger. */
.app-nav-links { display: flex; align-items: center; gap: 1px; margin-right: auto; }
.app-nav-links a {
  position: relative; color: #4b5768; text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 8px 11px; border-radius: 6px; transition: background .15s, color .15s;
}
.app-nav-links a:hover { background: rgba(18,35,59,.06); color: #12233b; }
.app-nav-links a.active { color: #12233b; font-weight: 600; }
.app-nav-links a.active::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #e0ac4a, #9c7020);
}

.app-nav-more { position: relative; }
.app-nav-more-btn {
  display: inline-flex; align-items: center; gap: 4px; color: #4b5768; background: none; border: none;
  font-size: 13.5px; font-weight: 500; padding: 8px 11px; border-radius: 6px; cursor: pointer;
  font-family: inherit; transition: background .15s, color .15s;
}
.app-nav-more-btn:hover, .app-nav-more.open .app-nav-more-btn { background: rgba(18,35,59,.06); color: #12233b; }
.app-nav-more-btn.active { color: #12233b; }
.app-nav-more-btn .app-nav-caret { transition: transform .15s; }
.app-nav-more.open .app-nav-more-btn .app-nav-caret { transform: rotate(180deg); }
.app-nav-more-dropdown { left: 0; right: auto; min-width: 190px; }
.app-nav-more-dropdown a.active { color: #9c7020; font-weight: 700; background: #fbf1de; }

.app-nav-profile { position: relative; display: flex; align-items: center; gap: 8px; }
.app-nav-lang { display: flex; align-items: center; }
.app-nav-lang select {
  background: #f4f6f8; color: #4b5768; border: 1px solid #e6e9ee;
  border-radius: 6px; padding: 6px 8px; font-size: 12px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .12s, color .12s;
}
.app-nav-lang select:hover { background: #eceff2; color: #12233b; }
.app-nav-lang select:focus { outline: none; box-shadow: 0 0 0 2px rgba(18,35,59,.15); }
.app-nav-lang select option { color: #16202c; }
/* Ghost/outline treatment - direct feedback that this read as a plain
   text link rather than an actual button next to the gold CTA. Same
   height/radius as .app-nav-btn so the pair reads as one deliberate
   secondary+primary button group, not two unrelated controls. */
.app-nav-link {
  color: #12233b; text-decoration: none; font-size: 13px; font-weight: 600;
  background: none; border: 1px solid #dde1e6; padding: 7px 16px; border-radius: 7px; cursor: pointer;
  font-family: inherit; transition: background .15s, border-color .15s, color .15s;
}
.app-nav-link:hover { background: rgba(18,35,59,.05); border-color: #9c7020; color: #9c7020; }
/* Same gold gradient CTA used everywhere else on the site (homepage
   hero, pricing cards) - direct feedback that this button was still on
   the old blue accent from before the navy/gold rebrand. */
.app-nav-btn {
  background: linear-gradient(135deg, #e0ac4a, #9c7020); color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 700; padding: 7px 18px; border-radius: 7px; border: none; cursor: pointer;
  font-family: inherit; transition: filter .15s, transform .15s; box-shadow: 0 2px 10px rgba(200,146,46,.35);
}
.app-nav-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

.app-nav-profile-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer;
  color: #12233b; padding: 6px 8px 6px 6px; border-radius: 20px; transition: background .12s;
}
.app-nav-profile-btn:hover { background: rgba(18,35,59,.06); }
.app-nav-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; background: linear-gradient(135deg, #e0ac4a, #9c7020); color: #1a1204; font-size: 12px; font-weight: 800;
}
.app-nav-username { font-size: 13px; font-weight: 500; }
.app-nav-caret { font-size: 9px; opacity: .7; }

.app-nav-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px;
  background: #fff; color: #16202c; border: 1px solid #e6e9ee; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(18,35,59,.12); padding: 8px; z-index: 30;
}
.app-nav-dropdown.open { display: block; }
.app-nav-dropdown-tier {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #8a94a3;
  padding: 8px 10px 6px; display: flex; align-items: center; gap: 6px;
}
.app-nav-tier-badge {
  background: #fdf1d8; color: #92650a; padding: 1px 6px; border-radius: 4px; font-size: 10px;
  text-transform: none; letter-spacing: 0; font-weight: 600;
}
.app-nav-dropdown a, .app-nav-dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 6px;
  color: #16202c; text-decoration: none; font-size: 13.5px; border: none; background: none;
  cursor: pointer; font-family: inherit;
}
.app-nav-dropdown a:hover, .app-nav-dropdown button:hover { background: #f2f5f8; }
.app-nav-dropdown form { margin: 0; }

@media (max-width: 860px) {
  .app-nav { flex-wrap: wrap; gap: 0; padding: 0 16px; }
  .app-nav-toggle { display: flex; }

  /* Collapsed by default - .open (toggled by navbar.js) reveals it as a
     full-width panel dropping down from the bar, links and profile section
     stacked vertically instead of squeezed into one row. */
  .app-nav-collapse {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-top: 1px solid #e6e9ee; max-height: calc(100vh - 60px); overflow-y: auto;
    box-shadow: 0 12px 24px rgba(18,35,59,.12);
  }
  .app-nav.open .app-nav-collapse { display: flex; }

  .app-nav-links { flex-direction: column; gap: 0; margin-right: 0; padding: 8px 8px 4px; align-items: stretch; }
  .app-nav-links a { padding: 12px 14px; }
  .app-nav-links a.active::after { display: none; }
  .app-nav-links a.active { background: rgba(18,35,59,.06); border-radius: 6px; }

  .app-nav-more-btn { width: 100%; justify-content: space-between; padding: 12px 14px; }
  .app-nav-more-btn.active { background: rgba(18,35,59,.06); border-radius: 6px; }
  .app-nav-more-dropdown { position: static; box-shadow: none; margin-top: 0; width: 100%; padding-left: 10px; }
  .app-nav-more-dropdown a { color: #4b5768; }
  .app-nav-more-dropdown a:hover { background: rgba(18,35,59,.06); color: #12233b; }
  .app-nav-more-dropdown a.active { background: rgba(18,35,59,.06); color: #12233b; }

  .app-nav-profile {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 12px 16px 16px; border-top: 1px solid #e6e9ee;
  }
  .app-nav-lang { align-self: flex-start; }
  .app-nav-profile-btn { justify-content: flex-start; width: 100%; }
  .app-nav-dropdown { position: static; box-shadow: none; margin-top: 4px; width: 100%; }
  .app-nav-link, .app-nav-btn { text-align: center; }
}
