/* ============================================
   Abbhitrust Navigation Menu
   A warm, refined navigation for charitable trust
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

/* CSS Custom Properties - Scoped to navigation */
.abbhitrust-nav {
  --nav-bg: #FFFBF5;
  --nav-bg-scrolled: rgba(255, 251, 245, 0.97);
  --nav-text: #2D3436;
  --nav-text-muted: #636E72;
  --nav-accent: #D35400;
  --nav-accent-light: #E67E22;
  --nav-accent-glow: rgba(211, 84, 0, 0.15);
  --nav-border: rgba(45, 52, 54, 0.08);
  --nav-dropdown-bg: #FFFFFF;
  --nav-dropdown-shadow: 0 20px 60px rgba(45, 52, 54, 0.15), 0 8px 20px rgba(45, 52, 54, 0.08);
  --nav-transition: cubic-bezier(0.4, 0, 0.2, 1);
  --nav-font-brand: 'Cormorant Garamond', Georgia, serif;
  --nav-font-ui: 'DM Sans', -apple-system, sans-serif;
}

/* Reset & Base */
.abbhitrust-nav *,
.abbhitrust-nav *::before,
.abbhitrust-nav *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Main Navigation Container */
.abbhitrust-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  transition: all 0.4s var(--nav-transition);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.abbhitrust-nav.scrolled {
  background: var(--nav-bg-scrolled);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(45, 52, 54, 0.06);
}

/* Decorative Top Accent Line */
.abbhitrust-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--nav-accent) 0%,
    var(--nav-accent-light) 25%,
    #F39C12 50%,
    var(--nav-accent-light) 75%,
    var(--nav-accent) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Navigation Inner Container */
.abbhitrust-nav__container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  transition: height 0.4s var(--nav-transition);
}

.abbhitrust-nav.scrolled .abbhitrust-nav__container {
  height: 68px;
}

/* Logo/Brand Section */
.abbhitrust-nav__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--nav-text);
  transition: transform 0.3s var(--nav-transition);
}

.abbhitrust-nav__brand:hover {
  transform: translateY(-1px);
}

.abbhitrust-nav__logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: contain;
  transition: all 0.4s var(--nav-transition);
}

.abbhitrust-nav.scrolled .abbhitrust-nav__logo {
  width: 44px;
  height: 44px;
}

/* Logo SVG Container */
.abbhitrust-nav__logo-svg {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--nav-transition);
}

.abbhitrust-nav.scrolled .abbhitrust-nav__logo-svg {
  width: 44px;
  height: 44px;
}

.abbhitrust-nav__logo-svg svg {
  width: 100%;
  height: 100%;
  color: var(--nav-accent);
  fill: var(--nav-accent);
}

.abbhitrust-nav__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.abbhitrust-nav__brand-name {
  font-family: var(--nav-font-brand);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nav-text);
  letter-spacing: -0.02em;
}

.abbhitrust-nav__brand-tagline {
  font-family: var(--nav-font-ui);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--nav-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
  max-width: 180px;
  line-height: 1.3;
}

/* Main Menu */
.abbhitrust-nav__menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.abbhitrust-nav__item {
  position: relative;
}

.abbhitrust-nav__link {
  font-family: var(--nav-font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--nav-text);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s var(--nav-transition);
  position: relative;
}

.abbhitrust-nav__link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--nav-accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--nav-transition);
}

.abbhitrust-nav__link:hover {
  color: var(--nav-accent);
  background: var(--nav-accent-glow);
}

.abbhitrust-nav__link:hover::after {
  transform: scaleX(1);
}

/* Non-clickable parent links (span elements) */
span.abbhitrust-nav__link {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* Dropdown Arrow */
.abbhitrust-nav__arrow {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
  transition: transform 0.3s var(--nav-transition);
}

.abbhitrust-nav__item:hover .abbhitrust-nav__arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.abbhitrust-nav__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 220px;
  background: var(--nav-dropdown-bg);
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--nav-dropdown-shadow);
  border: 1px solid var(--nav-border);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--nav-transition);
  list-style: none;
}

.abbhitrust-nav__dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 16px;
}

.abbhitrust-nav__item:hover .abbhitrust-nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1080px) {
  .abbhitrust-nav__item:hover .abbhitrust-nav__dropdown {
    transform: none;
  }
}

.abbhitrust-nav__dropdown-item {
  margin: 2px 0;
}

.abbhitrust-nav__dropdown-link {
  font-family: var(--nav-font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--nav-text-muted);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 10px;
  display: block;
  transition: all 0.25s var(--nav-transition);
  position: relative;
  overflow: hidden;
}

.abbhitrust-nav__dropdown-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--nav-accent);
  border-radius: 0 2px 2px 0;
  transition: height 0.25s var(--nav-transition);
}

.abbhitrust-nav__dropdown-link:hover {
  color: var(--nav-text);
  background: var(--nav-accent-glow);
}

.abbhitrust-nav__dropdown-link:hover::before {
  height: 60%;
}

/* CTA Button (Contact Us) */
.abbhitrust-nav__cta .abbhitrust-nav__link {
  background: linear-gradient(135deg, var(--nav-accent) 0%, var(--nav-accent-light) 100%);
  color: #FFFFFF !important;
  font-weight: 600;
  padding: 10px 20px;
  box-shadow: 0 4px 15px rgba(211, 84, 0, 0.25);
}

.abbhitrust-nav__cta .abbhitrust-nav__link:visited {
  color: #FFD700 !important;
}

.abbhitrust-nav__cta .abbhitrust-nav__link:active {
  color: #FFC107 !important;
}

.abbhitrust-nav__cta .abbhitrust-nav__link::after {
  display: none;
}

.abbhitrust-nav__cta .abbhitrust-nav__link:hover {
  background: linear-gradient(135deg, var(--nav-accent-light) 0%, var(--nav-accent) 100%);
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211, 84, 0, 0.35);
}

/* Mobile Toggle Button */
.abbhitrust-nav__toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  position: relative;
  transition: background 0.25s var(--nav-transition);
}

.abbhitrust-nav__toggle:hover {
  background: var(--nav-accent-glow);
}

.abbhitrust-nav__toggle-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 16px;
}

.abbhitrust-nav__toggle-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: all 0.3s var(--nav-transition);
}

.abbhitrust-nav__toggle-line:nth-child(1) { top: 0; }
.abbhitrust-nav__toggle-line:nth-child(2) { top: 50%; transform: translateY(-50%); }
.abbhitrust-nav__toggle-line:nth-child(3) { bottom: 0; }

.abbhitrust-nav__toggle.active .abbhitrust-nav__toggle-line:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.abbhitrust-nav__toggle.active .abbhitrust-nav__toggle-line:nth-child(2) {
  opacity: 0;
  transform: translateY(-50%) scaleX(0);
}

.abbhitrust-nav__toggle.active .abbhitrust-nav__toggle-line:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Body Padding for Fixed Nav */
.abbhitrust-nav-spacer {
  height: 80px;
  height: calc(80px + env(safe-area-inset-top, 0px));
  transition: height 0.4s var(--nav-transition);
}

/* ============================================
   Mobile Responsive Styles
   ============================================ */

@media (max-width: 1080px) {
  .abbhitrust-nav__toggle {
    display: block;
  }

  .abbhitrust-nav__menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: var(--nav-dropdown-bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 100px 24px 40px;
    box-shadow: -20px 0 60px rgba(45, 52, 54, 0.15);
    transform: translateX(100%);
    transition: transform 0.4s var(--nav-transition);
    overflow-y: auto;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }

  .abbhitrust-nav__menu.active {
    transform: translateX(0);
  }

  .abbhitrust-nav__item {
    border-bottom: 1px solid var(--nav-border);
  }

  .abbhitrust-nav__item:last-child {
    border-bottom: none;
  }

  .abbhitrust-nav__link {
    padding: 16px 8px;
    font-size: 1rem;
    justify-content: space-between;
  }

  .abbhitrust-nav__link::after {
    display: none;
  }

  .abbhitrust-nav__dropdown {
    position: static;
    transform: none;
    min-width: 100%;
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 8px 16px;
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: max-height 0.4s var(--nav-transition), padding 0.4s var(--nav-transition);
  }

  .abbhitrust-nav__dropdown::before {
    display: none;
  }

  .abbhitrust-nav__item.dropdown-open .abbhitrust-nav__dropdown {
    max-height: 400px;
    padding: 8px 0 8px 16px;
  }

  .abbhitrust-nav__item.dropdown-open .abbhitrust-nav__arrow {
    transform: rotate(180deg);
  }

  .abbhitrust-nav__dropdown-link {
    padding: 12px 12px;
    font-size: 0.92rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .abbhitrust-nav__cta {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--nav-border);
    border-bottom: none !important;
  }

  .abbhitrust-nav__cta .abbhitrust-nav__link {
    justify-content: center;
    text-align: center;
  }

  /* Mobile Menu Overlay */
  .abbhitrust-nav__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 54, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--nav-transition);
    z-index: 99998;
  }

  .abbhitrust-nav__overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 480px) {
  .abbhitrust-nav__container {
    padding: 0 16px;
    height: 72px;
  }

  .abbhitrust-nav__brand-name {
    font-size: 1.25rem;
  }

  .abbhitrust-nav__brand-tagline {
    font-size: 0.6rem;
  }

  .abbhitrust-nav__logo-placeholder,
  .abbhitrust-nav__logo {
    width: 44px;
    height: 44px;
  }

  .abbhitrust-nav-spacer {
    height: 72px;
    height: calc(72px + env(safe-area-inset-top, 0px));
  }

  .abbhitrust-nav__menu {
    width: 100%;
    max-width: 100%;
    padding-top: 80px;
  }
}

/* ============================================
   Animation Entrance Effects
   ============================================ */

.abbhitrust-nav {
  animation: navSlideDown 0.6s var(--nav-transition) forwards;
}

@keyframes navSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered menu item animation */
.abbhitrust-nav__item {
  animation: fadeInUp 0.5s var(--nav-transition) backwards;
}

.abbhitrust-nav__item:nth-child(1) { animation-delay: 0.1s; }
.abbhitrust-nav__item:nth-child(2) { animation-delay: 0.15s; }
.abbhitrust-nav__item:nth-child(3) { animation-delay: 0.2s; }
.abbhitrust-nav__item:nth-child(4) { animation-delay: 0.25s; }
.abbhitrust-nav__item:nth-child(5) { animation-delay: 0.3s; }
.abbhitrust-nav__item:nth-child(6) { animation-delay: 0.35s; }
.abbhitrust-nav__item:nth-child(7) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Active Page Indicator */
.abbhitrust-nav__link.active {
  color: var(--nav-accent);
}

.abbhitrust-nav__link.active::after {
  transform: scaleX(1);
}

.abbhitrust-nav__dropdown-link.active {
  color: var(--nav-accent);
  background: var(--nav-accent-glow);
}

.abbhitrust-nav__dropdown-link.active::before {
  height: 60%;
}
