/*
 * page-overrides.css
 *
 * Global cascade corrections — loaded on every page after av-main.
 *
 * Problem: main.css is generated by concatenating CSS from 17 static HTML files.
 * Later-file rules at equal specificity silently win on every page.
 *
 * This file contains ONLY unscoped rules that are safe to apply globally
 * (i.e. they restore index.html values that were overridden by later pages).
 *
 * Page-specific fixes live in assets/css/page-{slug}.css, each loaded
 * only on its own template via is_page_template() in functions.php.
 */

/* ============================================================
   FOOTER — restore index.html values overridden by later pages
   Safe to apply globally: later pages moved these in the wrong
   direction; index.html is the canonical footer style.
   ============================================================ */

.footer-top {
  padding-bottom: 60px;
  max-width: none;
  margin: 0;
}

.footer-logo {
  margin-bottom: 16px;
}

.footer-social {
  gap: 24px;
}

/* ============================================================
   MOBILE NAV — hamburger + drawer (global, all pages)
   ============================================================ */

/* Hamburger button — hidden on desktop */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s, width 0.25s;
  transform-origin: center;
}
/* Animate to X when open */
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; width: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.nav-mobile {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(16,20,31,0.12);
  z-index: 99;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav-mobile.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.nav-mobile-inner {
  padding: 16px 0 24px;
}
.nav-mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.nav-mobile-links > li > a:not(.nav-mobile-cta),
.nav-mobile-toggle {
  display: flex;
  align-items: center;
  padding: 13px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--dark);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  justify-content: space-between;
}
.nav-mobile-links > li > a:not(.nav-mobile-cta):hover,
.nav-mobile-toggle:hover { background: var(--light); color: var(--blue); }
.nav-mobile-links > li > a:not(.nav-mobile-cta).active { color: var(--blue); font-weight: 700; }

/* Resources accordion */
.nav-mobile-toggle svg { transition: transform 0.2s; flex-shrink: 0; }
.nav-mobile-toggle.is-open svg { transform: rotate(180deg); }
.nav-mobile-sub {
  list-style: none;
  display: none;
  flex-direction: column;
  background: var(--light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.nav-mobile-sub.is-open { display: flex; }
.nav-mobile-sub li a {
  display: block;
  padding: 11px 24px 11px 36px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--dark);
  text-decoration: none;
  transition: color 0.15s;
  opacity: 0.75;
}
.nav-mobile-sub li a:hover { color: var(--blue); opacity: 1; }

/* CTA row */
.nav-mobile-cta-row { padding: 16px 24px 0; }
.nav-mobile-cta {
  display: block;
  background: var(--blue);
  color: white !important;
  text-align: center;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.nav-mobile-cta:hover { background: #1a6aa0; }

/* Dark overlay behind drawer */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 72px 0 0 0;
  background: rgba(16,20,31,0.3);
  z-index: 98;
  backdrop-filter: blur(2px);
}
.nav-mobile-overlay.is-open { display: block; }

/* Show hamburger + hide desktop links on mobile */
@media (max-width: 900px) {
  .nav-hamburger { display: flex; }
  .nav-links { display: none !important; }
  .nav-mobile { display: block; }
}

/* Active nav states — desktop Resources trigger + mobile toggle */
.nav-more.active {
  opacity: 1;
  font-weight: 700;
  color: var(--dark);
}
.nav-mobile-toggle.active {
  color: var(--blue);
  font-weight: 700;
}
