/* ============================================
   ENDTIME MINISTRIES - Main Stylesheet
   Color Palette from reference: Navy + Orange
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@400;500;600;700;800&display=swap');

:root {
    --navy: #1a1f3d;
    --navy-dark: #0f1229;
    --navy-light: #2a3158;
    --orange: #e8712a;
    --orange-hover: #d4601e;
    --orange-light: #f5a623;
    --gold: #c9963b;
    --white: #ffffff;
    --off-white: #f8f9fc;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --text-dark: #1a1a2e;
    --text-body: #4a4a68;
    --text-light: #8888a0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-body);
    line-height: 1.7;
    background: var(--white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--text-dark);
    line-height: 1.2;
    font-weight: 700;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

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

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 32px; border-radius: var(--radius-xl);
    font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.95rem;
    border: none; cursor: pointer; transition: var(--transition);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-primary {
    background: var(--orange); color: var(--white);
    box-shadow: 0 4px 15px rgba(232,113,42,0.35);
}
.btn-primary:hover {
    background: var(--orange-hover); transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(232,113,42,0.45);
}
.btn-outline {
    background: transparent; color: var(--white);
    border: 2px solid rgba(255,255,255,0.5);
}
.btn-outline:hover { background: var(--white); color: var(--navy); }
.btn-outline-dark {
    background: transparent; color: var(--navy);
    border: 2px solid var(--navy);
}
.btn-outline-dark:hover { background: var(--navy); color: var(--white); }
.btn-sm { padding: 10px 24px; font-size: 0.85rem; }

/* ---- SECTION STYLING ---- */
.section { padding: 100px 0; }
.section-label {
    display: inline-block; font-family: 'Inter', sans-serif;
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 3px; color: var(--orange);
    margin-bottom: 12px;
}
.section-title { font-size: 2.8rem; margin-bottom: 20px; }
.section-subtitle {
    font-size: 1.1rem; color: var(--text-light);
    max-width: 600px; margin: 0 auto;
}
.text-center { text-align: center; }

/* ============ HEADER / NAVBAR ============ */
.top-bar {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1001;
    background: var(--navy-dark); padding: 8px 0;
    font-size: 0.82rem; color: rgba(255,255,255,0.7);
    transition: transform 0.3s ease;
}
.top-bar .container {
    display: flex; justify-content: space-between; align-items: center;
}
.top-bar a { color: rgba(255,255,255,0.7); }
.top-bar a:hover { color: var(--orange); }
.top-bar-left, .top-bar-right { display: flex; align-items: center; gap: 20px; }
.top-bar-right .social-links { display: flex; gap: 12px; }
.top-bar-right .social-links a { font-size: 0.9rem; }

.navbar {
    position: fixed; top: 36px; left: 0; width: 100%; z-index: 1000;
    padding: 14px 0; transition: var(--transition);
}
.navbar.scrolled {
    top: 0;
    background: var(--navy-dark); padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}
.navbar .container {
    display: flex; justify-content: space-between; align-items: center;
}
.nav-brand {
    display: flex; align-items: center; gap: 12px; color: var(--white);
}
.nav-brand .brand-icon {
    width: 42px; height: 42px; background: var(--orange);
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 1.2rem;
}
.nav-brand .brand-text { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; }
.nav-brand .brand-sub { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px; opacity: 0.7; display: block; }

.nav-menu { display: flex; align-items: center; gap: 5px; margin-left: 40px; margin-right: auto; }
.nav-menu a {
    color: rgba(255,255,255,0.85); padding: 10px 16px;
    font-size: 0.9rem; font-weight: 500; border-radius: var(--radius-sm);
    position: relative;
}
.nav-menu a:hover, .nav-menu a.active { color: var(--white); }
.nav-menu a.active::after {
    content: ''; position: absolute; bottom: 2px; left: 16px; right: 16px;
    height: 2px; background: var(--orange); border-radius: 2px;
}
.nav-cta .btn { padding: 10px 28px; font-size: 0.85rem; }

.hamburger {
    display: none; flex-direction: column; gap: 5px; cursor: pointer;
    background: none; border: none; padding: 5px;
}
.hamburger span {
    width: 26px; height: 2px; background: var(--white);
    transition: var(--transition); border-radius: 2px;
}

/* ============ HERO ============ */
.hero {
    position: relative; min-height: 100vh;
    display: flex; align-items: center;
    background: linear-gradient(135deg, rgba(15,18,41,0.85), rgba(26,31,61,0.75)),
                url('../images/hero-worship.png') center/cover no-repeat;
    /* Removed overflow: hidden to allow card overlap */
}
.hero::before {
    content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
    height: 120px; background: linear-gradient(to top, var(--white), transparent);
    z-index: 2;
}
.hero .container { position: relative; z-index: 3; padding-top: 120px; padding-bottom: 160px; }
.hero-content { max-width: 650px; }
.hero-label {
    display: inline-block; font-size: 0.8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 3px; color: var(--orange-light);
    margin-bottom: 20px;
}
.hero-title {
    font-size: 4rem; color: var(--white); margin-bottom: 24px;
    line-height: 1.1;
}
.hero-title span { color: var(--orange); }
.hero-text {
    font-size: 1.15rem; color: rgba(255,255,255,0.75);
    margin-bottom: 40px; max-width: 520px; line-height: 1.8;
}
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

/* Floating Live Card Overlap */
.live-card-wrapper {
    position: absolute;
    bottom: -50px; /* Anchored to bottom of hero section */
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
}

.live-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    overflow: hidden;
    animation: floatUp 0.8s ease-out;
    border: 1px solid var(--gray-100);
    height: 140px;
    max-width: 1100px;
    margin: 0 auto;
}

.live-card-image {
    width: 180px; /* Slightly narrower image */
    height: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.live-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.live-card:hover .live-card-image img {
    transform: scale(1.1);
}

.live-card-content {
    padding: 15px 40px; /* Reduced padding for lower height */
    flex: 1;
    display: flex;
    align-items: center; /* Center items horizontally in the row */
    gap: 30px;
}

.live-info { flex: 1; }

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 6px;
}

.live-badge .pulse {
    width: 8px;
    height: 8px;
    background: var(--orange);
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.live-badge .pulse::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--orange);
    border-radius: 50%;
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
}

.live-card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
}

.live-card-content p {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.4;
}

.live-card-buttons {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.live-card-buttons .btn-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
    border-bottom: 2px solid transparent;
    white-space: nowrap; /* Prevent "Recent Messages" from wrapping */
}

.live-card-buttons .btn-primary {
    white-space: nowrap;
}

.live-card-buttons .btn-link:hover {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

@keyframes floatUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: floatUp 0.8s ease-out; }

/* ============ SERVICES SECTION ============ */
.services-section { 
    background: var(--off-white); 
    position: relative; 
    z-index: 1; 
    padding-top: 200px; /* Further increased to prevent overlap with Live Card */
}
.services-grid {
    display: grid; grid-template-columns: 1fr 2fr;
    gap: 60px; align-items: start;
}
.services-intro h2 { font-size: 2.4rem; margin-bottom: 20px; }
.services-intro p { margin-bottom: 30px; line-height: 1.8; }
.services-cards {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.service-card {
    background: var(--white); padding: 32px 24px;
    border-radius: var(--radius-md); transition: var(--transition);
    border: 1px solid transparent;
}
.service-card:hover {
    transform: translateY(-5px); box-shadow: var(--shadow-lg);
    border-color: rgba(232,113,42,0.15);
}
.service-card .card-icon {
    width: 52px; height: 52px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    display: flex; align-items: center; justify-content: center;
    color: var(--white); font-size: 1.2rem; margin-bottom: 18px;
}
.service-card h4 {
    font-family: 'Inter', sans-serif; font-size: 1rem;
    font-weight: 700; margin-bottom: 10px;
}
.service-card p { font-size: 0.88rem; color: var(--text-light); line-height: 1.6; }

/* ============ CURRENT SERIES / SERMONS ============ */
.sermons-section { padding-bottom: 120px; }
.sermons-header { text-align: center; margin-bottom: 60px; }
.sermons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.sermon-card { border-radius: var(--radius-md); overflow: hidden; transition: var(--transition); background: var(--white); }
.sermon-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
.sermon-card-image {
    position: relative; height: 240px; overflow: hidden;
}
.sermon-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.sermon-card:hover .sermon-card-image img { transform: scale(1.05); }
.sermon-card-image .series-badge {
    position: absolute; top: 16px; left: 16px;
    background: var(--orange); color: var(--white);
    padding: 4px 14px; border-radius: var(--radius-xl);
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px;
}
.sermon-card-body { padding: 24px; }
.sermon-card-meta {
    font-size: 0.78rem; color: var(--orange); font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.sermon-card-body h3 { font-family: 'Inter', sans-serif; font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.sermon-card-body .sermon-date { font-size: 0.82rem; color: var(--text-light); margin-bottom: 14px; }
.sermon-card-body .sermon-link {
    font-size: 0.85rem; font-weight: 700; color: var(--navy);
    text-transform: uppercase; letter-spacing: 1px;
    display: inline-flex; align-items: center; gap: 6px;
}
.sermon-card-body .sermon-link:hover { color: var(--orange); gap: 10px; }

/* Responsive Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============ ABOUT / WHO WE ARE ============ */
.about-section {
    background: var(--navy-dark);
    color: var(--white); position: relative; overflow: hidden;
}
.about-section::before {
    content: ''; position: absolute; top: -50%; right: -20%;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(232,113,42,0.1), transparent);
}
.about-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 80px; align-items: center;
}
.about-image { position: relative; border-radius: var(--radius-lg); overflow: hidden; }
.about-image img { border-radius: var(--radius-lg); width: 100%; }
.about-image .experience-badge {
    position: absolute; bottom: -20px; right: -20px;
    background: var(--orange); color: var(--white);
    padding: 24px 30px; border-radius: var(--radius-md);
    text-align: center; box-shadow: var(--shadow-xl);
}
.experience-badge .number { font-size: 2.5rem; font-weight: 800; display: block; line-height: 1; }
.experience-badge .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.about-content .section-label { color: var(--orange-light); }
.about-content .section-title { color: var(--white); font-size: 2.5rem; }
.about-content p { color: rgba(255,255,255,0.7); margin-bottom: 20px; line-height: 1.8; }
.about-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
    margin-top: 40px; padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.about-stat .stat-number { font-size: 2rem; font-weight: 800; color: var(--orange); display: block; }
.about-stat .stat-label { font-size: 0.82rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }

/* ============ EVENTS ============ */
.events-section { background: var(--off-white); }
.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 50px; }
.event-card {
    background: var(--white); border-radius: var(--radius-md);
    overflow: hidden; transition: var(--transition);
    border: 1px solid var(--gray-100);
}
.event-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.event-card-header {
    background: var(--navy); color: var(--white); padding: 20px 24px;
    display: flex; align-items: center; gap: 16px;
}
.event-date-box {
    text-align: center; min-width: 56px; background: var(--orange);
    padding: 10px 14px; border-radius: var(--radius-sm);
}
.event-date-box .day { font-size: 1.6rem; font-weight: 800; display: block; line-height: 1; }
.event-date-box .month { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; }
.event-card-header h4 { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 600; color: var(--white); }
.event-card-header .event-time { font-size: 0.8rem; opacity: 0.7; margin-top: 4px; }
.event-card-body { padding: 24px; }
.event-card-body p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 16px; line-height: 1.7; }
.event-card-body .event-location { font-size: 0.82rem; color: var(--text-light); display: flex; align-items: center; gap: 6px; }
.event-card-body .event-location i { color: var(--orange); }

/* ============ CTA / NEWSLETTER ============ */
.cta-section {
    background: linear-gradient(135deg, var(--navy), var(--navy-dark));
    position: relative; overflow: hidden; text-align: center;
}
.cta-section::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: url('../images/hero-worship.png') center/cover no-repeat;
    opacity: 0.08;
}
.cta-section .container { position: relative; z-index: 2; }
.cta-section .section-title { color: var(--white); font-size: 3rem; }
.cta-section p { color: rgba(255,255,255,0.7); margin-bottom: 40px; font-size: 1.1rem; }
.newsletter-form {
    display: flex; gap: 12px; max-width: 500px; margin: 0 auto;
}
.newsletter-form input {
    flex: 1; padding: 16px 24px; border-radius: var(--radius-xl);
    border: 2px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1);
    color: var(--white); font-size: 0.95rem; font-family: 'Inter', sans-serif;
    outline: none; transition: var(--transition);
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.4); }
.newsletter-form input:focus { border-color: var(--orange); background: rgba(255,255,255,0.15); }

/* ============ FOOTER ============ */
.footer {
    background: var(--navy-dark); color: rgba(255,255,255,0.7);
    padding: 80px 0 0;
}
.footer-grid {
    display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 50px; padding-bottom: 60px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-about .brand { color: var(--white); font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; }
.footer-about p { font-size: 0.9rem; line-height: 1.8; margin-bottom: 20px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.08); display: flex;
    align-items: center; justify-content: center;
    color: rgba(255,255,255,0.6); transition: var(--transition);
}
.footer-social a:hover { background: var(--orange); color: var(--white); }
.footer h4 {
    color: var(--white); font-family: 'Inter', sans-serif;
    font-size: 0.9rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 24px;
}
.footer-links li { margin-bottom: 12px; }
.footer-links a { font-size: 0.88rem; color: rgba(255,255,255,0.5); }
.footer-links a:hover { color: var(--orange); padding-left: 5px; }
.footer-contact li {
    display: flex; gap: 12px; margin-bottom: 16px; font-size: 0.88rem;
}
.footer-contact i { color: var(--orange); margin-top: 3px; }
.footer-bottom {
    padding: 24px 0; text-align: center; font-size: 0.82rem;
    color: rgba(255,255,255,0.35);
}

/* ============ ANIMATIONS ============ */
.fade-in { opacity: 0; transform: translateY(30px); transition: all 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in-left { opacity: 0; transform: translateX(-30px); transition: all 0.6s ease-out; }
.fade-in-left.visible { opacity: 1; transform: translateX(0); }
.fade-in-right { opacity: 0; transform: translateX(30px); transition: all 0.6s ease-out; }
.fade-in-right.visible { opacity: 1; transform: translateX(0); }

/* ============ PAGE BANNER ============ */
.page-banner {
    background: linear-gradient(135deg, rgba(15,18,41,0.9), rgba(26,31,61,0.8)),
                url('../images/hero-worship.png') center/cover no-repeat;
    padding: 180px 0 80px; text-align: center;
}
.page-banner h1 { color: var(--white); font-size: 3rem; margin-bottom: 12px; }
.page-banner .breadcrumb {
    display: flex; justify-content: center; gap: 8px;
    font-size: 0.9rem; color: rgba(255,255,255,0.6);
}
.page-banner .breadcrumb a { color: var(--orange); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .container { padding: 0 30px; }
    .services-grid { grid-template-columns: 1fr; text-align: center; }
    .services-intro { margin-bottom: 40px; }
    .services-cards { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    html { font-size: 14px; }
    .top-bar { display: none; }
    .navbar { top: 0; background: var(--navy-dark); padding: 15px 0; }
    
    .nav-menu { 
        position: fixed; top: 0; right: -100%;
        width: 80%; height: 100vh; background: var(--navy-dark);
        flex-direction: column; justify-content: center; 
        align-items: center; gap: 20px; transition: var(--transition);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        z-index: 999;
    }
    .nav-menu.active { right: 0; }
    .nav-menu a { font-size: 1.2rem; width: 100%; text-align: center; }
    
    .hamburger { display: flex; z-index: 1001; }
    .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

    .nav-cta { display: none; }
    .mobile-only { display: block !important; }

    .hero { min-height: auto; padding: 140px 0 100px; text-align: center; }
    .hero-title { font-size: 2.8rem; }
    .hero-text { margin: 0 auto 40px; }
    .hero-buttons { justify-content: center; }

    .live-card-wrapper { position: static; padding: 0 20px; margin-top: -60px; margin-bottom: 40px; }
    .live-card { flex-direction: column; height: auto; }
    .live-card-image { width: 100%; height: 180px; }
    .live-card-content { padding: 30px; flex-direction: column; text-align: center; gap: 20px; }
    .live-card-buttons { justify-content: center; width: 100%; }

    .section { padding: 60px 0; }
    .section-title { font-size: 2.2rem; }
    .services-section { padding-top: 40px; }
    .services-cards { grid-template-columns: 1fr; }
    
    .sermons-grid, .events-grid { grid-template-columns: 1fr; gap: 25px; }
    .about-stats { grid-template-columns: repeat(3, 1fr); gap: 15px; }
    
    .newsletter-form { flex-direction: column; width: 100%; }
    .newsletter-form input { width: 100%; }
    
    .footer-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .footer-social { justify-content: center; }
    .footer-contact li { justify-content: center; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.2rem; }
    .about-stats { grid-template-columns: 1fr; gap: 30px; }
    .experience-badge { right: 0; left: 0; bottom: -10px; margin: 0 auto; width: fit-content; }
    .about-image { margin-bottom: 30px; }
}
