/* ===== ENHANCEMENT 1: Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger cards */
.card-grid .card:nth-child(1) { transition-delay: 0s; }
.card-grid .card:nth-child(2) { transition-delay: 0.15s; }
.card-grid .card:nth-child(3) { transition-delay: 0.3s; }

/* ===== ENHANCEMENT 3: Better Card Hovers ===== */
.card {
  border-top: 3px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-top-color: var(--highlight);
}
.card-icon {
  transition: transform 0.3s ease;
}
.card:hover .card-icon {
  transform: scale(1.15);
}

/* ===== ENHANCEMENT 4: Sticky Donate CTA ===== */
.sticky-donate {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--highlight);
  color: var(--primary);
  padding: 0.85rem 1.75rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 90;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  opacity: 1;
}
.sticky-donate:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
  color: var(--primary);
}
/* Hide on donate page */
body.page-donate .sticky-donate { display: none; }

/* ===== ENHANCEMENT 5: Counter Animation ===== */
.stats-bar {
  background: var(--primary);
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.stats-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: block;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  width: 100%;
}
@media (max-width: 820px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 420px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}
.stats-row + .stats-row-label {
  margin-top: 1.75rem;
}
.stats-row-label + .stats-row {
  margin-top: 1rem;
}
.stats-row-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--highlight);
  text-align: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.stats-row-label:first-child {
  padding-top: 0;
  border-top: none;
}
.stat {
  color: #fff;
}
.stat-number {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 700;
  color: var(--highlight);
  display: block;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

/* ===== ENHANCEMENT 6: Typography / Pull Quotes ===== */
.pull-quote {
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  font-style: italic;
  color: var(--primary);
  border-left: 4px solid var(--highlight);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  line-height: 1.5;
  background: rgba(219, 196, 46, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ===== ENHANCEMENT 7: Testimonial Carousel ===== */
.testimonial-section {
  background: #f5f7fa;
  padding: clamp(3rem, 5vw, 5rem) 1.5rem;
  text-align: center;
  overflow: hidden;
}
.testimonial-carousel {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  min-height: 160px;
}
.testimonial-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.testimonial-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}
.testimonial-slide blockquote {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.testimonial-slide blockquote::before {
  content: '\201C';
  font-size: 3rem;
  color: var(--highlight);
  line-height: 0;
  vertical-align: -0.5em;
  margin-right: 0.1em;
}
.testimonial-slide cite {
  font-style: normal;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}
.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.testimonial-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  padding: 0;
}
.testimonial-dot.active {
  background: var(--highlight);
  transform: scale(1.3);
}

/* ===== Header accent border ===== */
.site-header {
  border-bottom: 3px solid var(--highlight);
}

/* ===== Color scheme overrides for enhancements ===== */
.stats-bar {
  background: var(--primary-dark);
}

.testimonial-section {
  background: var(--bg-alt);
}

/* ===== SPLIT HERO ===== */
.hero-split {
  position: relative;
  padding-bottom: 0;
  overflow: hidden;
}
.hero-split-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
  padding: clamp(3rem, 5vw, 5rem) 1.5rem clamp(4rem, 6vw, 6rem);
}
.hero-split .hero-text {
  text-align: left;
}
.hero-split .hero-text h1 {
  font-size: clamp(2.2rem, 1.5rem + 3vw, 3.5rem);
  margin-bottom: 0.5rem;
}
.hero-split .hero-text .subtitle {
  font-size: clamp(1.1rem, 1rem + 0.75vw, 1.6rem);
}
.hero-photo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-photo-split {
  width: clamp(200px, 25vw, 320px);
  height: clamp(200px, 25vw, 320px);
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--highlight);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

@media (max-width: 767px) {
  .hero-split-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-split .hero-text {
    text-align: center;
    order: 2;
  }
  .hero-photo-wrap {
    order: 1;
  }
}

/* Hero background pattern */
.hero-split::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(219,196,46,0.05) 0%, transparent 40%);
  pointer-events: none;
}

/* Wave divider */
.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  line-height: 0;
}
.hero-wave svg {
  width: 100%;
  height: 60px;
}

/* Page header wave (subpages) */
.page-header {
  position: relative;
  overflow: hidden;
  padding-bottom: clamp(3rem, 5vw, 4.5rem);
}
.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(219,196,46,0.05) 0%, transparent 40%);
  pointer-events: none;
}
.page-header-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  line-height: 0;
}
.page-header-wave svg {
  width: 100%;
  height: 50px;
}

/* ===== ENHANCEMENT 8: Scroll Progress Bar ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--highlight);
  z-index: 200;
  width: 0%;
  transition: width 0.05s linear;
}

/* ===== ENHANCEMENT 9: Parallax Photos ===== */
.parallax-img {
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.parallax-img img {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ===== ENHANCEMENT 10: Micro-Interactions ===== */

/* Nav link animated underline */
.nav-links a {
  position: relative;
  overflow: hidden;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--highlight);
  transition: width 0.3s ease, left 0.3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: calc(100% - 1.5rem);
  left: 0.75rem;
}

/* Active (current page) link: stronger and permanent, not subtle like hover */
.nav-links a.active {
  font-weight: 700;
  color: #fff;
}
.nav-links a.active::after {
  height: 3px;
  background: var(--highlight);
}

/* Prevent multi-word menu items from wrapping to a second line and
   tighten the horizontal gap between them so 8 items fit comfortably
   on a standard 1280px laptop. */
.nav-links {
  gap: 0.1rem;
}
.nav-links a {
  white-space: nowrap;
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}

/* Keep breathing room between the site name and the first menu item
   so the brand text never appears to bump into the Home button. */
.nav-brand {
  margin-right: 1.25rem;
  min-width: 0; /* allow flex child to shrink below intrinsic width */
}

/* "Hamm for Auditor" is short enough to fit any viewport, so no wrap
   override needed. Slightly smaller motto on mobile for balance. */
@media (max-width: 600px) {
  .nav-motto {
    font-size: 0.75rem;
  }
}

/* The Donate pill is a CTA, not another text link. Give it clear
   horizontal separation from the last text link so it reads as a button. */
.nav-links a.nav-donate {
  margin-left: 1rem;
}

/* Raise the hamburger breakpoint. With 8 menu items the horizontal nav
   needs true-desktop width. Below 1024px we collapse to the hamburger
   menu that style.css defines at max-width: 767px. We extend the same
   collapse behavior up to 1023px. */
@media (max-width: 1023px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    padding: 0.5rem 1rem 1rem;
    box-shadow: var(--shadow-lg);
    gap: 0;
  }
  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 0;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

/* Button ripple */
.btn {
  position: relative;
  overflow: hidden;
}
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}
@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Form focus animation */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 61, 106, 0.15);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== Scope & Scale cards (home page) =====
   Uses the existing .card-grid and .card classes for visual consistency
   with 'Why Stacey?' and 'Proven Track Record'. Force 2-column layout
   (since we have 2 big cards, not 3) and left-align everything inside
   the card so the bulleted list reads properly. */
.scope-cards {
  max-width: 1050px;
  margin: 0 auto;
}

@media (min-width: 820px) {
  .scope-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* In scope cards, left-align the heading and paragraph so they line up
   with the bullet list. The icon stays centered at the top. */
.scope-cards .card {
  text-align: left;
}

.scope-cards .card .card-icon {
  text-align: center;
}

.scope-cards .card h3 {
  text-align: left;
}

/* Bulleted list styled with real bullets */
.scope-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 1rem 0 0 0;
}

.scope-list li {
  padding: 0.4rem 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
}

.scope-list li::marker {
  color: var(--primary);
}

.scope-list strong {
  color: var(--primary);
  font-weight: 700;
}

.scope-sources {
  text-align: center;
  max-width: 900px;
  margin: 2rem auto 0;
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

/* ===== Prose column (shared by sections that want article-style formatting) ===== */
.prose-column {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.7;
}

.prose-column .section-title {
  text-align: left;
  margin-bottom: 1.5rem;
}

.prose-column p {
  margin: 1rem 0;
}

/* ===== Footer layout ===== */
.site-footer .footer-inner {
  max-width: 960px;
  margin: 0 auto;
}

.site-footer .footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.site-footer .footer-brand p {
  margin: 0;
}

.site-footer .footer-title {
  font-size: 1.05rem;
}

.site-footer .footer-tagline {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 0.2rem;
}

.site-footer .footer-row .footer-disclaimer {
  margin: 0;
  text-align: right;
}

.site-footer .footer-inner > .footer-credit {
  margin: 1rem 0 0;
  text-align: center;
}

@media (max-width: 620px) {
  .site-footer .footer-row {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  .site-footer .footer-row .footer-disclaimer {
    text-align: center;
  }
}

.prose-column .prose-cta {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.prose-column .prose-cta .btn {
  flex-shrink: 0;
}

.prose-column .motto-card {
  float: right;
  width: 300px;
  max-width: 50%;
  margin: 0.25rem 0 1.25rem 1.75rem;
  padding: 1rem 1.25rem;
  border-left: 6px solid var(--highlight);
  background: #fff;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-lg);
}

.prose-column .motto-label {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--highlight);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  margin: 0 0 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(217, 119, 6, 0.25);
}

.prose-column .motto-card .motto-line {
  margin: 0;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--primary);
  line-height: 1.25;
}

@media (max-width: 560px) {
  .prose-column .motto-card {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0 0 1.25rem;
  }
}

.prose-column .prose-hero {
  float: left;
  width: 240px;
  max-width: 40%;
  margin: 0.25rem 1.5rem 1rem 0;
  shape-outside: margin-box;
}

.prose-column .prose-hero img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
}

.prose-column .prose-closer {
  clear: both;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--highlight);
  font-size: 1.1rem;
}

@media (max-width: 560px) {
  .prose-column .prose-hero {
    float: none;
    width: 70%;
    max-width: 260px;
    margin: 0 auto 1.25rem;
  }
}

/* ===== Card paragraph readability =====
   .card itself is centered so the icon and heading stay centered,
   but centered multi-line body text is hard to read in narrow cards.
   Left-align just the paragraph. */
.card p {
  text-align: left;
}

/* ===== Family Section (magazine layout with text flow) ===== */
.family-magazine {
  max-width: 820px;
  margin: 0 auto;
}

.family-magazine h2 {
  margin-bottom: 1rem;
}

.family-magazine p {
  margin: 1rem 0;
  line-height: 1.7;
}

/* clearfix so the section doesn't collapse around floats */
.family-magazine::after {
  content: "";
  display: block;
  clear: both;
}

.family-magazine figure {
  margin: 0;
}

.family-magazine figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.family-magazine figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
  font-style: italic;
  text-align: center;
}

/* Utility: break out of a left float wrap so a paragraph starts on a clean line below the floated image */
.family-magazine .clear-left {
  clear: left;
}
.family-magazine .clear-right {
  clear: right;
}
.family-magazine .clear-both {
  clear: both;
}

/* Primary: family photo, floats left, wraps first paragraphs */
.family-magazine .family-primary {
  float: left;
  width: 50%;
  margin: 0.5rem 1.75rem 1rem 0;
  shape-outside: margin-box;
}

/* Secondary: Desert Storm photo, floats right, wraps later paragraphs */
.family-magazine .family-secondary {
  float: right;
  width: 38%;
  margin: 0.5rem 0 1rem 1.75rem;
  shape-outside: margin-box;
}

/* On narrow screens floats break down, so stack them full width */
@media (max-width: 720px) {
  .family-magazine .family-primary,
  .family-magazine .family-secondary {
    float: none;
    width: 100%;
    margin: 1.25rem 0;
  }
}
