/* ===== SHARED STYLES - Mohler for Iowa ===== */
/* Extracted from duplicated inline styles across pages */

/* ===== CSS VARIABLES ===== */
:root {
  --navy: #1a365d;
  --navy-dark: #0f2440;
  --navy-light: #2d4a6f;
  --gold: #d69e2e;
  --gold-light: #ecc94b;
  --gold-dark: #b7791f;
  --cream: #fffbeb;
  --slate: #718096;
  --white: #ffffff;
  --text-dark: #1a202c;
  --red: #e53e3e;
  --blue: #3182ce;
  --font-heading: 'Lexend', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
  --shadow-sm: 0 1px 2px rgba(26, 54, 93, 0.08);
  --shadow-md: 0 4px 12px rgba(26, 54, 93, 0.12);
  --shadow-lg: 0 12px 28px rgba(26, 54, 93, 0.16);
  --transition: 200ms ease;
}

/* ===== MODERN SCROLLBARS ===== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 54, 93, 0.2) transparent;
}
*:hover {
  scrollbar-color: rgba(26, 54, 93, 0.35) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(26, 54, 93, 0.2);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(26, 54, 93, 0.35); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* ===== ACCESSIBILITY: Skip Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  background: var(--gold);
  color: var(--navy-dark);
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ===== ACCESSIBILITY: Focus Rings ===== */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.nav-link:focus-visible,
.nav-cta:focus-visible,
.nav-brand:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26, 54, 93, 0.1);
  transition: box-shadow var(--transition), background var(--transition);
  box-shadow: 0 4px 20px -10px rgba(0, 0, 0, 0.1);
  min-height: 60px;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
  padding: 0.25rem 0;
}

.nav-brand-main {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin-bottom: 0px;
}

.nav-brand-sub {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  gap: 0.25em;
}

.nav-brand-sub span:first-child { color: var(--slate); }
.nav-brand-sub span:last-child { color: var(--gold); }
.nav-brand:hover .nav-brand-main { color: var(--navy-dark); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  position: relative;
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--navy);
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
}

.nav-link:hover { color: var(--gold); }
.nav-link.active { color: var(--gold); }

/* Sliding underline indicator */
.nav-indicator {
  position: absolute;
  bottom: -4px;
  height: 2px;
  background: var(--gold);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
              width 300ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  left: 0;
  width: 0;
  will-change: transform, width;
}

.nav-cta {
  background: var(--gold);
  color: var(--navy-dark);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
}

.nav-cta:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.nav-cta-donate {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(229, 62, 62, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  animation: donatePulse 2.5s ease-in-out infinite;
}

.nav-cta-donate:hover {
  background: linear-gradient(135deg, #fc4e4e 0%, #e53e3e 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 62, 62, 0.5);
  animation: none;
}

@keyframes donatePulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(229, 62, 62, 0.35); }
  50% { box-shadow: 0 4px 20px rgba(229, 62, 62, 0.55); }
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

/* ===== AUTH UI ===== */
.auth-avatar-btn { background: none; border: none; cursor: pointer; padding: 2px; border-radius: 50%; transition: box-shadow var(--transition); }
.auth-avatar-btn:hover { box-shadow: 0 0 0 3px rgba(214,158,46,0.3); }
.auth-avatar-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(214,158,46,0.4); }
.auth-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; font-size: 0.85rem; }
.auth-signin-btn { font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; color: var(--navy); background: none; border: none; cursor: pointer; position: relative; }
.auth-signin-btn::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--gold); transition: width var(--transition); }
.auth-signin-btn:hover { color: var(--gold); }
.auth-signin-btn:hover::after { width: 100%; }

/* Auth popover */
.auth-popover { position: fixed; width: 220px; background: #fff; border: 1px solid rgba(26,54,93,0.1); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.15); z-index: 9999; padding: 0.5rem 0; opacity: 0; transform: translateY(-6px); transition: opacity 150ms ease, transform 150ms ease; pointer-events: none; }
.auth-popover.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.auth-popover-header { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.85rem; }
.auth-popover-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; flex-shrink: 0; }
.auth-popover-info { overflow: hidden; }
.auth-popover-name { display: block; font-family: var(--font-heading); font-weight: 600; font-size: 0.85rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-popover-email { display: block; font-size: 0.75rem; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-popover-divider { height: 1px; background: #e2e8f0; margin: 0.25rem 0; }
.auth-popover-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.5rem 0.85rem; font-family: var(--font-heading); font-size: 0.85rem; font-weight: 500; color: var(--navy); text-decoration: none; background: none; border: none; cursor: pointer; text-align: left; transition: background 120ms ease; }
.auth-popover-item:hover { background: rgba(26,54,93,0.05); }
.auth-popover-item svg { color: var(--slate); flex-shrink: 0; }
.auth-popover-signout { color: #e53e3e; }
.auth-popover-signout:hover { background: rgba(229,62,62,0.06); }
.auth-popover-signout svg { color: #e53e3e; }

/* Auth modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,36,64,0.6); backdrop-filter: blur(4px); z-index: 5000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.auth-modal { background: var(--white); border-radius: 16px; padding: 2rem; max-width: 420px; width: 90%; box-shadow: var(--shadow-lg); position: relative; }
.auth-modal h2 { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 800; color: var(--navy); margin-bottom: 0.5rem; }
.auth-modal p { color: var(--slate); font-size: 0.9rem; margin-bottom: 1rem; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.5rem; color: var(--slate); cursor: pointer; }
.modal-form { display: flex; flex-direction: column; gap: 0.75rem; }
.modal-form input { width: 100%; padding: 0.65rem 0.85rem; font-size: 1rem; border: 2px solid #e2e8f0; border-radius: 10px; font-family: var(--font-body); color: var(--text-dark); background: var(--white); }
.modal-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,158,46,0.15); }
.auth-google-btn { display: flex; align-items: center; justify-content: center; width: 100%; padding: 0.75rem; border: 2px solid #e2e8f0; border-radius: 10px; background: var(--white); font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem; cursor: pointer; }
.auth-google-btn:hover { border-color: var(--navy); }
.auth-divider { display: flex; align-items: center; gap: 1rem; margin: 0.5rem 0; color: var(--slate); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }
.auth-error { color: #e53e3e; font-size: 0.85rem; padding: 0.5rem; background: #fff5f5; border-radius: 6px; }
.auth-toggle-text { font-size: 0.85rem; color: var(--slate); text-align: center; }
.auth-toggle-text a { color: var(--gold-dark); font-weight: 600; }
.auth-submit-btn { background: var(--gold); color: var(--navy-dark); border: none; padding: 0.75rem; border-radius: 10px; font-family: var(--font-heading); font-weight: 700; font-size: 1rem; cursor: pointer; }
.auth-submit-btn:hover { background: var(--gold-light); }

/* ===== MOBILE RESPONSIVE: Nav ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0;
    border-bottom: 1px solid rgba(26, 54, 93, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }
  .nav-links.open { display: flex; }
  .nav-links .nav-link {
    padding: 0.75rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(26, 54, 93, 0.06);
  }
  .nav-indicator { display: none; }
  .nav-links .nav-cta { margin-top: 0.5rem; text-align: center; }
  .nav-mobile-toggle { display: block; }

  /* Donate button always visible on mobile — outside hamburger menu */
  .nav-cta-donate.mobile-donate {
    display: inline-flex !important;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  /* Donate as direct child of nav-container (new layout) — keep visible, shrink */
  .nav-container > .nav-cta-donate {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  /* Hide donate inside the menu on mobile (it's duplicated outside) */
  .nav-links .nav-cta-donate { display: none !important; }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navy-dark);
  color: var(--white);
  padding: 4rem 1.5rem 2rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand img {
  height: 48px;
  margin-bottom: 1rem;
}

.footer-brand p {
  opacity: 0.7;
  font-size: 0.95rem;
  max-width: 300px;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--gold);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  opacity: 0.7;
  font-size: 0.95rem;
  transition: opacity var(--transition);
  cursor: pointer;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--gold-light);
}

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright {
  opacity: 0.6;
  font-size: 0.875rem;
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

.footer-legal a {
  opacity: 0.6;
  font-size: 0.875rem;
  cursor: pointer;
  transition: opacity var(--transition);
}

.footer-legal a:hover {
  opacity: 1;
}

/* ===== MOBILE RESPONSIVE: Footer ===== */
@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-brand p { margin: 0 auto; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .footer-brand .nav-brand {
    align-items: center !important;
  }
  .footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

/* ===== ACCESSIBILITY: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
