/* =================================================================== */
/*  DESIGN SYSTEM & SETUP (Theme: Spiced Chai)
/* =================================================================== */

:root {
    /* Palette: Spiced Chai */
    --color-background: #F9F4F4;
    --color-surface: #FFFFFF;

    --color-text-body: #5C4747;
    --color-text-heading: #8F5C5C;
    --color-text-on-dark: #F9F4F4;
    --color-text-heading-on-dark: #FFFFFF;
    --color-text-on-primary: #FFFFFF;

    --color-primary: #B56576; /* Dusty Rose */
    --color-primary-hover: #A15968;
    
    --color-accent: #6D9886; /* Sage */
    
    --color-background-dark: #594848; /* For CTA sections */

    --color-border: #E2DDDD;
    --color-subtle-background: #EDE9E9;
    --color-success-background: #F2F8F6;
    --color-success-border: #6D9886;
    --color-success-text: #2A4E44;

}

html { 
    scroll-behavior: smooth; 
}

body {
    background-color: var(--color-background);
    color: var(--color-text-body);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
}

/* =================================================================== */
/*  ACCESSIBILITY
/* =================================================================== */

.skip-link {
    background: var(--color-surface);
    border: 2px solid var(--color-text-heading);
    border-radius: 8px;
    color: var(--color-text-heading);
    left: 12px;
    padding: 8px 12px;
    position: absolute;
    transition: all .2s ease;
    z-index: 10000;

    /* Robustly hide the link off-screen until focused */
    clip: rect(0,0,0,0);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    white-space: nowrap;
}
.skip-link:focus {
    top: 12px;
    /* Un-do the hiding styles to make it visible */
    clip: auto;
    height: auto;
    width: auto;
    margin: 0;
    overflow: visible;
    white-space: normal;
}

.sr-only {
    border: 0;
    clip: rect(0,0,0,0); 
    height: 1px; 
    margin: -1px; 
    overflow: hidden; 
    padding: 0; 
    position: absolute; 
    white-space: nowrap; 
    width: 1px; 
}

:where(a, button, .btn, .nav-toggle):focus-visible {
    border-radius: 10px;
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* =================================================================== */
/*  LAYOUT & CONTAINERS
/* =================================================================== */

.container { 
    margin: 0 auto; 
    max-width: 1100px; 
    padding: 0 20px; 
}

section { 
    padding: 80px 0; 
}

section:nth-child(even) { 
    background-color: var(--color-surface); 
}

.section-intro { 
    margin: 0 auto 50px auto; 
    max-width: 700px; 
    text-align: center; 
}

/* =================================================================== */
/*  TYPOGRAPHY
/* =================================================================== */

h1, h2, h3 {
    color: var(--color-text-heading);
    font-family: 'Lora', serif;
    font-weight: 600;
    line-height: 1.3;
}
h1 { 
    font-size: 3rem; 
    margin-bottom: 1rem;
}
h2 { 
    font-size: 2.25rem; 
    margin-bottom: 1rem;
}
h3 { 
    color: var(--color-text-heading); 
    font-size: 1.5rem; 
}

p { 
    margin-bottom: 1rem; 
    max-width: 650px; 
}

a { 
    color: var(--color-primary); 
    font-weight: 600; 
    text-decoration: none; 
}
a:hover { 
    text-decoration: underline; 
}

.section-intro h2 { 
    margin-bottom: 0.5rem; 
}
.section-intro p { 
    font-size: 1.1rem; 
}


/* =================================================================== */
/*  COMPONENTS
/* =================================================================== */

/* --- Buttons --- */
.btn {
    border: 2px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    display: inline-block;
    font-weight: 700;
    padding: 12px 28px;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-primary { 
    background-color: var(--color-primary); 
    color: var(--color-text-on-primary); 
}
.btn-primary:hover { 
    background-color: var(--color-primary-hover); 
    text-decoration: none; 
    transform: translateY(-2px); 
}
.btn-secondary { 
    background-color: transparent; 
    border-color: var(--color-text-heading); 
    color: var(--color-text-heading); 
}
.btn-secondary:hover { 
    background-color: var(--color-text-heading); 
    color: var(--color-surface); 
    text-decoration: none; 
}

/* --- Header & Navigation --- */
header {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 16px 0;
    position: sticky; 
    top: 0; 
    z-index: 999;
}
.header-content {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}
.header-content .logo-block { 
    text-decoration: none; 
}
.header-content .full-name {
    color: var(--color-text-heading);
    display: block;
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
}
.header-content .abbreviation {
    color: var(--color-text-body);
    display: block;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
.site-nav { 
    align-items: center; 
    display: flex; 
    gap: 12px; 
}
.nav-toggle {
    background: transparent;
    border: 2px solid var(--color-text-heading);
    border-radius: 10px;
    color: var(--color-text-heading);
    display: none;
    font-weight: 700;
    padding: 6px 10px;
}
.menu { 
    display: flex; 
    gap: 10px; 
    list-style: none; 
    margin: 0; 
    padding: 0; 
}
.menu a {
    border-radius: 999px;
    color: var(--color-text-body);
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
}
.menu a:hover,
.menu a:focus-visible { 
    background-color: var(--color-subtle-background); 
    text-decoration: none; 
}

/* --- Value Cards (#why section) --- */
.value-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 30px;
}
.value-card h3 { 
    margin-top: 0; 
}
.value-card p { 
    font-size: 0.95rem; 
}

/* --- Event Cards (events.html) --- */
.event-card { 
    background: var(--color-surface); 
    border: 1px solid var(--color-border); 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensures image respects border-radius */
}
.event-meta { 
    margin: 4px 0 12px; 
}
.tag { 
    background: var(--color-subtle-background); 
    border-radius: 999px; 
    display:inline-block; 
    font-size: 0.9rem; 
    margin-right:8px; 
    padding: 4px 10px; 
}
.event-actions { 
    margin-top: auto; /* Pushes button to bottom of card */
    padding-top: 16px;
}
.btn[disabled] {
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- Footer --- */
footer { 
    padding: 40px 20px; 
    text-align: center; 
}
.footer-links {
    align-items: center; 
    display: flex; 
    flex-wrap: wrap;
    gap: 12px; 
    justify-content: center; 
    margin-bottom: 20px;
}
.footer-links a { 
    color: var(--color-text-body); 
    font-size: 0.9rem; 
    font-weight: 600; 
    padding: 0 10px; 
    text-decoration: none; 
}
.footer-links a:hover { 
    color: var(--color-primary); 
    text-decoration: underline; 
}
footer p { 
    color: #777; 
    font-size: 0.9rem; 
    margin-bottom: 0.5rem; 
    max-width: 100%; 
}

/* Fix for header overlap bug */
main#main {
    position: relative;
    z-index: 0;
}

/* =================================================================== */
/*  PAGE-SPECIFIC STYLES & NEW IMAGE LAYOUTS
/* =================================================================== */

/* --- Image Figure Styles (Global) --- */
figure {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}
figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
figure:hover img {
    transform: scale(1.05);
}
figcaption {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
figure:hover figcaption {
    opacity: 1;
}

/* --- Hero Section --- */
#hero { 
    padding: 60px 0; /* Adjusted padding for text-only hero */
}
.hero-text {
    text-align: center;
    margin: 0 auto;
    max-width: 800px; /* Constrain line length for readability */
}
.hero-text h1 { 
    color: var(--color-text-heading); 
}
.hero-text .subtitle { 
    color: var(--color-text-body); 
    font-size: 1.25rem; 
    margin: 0 0 30px 0;
    max-width: 100%;
}
/* Refactored Hero CTA Group */
.hero-cta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center buttons */
    gap: 16px;
}
.hero-cta .btn {
    margin: 0; /* Remove old margin */
}
/* --- Feature Layout (#about) --- */
.feature-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.feature-layout-reversed .feature-text {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}
.feature-layout-reversed .feature-image {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}
.feature-text {
    text-align: left;
}
.feature-text h2 {
    text-align: left;
}
.feature-text p {
    max-width: none;
}

/* --- Community Grid (#who-for) --- */
.community-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}
#who-for .section-intro {
    margin-bottom: 0;
}
#who-for ul { 
    list-style: none; 
    margin: 30px auto 0 auto; 
    max-width: 600px; 
    padding-left: 0; 
}
#who-for li { 
    font-size: 1.1rem; 
    padding: 10px 0 10px 35px; 
    position: relative; 
}
#who-for li::before { 
    color: var(--color-primary); 
    content: '✔'; 
    font-size: 1.2rem; 
    font-weight: bold; 
    left: 0; 
    position: absolute; 
    top: 10px; 
}

/* --- "Why" Section --- */
#why .values-grid { 
    display: grid; 
    gap: 30px; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    margin-top: 50px; 
}

/* --- Creator Section --- */
#creator .creator-flex { 
    align-items: center; 
    display: flex; 
    gap: 50px; 
    justify-content: center; 
}
#creator .creator-img img {
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    height: 200px; 
    object-fit: cover; 
    width: 200px; 
}
#creator .creator-text { 
    max-width: 500px; 
}
#creator .creator-text p.quote {
    border-left: 3px solid var(--color-primary); 
    font-family: 'Lora', serif; 
    font-size: 1.1rem; 
    font-style: italic;
    padding-left: 20px; 
}

/* --- Newsletter & Join Sections --- */
#join { 
    background-color: var(--color-background-dark); 
    color: var(--color-text-on-dark); 
}
#join h2, #join h3 { 
    color: var(--color-text-heading-on-dark); 
}
.join-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 50px;
}
.join-card {
    text-align: center;
}
.join-card .btn-primary {
    background-color: var(--color-surface); /* Keep the standout style */
    color: var(--color-background-dark);
}
.join-card .btn-primary:hover {
    background-color: var(--color-background); /* Keep the standout style */
}
.join-card p {
    margin-left: auto; margin-right: auto; /* Center the paragraphs */
}


/* --- Events Hero (events.html) --- */
.events-hero { 
    background-color: var(--color-background-dark);
    color: var(--color-text-on-dark);
    padding: 60px 0; 
    text-align: center;
}
.events-hero h1 { 
    color: var(--color-text-heading-on-dark);
    margin-bottom: 10px; 
}
.events-hero p {
    font-size: 1.1rem;
    margin: 0 auto;
    max-width: 700px;
}

/* --- Events List (events.html) --- */
#events-list {
    padding-top: 60px;
}
.event-category-title {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: 40px;
}
.event-category-title:not(:first-of-type) {
    margin-top: 80px;
}
.events-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.event-image img {
    height: 180px;
    object-fit: cover;
    width: 100%;
}
.event-content {
    display: flex;
    gap: 20px;
    padding: 24px;
}
.event-info {
    display: flex;
    flex-direction: column;
    flex: 1; /* Takes up remaining space */
}
.event-info h3 { margin-top: 0; }
.event-info p { font-size: 0.95rem; }
.event-date {
    background-color: var(--color-subtle-background);
    border-radius: 8px;
    flex-shrink: 0;
    padding: 10px;
    width: 70px; /* Gives a fixed width */
    box-sizing: border-box; /* Ensures padding is included in width */
    text-align: center;
}
.event-date span { display: block; } .event-date .day { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--color-primary); } .event-date .month { display: block; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.5px; margin-top: 2px; }
.event-date .year { font-size: 0.85rem; margin-top: 4px; color: var(--color-text-body); }
.event-description {
    margin-top: 16px; /* Adds space between header and description */
}
.past-event { opacity: 0.7; }

/* --- Privacy Policy (privacy.html) --- */
.privacy-policy-container { 
    background-color: var(--color-surface); 
    border-radius: 8px; 
    margin: 40px auto; 
    max-width: 800px; 
    padding: 40px 20px 60px 20px; 
}
.privacy-policy-container h1 { 
    border-bottom: 1px solid var(--color-border); 
    margin-bottom: 30px; 
    padding-bottom: 20px; 
    text-align: center; 
}
.privacy-policy-container h2 { 
    margin-top: 40px; 
}
.privacy-policy-container p, 
.privacy-policy-container li { 
    max-width: 100%; 
}
.privacy-policy-container ul { 
    padding-left: 20px; 
}

/* =================================================================== */
/*  VENDOR OVERRIDES (ConvertKit)
/* =================================================================== */

.formkit-form { 
    margin-top: 30px; 
}
.formkit-fields { 
    display: flex; 
    gap: 10px; 
    justify-content: center; 
}
.formkit-input {
    border: 1px solid var(--color-border) !important;
    border-radius: 50px !important;
    font-family: 'Nunito Sans', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    min-width: 300px;
    padding: 12px 20px !important;
}
.formkit-submit {
    background-color: var(--color-primary) !important;
    border: none !important;
    border-radius: 50px !important;
    color: var(--color-text-on-primary) !important;
    cursor: pointer !important;
    display: inline-block !important;
    font-family: 'Nunito Sans', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    padding: 12px 28px !important;
    transition: all 0.3s ease !important;
}
.formkit-submit:hover { 
    background-color: var(--color-primary-hover) !important; 
    transform: translateY(-2px); 
}

/* Custom Kit success message */
.custom-success-message {
    align-items: center;
    background-color: var(--color-success-background) !important;
    border: 2px solid var(--color-success-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    color: var(--color-success-text) !important;
    display: flex !important;
    gap: 15px;
    margin-top: 20px !important;
    padding: 20px !important;
    text-align: left;
}
.custom-success-message::before {
    color: var(--color-accent);
    content: '✔';
    font-family: 'Lora', serif;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1;
}
.custom-success-message strong { 
    display: block; 
    font-size: 1.1rem; 
    margin-bottom: 2px; 
}

/* =================================================================== */
/*  RESPONSIVE DESIGN
/* =================================================================== */

@media (max-width: 992px) {
    .header-content .full-name { 
      font-size: 1.05rem; 
    }
    .hero-layout, .feature-layout {
        gap: 40px;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    section { padding: 60px 0; }    
    #hero { padding: 40px 0; } /* Slightly less padding on mobile */
    .header-content { align-items: flex-start; }    .header-content .full-name { font-size: 1rem; }
    .nav-toggle { 
        display: inline-block; 
    }
    .menu { 
        background: var(--color-surface); 
        border-top: 1px solid var(--color-border); 
        box-shadow: 0 8px 20px rgba(0,0,0,0.06); 
        display: none; 
        left: 0; 
        padding: 12px 20px; 
        position: absolute; 
        right: 0; 
        top: calc(100% + 0px); 
    }
    .site-nav.open .menu { 
        display: flex; 
        flex-direction: column; 
        gap: 6px; 
    }
    .menu a { 
        padding: 10px 14px; 
    }

    /* Hero styles are now consistent with desktop, so no overrides needed */
    .feature-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .feature-layout-reversed .feature-text,
    .feature-layout-reversed .feature-image {
        grid-column: auto; grid-row: auto; /* Reset grid placement */
    }
    .feature-layout .feature-image {
        grid-row-start: 1; /* Puts image above text on mobile */
    }
    .feature-text {
        text-align: center;
    }
    
    .community-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    #creator .creator-flex { 
        flex-direction: column; 
        text-align: center; 
    }
    #creator .creator-text { 
        margin-top: 20px; 
    }
    .formkit-fields { 
        align-items: center; 
        flex-direction: column; 
    }
    .formkit-input { 
        box-sizing: border-box; 
        max-width: 300px; 
        min-width: 0; /* Override desktop min-width */
        width: 100%;
    }
    .join-grid {
        grid-template-columns: 1fr;
    }

    .event-content {
        flex-direction: column;
    }
    .event-date { width: 60px; }
}