/*
Theme Name: Emgage Action
Theme URI: https://emgageaction.org
Author: Emgage Action
Description: Custom theme for Emgage Action. Floating pill-style sticky header with an editable WordPress menu, and a navy footer with editable navigation. Build page content (hero, body sections) with Elementor.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: emgage-action
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --ea-ink: #111111;
  --ea-white: #FFFFFF;
  --ea-muted: #9CA3AF;
  --ea-border: #E5E7EB;
  --ea-navy: #2A4696;
  --ea-navy-dark: #1F356F;
  --ea-navy-muted: #AEB9DC;
  --ea-header-height: 88px;
  --ea-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ==========================================================================
   Reset-lite / base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--ea-font);
  color: var(--ea-ink);
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
}

/* No automatic top padding — the header floats over whatever the
   first section on a page is. Add spacing per-page in Elementor if
   a given page's content shouldn't sit under the header. */

/* ==========================================================================
   Header — floating pill nav + donate button
   ========================================================================== */
#ea-masthead {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.ea-nav-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--ea-white);
  border-radius: 14px;
  padding: 4px;
  box-shadow: 0 2px 10px rgba(17,17,17,0.08);
  transition: box-shadow 0.25s ease;
}

#ea-masthead.is-scrolled .ea-nav-pill,
#ea-masthead.is-scrolled .ea-donate-btn {
  box-shadow: 0 10px 28px rgba(17,17,17,0.16);
}

.ea-brand {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.01em;
  padding: 8px 10px 8px 12px;
  color: var(--ea-ink);
  white-space: nowrap;
}

.ea-divider {
  width: 1px;
  height: 18px;
  background: var(--ea-border);
  margin: 0 2px;
  flex-shrink: 0;
}

.ea-menu {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Each top-level item is a dropdown anchor point. The padding-bottom
   here extends the item's actual hoverable area down through the
   visual gap above the dropdown, so moving the cursor from the link
   to the dropdown doesn't cross a dead zone that closes it — the
   negative margin cancels the padding back out so it doesn't add
   extra height to the header itself. */
.ea-menu > li {
  position: relative;
  padding-bottom: 10px;
  margin-bottom: -10px;
}

.ea-menu li a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ea-muted);
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.ea-menu li a:hover { color: var(--ea-ink); }

.ea-menu li.current-menu-item > a {
  color: var(--ea-ink);
  border-color: var(--ea-ink);
}

/* Small caret on items that have a dropdown */
.ea-menu li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.ea-menu li.menu-item-has-children:hover > a::after,
.ea-menu li.menu-item-has-children:focus-within > a::after {
  transform: rotate(-135deg);
}

/* Desktop dropdown panel */
.ea-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--ea-white);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(17,17,17,0.16);
  padding: 6px;
  z-index: 1100;
}

.ea-menu li.menu-item-has-children:hover > .sub-menu,
.ea-menu li.menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

.ea-menu .sub-menu li a {
  display: block;
  color: var(--ea-ink);
  border-radius: 8px;
  padding: 10px 14px;
  border: none;
  white-space: nowrap;
}

.ea-menu .sub-menu li a:hover { background: #F4F5F7; }

.ea-donate-btn {
  display: inline-block;
  background: var(--ea-ink);
  color: var(--ea-white);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(17,17,17,0.08);
  transition: background 0.2s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

.ea-donate-btn:hover { background: #000000; }

/* Mobile menu toggle — lives inside the pill, only shown on small screens */
.ea-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--ea-ink);
  flex-shrink: 0;
}

.ea-menu-toggle svg { width: 19px; height: 19px; }

/* Mobile dropdown panel for the menu */
.ea-menu-panel {
  display: none;
}

@media (max-width: 820px) {
  :root { --ea-header-height: 70px; }

  #ea-masthead { top: 12px; padding: 0 16px; }

  .ea-menu { display: none; }
  .ea-menu-toggle { display: flex; }

  /* Fixed to the viewport (matching the header's own 16px side
     padding) instead of being sized/positioned relative to the
     nav pill itself — the pill is only as wide as the brand label
     + toggle button on mobile, which was cutting the panel down to
     that same narrow width and pushing menu text outside its box. */
  .ea-menu-panel {
    display: none;
    position: fixed;
    top: calc(var(--ea-header-height) + 6px);
    left: 16px;
    right: 16px;
    max-height: calc(100vh - var(--ea-header-height) - 26px);
    overflow-y: auto;
    background: var(--ea-white);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(17,17,17,0.16);
    padding: 8px;
    box-sizing: border-box;
  }

  .ea-menu-panel.is-open { display: block; }

  .ea-menu-panel ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }

  .ea-menu-panel li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
  }

  .ea-menu-panel li a {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ea-ink);
    white-space: normal;
    overflow-wrap: break-word;
    box-sizing: border-box;
  }

  .ea-menu-panel li.current-menu-item > a {
    background: #F4F5F7;
    font-weight: 700;
  }

  /* Submenu accordion toggle button, injected by header.js next to
     any top-level link that has children */
  .ea-menu-panel .ea-submenu-toggle {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--ea-ink);
    border-radius: 8px;
  }

  .ea-menu-panel .ea-submenu-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
  }

  .ea-menu-panel li.ea-submenu-open > .ea-submenu-toggle svg {
    transform: rotate(180deg);
  }

  .ea-menu-panel .sub-menu {
    flex-basis: 100%;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    padding-left: 12px;
    transition: max-height 0.25s ease;
  }

  .ea-menu-panel li.ea-submenu-open > .sub-menu {
    max-height: 600px;
  }

  .ea-menu-panel .sub-menu li a { font-size: 14px; }

  .ea-donate-btn { padding: 9px 16px; font-size: 12.5px; }
  .ea-brand { font-size: 12.5px; padding: 7px 8px 7px 12px; }
}

@media (max-width: 480px) {
  .ea-brand span.ea-brand-full { display: none; }
  .ea-brand span.ea-brand-short { display: inline; }
}

.ea-brand span.ea-brand-short { display: none; }

/* ==========================================================================
   Footer
   ========================================================================== */
#colophon {
  background: var(--ea-navy);
  color: var(--ea-navy-muted);
  padding: 64px 0 0;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.footer-logo {
  display: block;
  margin-bottom: 20px;
}

.footer-logo .line1 {
  display: block;
  font-family: var(--ea-font);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--ea-white);
  line-height: 1.1;
}

.footer-logo .line2 {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--ea-white);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 2px solid rgba(255,255,255,0.6);
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 0 22px;
}

.footer-social {
  display: flex;
  gap: 14px;
}

.footer-social a {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.footer-social a:hover {
  background: var(--ea-white);
  border-color: var(--ea-white);
}

.footer-social a:hover svg { fill: var(--ea-navy); }

.footer-social svg { width: 16px; height: 16px; fill: var(--ea-white); transition: fill 0.2s ease; }

.footer-col h4 {
  font-family: var(--ea-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ea-white);
  margin: 0 0 20px;
}

.footer-col ul li { margin-bottom: 13px; }

.footer-col ul li a {
  font-size: 14px;
  color: var(--ea-navy-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.footer-col ul li a:hover { color: var(--ea-white); }

.footer-col address { font-style: normal; font-size: 14px; line-height: 1.9; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 22px 0;
  font-size: 12.5px;
}

.footer-bottom a { text-decoration: underline; }
.footer-bottom a:hover { color: var(--ea-white); }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
