/* --- LOAD LOCAL HORIZON FONT --- */
@font-face {
    font-family: 'horizon';
    /* Ensure this matches your actual filename (case-sensitive on Cloudflare!) */
    src: url('horizon.woff2') format('woff2'); 
    font-weight: normal; font-style: normal;
}

/* --- VARIABLES & RESET --- */
:root {
    --bg-cream: #F2F0E6;
    --text-dark: #1A1A1A;
    --accent-mustard: #FEC057; 
    --accent-green: #2D4F2F;   
    --font-headline: 'horizon', 'Arial Black', sans-serif; 
    --font-body: 'Space Grotesk', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* FIX: Locks the site width to prevent side-scrolling */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    font-family: var(--font-body);
    line-height: 1.5;
}

/* --- TEXTURE --- */
.film-grain {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999; opacity: 0.08;
    background-image: url('data:image/svg+xml,%3Csvg viewBox=%270 0 400 400%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cfilter id=%27noiseFilter%27%3E%3CfeTurbulence type=%27fractalNoise%27 baseFrequency=%270.85%27 numOctaves=%273%27 stitchTiles=%27stitch%27/%3E%3C/filter%3E%3Crect width=%27100%25%27 height=%27100%25%27 filter=%27url%28%23noiseFilter%29%27/%3E%3C/svg%3E');
}

/* --- TYPOGRAPHY --- */
.headline { font-family: var(--font-headline); text-transform: uppercase; line-height: 0.95; letter-spacing: 1px; }
.highlight { color: var(--accent-mustard); }
.text-cream { color: var(--bg-cream); }
.bg-accent .highlight { color: var(--bg-cream); }

/* Standard Outline (Black) */
.outline-text {
    color: transparent; -webkit-text-stroke: 2px var(--text-dark);
    text-shadow: 2px 2px 0px transparent;
}

/* White Outline (For Video) */
.outline-text-light {
    color: transparent; 
    -webkit-text-stroke: 2px var(--bg-cream); 
    text-shadow: none;
}
@media (min-width: 769px) { .outline-text-light { -webkit-text-stroke: 3px var(--bg-cream); } }


/* --- NAVIGATION --- */
.navbar { 
    padding: 25px 0; 
    position: absolute; width: 100%; top: 0; z-index: 100;
    background: transparent; border-bottom: none; 
}
.nav-container { display: flex; justify-content: space-between; align-items: center; width: 92%; margin: 0 auto; }

/* LOGO: TIGHT SPACING LOGIC */
.logo { 
    font-family: var(--font-headline); 
    font-size: 1.5rem; 
    letter-spacing: 0.5px; 
    color: var(--bg-cream); 
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    
    /* This line-height tightens the gap ONLY when text wraps to 2 lines */
    line-height: 0.85; 
}

.nav-links { display: flex; gap: 30px; list-style: none; align-items: center; }
.nav-links a { text-decoration: none; color: var(--bg-cream); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.btn-nav { 
    background: var(--bg-cream); color: var(--text-dark) !important; text-shadow: none !important;
    padding: 12px 24px; border-radius: 4px; transition: 0.3s;
}
.btn-nav:hover { background: var(--accent-mustard); transform: translateY(-3px); }


/* --- HERO VIDEO MODE --- */
.hero { 
    height: 100vh; 
    min-height: 700px;
    position: relative; 
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

/* Video Background Layer */
.video-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; overflow: hidden;
}
.video-background video { width: 100%; height: 100%; object-fit: cover; }
.video-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.45); /* Darken video here */
    z-index: 1;
}

/* Centered Content Container */
.container { width: 92%; max-width: 1600px; margin: 0 auto; }

.centered-layout {
    position: relative; z-index: 10;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; width: 100%;
}

.hero-content {
    position: relative; 
    z-index: 10;
}

/* The Vector Star - Relative to Content */
.retro-star {
    position: absolute; 
    left: 50%; 
    top: 50%; 
    transform: translate(-50%, -50%); /* Locks to exact center of text block */
    width: 60vw; 
    height: 60vw;
    z-index: -1; /* Behind text */
    opacity: 0.15;
    pointer-events: none;
    overflow: visible !important;
}

/* FIX: Using IMG tag avoids vector clipping */
.retro-star img { 
    width: 100%; 
    height: 100%; 
    display: block; 
    animation: spin 80s linear infinite; 
    transform-origin: center center; 
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }


/* Text Styles */
.hero-content .headline { font-size: 7rem; margin-bottom: 30px; } 
.sub-headline { font-size: 1.4rem; max-width: 600px; margin-bottom: 40px; font-weight: 500; margin-left: auto; margin-right: auto; }

.btn-primary {
    display: inline-block; background: var(--accent-mustard); color: var(--text-dark);
    padding: 22px 50px; text-decoration: none; font-family: var(--font-headline);
    text-transform: uppercase; font-size: 1.3rem; border: 3px solid var(--text-dark);
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5); transition: 0.2s; letter-spacing: 1px;
}
.btn-primary:hover { transform: translate(-4px, -4px); box-shadow: 12px 12px 0px rgba(0,0,0,0.5); }


/* --- MARQUEE --- */
.marquee-track { 
    position: absolute; bottom: 0; left: 0; width: 100%;
    /* FIX: Force max-width to prevent overflow */
    max-width: 100vw;
    background: var(--accent-green); color: var(--bg-cream); 
    border-top: 4px solid var(--text-dark);
    padding: 20px 0; z-index: 10;
    overflow: hidden; white-space: nowrap;
    display: flex; 
}
.marquee-content { 
    display: flex; 
    animation: scroll 30s linear infinite;
    width: max-content;
    flex-shrink: 0;
}
.marquee-content span { font-family: var(--font-headline); margin-right: 0; letter-spacing: 1px; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }


/* --- SECTIONS --- */
.gathering-section { background: var(--text-dark); color: var(--bg-cream); padding: 100px 0; border-top: 4px solid var(--text-dark); }
.section-title { font-family: var(--font-headline); font-size: 4rem; text-align: center; margin-bottom: 60px; line-height: 1; }

/* FIX: Set to 2 Columns (1fr 1fr) for perfect 2x2 grid with 4 cards */
.schedule-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
    max-width: 1000px; /* Reduced width keeps the 2x2 cards nice and tight */
    margin: 0 auto; 
}

.schedule-card {
    background: var(--bg-cream); color: var(--text-dark);
    padding: 40px; border: 4px solid var(--text-dark);
    border-radius: 8px; position: relative;
    box-shadow: 10px 10px 0px var(--accent-mustard); transition: 0.3s;
}
.schedule-card:hover { transform: translateY(-5px); }
.day-badge {
    background: var(--text-dark); color: var(--bg-cream);
    display: inline-block; padding: 5px 15px; font-weight: 700; margin-bottom: 20px; text-transform: uppercase;
}
.highlight-bg { background: var(--accent-mustard); color: var(--text-dark); }

/* FIX: Adjusted margins to align headers left correctly */
.event-title { 
    font-family: var(--font-headline); 
    font-size: 3rem; 
    margin-bottom: 15px; 
    line-height: 1;
    text-align: left; /* Explicitly force left alignment */
    margin-left: -5px; /* PULL LEFT: Counteracts the font's natural side gap */
}

.event-details { font-size: 1.2rem; }
.event-details p { margin-bottom: 5px; }
.time { font-weight: 700; color: var(--accent-green); }


/* --- STORIES & FOOTER --- */
.section { padding: 100px 0; }
.bg-accent { background: var(--accent-mustard); }
.stories-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; max-width: 1000px; margin: 0 auto; }
.story-card { background: var(--bg-cream); padding: 20px; border: 4px solid var(--text-dark); box-shadow: 10px 10px 0px rgba(0,0,0,0.2); }
.story-img img { width: 100%; height: 300px; object-fit: cover; border-bottom: 4px solid var(--text-dark); filter: grayscale(30%); }
.story-content { padding: 30px 10px 10px; }
blockquote { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
cite { display: block; font-family: var(--font-headline); text-transform: uppercase; color: var(--accent-green); font-size: 1.2rem; }
.push-down { margin-top: 80px; }
.rotate-left { transform: rotate(-2deg); }
.rotate-right { transform: rotate(2deg); }

footer { padding: 100px 0; text-align: center; }
footer .headline { font-size: 4rem; margin-bottom: 20px; }
footer p { font-size: 1.5rem; margin-bottom: 30px; }
.pastor-badge { display: inline-block; background: var(--accent-green); color: #fff; padding: 10px 20px; border-radius: 50px; font-weight: 700; margin-bottom: 40px; }
.social-links { display: flex; justify-content: center; gap: 30px; }
.social-links a { font-family: var(--font-headline); font-size: 1.5rem; color: var(--text-dark); text-decoration: none; border-bottom: 3px solid var(--accent-mustard); transition: 0.3s; }
.social-links a:hover { color: var(--accent-mustard); border-color: var(--text-dark); }


/* --- VERTICAL VIDEO & SINGLE STORY LAYOUT --- */
/* 1. Center the single card */
.single-story-layout {
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

/* 2. Limit the width so the vertical video doesn't get too huge */
.single-story-layout .story-card {
    width: 100%;
    max-width: 400px; 
    /* Base styles for the card */
    background: var(--bg-cream); 
    padding: 20px; 
    border: 4px solid var(--text-dark); 
    box-shadow: 10px 10px 0px rgba(0,0,0,0.2);
    /* Rotate slightly for style */
    transform: rotate(-2deg);
}

.story-video {
    position: relative;
    padding-bottom: 177.77%; /* 16:9 vertical ratio */
    height: 0;
    overflow: hidden;
    border-bottom: 4px solid var(--text-dark); 
    background: #000;
}
.story-video iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}


/* --- MOBILE RESPONSIVE FIXES --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-container { justify-content: center; }
    
    /* LOGO MOBILE ADJUSTMENTS */
    .logo { 
        text-align: center; 
        font-size: 1.3rem; 
        margin-top: 15px; 
        
        /* Force Wrap Logic: */
        /* Limits width to force "CAMPUS MINISTRY" to next line */
        /* Since line-height is 0.85, they will look tightly stacked */
        max-width: 240px; 
        margin-left: auto;
        margin-right: auto;
    }

    .hero { 
        min-height: 100vh; 
        height: auto;
        display: flex; 
        align-items: center; 
        justify-content: center;
        padding-top: 0; 
        padding-bottom: 0;
    }

    /* Star Sizing */
    .retro-star {
        width: 150vw;
        height: 150vw;
        top: 50%; /* Re-centered since parent is relative */
        left: 50%;
        opacity: 0.2;
    }

    /* FIX: Hero Text Size increased to fill width */
    .hero-content .headline { 
        /* VW units make it scale perfectly to phone width */
        font-size: 13vw; 
        margin-bottom: 20px; 
        line-height: 0.9;
        letter-spacing: -0.5px; /* Slight squeeze to fit huge text */
    }
    
    .sub-headline { 
        font-size: 1.1rem; 
        padding: 0 20px; 
    }
    
    .btn-primary { 
        padding: 18px 30px; 
        font-size: 1rem; 
    }

    /* FIX: Reduce Padding to fix width overflow */
    .section, .gathering-section, footer {
        padding: 50px 0;
    }
    
    /* FIX: Tightened spacing under headers */
    .section-title {
        font-size: 2.5rem; 
        padding: 0 15px;
        word-wrap: break-word; 
        line-height: 1.1;
        margin-bottom: 15px; /* Reduced margin */
    }
    
    /* FIX: Smaller padding fits better on phones */
    .schedule-card { 
        padding: 25px; 
    }

    /* FIX: Tighter gutters for single story */
    .single-story-layout {
        padding: 0 15px; 
        width: 100%;
    }
    
    /* FIX: Restored tilt for mobile, added margin so corners don't cut off */
    .single-story-layout .story-card {
        transform: rotate(-2deg); 
        max-width: 90%; /* Ensure it doesn't touch edges */
        margin: 20px auto; /* Centers it and gives vertical breathing room */
    }

    /* Grids */
    .schedule-grid, .stories-grid { grid-template-columns: 1fr; gap: 30px; }
    .push-down { margin-top: 0; }
    .story-card { transform: rotate(0deg) !important; } 
    /* ^ This line resets standard story cards, but the .single-story-layout .story-card above overrides it for the video card */
    
    footer .headline { font-size: 2.8rem; }
    .social-links { flex-direction: column; gap: 15px; }
}