/* ══════════════════════════════
   GLOBAL RESET (shared by every page — navbar.css loads everywhere)
══════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }

/* offset for the fixed navbar so page content doesn't start underneath it */
body { padding-top: 56px; }
@media (max-width: 768px) {
  body { padding-top: 52px; }
}

/* ══════════════════════════════
   SCROLL REVEAL (see js/reveal.js)
   Elements with class "reveal" start faded + shifted down; JS adds
   "reveal--visible" via IntersectionObserver once they scroll into
   view, and this transition animates them in.
══════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger multiple reveal elements sitting side-by-side (e.g. cards) so
   they don't all pop in at the exact same instant */
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }

/* respect users who've asked their OS to minimize motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; }
}

/* ══════════════════════════════
   NAVBAR
══════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background: #f5f3f0;
  z-index: 9999;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.navbar > ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0 2vw;
  height: 56px;
  justify-content: center;
  gap: 2px;
}
.navbar > ul > li > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font: 500 clamp(13px, 1.2vw, 15px)/1 'DM Sans', sans-serif;
  color: #4a5568;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.navbar > ul > li > a:hover { color: #8b0000; }

/* ── SVG CHEVRON ── */
.chevron {
  width: 10px; height: 6px;
  color: #8b0000;
  transition: transform 0.22s ease;
  flex-shrink: 0;
}
.has-submenu:hover > a .chevron {
  transform: rotate(180deg);
}

/* ── HAS-SUBMENU — static so fixed child works ── */
.has-submenu {
  position: static;
}

/* ── SUBMENU — FULL WIDTH MEGA MENU ── */
.submenu {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  justify-content: center;
  top: 56px;
  left: 0;
  right: 0;
  width: 100%;
  background: #f5f3f0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  border-top: 2px solid #8b0000;
  padding: 28px 0 !important;
  z-index: 9998;
  list-style: none !important;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  transition-delay: 0.2s;
  margin: 0 !important;
}

/* ── SHOW ON HOVER (desktop) ── */
.has-submenu:hover > .submenu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.submenu li {
  flex: 0 0 240px;
  margin: 0 10px;
}

.submenu li a {
  display: flex;
  flex-direction: column;
  padding: 34px 20px;
  font: 500 16px/1.3 'DM Sans', sans-serif;
  color: #1a202c;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.submenu li a span {
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  margin-top: 4px;
}
.submenu li a:hover {
  color: #8b0000;
  background: rgba(139,0,0,0.05);
}
.submenu li a:hover span { color: #8b0000; }

/* ── HAMBURGER ── */
.nav-toggle { display: none; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    z-index: 10000;
    background: #f5f3f0 !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
    padding: 14px 16px;
    cursor: pointer;
    height: 52px;
  }
  .nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: #8b0000;
    border-radius: 2px;
    transition: all 0.3s;
  }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .navbar {
    position: fixed;
    top: 0; right: -260px; left: auto;
    width: 240px; height: 100vh;
    background: #f5f3f0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
    transition: right 0.3s ease;
  }
  .navbar.open { right: 0; }

  .navbar > ul {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: 100%;
    padding: 64px 0 0;
    gap: 0;
    overflow-y: auto;
  }
  .navbar > ul > li { width: 100%; }
  .navbar > ul > li > a {
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    justify-content: space-between;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }
  .navbar > ul > li > a:hover {
    color: #8b0000;
    background: rgba(139,0,0,0.06);
  }

  /* Mobile submenu — reset to vertical stacked */
  .submenu {
    display: none !important;
    position: static !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    flex-direction: column !important;
    box-shadow: none !important;
    border-top: none !important;
    border-left: 2px solid #8b0000 !important;
    border-radius: 0 !important;
    margin-left: 16px !important;
    padding: 0 !important;
    width: auto !important;
    background: transparent !important;
    gap: 0 !important;
  }
  .has-submenu.open > .submenu {
    display: flex !important;
  }
  /* Kill CSS hover on mobile */
  .has-submenu:hover > .submenu {
    visibility: visible;
    opacity: 1;
  }
  .submenu li { flex: none; width: 100%; }
  .submenu li a {
    padding: 10px 16px;
    font-size: 13px;
    color: #1a202c;
    border-radius: 0;
  }
  .has-submenu.open > a .chevron { transform: rotate(180deg) !important; }
  .has-submenu:hover > a .chevron { transform: none; }
}
