/* =========================================
   CSS Reset & Base Styles - PREMIUM EDITION
   ========================================= */
:root {
    --primary-dark: #0f172a; /* Deep, rich slate */
    --accent-gold: #d97706; /* Refined, sharp gold */
    --accent-hover: #b45309;
    --text-main: #334155;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    --white: #ffffff;
    --background: #faf7f0; /* Warm cream — was #f8fafc cool off-white */
    --surface: #f7f1e5; /* Warm cream card surface (reads clearly cream, not white); defined by border + shadow */
    --surface-border: #e9dec8; /* Warm border to separate cards from the page cream */
    --border-radius: 8px; /* Sharper edges */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    /* Stop iOS from inflating text in landscape */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--background);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .logo {
    font-family: 'Playfair Display', serif;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

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

/* Remove the 300ms tap delay and tidy the tap highlight on touch devices */
a, button, .btn, .mobile-toggle {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(217, 119, 6, 0.15);
}

/* =========================================
   Typography & Buttons
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-dark);
    color: var(--white);
    border: 1px solid var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--accent-gold);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(217, 119, 6, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* =========================================
   Navigation (Glassmorphism)
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding: 12px 0;
    transition: var(--transition);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 100px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-gold);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-dark);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Header CTA sits next to small uppercase links, so keep it more compact
   than the full-size hero buttons */
.navbar .btn {
    padding: 10px 22px;
    font-size: 0.82rem;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-dark);
    cursor: pointer;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    position: relative;
    overflow: hidden;
    height: 90vh;
    height: 90svh; /* avoids the mobile address-bar jump where supported */
    min-height: 700px;
    display: flex;
    align-items: center;
    /* Fallback still (low-res paint before the hero <img> decodes) */
    background-image: url('hero-community-1200.jpg?v=16');
    background-size: cover;
    background-position: center 30%;
}

/* Background image layer — sits behind the gradient overlay and the content.
   object-position pushes the framing right so faces fall under the lighter side
   of the left-to-right gradient, keeping the headline over the darker left area. */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 65% 30%;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.4) 100%);
}

/* Hero is now a static photo (no motion), so no reduced-motion handling needed. */

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
    transform: translateY(20px);
}

.hero h1 {
    color: var(--white);
    font-size: 5rem;
    line-height: 1.05;
    margin-bottom: 24px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.page-hero h1 {
    color: var(--white) !important;
    font-size: 3.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    position: relative;
    z-index: 10;
}

.hero p {
    color: #cbd5e1;
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 48px;
    max-width: 600px;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    gap: 24px;
}

/* =========================================
   Interactive Cards (Quick Links)
   ========================================= */
.quick-links {
    margin-top: -100px;
    position: relative;
    z-index: 20;
    padding-bottom: 100px;
}

.cards-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

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

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin-bottom: 24px;
}

.card h3 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: var(--primary-dark);
}

.card p {
    color: var(--text-muted);
    margin-bottom: 32px;
    flex-grow: 1;
    font-size: 1.05rem;
    line-height: 1.6;
}

.card-link {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.card-link::after {
    content: '→';
    transition: transform 0.3s ease;
}

.card:hover .card-link {
    color: var(--accent-hover); /* darker gold for 4.5:1 contrast on white */
}

.card:hover .card-link::after {
    transform: translateX(5px);
}

/* =========================================
   Plan a Visit Section
   ========================================= */
.visit-section {
    padding: 100px 40px;
    background-color: var(--background);
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.visit-container {
    max-width: 1000px;
    margin: 0 auto;
}

.visit-title {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.visit-intro {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 50px;
}

.visit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 40px;
    text-align: left;
    margin-bottom: 50px;
}

.visit-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent-gold);
}

.visit-card h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.visit-card h3 i {
    color: var(--accent-gold);
    margin-right: 10px;
}

.visit-card p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.visit-note {
    font-size: 0.9rem;
}

.visit-times {
    list-style: none;
    color: var(--text-muted);
    line-height: 1.8;
}

.visit-map {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    line-height: 0;
}

/* =========================================
   Footer
   ========================================= */
footer {
    background-color: var(--primary-dark);
    color: var(--text-light);
    padding: 80px 40px 32px;
}

/* Top region: balanced, equal-width info columns */
.footer-grid {
    max-width: 1200px;
    margin: 0 auto 48px;
    padding-bottom: 56px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.footer-col a {
    color: #94a3b8;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--white);
}

/* Explore links sit in two even sub-columns so the column height matches its neighbors */
.footer-nav ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
}

.footer-nav li {
    margin-bottom: 0;
}

/* Bottom bar: copyright + social, evenly split */
.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    color: #94a3b8; /* 6.96:1 on slate — passes 4.5:1 */
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 14px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.footer-social a:hover {
    background-color: var(--accent-gold);
    transform: translateY(-4px);
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 4rem;
    }
    .cards-container {
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 20px;
        flex-wrap: wrap; /* allow menu panel to wrap onto full-width rows */
    }

    /* Cap logo on phones so it doesn't dominate the bar */
    .nav-logo-img {
        height: 60px;
    }

    /* Collapsed by default; revealed as a stacked panel when .nav-open is set */
    .nav-links {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        gap: 0;
        padding-top: 8px;
    }

    .navbar.nav-open .nav-links {
        display: flex;
    }

    .navbar.nav-open .nav-links a {
        padding: 14px 4px; /* 44px+ tap targets */
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        font-size: 1rem;
    }

    /* CTA hidden in the bar, shown as the last item of the open menu */
    .navbar .btn {
        display: none;
    }

    .navbar.nav-open .btn {
        display: inline-flex;
        flex-basis: 100%;
        width: 100%;
        margin-top: 12px;
    }

    .mobile-toggle {
        display: block;
    }

    /* fixed-attachment parallax is janky/unsupported on mobile */
    .hero {
        background-attachment: scroll;
    }

    .hero h1 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
    
    .quick-links {
        margin-top: -60px;
    }
    
    .card {
        padding: 40px 30px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-nav ul {
        justify-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    /* Footer links get full-width tap rows on phones */
    .footer-nav ul {
        gap: 4px 24px;
    }

    .footer-col a {
        display: inline-block;
        padding: 6px 0;
    }

    /* Shorter hero so the fold isn't pushed way down on small screens */
    .hero {
        min-height: 540px;
    }

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

    .page-hero h1 {
        font-size: 2.5rem;
    }

    /* Comfortable side gutters + tighter vertical rhythm on phones */
    .visit-section {
        padding: 64px 20px;
    }

    .visit-title {
        font-size: 2rem;
    }

    .page-content {
        margin: 48px auto;
        padding: 0 20px;
    }

    .page-prose h2 {
        font-size: 2rem;
    }

    .service-info,
    .visit-card {
        padding: 28px 24px;
    }

    /* Stack event cards: full-width date banner on top */
    .event-card {
        flex-direction: column;
    }

    .event-date {
        min-width: 0;
    }
}

/* Small phones (≤480px): scale down the largest type so nothing overflows */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.4rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .page-hero h1 {
        font-size: 2rem;
    }

    .visit-title,
    .page-prose h2 {
        font-size: 1.75rem;
    }
}

/* Subsplash Embed Container */
.subsplash-embed-container {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    border: 1px solid var(--surface-border);
    margin-bottom: 60px;
}

/* =========================================
   Accessibility utilities
   ========================================= */

/* Visible keyboard focus indicator (gold reads on both light & dark surfaces) */
:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Screen-reader-only text (kept out of the visual layout) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero {
        background-attachment: scroll; /* disable parallax */
    }
}

/* =========================================
   Inner Page Layout (shared by sub-pages)
   ========================================= */
.page-hero {
    height: 40vh;
    height: 40svh;
    min-height: 400px;
    display: flex;
    align-items: center;
    background-image: url('hero-family.png?v=2');
    background-size: cover;
    background-position: center;
    position: relative;
}

.page-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
}

.page-content {
    max-width: 1000px;
    margin: 80px auto;
    padding: 0 40px;
}

/* width / alignment modifiers */
.page-content.narrow { max-width: 800px; }
.page-content.medium { max-width: 900px; }
.page-content.wide   { max-width: 1200px; }
.page-content.center { text-align: center; }

/* About page prose */
.page-prose h2 {
    margin-bottom: 24px;
    font-size: 2.5rem;
}

.page-prose p {
    font-size: 1.1rem;
    margin-bottom: 24px;
    color: var(--text-muted);
}

.page-prose ol {
    margin: 0 0 24px;
    padding-left: 24px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.page-prose ol li {
    margin-bottom: 14px;
    line-height: 1.7;
}

.page-prose ol li strong {
    color: var(--primary-dark);
}

/* Scripture quote */
.scripture {
    margin: 0 0 28px;
    padding: 24px 28px;
    background: #f4ecdd; /* warm cream to match the page (was cool #f8fafc) */
    border-left: 4px solid var(--accent-gold);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.scripture p {
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.scripture cite {
    display: block;
    font-style: normal;
    font-weight: 600;
    color: var(--accent-gold);
}

/* Services */
.service-info {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-border);
    margin-bottom: 30px;
    border-left: 4px solid var(--accent-gold);
}

/* Ministries */
.ministry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 30px;
    margin-top: 40px;
}

.ministry-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-border);
    padding: 30px;
    text-align: center;
    transition: var(--transition);
}

.ministry-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.ministry-card i {
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
}

.ministry-card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* Events */
.event-card {
    display: flex;
    flex-wrap: wrap;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    overflow: hidden;
    border-left: 4px solid var(--accent-gold);
}

.event-date {
    background: var(--primary-dark);
    color: var(--white);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 150px;
}

.event-date .month { font-weight: 600; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; }
.event-date .day { font-size: 2.5rem; font-family: 'Playfair Display', serif; font-weight: 700; }

.event-details {
    padding: 30px;
    flex-grow: 1;
}

.event-details h3 { font-size: 1.5rem; margin-bottom: 10px; }

/* Giving */
.give-box {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--surface-border);
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}

iframe#subsplash-giving-container {
    max-height: 650px !important;
    border-radius: 8px !important;
    border: none;
}

/* Resources */
.resource-box {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.resource-icon {
    font-size: 2rem;
    color: var(--accent-gold);
    background: rgba(217, 119, 6, 0.1);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.resource-text h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

/* Live stream embed */
.sap-embed-player {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #000;
}

.sap-embed-player > iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Live captions / translation embed (CaptionFlow) */
.captions-embed {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--primary-dark);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.captions-embed > iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 768px) {
    .captions-embed {
        height: 70vh;
        height: 70svh;
        min-height: 440px;
    }
}
