/**
 * Utilities — token-based replacements for the handful of Bootstrap 4
 * classes the markup relied on (navbar system + a few layout helpers).
 * Replaces ~25KB of Bootstrap CSS with ~150 lines scoped to actual usage.
 */

/* ============================================
   LAYOUT HELPERS
   ============================================ */
.container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
  box-sizing: border-box;
}

.d-flex { display: flex; }
.text-center { text-align: center; }
.justify-content-center { justify-content: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ============================================
   SCREEN-READER / SKIP LINK
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100000;
  padding: 0.6rem 1rem;
  background: var(--color-accent-primary, #8C1515);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-family: var(--font-body, system-ui, sans-serif);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ============================================
   NAVBAR SYSTEM (replaces .navbar / .navbar-expand-lg / collapse)
   Behavior mirrors Bootstrap 4 navbar-expand-lg (breakpoint 992px).
   ============================================ */
.navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.fixed-top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
}

/* Toggler (hamburger) — shown only below the lg breakpoint */
.navbar-toggler {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}

.navbar-toggler-icon {
  display: inline-block;
  width: 1.4em;
  height: 1.4em;
  vertical-align: middle;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.85)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Collapsible content */
.navbar-collapse {
  flex-basis: 100%;
  flex-grow: 1;
  align-items: center;
}

/* Bootstrap-style collapse: hidden unless .show (mobile) */
.collapse:not(.show) {
  display: none;
}

/* Nav list */
.navbar-nav {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.navbar-nav .nav-item { display: block; }

.nav-link {
  display: block;
  text-decoration: none;
}

/* ---- Desktop (lg and up): expand the navbar ---- */
@media (min-width: 992px) {
  .navbar-expand-lg {
    flex-flow: row nowrap;
    justify-content: flex-start;
  }
  .navbar-expand-lg .navbar-toggler {
    display: none;
  }
  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }
  .navbar-expand-lg .navbar-nav {
    flex-direction: row;
  }
}

/* ---- Mobile (below lg): stacked menu when toggled open ---- */
@media (max-width: 991.98px) {
  .navbar-collapse.show {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem 0;
  }
  .navbar-collapse.show .navbar-nav {
    width: 100%;
    gap: 0.25rem;
  }
  .navbar-collapse.show .nav-social {
    justify-content: center;
    margin-top: 0.75rem;
  }
}
