/* ============================================
   IMPELER MÉXICO - MAIN STYLESHEET
   Design System for Women Empowerment Platform
   ============================================ */

/* ============================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */
:root {
    /* Brand Colors */
    --green-deep: #2E4633;
    --green-mid: #3E5F45;
    --green-light: #527A5C;
    --orange-optimist: #E89A3D;
    --orange-hover: #D68932;
    --blue-trust: #4A90A4;
    --blue-light: #EBF4F6;

    /* Neutral Colors */
    --bg-creme: #FDFCF9;
    --bg-white: #FFFFFF;
    --text-dark: #1F2937;
    --text-mid: #4B5563;
    --text-light: #9CA3AF;
    --white: #ffffff;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
}

/* ============================================
   2. RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-creme);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--green-deep);
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 0.5em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:focus-visible {
    outline: 2px solid var(--orange-optimist);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ============================================
   4. LAYOUT CONTAINERS
   ============================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-lg);
    }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   5. HEADER & NAVIGATION
   ============================================ */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 2000;
    border-bottom: 1px solid rgba(46, 70, 51, 0.08);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

nav.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left .logo svg,
.header-left .logo img {
    height: 64px;
    width: auto;
    transition: var(--transition-fast);
}

.header-left .logo:focus-visible svg,
.header-left .logo:hover svg,
.header-left .logo:focus-visible img,
.header-left .logo:hover img {
    transform: scale(1.05);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 600;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--green-mid);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--orange-optimist);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
    width: 100%;
}

/* Donate Button */
.btn-donate-nav {
    background: var(--orange-optimist);
    color: var(--white) !important;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(232, 154, 61, 0.25);
    transition: var(--transition);
}

.btn-donate-nav:hover,
.btn-donate-nav:focus-visible {
    background: var(--orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 154, 61, 0.35);
}

.btn-donate-nav:active {
    transform: translateY(0);
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--green-deep);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1100;
    transition: var(--transition-fast);
}

.mobile-nav-toggle:hover {
    color: var(--green-mid);
}

.mobile-nav-toggle:focus-visible {
    outline: 2px solid var(--orange-optimist);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.mobile-only {
    display: none;
}

.mobile-menu-brand {
    display: none;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(46, 70, 51, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1500;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   6. HERO SECTION
   ============================================ */
.hero {
    position: relative;
    overflow: hidden;
    padding: 160px 0 100px;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 1.5rem;
    max-width: 900px;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 650px;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.highlight {
    color: var(--orange-optimist);
    position: relative;
    display: inline-block;
}

/* ============================================
   7. STATS SECTION
   ============================================ */
.stats-section {
    padding: 0;
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    background: var(--bg-white);
    padding: 3rem 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--green-mid);
    line-height: 1;
    font-weight: 900;
}

.stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--text-mid);
}

/* ============================================
   8. SECTIONS
   ============================================ */
section {
    padding: 100px 0;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
    font-size: 1.125rem;
    color: var(--text-mid);
    line-height: 1.7;
}

/* CTA Sections */
.cta-transformation {
    background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
    color: white;
    padding: 80px 0;
}

.cta-transformation h2 {
    color: white;
    margin-bottom: 1rem;
}

.cta-transformation p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* ============================================
   9. GRIDS & CARDS
   ============================================ */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Ensure 3 items look good */
.grid-cards:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Ensure 4 items look good (balanced) */
.grid-cards:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 1024px) {
    .grid-cards:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Cards */
.card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(46, 70, 51, 0.08);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.card.highlight-card {
    border: 2px solid var(--orange-optimist);
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(46, 70, 51, 0.15);
}

.card:focus-within {
    outline: 2px solid var(--orange-optimist);
    outline-offset: 2px;
}

.card h3 {
    margin-bottom: 1.25rem;
    font-size: 1.75rem;
}

.card p {
    color: var(--text-mid);
    line-height: 1.7;
}

.card>a {
    margin-top: auto;
}

/* ============================================
   10. FOOTER
   ============================================ */
footer {
    background: var(--green-deep);
    color: rgba(255, 255, 255, 0.7);
    padding: 100px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 4rem;
    margin-bottom: 5rem;
}

.footer-col h4 {
    color: var(--white);
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 1rem;
}

.footer-col a {
    color: inherit;
    transition: var(--transition-fast);
}

.footer-col a:hover,
.footer-col a:focus-visible {
    color: var(--orange-optimist);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.footer-bottom a {
    transition: var(--transition-fast);
}

.footer-bottom a:hover {
    opacity: 1 !important;
}

/* ============================================
   11. CONTENT PAGES
   ============================================ */
.prose {
    max-width: 70ch;
    margin: 0 auto;
    font-size: 1.125rem;
    color: var(--text-mid);
    line-height: 1.8;
}

.prose p {
    margin-bottom: 1.5rem;
}

.prose h2,
.prose h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-header {
    background: var(--green-deep);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header h1 {
    color: white;
    margin-bottom: 1rem;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

/* ============================================
   12. BUTTONS & INTERACTIVE ELEMENTS
   ============================================ */
.btn-primary {
    display: inline-block;
    background: var(--green-deep);
    color: white !important;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--green-mid);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ============================================
   13. ICONS & DECORATIVE ELEMENTS
   ============================================ */
.icon-box {
    width: 60px;
    height: 60px;
    background: var(--blue-light);
    color: var(--blue-trust);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover .icon-box {
    transform: scale(1.1);
}

.icon-box i {
    width: 32px;
    height: 32px;
}

/* Tilted Image Effects */
.hover-straighten {
    transition: var(--transition);
}

.hover-straighten:hover {
    transform: rotate(0deg) !important;
    box-shadow: var(--shadow-xl);
}

.rotate-2 {
    transform: rotate(2deg);
}

.rotate-n1 {
    transform: rotate(-1deg);
}

.rotate-n2 {
    transform: rotate(-2deg);
}

/* ============================================
   14. UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: var(--spacing-sm);
}

.mb-8 {
    margin-bottom: var(--spacing-lg);
}

.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ============================================
   15. VISUAL ENHANCEMENTS
   ============================================ */
/* Subtle ambient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(74, 144, 164, 0.05) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(232, 154, 61, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* Selection styling */
::selection {
    background: var(--orange-optimist);
    color: white;
}

::-moz-selection {
    background: var(--orange-optimist);
    color: white;
}

/* ============================================
   16. RESPONSIVE DESIGN - TABLET
   ============================================ */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .hero {
        padding: 120px 0 80px;
    }

    section {
        padding: 80px 0;
    }
}

/* ============================================
   17. RESPONSIVE DESIGN - MOBILE
   ============================================ */
@media (max-width: 768px) {

    /* Mobile Navigation */
    .mobile-nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -101%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: var(--bg-creme);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2.5rem 2rem;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        overflow-y: auto;
        align-items: flex-start;
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-menu-brand {
        display: block;
        margin-bottom: 2.5rem;
        text-align: center;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid rgba(46, 70, 51, 0.1);
        width: 100%;
    }

    .mobile-menu-brand svg,
    .mobile-menu-brand img {
        height: 48px;
        margin: 0 auto;
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    .nav-links li {
        width: 100%;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }

    /* Stagger link animations */
    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-links.active li:nth-child(5) {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(6) {
        transition-delay: 0.35s;
    }

    .nav-links a {
        font-size: 1.25rem;
        font-weight: 700;
        display: block;
        padding: 1.25rem 0;
        color: var(--green-deep);
        border-bottom: 1px solid rgba(46, 70, 51, 0.05);
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    .nav-links .donate-li {
        margin-top: 2rem;
        padding-top: 1rem;
        border-top: none;
    }

    .nav-links .btn-donate-nav {
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 1rem;
        display: block;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        padding: 2rem 1rem;
        gap: 1rem;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    /* Cards */
    .grid-cards,
    .grid-cards:has(> :nth-child(4):last-child),
    .grid-cards:has(> :nth-child(3):last-child) {
        grid-template-columns: 1fr;
    }

    /* Sections */
    section {
        padding: 60px 0;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .page-header {
        padding: 80px 0 60px;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    /* Cards on mobile */
    .card {
        padding: 2rem;
    }
}

/* ============================================
   18. PRINT STYLES
   ============================================ */
@media print {

    header,
    footer,
    .btn-primary,
    .btn-donate-nav,
    .mobile-nav-toggle {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }
}