/* ============================================================
   AHGCC Huruma — Main Stylesheet
   "Sacred Fire" Design System
   ============================================================ */

/* ---------- CSS Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-base);
    color: var(--color-text-dark);
    background-color: var(--color-white);
    overflow-x: hidden;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    line-height: 1.2;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ---------- Design Tokens ---------- */
:root {
    /* Primary */
    --color-midnight:   #0D0F1A;
    --color-deep-navy:  #111827;
    --color-navy:       #1C2A4A;

    /* Accent */
    --color-gold:       #C9922A;
    --color-gold-light: #E8B84B;
    --color-amber:      #F5D68A;

    /* Neutral */
    --color-white:      #FFFFFF;
    --color-off-white:  #F4F0EB;
    --color-mist:       #E8E4DC;
    --color-stone:      #9A8F82;

    /* Text */
    --color-text-dark:  #1A1410;
    --color-text-light: #D6CEBD;
    --color-text-muted: #7B7068;

    /* Functional */
    --color-success:    #2E7D52;
    --color-error:      #C0392B;

    /* Typography */
    --font-display:   'Playfair Display', Georgia, serif;
    --font-body:      'Barlow', sans-serif;
    --font-condensed: 'Barlow Condensed', sans-serif;

    /* Type Scale */
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  2rem;
    --text-4xl:  2.75rem;
    --text-5xl:  3.75rem;
    --text-6xl:  5rem;

    /* Spacing */
    --space-xs:  0.5rem;
    --space-sm:  1rem;
    --space-md:  1.5rem;
    --space-lg:  2.5rem;
    --space-xl:  4rem;
    --space-2xl: 6rem;
    --space-3xl: 10rem;

    /* Layout */
    --container-max:  1280px;
    --container-wide: 1440px;
    --container-pad:  clamp(1.5rem, 5vw, 4rem);

    /* Radius */
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-card:  0 4px 24px rgba(0,0,0,0.12);
    --shadow-float: 0 12px 48px rgba(0,0,0,0.22);
    --shadow-gold:  0 0 32px rgba(201,146,42,0.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ---------- Layout Utilities ---------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.container-wide {
    max-width: var(--container-wide);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

/* ---------- Typography Utilities ---------- */
.eyebrow {
    font-family: var(--font-condensed);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: var(--space-sm);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: var(--space-md);
}

.section-title--light {
    color: var(--color-white);
}

.section-title--dark {
    color: var(--color-text-dark);
}

.section-subtitle {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: 300;
    line-height: 1.7;
    max-width: 640px;
}

.section-subtitle--light {
    color: var(--color-text-light);
}

.section-subtitle--muted {
    color: var(--color-text-muted);
}

.gold-text {
    color: var(--color-gold);
}

.gold-italic {
    color: var(--color-gold);
    font-style: italic;
}

/* ---------- Button Styles ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--font-condensed);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--color-gold);
    color: var(--color-midnight);
}

.btn-primary:hover {
    background: var(--color-gold-light);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.btn-outline-gold {
    background: transparent;
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
}

.btn-outline-gold:hover {
    background: var(--color-gold);
    color: var(--color-midnight);
    box-shadow: var(--shadow-gold);
}

.btn-gold-full {
    background: var(--color-gold);
    color: var(--color-midnight);
    width: 100%;
    justify-content: center;
}

.btn-gold-full:hover {
    background: var(--color-gold-light);
    box-shadow: var(--shadow-gold);
}

/* Text Link CTA */
.text-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-condensed);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-gold);
    transition: gap var(--transition-base);
}

.text-cta:hover {
    gap: 1rem;
    color: var(--color-gold-light);
}

.text-cta .arrow {
    transition: transform var(--transition-base);
}

.text-cta:hover .arrow {
    transform: translateX(4px);
}

/* ---------- Section Spacing ---------- */
.section {
    padding: var(--space-2xl) 0;
}

.section-dark {
    background-color: var(--color-deep-navy);
    color: var(--color-text-light);
}

.section-midnight {
    background-color: var(--color-midnight);
    color: var(--color-text-light);
}

.section-light {
    background-color: var(--color-off-white);
    color: var(--color-text-dark);
}

.section-white {
    background-color: var(--color-white);
    color: var(--color-text-dark);
}

/* ---------- Card Base ---------- */
.card {
    background: var(--color-navy);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-float);
}

/* ---------- Scroll Reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 300ms; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 400ms; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 500ms; }
.reveal-stagger.revealed > *:nth-child(7) { transition-delay: 600ms; }
.reveal-stagger.revealed > *:nth-child(8) { transition-delay: 700ms; }
.reveal-stagger.revealed > *:nth-child(9) { transition-delay: 800ms; }

/* ---------- Gold HR ---------- */
.gold-rule {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, var(--color-gold), transparent);
    margin: var(--space-md) 0;
}

/* ---------- Pill / Tag ---------- */
.pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-family: var(--font-condensed);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    background: rgba(201,146,42,0.15);
    color: var(--color-gold);
}

/* ---------- Page Hero (inner pages) ---------- */
.page-hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13,15,26,0.88) 0%, rgba(13,15,26,0.6) 100%);
    z-index: 1;
}

.page-hero-content {
    position: relative;
    z-index: 2;
    padding: var(--space-2xl) var(--container-pad);
}

.page-hero h1 {
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    font-weight: 900;
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.page-hero p {
    font-size: var(--text-lg);
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- Sermon Modal ---------- */
.sermon-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13,15,26,0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.sermon-modal-overlay.is-open {
    display: flex;
    opacity: 1;
}

.sermon-modal {
    width: 90%;
    max-width: 900px;
    background: var(--color-deep-navy);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-float);
}

.sermon-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sermon-modal-header h3 {
    font-family: var(--font-display);
    color: var(--color-white);
    font-size: var(--text-xl);
}

.sermon-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    background: rgba(255,255,255,0.05);
    transition: all var(--transition-fast);
    font-size: 1.25rem;
    cursor: pointer;
}

.sermon-modal-close:hover {
    background: rgba(255,255,255,0.15);
    color: var(--color-gold);
}

.sermon-modal-body {
    padding: var(--space-md);
}

.sermon-modal-body .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.sermon-modal-body .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
    .section-title {
        font-size: var(--text-3xl);
    }

    .page-hero h1 {
        font-size: var(--text-4xl);
    }

    .page-hero {
        min-height: 320px;
    }

    .section {
        padding: var(--space-xl) 0;
    }
}

@media (max-width: 479px) {
    .section-title {
        font-size: var(--text-2xl);
    }

    .page-hero h1 {
        font-size: var(--text-3xl);
    }
}

/* ---------- GIVING FORM ---------- */
.giving-container {
    max-width: 600px;
    margin: 0 auto;
}

.giving-form-card {
    background: var(--color-white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border: 1px solid var(--color-mist);
    text-align: center;
}

.giving-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: #8B1E1E; /* Dark Red from screenshot */
    margin-bottom: var(--space-lg);
    letter-spacing: -0.01em;
}

.mpesa-text {
    color: #8B1E1E;
}

#mpesa-giving-form {
    text-align: left;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    border-bottom: 2px solid var(--color-mist);
    background: #F9F9F9;
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text-dark);
    transition: all var(--transition-base);
}

.form-group input::placeholder {
    color: #B0B0B0;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-bottom-color: var(--color-gold);
    background: #FFF;
}

.btn-mpesa {
    width: 100%;
    justify-content: center;
    background: #F2C069; /* Soft gold from screenshot */
    color: var(--color-white);
    font-size: var(--text-lg);
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(242, 192, 105, 0.2);
}

.btn-mpesa:hover {
    background: #E8B84B;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(242, 192, 105, 0.3);
}

.form-status {
    margin-top: var(--space-md);
    text-align: center;
    font-size: var(--text-sm);
    min-height: 1.5em;
}

.form-status.success {
    color: var(--color-success);
}

.form-status.error {
    color: var(--color-error);
}

.form-status.loading {
    color: var(--color-gold);
    font-style: italic;
}
