/* ------------------------------------------------
   :root Variables
--------------------------------------------------- */
:root {
  /* DESKTOP: measure your actual .main-nav height in px */
  --nav-height: 80px;

  /* MOBILE: measure your mobile .main-nav height in px */
  --nav-height-mobile: 64px;
}

/* ------------------------------------------------
   1. Base Reset & Layout
--------------------------------------------------- */
html {
  box-sizing: border-box;
  overflow-x: hidden;
}



*, *::before, *::after {
  box-sizing: inherit;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding-top: var(--nav-height);
  padding-right: 0;
  padding-left: 0;
  padding-bottom: 20px;
  color: #2a2a2a;
  line-height: 1.6;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------
   2. Navigation Bar
--------------------------------------------------- */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #001f3f;
  color: #fff;
  padding: 0 20px;  /* vertical centering via height */
}

.nav-left {
  display: flex;
  align-items: center;
}
.nav-logo img {
  height: calc(var(--nav-height) - 32px); /* account for nav top/bottom padding if any */
  object-fit: contain;
}

.nav-center {
  flex-grow: 1;
  text-align: center;
}
.nav-page-title {
  font-size: 1.8em;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-right {
  display: flex;
  align-items: center;
}
.menu-toggle {
  font-size: 1.4em;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 10px;
}

.nav-links {
  display: none;
  flex-direction: column;
  background: #001f3f;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 10px 0;
  text-align: center;
}
.nav-links.show {
  display: flex;
}
.nav-links li {
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 10px 20px;
  margin: 6px auto;
  background: #fff;
  color: #1c2f41;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #1c2f41;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
}
.nav-links a:hover {
  background: #1c2f41;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}



/* ------------------------------------------------
   3. Desktop Overrides
--------------------------------------------------- */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
  .nav-links {
    display: flex !important;
    flex-direction: row;
    justify-content: flex-end;
    position: static;
    background: none;
    padding: 0;
  }



  .nav-links a {
    margin: 0 10px;
  }
}

/* ------------------------------------------------
   4. Page Headings
--------------------------------------------------- */
h1 {
  text-align: center;
  font-weight: 700;
  color: #fff;
  background: #001f3f;
  margin: 20px 0;
  padding: 20px;
  border-radius: 8px;
  font-size: 2.5em;
}
h2 {
  font-size: 2em;
}




/* ------------------------------------------------
   5. Search Box (Edge-to-Edge, Clipped)
--------------------------------------------------- */
.search-box {
  position: sticky;
  top: calc(var(--nav-height) - 1px); /* clip 1px under nav */
  margin: 0 auto;
  width: 100%;
  max-width: none;

  background: #001f3f;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  z-index: 999;
}
.search-box,
.search-box * {
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.search-box form {
  display: flex;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 20px;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.search-box input {
  flex: 1;
  padding: 12px 14px;
  font-size: 1em;
  border: none;
  background: #fff;
  border-radius: 4px 0 0 4px;
  outline: none;
}

.search-box button {
  background: #3399cc;
  border: none;
  padding: 0 16px;
  font-size: 1.3em;
  color: #fff;
  cursor: pointer;
  border-radius: 0 4px 4px 0;
}
.search-box button:hover {
  background: #227799;
}

/* ------------------------------------------------
   6. Timeline Entries
--------------------------------------------------- */
.year-header {
  font-size: 1.6em;
  font-weight: 700;
  color: #3399cc;
  border-bottom: 2px solid #ccd9e2;
  margin: 50px 0 15px;
  padding-bottom: 4px;
}
.crash-entry {
  background: #fff;
  padding: 24px;
  margin-bottom: 24px;
  border-left: 5px solid #3399cc;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border-radius: 8px;
}
.crash-entry h3 {
  margin: 0 0 12px;
  font-size: 1.3em;
  color: #1c2f41;
}
.field {
  margin: 6px 0;
}
.controls {
  margin-top: 12px;
}
.timeline-link {
  margin-right: 20px;
  color: #3399cc;
}
.timeline-link:hover {
  color: #0077cc;
  text-decoration: underline;
}
.cvr-icon {
  cursor: pointer;
  font-size: 1.3em;
  color: #228b22;
}

/* ------------------------------------------------
   7. Donate Page
--------------------------------------------------- */
.content {
  max-width: 800px;
  margin: 40px auto;
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.qr-placeholder {
  text-align: center;
  margin: 40px 0;
}
.qr-placeholder img {
  max-width: 250px;
  width: 100%;
  border: 2px solid #ccd9e2;
  border-radius: 8px;
}
.donate-button {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 24px;
  background: #3399cc;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.donate-button:hover {
  background: #227799;
}

/* ------------------------------------------------
   8. Mobile Overrides
--------------------------------------------------- */
@media (max-width: 768px) {
  /* bump body padding to mobile nav height */
  body {
    padding-top: var(--nav-height-mobile);
  }

  .main-nav {
    height: var(--nav-height-mobile);
    padding: 0 12px;
  }
  .nav-logo img {
    height: calc(var(--nav-height-mobile) - 16px);
  }
  .menu-toggle {
    font-size: 1.3em;
    padding: 6px;
  }
  .nav-left {
    gap: 10px;
  }
  .nav-right {
    margin-left: auto;
  }
  .nav-page-title {
    font-size: 1.2em;
    line-height: 1;
  }

  .search-box {
    top: calc(var(--nav-height-mobile) - 1px) !important;
    margin: 0;
    width: 100vw;
  }
  .search-box form {
    padding: 8px 12px;
  }
  .search-box input {
    padding: 10px;
    font-size: 1em;
  }
  .search-box button {
    padding: 10px 12px;
    font-size: 1.2em;
  }

  .year-header {
    font-size: 1.4em;
  }
  .crash-entry {
    padding: 16px;
  }
}