/* =================================================================
   TABLE OF CONTENTS
   1. CSS Variables
   2. Base & Typography
   3. Layout & Helpers
   4. Header & Navigation
   5. Buttons
   6. Components (Cards, Forms, etc.)
   7. Section Styles (Hero, About, Contact, etc.)
   8. Static Pages (Success, Privacy, etc.)
   9. Media Queries
================================================================= */

/* =================================================================
   1. CSS Variables
================================================================= */
:root {
    /* Complementary Color Scheme */
    --primary-color: #6F4E37; /* Coffee Brown */
    --primary-color-dark: #5a3f2b;
    --secondary-color: #3A506B; /* Steel Blue */
    --accent-color: #E57A44; /* Terracotta */
    --accent-color-hover: #d46a33;

    /* Text Colors */
    --text-color: #333333;
    --heading-color: #222222;
    --light-text-color: #FFFFFF;
    --subtle-text-color: #555555;

    /* Background Colors */
    --bg-color: #FDF8F2; /* Almond */
    --bg-color-light: #F5EFE6; /* Linen */
    --bg-color-dark: #2a2a2a;

    /* Fonts */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Merriweather', serif;

    /* Spacing & Sizing */
    --header-height: 80px;
    --spacing-unit: 1rem;
    --container-width: 1140px;
    --container-padding: 2rem;
    
    /* Effects */
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--heading-color);
    line-height: 1.2;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Adaptive Typography */
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.25rem); }
p { font-size: clamp(1rem, 2vw, 1.1rem); margin-bottom: var(--spacing-unit); }

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

a:hover {
    color: var(--accent-color-hover);
    text-decoration: underline;
}

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

/* =================================================================
   3. Layout & Helpers
================================================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: clamp(3rem, 8vw, 6rem) 0;
}

.section-light { background-color: var(--bg-color-light); }
.section-dark { background-color: var(--bg-color-dark); color: var(--light-text-color); }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: var(--light-text-color); text-shadow: none; }

.section-title, .section-subtitle {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    margin-bottom: var(--spacing-unit);
    position: relative;
    padding-bottom: var(--spacing-unit);
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.section-subtitle {
    max-width: 700px;
    margin-bottom: calc(var(--spacing-unit) * 3);
    color: var(--subtle-text-color);
}

.columns {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 2);
}

.column {
    flex: 1;
    min-width: 300px; /* Prevents columns from getting too narrow */
}

.is-two-thirds { flex-basis: 66.66%; flex-grow: 1; }
.is-vcentered { align-items: center; }
.is-centered { justify-content: center; }
.is-multiline { flex-wrap: wrap; }

/* Scroll Animation Helpers */
[data-animation] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
[data-animation].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =================================================================
   4. Header & Navigation
================================================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    background-color: transparent;
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
}
.header.scrolled .navbar-logo, .header.scrolled .navbar-menu a {
    color: var(--heading-color);
}
.header.scrolled .navbar-burger span {
    background-color: var(--heading-color);
}


.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light-text-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: calc(var(--spacing-unit) * 2);
}

.navbar-menu a {
    color: var(--light-text-color);
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-speed);
}

.navbar-menu a:hover::after, .navbar-menu a.active::after {
    transform: scaleX(1);
}

.navbar-burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

/* =================================================================
   5. Buttons
================================================================= */
.button {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed);
    user-select: none;
}

.button-primary {
    background-color: var(--accent-color);
    color: var(--light-text-color);
    border-color: var(--accent-color);
}
.button-primary:hover {
    background-color: var(--accent-color-hover);
    border-color: var(--accent-color-hover);
    color: var(--light-text-color);
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(229, 122, 68, 0.3);
}

.button-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.button-secondary:hover {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    text-decoration: none;
}


/* =================================================================
   6. Components (Cards, Forms, etc.)
================================================================= */
/* --- Cards --- */
.card {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    text-align: center;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.card-image {
    width: 100%;
    height: 200px; /* Fixed height for image containers */
    overflow: hidden;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area without distortion */
    transition: transform 0.4s ease;
}
.card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: calc(var(--spacing-unit) * 1.5);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card-content h4 { margin-top: 0; }
.card-content p { color: var(--subtle-text-color); margin-bottom: var(--spacing-unit); }
.card-content .button { margin-top: auto; }

/* --- Forms --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    background-color: var(--bg-color-light);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}
.section-dark .contact-form input,
.section-dark .contact-form textarea {
    background-color: #3e3e3e;
    border-color: #555;
    color: var(--light-text-color);
}


.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(229, 122, 68, 0.2);
}

.contact-form label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: #999;
    pointer-events: none;
    transition: all var(--transition-speed);
}

.contact-form input:focus + label,
.contact-form input:not(:placeholder-shown) + label,
.contact-form textarea:focus + label,
.contact-form textarea:not(:placeholder-shown) + label {
    top: -0.75rem;
    left: 0.75rem;
    font-size: 0.8rem;
    color: var(--accent-color);
    background-color: var(--bg-color-dark);
    padding: 0 0.25rem;
}
.contact-form button { align-self: flex-start; }

/* --- Resource Cards --- */
.resource-card {
    background: var(--bg-color-light);
    padding: 1.5rem;
    border-left: 5px solid var(--accent-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    transition: box-shadow var(--transition-speed);
}
.resource-card:hover { box-shadow: var(--box-shadow); }
.resource-card .resource-title a { color: var(--heading-color); font-weight: 700; text-decoration: none; }
.resource-card .resource-title a:hover { color: var(--accent-color); }
.resource-card .resource-description { color: var(--subtle-text-color); font-size: 0.9rem; }

/* =================================================================
   7. Section Styles (Hero, About, Contact, etc.)
================================================================= */
/* --- Hero --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-text-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Simple parallax effect */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}
.hero-title {
    color: var(--light-text-color);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    margin-bottom: 1rem;
}
.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    max-width: 700px;
    margin: 0 auto 2rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* --- About --- */
.image-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

/* --- Partners --- */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    align-items: center;
}
.partners-grid img {
    margin: 0 auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter var(--transition-speed), opacity var(--transition-speed);
}
.partners-grid img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* --- Contact Info --- */
.contact-info {
    margin-top: 2rem;
}
.contact-info p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.contact-info strong { color: var(--accent-color); }

/* --- Footer --- */
.footer {
    background-color: var(--bg-color-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 4rem 0 2rem;
}
.footer h4 { color: var(--light-text-color); }
.footer ul { list-style: none; }
.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}
.footer a:hover {
    color: var(--light-text-color);
    text-decoration: underline;
}
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* =================================================================
   8. Static Pages (Success, Privacy, etc.)
================================================================= */
.success-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding: var(--container-padding);
    background-color: var(--bg-color-light);
}

.success-page h1 {
    color: var(--primary-color);
}

.static-page-content {
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 4rem;
    min-height: 80vh;
}
.static-page-content .container {
    max-width: 800px;
}
.static-page-content h1 {
    margin-bottom: 2rem;
}
.static-page-content h2 {
    margin-top: 2.5rem;
}

/* =================================================================
   9. Media Queries
================================================================= */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    .columns {
        flex-direction: column;
    }
    
    .column.is-two-thirds {
        flex-basis: auto;
    }

    /* Mobile Navigation */
    .navbar-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }
    .navbar-menu.is-active {
        transform: translateX(0);
    }
    .navbar-menu a {
        color: var(--heading-color);
        font-size: 1.5rem;
    }

    .navbar-burger {
        display: block;
        width: 24px;
        height: 18px;
        position: relative;
    }
    .navbar-burger span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--light-text-color);
        position: absolute;
        left: 0;
        border-radius: 2px;
        transition: all var(--transition-speed);
    }
    .navbar-burger span:nth-child(1) { top: 0; }
    .navbar-burger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
    .navbar-burger span:nth-child(3) { bottom: 0; }

    .navbar-burger.is-active span {
        background-color: var(--heading-color);
    }
    .navbar-burger.is-active span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }
    .navbar-burger.is-active span:nth-child(2) {
        opacity: 0;
    }
    .navbar-burger.is-active span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }

    .header.scrolled .navbar-burger span {
        background-color: var(--heading-color);
    }
    
    .footer .columns {
        flex-direction: column;
        text-align: center;
    }
}