/*
Theme Name: Defend & Advance
Theme URI: https://defendandadvance.org
Author: Emgage Action
Description: Custom theme for Defend & Advance (Emgage Action). Navy/red brand system with a sticky, fading header and matching footer. Build page content (hero, body sections) with Elementor.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: defend-and-advance
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --navy: #142B4D;
  --navy-dark: #0C1B33;
  --red: #E31C4E;
  --red-dark: #C5123F;
  --cream: #F6F1E9;
  --white: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #C9D2E0;
  --header-height: 84px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  -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);
}

/* Content gets pushed below the fixed header everywhere except the
   front page, where the hero is meant to sit full-bleed behind it. */
body:not(.home) #site-content {
  padding-top: var(--header-height);
}

/* ==========================================================================
   Header
   ========================================================================== */
#masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.7);
}

#masthead.is-scrolled {
  background: var(--navy-dark);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  border-bottom-color: rgba(255,255,255,0.15);
}

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

/* Top row: logo + donate */
.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo img.site-logo-img {
  height: 26px;
  width: auto;
  display: block;
}

/* Red dot shown next to the logo image */
.site-logo .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .site-logo img.site-logo-img { height: 22px; }
}

.masthead-donate {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 2px;
  transition: background 0.2s ease;
}

.masthead-donate:hover { background: var(--red-dark); color: var(--white); }

/* Nav row */
.masthead-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 8px 0;
}

.primary-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.primary-menu a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.primary-menu a:hover,
.primary-menu li.current-menu-item > a {
  color: var(--white);
}

.masthead-tools {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}

.masthead-tools button {
  background: none;
  border: none;
  color: inherit;
  display: flex;
  align-items: center;
  padding: 4px;
}

.masthead-tools svg { width: 18px; height: 18px; }

/* Mobile toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
}

@media (max-width: 860px) {
  :root { --header-height: 64px; }

  .masthead-nav-row { display: none; }
  .masthead-nav-row.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    background: var(--navy-dark);
    position: absolute;
    left: 0; right: 0; top: 100%;
    padding: 20px 24px 28px;
  }
  .masthead-nav-row.is-open .primary-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .menu-toggle { display: block; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
#colophon {
  background: var(--navy);
  color: var(--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-brand .site-logo-box {
  display: inline-block;
  border: 2px solid var(--white);
  padding: 8px 14px;
  margin-bottom: 18px;
}

.footer-brand .site-logo-box img.site-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.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(--red);
  border-color: var(--red);
}

.footer-social svg { width: 16px; height: 16px; fill: var(--white); }

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

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

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

.footer-col ul li a:hover { color: var(--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(--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; }
}
