/*
Theme Name: NM-ERA
Theme URI: https://nm-era.org
Author: Sketch
Author URI: mailto:humboildtfleamarket@gmail.com
Description: A custom WordPress blocks theme made exclusively for NMERA
Version: 3.55.13
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nm-era
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready
*/

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700&family=Open+Sans:wght@400;600&display=swap');

/* Import Font Awesome */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css');

/*
 * ----------------------------------------------------------------------------
 * 1. Base Styles
 * ----------------------------------------------------------------------------
 */

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--wp--preset--color--primary);
    overflow-x: visible;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    color: var(--wp--preset--color--dark);
}

/*
 * ----------------------------------------------------------------------------
 * 2. Layout
 * ----------------------------------------------------------------------------
 */

.site-main {
    padding: 0;
    overflow: visible;
}

/* --- Sticky Header Robust Fix --- */
html, body, .site-main {
  overflow-x: visible !important;
}

/* Ensure .site-header is always sticky */
.site-header {
  position: sticky !important;
  top: 0;
  z-index: 1000;
  background-color: var(--wp--preset--color--white);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header.is-scrolled {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background-color: rgba(255, 255, 255, 0.95);
}

.site-header .top-bar,
.site-header .main-bar {
    padding-right: 1rem;
    padding-left: 1rem;
}

.site-footer {
    padding-top: 150px;
    position: relative;
}

#footer-wave-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    pointer-events: none;
    z-index: 1;
}

.footer-content {
    position: relative;
    z-index: 2;
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-copyright {
    padding: 1rem 0;
}

.footer-copyright p {
    margin: 0;
}

/* Social Links */
.wp-block-social-links {
    margin: 0;
    padding: 0;
}

.wp-block-social-links li {
    margin: 0;
}

/* Newsletter Form */
.newsletter-form .wp-block-search {
    max-width: 100%;
}

.newsletter-form .wp-block-search__input {
    border-radius: 12px 0 0 12px;
}

.newsletter-form .wp-block-search__button {
    border-radius: 0 12px 12px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-block-query {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-copyright {
        flex-direction: column;
        text-align: center;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--wp--preset--color--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 12px;
}

.back-to-top-button:hover {
    background-color: var(--wp--preset--color--secondary);
    transform: translateY(-3px);
}

.back-to-top-button svg {
    width: 100%;
    height: 100%;
}

.back-to-top-button .main-arrow {
    stroke-width: 2;
}

.back-to-top-button .leaf-accent {
    stroke-width: 1;
    opacity: 0.6;
    animation: leafPulse 2s ease-in-out infinite;
}

.back-to-top-button .ecosystem-circle {
    stroke-dasharray: 60;
    stroke-dashoffset: 0;
    animation: circleRotate 3s linear infinite;
    opacity: 0.3;
}

@keyframes leafPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes circleRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Button styles are now handled in theme.json */
.donate-button {
    width: auto !important;
    display: flex;
    justify-content: center;
    margin-left: auto !important;
    margin-right: 0 !important;
    position: relative;
    z-index: 10;
}

.hero-section,
.facts-section,
.is-style-curved-hero,
.is-style-curved-hero-bottom,
.is-style-curved-hero-inverse,
.is-style-curved-hero-bottom-opposite {
    position: relative;
}

.is-style-curved-hero,
.wp-block-cover.hero-section {
    position: relative;
    width: 100vw !important;
    min-width: 100vw !important;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 100vh !important;
    min-height: unset !important;
    /* Fallback: Wavy bottom using polygon (works everywhere) */
    clip-path: polygon(0 0, 100% 0, 100% 85%, 80% 90%, 60% 95%, 40% 90%, 20% 95%, 0 85%);
    box-shadow: 0 20px 60px 0 rgba(52, 142, 56, 0.5);
    background: none;
}

/* Modern browsers: Smooth rolling wave using SVG path */
@supports (clip-path: path('')) {
    .hero-section,
    .wp-block-cover.hero-section {
        clip-path: path('M0,0 H100% V85% C15% 95%, 35% 75%, 50% 85% C65% 95%, 85% 75%, 100% 85% L100% 100% L0 100% Z');
    }
}

/* Safari/Old browsers: SVG background wave */
@supports not (clip-path: path('')) {
    .hero-section,
    .wp-block-cover.hero-section {
        background:
            linear-gradient(to bottom, rgba(255,255,255,0) 85%, #e8f5e9 100%),
            url('data:image/svg+xml;utf8,<svg width="100%25" height="100%25" viewBox="0 0 100 100" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0,85 Q25,95 50,85 Q75,75 100,85 L100,100 L0,100 Z" fill="%23e8f5e9"/></svg>') bottom/100% 15% no-repeat;
    }
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    color: white;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3rem;
}

/* Hero button styles are now managed by block editor styles or theme.json variations */

/* Statistics Section Parallax Styles */
.facts-section {
  position: relative;
  /* overflow: hidden; */ /* Can break sticky header if header is inside it */
  min-height: 400px;
  z-index: 1;
}
.parallax-bg {
