/* ═══════════════════════════════════════════════════════════
   SITE HEADER — Mujeres Latinas Unidas
   Shared across all pages
   ─────────────────────────────────────────────────────────── */

/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
  --h-white:  #FFFFFF;
  --h-orange: #D9593C;
  --h-gray:   #363636;
  --h-brown:  #803723;
  --h-height: 80px;
  --h-max:    1280px;
}

/* ─── RESET (scoped to header) ────────────────────────────── */
.site-header *,
.site-header *::before,
.site-header *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── HEADER WRAPPER ──────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--h-white);
  border-bottom: 1px solid rgba(54, 54, 54, 0.08);
}

/* ─── INNER CONTAINER ─────────────────────────────────────── */
.header-container {
  max-width: var(--h-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  height: var(--h-height);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
}

/* ─── LOGO ────────────────────────────────────────────────── */
.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}

.header-logo-img {
  height: 72px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Fallback text logo if image not found */
.header-logo-fallback {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--h-gray);
  line-height: 1.25;
}
.header-logo-fallback span {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--h-orange);
  margin-top: 3px;
}

/* ─── NAV ─────────────────────────────────────────────────── */
.header-nav {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  list-style: none;
}

.nav-link {
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--h-gray);
  text-decoration: none;
  padding-bottom: 4px;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--h-orange);
}

/* Active state — underline indicator */
.nav-link.active {
  color: var(--h-gray);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--h-orange);
  border-radius: 1px;
}

/* ─── DROPDOWN (What we do) ───────────────────────────────── */
.nav-item-dropdown {
  position: relative;
}

.nav-link-parent {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding-top: 4px; /* balance padding-bottom from .nav-link so flex content centers correctly */
}

.nav-chevron {
  width: 11px; height: 11px;
  flex-shrink: 0;
  transition: transform .22s ease;
  opacity: .65;
}

.nav-item-dropdown:hover .nav-chevron,
.nav-item-dropdown:focus-within .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + .65rem);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--h-white);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(54,54,54,.13);
  padding: .45rem 0;
  min-width: 200px;
  list-style: none;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 200;
}

.nav-item-dropdown:hover .nav-dropdown,
.nav-item-dropdown:focus-within .nav-dropdown {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* small arrow tip */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -5px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: var(--h-white);
  border-radius: 2px;
}

.nav-dropdown-link {
  display: block;
  padding: .6rem 1.25rem;
  font-family: 'Poppins', sans-serif;
  font-size: .82rem; font-weight: 500;
  color: var(--h-gray);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

.nav-dropdown-link:hover {
  color: var(--h-orange);
  background: rgba(217,89,60,.05);
}

/* ─── MOBILE NAV PANEL ────────────────────────────────────── */
.mobile-nav {
  position: fixed;
  top: var(--h-height);
  left: 0;
  right: 0;
  background: var(--h-white);
  box-shadow: 0 24px 60px rgba(54,54,54,.18);
  border-top: 2.5px solid var(--h-orange);
  z-index: 999;
  animation: slideDown .26s cubic-bezier(.22,1,.36,1);
  max-height: calc(100dvh - var(--h-height));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-nav .nav-list {
  list-style: none;
  padding: 0.5rem 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.mobile-nav .nav-list > li {
  border-bottom: 1px solid rgba(54,54,54,.06);
}

.mobile-nav .nav-list > li:last-child {
  border-bottom: none;
}

.mobile-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 1rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--h-gray);
  letter-spacing: .01em;
  border-left: 3px solid transparent;
  transition: color .18s, border-color .18s, background .18s;
  width: 100%;
}

.mobile-nav .nav-link:hover,
.mobile-nav .nav-link.active {
  color: var(--h-orange);
  border-left-color: var(--h-orange);
  background: rgba(217,89,60,.04);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  top: var(--h-height);
  background: rgba(0,0,0,.4);
  z-index: 998;
  animation: fadeIn .22s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Mobile sub-items */
.nav-sub-list {
  list-style: none;
  padding: 0.3rem 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(217,89,60,.03);
  border-top: 1px solid rgba(54,54,54,.05);
}

.nav-sub-list .nav-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--h-gray);
  opacity: .62;
  padding: 0.7rem 1.75rem 0.7rem 2.5rem;
  transition: color .18s, opacity .18s;
}

.nav-sub-list .nav-dropdown-link::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 1.5px;
  background: var(--h-orange);
  opacity: .55;
  flex-shrink: 0;
  margin-left: -1rem;
  margin-right: .4rem;
}

.nav-sub-list .nav-dropdown-link:hover {
  opacity: 1;
  color: var(--h-orange);
  background: none;
}

/* Mobile lang switcher at bottom of nav */
.mobile-nav-lang {
  border-top: 1px solid rgba(54,54,54,.08);
  padding: 1rem 1.75rem !important;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: rgba(54,54,54,.015);
}

/* ─── ACTIONS (right side) ────────────────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

/* Donate button — rounded pill */
.header-donate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--h-orange);
  color: var(--h-white);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease;
}

.header-donate:hover {
  background: var(--h-brown);
  transform: translateY(-1px);
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--h-gray);
  opacity: 0.45;
  padding: 0;
  line-height: 1;
  transition: opacity 0.2s, color 0.2s;
}

.lang-btn:hover {
  opacity: 0.8;
}

.lang-btn.lang-btn--active {
  color: var(--h-orange);
  opacity: 1;
  font-weight: 600;
}

.lang-sep {
  font-size: 0.72rem;
  color: rgba(54, 54, 54, 0.28);
  font-family: 'Poppins', sans-serif;
  line-height: 1;
  pointer-events: none;
}

/* ─── MOBILE HAMBURGER ────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 0.5rem;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--h-gray);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-menu-btn.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── PAGE OFFSET (so fixed header doesn't overlap content) ── */
body {
  padding-top: var(--h-height);
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */

/* Tablet: slightly tighter nav gaps */
@media (max-width: 1024px) {
  .nav-list {
    gap: 1.5rem;
  }
  .nav-link {
    font-size: 0.83rem;
  }
}

/* Mobile: collapsed nav */
@media (max-width: 768px) {
  :root {
    --h-height: 68px;
  }

  .header-container {
    grid-template-columns: auto 1fr auto auto;
  }

  /* Hide desktop nav */
  .header-nav {
    display: none;
    position: fixed;
    top: var(--h-height);
    left: 0;
    right: 0;
    background: var(--h-white);
    border-bottom: 1px solid rgba(54, 54, 54, 0.08);
    padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2rem;
    box-shadow: 0 8px 32px rgba(54, 54, 54, 0.12);
    z-index: 999;
    /* Slide-down animation */
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .header-nav.is-open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.15rem;
    width: 100%;
  }

  .nav-link {
    font-size: 1rem;
    font-weight: 500;
  }

  .nav-link.active::after {
    bottom: -3px;
  }

  /* Show hamburger */
  .mobile-menu-btn {
    display: flex;
  }

  /* Compact donate on mobile */
  .header-donate {
    padding: 0.5rem 1.1rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  :root {
    --h-height: 60px;
  }

  .header-logo-img {
    height: 40px;
  }

  .lang-switcher {
    display: none; /* hide lang switcher on very small screens — accessible via nav */
  }

  .header-actions {
    gap: 0.75rem;
  }
}
